Keep track of the reason that an apk is incompatible

This commit is contained in:
Kevin Everets 2014-01-15 15:18:09 -05:00
parent d8df407b02
commit 763b4d3ea0

View File

@ -301,6 +301,8 @@ public class DB {
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
// transition to this field existing.
public String sig;
@ -372,14 +374,17 @@ public class DB {
}
public boolean isCompatible(Apk apk) {
if (!hasApi(apk.minSdkVersion))
if (!hasApi(apk.minSdkVersion)) {
apk.incompatible_reasons = CommaSeparatedList.make(String.valueOf(apk.minSdkVersion));
return false;
}
if (apk.features != null) {
for (String feat : apk.features) {
if (ignoreTouchscreen
&& feat.equals("android.hardware.touchscreen")) {
// Don't check it!
} else if (!features.contains(feat)) {
apk.incompatible_reasons = CommaSeparatedList.make(feat);
Log.d("FDroid", apk.id + " vercode " + apk.vercode
+ " is incompatible based on lack of "
+ feat);
@ -388,6 +393,7 @@ public class DB {
}
}
if (!compatibleApi(apk.nativecode)) {
apk.incompatible_reasons = apk.nativecode;
Log.d("FDroid", apk.id + " vercode " + apk.vercode
+ " only supports " + CommaSeparatedList.str(apk.nativecode)
+ " while your architectures are " + cpuAbisDesc);