- Added licenses of apps in FOSS panel
This commit is contained in:
Hamza417
2024-01-10 16:01:50 +05:30
parent 447b434daf
commit aed625efc5
6 changed files with 27 additions and 5443 deletions

View File

@ -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
View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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