Keep track of the reason that an apk is incompatible
This commit is contained in:
parent
d8df407b02
commit
763b4d3ea0
@ -301,6 +301,8 @@ public class DB {
|
|||||||
|
|
||||||
public CommaSeparatedList nativecode; // null if empty or unknown
|
public CommaSeparatedList nativecode; // null if empty or unknown
|
||||||
|
|
||||||
|
public CommaSeparatedList incompatible_reasons; // null if empty or
|
||||||
|
// unknown
|
||||||
// ID (md5 sum of public key) of signature. Might be null, in the
|
// ID (md5 sum of public key) of signature. Might be null, in the
|
||||||
// transition to this field existing.
|
// transition to this field existing.
|
||||||
public String sig;
|
public String sig;
|
||||||
@ -372,14 +374,17 @@ public class DB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCompatible(Apk apk) {
|
public boolean isCompatible(Apk apk) {
|
||||||
if (!hasApi(apk.minSdkVersion))
|
if (!hasApi(apk.minSdkVersion)) {
|
||||||
|
apk.incompatible_reasons = CommaSeparatedList.make(String.valueOf(apk.minSdkVersion));
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
if (apk.features != null) {
|
if (apk.features != null) {
|
||||||
for (String feat : apk.features) {
|
for (String feat : apk.features) {
|
||||||
if (ignoreTouchscreen
|
if (ignoreTouchscreen
|
||||||
&& feat.equals("android.hardware.touchscreen")) {
|
&& feat.equals("android.hardware.touchscreen")) {
|
||||||
// Don't check it!
|
// Don't check it!
|
||||||
} else if (!features.contains(feat)) {
|
} else if (!features.contains(feat)) {
|
||||||
|
apk.incompatible_reasons = CommaSeparatedList.make(feat);
|
||||||
Log.d("FDroid", apk.id + " vercode " + apk.vercode
|
Log.d("FDroid", apk.id + " vercode " + apk.vercode
|
||||||
+ " is incompatible based on lack of "
|
+ " is incompatible based on lack of "
|
||||||
+ feat);
|
+ feat);
|
||||||
@ -388,6 +393,7 @@ public class DB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!compatibleApi(apk.nativecode)) {
|
if (!compatibleApi(apk.nativecode)) {
|
||||||
|
apk.incompatible_reasons = apk.nativecode;
|
||||||
Log.d("FDroid", apk.id + " vercode " + apk.vercode
|
Log.d("FDroid", apk.id + " vercode " + apk.vercode
|
||||||
+ " only supports " + CommaSeparatedList.str(apk.nativecode)
|
+ " only supports " + CommaSeparatedList.str(apk.nativecode)
|
||||||
+ " while your architectures are " + cpuAbisDesc);
|
+ " while your architectures are " + cpuAbisDesc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user