mirror of
https://github.com/Hamza417/Inure.git
synced 2025-05-17 19:15:56 +08:00
Build97
- Added licenses of apps in FOSS panel
This commit is contained in:
1
.idea/dictionaries/hamza.xml
generated
1
.idea/dictionaries/hamza.xml
generated
@ -94,6 +94,7 @@
|
||||
<w>doesn</w>
|
||||
<w>doesnt</w>
|
||||
<w>dont</w>
|
||||
<w>droid's</w>
|
||||
<w>duan</w>
|
||||
<w>duzhe</w>
|
||||
<w>dwhite</w>
|
||||
|
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
@ -429,7 +430,7 @@
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="Python 3.10 (venv)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
|
@ -151,8 +151,10 @@ Various styles of menus and dialogs used in the app.
|
||||
|
||||
If you are a developer and want your app to be listed in the FOSS panel of Inure, there are two ways this can be done.
|
||||
|
||||
1. You can publish your app on F-Droid and inure will automatically fetch the list from the F-Droid's repositories.
|
||||
2. You can add `open_source` tag in your app's manifest file and Inure will fetch this info during the runtime and will include your app based on the flag.
|
||||
1. You can publish your app on F-Droid. Inure automatically mark the app as FOSS if it's available
|
||||
on F-Droid.
|
||||
2. You can add `open_source` tag in your app's manifest file and Inure will fetch this info during
|
||||
the runtime and will include your app based on the flag.
|
||||
|
||||
```xml
|
||||
<application
|
||||
|
@ -78,10 +78,6 @@ public class FOSSParser {
|
||||
});
|
||||
}
|
||||
|
||||
public static String getPackageVersion(String packageName) {
|
||||
return packageVersions.get(packageName);
|
||||
}
|
||||
|
||||
public static boolean isPackageFOSS(PackageInfo packageInfo) {
|
||||
try {
|
||||
return packageVersions.containsKey(packageInfo.packageName) ||
|
||||
@ -94,9 +90,25 @@ public class FOSSParser {
|
||||
@Nullable
|
||||
public static String getOpenSourceLicense(PackageInfo packageInfo) {
|
||||
try {
|
||||
return packageInfo.applicationInfo.metaData.getString(OPEN_SOURCE_LICENSE);
|
||||
String license = packageVersions.get(packageInfo.packageName);
|
||||
|
||||
if (license != null) {
|
||||
return license;
|
||||
} else {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
return null;
|
||||
try {
|
||||
String license = packageInfo.applicationInfo.metaData.getString(OPEN_SOURCE_LICENSE);
|
||||
|
||||
if (license != null) {
|
||||
return license;
|
||||
} else {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
} catch (NullPointerException e1) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -52,12 +52,12 @@ count = 0
|
||||
def parse_xml(root):
|
||||
for application in root.findall(".//application"):
|
||||
app_id = application.get("id")
|
||||
version_code = application.find(".//versioncode").text
|
||||
license_ = application.find(".//license").text
|
||||
|
||||
# Check for duplicates before adding to the xml_content
|
||||
global xml_content # use the global xml_content variable
|
||||
if f'{app_id}' not in xml_content:
|
||||
xml_content += f' <string name="{app_id}" translatable="false">{version_code}</string>\n'
|
||||
xml_content += f' <string name="{app_id}" translatable="false">{license_}</string>\n'
|
||||
global count # use the global count variable
|
||||
count += 1
|
||||
|
||||
|
Reference in New Issue
Block a user