Fixed bug package signature info not included
This commit is contained in:
parent
dc314963f9
commit
ee1a794680
@ -302,7 +302,7 @@ public class IndexV1Updater extends IndexUpdater {
|
||||
repo.version = getIntRepoValue(repoMap, "version");
|
||||
|
||||
if (TextUtils.isEmpty(platformSigCache)) {
|
||||
PackageInfo androidPackageInfo = Utils.getPackageInfo(context, "android");
|
||||
PackageInfo androidPackageInfo = Utils.getPackageInfoWithSignatures(context, "android");
|
||||
platformSigCache = Utils.getPackageSig(androidPackageInfo);
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.fdroid.fdroid;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
@ -808,6 +809,21 @@ public final class Utils {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to get the {@link PackageInfo} with signature info for the {@code packageName} provided.
|
||||
*
|
||||
* @return null on failure
|
||||
*/
|
||||
@SuppressLint("PackageManagerGetSignatures")
|
||||
public static PackageInfo getPackageInfoWithSignatures(Context context, String packageName) {
|
||||
try {
|
||||
return context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
debugLog(TAG, "Could not get PackageInfo: ", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Useful for debugging during development, so that arbitrary queries can be made, and their
|
||||
* results inspected in the debugger.
|
||||
|
Loading…
x
Reference in New Issue
Block a user