From 6090ca022615031528c91f7d30d5f66af7a61bbb Mon Sep 17 00:00:00 2001 From: Pete Fotheringham Date: Wed, 24 Apr 2024 20:19:28 +0100 Subject: [PATCH] Don't want or need the @hide annotations --- .../android_frameworks_base-Android14.patch | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/signature_spoofing_patches/android_frameworks_base-Android14.patch b/src/signature_spoofing_patches/android_frameworks_base-Android14.patch index cde30ba..59bb61c 100644 --- a/src/signature_spoofing_patches/android_frameworks_base-Android14.patch +++ b/src/signature_spoofing_patches/android_frameworks_base-Android14.patch @@ -1,5 +1,5 @@ diff --git a/core/api/current.txt b/core/api/current.txt -index 9b5316fb..9e0b9558 100644 +index 9b5316fb..1e7f6273 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -95,6 +95,7 @@ package android { @@ -20,20 +20,19 @@ index 9b5316fb..9e0b9558 100644 field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES"; @@ -61892,4 +61894,3 @@ package org.apache.http.params { } - + } - diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml -index 22591641..f3660c30 100644 +index 22591641..cede3930 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml -@@ -4318,6 +4318,28 @@ +@@ -4318,6 +4318,26 @@ android:description="@string/permdesc_getPackageSize" android:protectionLevel="normal" /> - + + + + Preview, %1$s - + -+ ++ + + Spoof package signature + @@ -77,7 +75,7 @@ index 4596ca74..a5ce5eb2 100644 + Allow + <b>%1$s</b> to spoof package signature? + - + disable or modify status bar diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java @@ -87,7 +85,7 @@ index d8cbe9d5..827a2061 100644 @@ -1512,6 +1512,29 @@ public class ComputerEngine implements Computer { return Optional.of(fakeSignature); } - + + private boolean requestsFakeSignature(AndroidPackage p) { + return p.getMetaData() != null && + p.getMetaData().getString("fake-signature") != null; @@ -123,13 +121,13 @@ index d8cbe9d5..827a2061 100644 + && !requestsFakeSignature(p)) || ArrayUtils.isEmpty(p.getRequestedPermissions())) ? Collections.emptySet() : mPermissionManager.getGrantedPermissions(ps.getPackageName(), userId); - + - PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags, + PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags, state.getFirstInstallTimeMillis(), ps.getLastUpdateTime(), installedPermissions, - grantedPermissions, state, userId, ps); + grantedPermissions, state, userId, ps), + grantedPermissions); - + if (packageInfo == null) { return null;