1
0
mirror of https://github.com/lineageos4microg/docker-lineage-cicd synced 2024-11-09 10:09:56 +01:00

Don't want or need the @hide annotations

This commit is contained in:
Pete Fotheringham 2024-04-24 20:19:28 +01:00
parent 3f6d79c5be
commit 6090ca0226

@ -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" />
+ <!-- Dummy user-facing group for faking package signature
+ @FlaggedApi("android.permission-group.FAKE_PACKAGE")
+ @hide
+ -->
+ <permission-group android:name="android.permission-group.FAKE_PACKAGE"
+ android:label="@string/permgrouplab_fake_package_signature"
@ -44,7 +43,6 @@ index 22591641..f3660c30 100644
+ <!-- Allows an application to change the package signature as
+ seen by applications
+ @FlaggedApi("android.permission-group.FAKE_PACKAGE_SIGNATURE")
+ @hide
+ -->
+ <permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
+ android:permissionGroup="android.permission-group.UNDEFINED"
@ -62,9 +60,9 @@ index 4596ca74..a5ce5eb2 100644
+++ b/core/res/res/values/strings.xml
@@ -993,6 +993,19 @@
<string name="dream_preview_title">Preview, <xliff:g id="dream_name" example="Clock">%1$s</xliff:g></string>
<!-- Permissions -->
+
+
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+ <string name="permlab_fakePackageSignature">Spoof package signature</string>
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
@ -77,7 +75,7 @@ index 4596ca74..a5ce5eb2 100644
+ <string name="permgrouprequest_fake_package_signature">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to spoof package signature?</string>
+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_statusBar">disable or modify status bar</string>
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;