You've already forked TrickyStore
mirror of
https://github.com/5ec1cff/TrickyStore.git
synced 2025-09-06 06:37:07 +00:00
fix A12 compatibility
This commit is contained in:
@@ -436,7 +436,7 @@ public final class CertHack {
|
||||
var dg = MessageDigest.getInstance("SHA-256");
|
||||
for (int i = 0; i < size; i++) {
|
||||
var name = packages[i];
|
||||
var info = pm.getPackageInfo(name, PackageManager.GET_SIGNATURES, uid / 100000);
|
||||
var info = UtilKt.getPackageInfoCompat(pm, name, PackageManager.GET_SIGNATURES, uid / 100000);
|
||||
ASN1Encodable[] arr = new ASN1Encodable[2];
|
||||
arr[ATTESTATION_PACKAGE_INFO_PACKAGE_NAME_INDEX] =
|
||||
new DEROctetString(packages[i].getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.github.a13e300.tricky_store
|
||||
|
||||
import android.content.pm.IPackageManager
|
||||
import android.os.Build
|
||||
import android.os.SystemProperties
|
||||
|
||||
@@ -38,3 +39,11 @@ fun String.convertPatchLevel(long: Boolean) = kotlin.runCatching {
|
||||
if (long) l[0].toInt() * 10000 + l[1].toInt() * 100 + l[2].toInt()
|
||||
else l[0].toInt() * 100 + l[1].toInt()
|
||||
}.onFailure { Logger.e("invalid patch level $this !", it) }.getOrDefault(202404)
|
||||
|
||||
fun IPackageManager.getPackageInfoCompat(name: String, flags: Long, userId: Int) =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
getPackageInfo(name, flags, userId)
|
||||
} else {
|
||||
getPackageInfo(name, flags.toInt(), userId)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ public interface IPackageManager {
|
||||
|
||||
PackageInfo getPackageInfo(String packageName, long flags, int userId);
|
||||
|
||||
PackageInfo getPackageInfo(String packageName, int flags, int userId);
|
||||
|
||||
class Stub {
|
||||
public static IPackageManager asInterface(IBinder binder) {
|
||||
throw new RuntimeException("");
|
||||
|
||||
Reference in New Issue
Block a user