Some fixes + Android 11 permission for scanning app.

This commit is contained in:
Thomas 2021-01-04 18:06:51 +01:00
parent 20f2e8412f
commit e3f2325d00
2 changed files with 9 additions and 5 deletions

View File

@ -5,6 +5,11 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
@ -14,6 +19,7 @@
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
android:largeHeap="true">
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize">

View File

@ -16,7 +16,7 @@ import java.util.Map;
public class ComputeAppList {
private static final String gStore = "com.android.vending";
private static final String fdroid = "ord.fdroid.fdroid";
private static final String fdroid = "org.fdroid.fdroid";
public static List<ApplicationViewModel> compute(PackageManager packageManager,
@ -32,7 +32,7 @@ public class ComputeAppList {
if (userOrderChoice == null) {
userOrderChoice = order.DEFAULT;
}
vms = order(vms, userOrderChoice);
order(vms, userOrderChoice);
return vms;
}
@ -41,9 +41,8 @@ public class ComputeAppList {
*
* @param vms List<ApplicationViewModel>
* @param orderChoice order
* @return List<ApplicationViewModel>
*/
private static List<ApplicationViewModel> order(List<ApplicationViewModel> vms, order orderChoice) {
private static void order(List<ApplicationViewModel> vms, order orderChoice) {
if (orderChoice == order.LESS_TRACKERS) {
Collections.sort(vms, (obj1, obj2) -> Integer.compare(obj1.requestedPermissions != null ? obj1.requestedPermissions.length : 0, obj2.requestedPermissions != null ? obj2.requestedPermissions.length : 0));
Collections.sort(vms, (obj1, obj2) -> Integer.compare(obj1.trackers != null ? obj1.trackers.size() : 0, obj2.trackers != null ? obj2.trackers.size() : 0));
@ -59,7 +58,6 @@ public class ComputeAppList {
} else {
Collections.sort(vms, (obj1, obj2) -> String.valueOf(obj1.label).compareToIgnoreCase(String.valueOf(obj2.label)));
}
return vms;
}
private static void convertPackagesToViewModels(List<ApplicationViewModel> appsToBuild,