Bonus patches

Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
Tad 2023-10-03 15:17:06 -04:00
parent af360bc9ea
commit 7d2c184d1f
No known key found for this signature in database
GPG Key ID: B286E9F57A07424B
9 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,31 @@
From fc22d2d5b977de8a148677ad5a15b20f97f1bd49 Mon Sep 17 00:00:00 2001
From: Pratyush <codelab@pratyush.dev>
Date: Fri, 22 Sep 2023 12:22:01 +0530
Subject: [PATCH] [bugfixes] handle null case
android docs doesn't state if SubscriptionInfo.getDisplayName() can return null, according to crash log it is returning null.
---
src/com/android/messaging/datamodel/ParticipantRefresh.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/com/android/messaging/datamodel/ParticipantRefresh.java b/src/com/android/messaging/datamodel/ParticipantRefresh.java
index 55d439bd..1726d69e 100644
--- a/src/com/android/messaging/datamodel/ParticipantRefresh.java
+++ b/src/com/android/messaging/datamodel/ParticipantRefresh.java
@@ -46,6 +46,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -391,7 +392,7 @@ private static void refreshSelfParticipantList() {
for (final Integer subId : activeSubscriptionIdToRecordMap.keySet()) {
final SubscriptionInfo record = activeSubscriptionIdToRecordMap.get(subId);
final String displayName =
- DatabaseUtils.sqlEscapeString(record.getDisplayName().toString());
+ DatabaseUtils.sqlEscapeString(Objects.toString(record.getDisplayName(), ""));
db.execSQL(getUpdateSelfParticipantSubscriptionInfoSql(record.getSimSlotIndex(),
record.getIconTint(), displayName,
ParticipantColumns.SUB_ID + " = " + subId));

View File

@ -0,0 +1,50 @@
From 039f815895f62c9f8af23df66622b66246f3f61e Mon Sep 17 00:00:00 2001
From: Michael Groover <mpgroover@google.com>
Date: Tue, 20 Jun 2023 11:51:03 -0500
Subject: [PATCH] Add errors from signature verify result to returned result
During APK signature verification, the apksig library will maintain
an internal Result instance for the current signature version being
verified; any errors / warnings from the specific version signer(s)
verification will then be copied to a Result instance that is
returned to the caller containing details for each of the signature
versions that the library attempted to verify. The internal Result
instance can also contain more general errors / warnings abut the
verification; these are currently not merged with the Result to be
returned to the caller, so some APKs may fail to verify without a
valid error returned. This commit resolves this by merging all
general errors / warnings with the Result to be returned to the
caller.
Bug: 266580022
Test: gradlew test
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0b086bdc130e1e6216fcbc5436fe8e3cdc9ec011)
Merged-In: Id0f4ee47a964a3bb5d30916808a3108858e6a0cf
Change-Id: Id0f4ee47a964a3bb5d30916808a3108858e6a0cf
---
src/main/java/com/android/apksig/ApkVerifier.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/main/java/com/android/apksig/ApkVerifier.java b/src/main/java/com/android/apksig/ApkVerifier.java
index 8ae5f78..0b04ef9 100644
--- a/src/main/java/com/android/apksig/ApkVerifier.java
+++ b/src/main/java/com/android/apksig/ApkVerifier.java
@@ -1276,6 +1276,15 @@ public class ApkVerifier {
}
private void mergeFrom(ApkSigningBlockUtils.Result source) {
+ if (source == null) {
+ return;
+ }
+ if (source.containsErrors()) {
+ mErrors.addAll(source.getErrors());
+ }
+ if (source.containsWarnings()) {
+ mWarnings.addAll(source.getWarnings());
+ }
switch (source.signatureSchemeVersion) {
case ApkSigningBlockUtils.VERSION_APK_SIGNATURE_SCHEME_V2:
mVerifiedUsingV2Scheme = source.verified;
--
GitLab

View File

@ -375,6 +375,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_KeyChain/319990.patch"; #n-asb-20
applyPatch "$DOS_PATCHES/android_packages_apps_KeyChain/334036.patch"; #n-asb-2022-07 Encode authority part of uri before showing in UI
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/Nfc"; then
applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/315715.patch"; #n-asb-2021-09 Add HIDE_NON_SYSTEM_OVERLAY_WINDOWS permission to Nfc
applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/328308.patch"; #n-asb-2022-04 Do not set default contactless application without user interaction

View File

@ -330,6 +330,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytic
cp -f "$DOS_PATCHES_COMMON/contributors.db" assets/contributors.db; #Update contributors cloud
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/PackageInstaller"; then
applyPatch "$DOS_PATCHES/android_packages_apps_PackageInstaller/344181.patch"; #P_asb_2022-11 Hide overlays on ReviewPermissionsAtivity
fi;

View File

@ -322,6 +322,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytic
cp -f "$DOS_PATCHES_COMMON/contributors.db" assets/contributors.db; #Update contributors cloud
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/Nfc"; then
#applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/365970.patch"; #R_asb_2023-09 Ensure that SecureNFC setting cannot be bypassed
if [ "$DOS_GRAPHENE_CONSTIFY" = true ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod.patch"; fi; #Constify JNINativeMethod tables (GrapheneOS)

View File

@ -344,6 +344,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytic
cp -f "$DOS_PATCHES_COMMON/contributors.db" assets/contributors.db; #Update contributors cloud
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/Nfc"; then
applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/365970.patch"; #R_asb_2023-09 Ensure that SecureNFC setting cannot be bypassed
if [ "$DOS_GRAPHENE_CONSTIFY" = true ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod.patch"; fi; #Constify JNINativeMethod tables (GrapheneOS)

View File

@ -302,6 +302,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytic
cp -f "$DOS_PATCHES_COMMON/contributors.db" assets/contributors.db; #Update contributors cloud
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/Nfc"; then
if [ "$DOS_GRAPHENE_CONSTIFY" = true ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod.patch"; fi; #Constify JNINativeMethod tables (GrapheneOS)
fi;

View File

@ -293,6 +293,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytic
cp -f "$DOS_PATCHES_COMMON/contributors.db" assets/contributors.db; #Update contributors cloud
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/Nfc"; then
if [ "$DOS_GRAPHENE_CONSTIFY" = true ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod.patch"; fi; #Constify JNINativeMethod tables (GrapheneOS)
fi;

View File

@ -307,6 +307,10 @@ applyPatch "$DOS_PATCHES/android_packages_apps_LineageParts/0001-Remove_Analytic
cp -f "$DOS_PATCHES_COMMON/contributors.db" assets/contributors.db; #Update contributors cloud
fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
fi;
if enterAndClear "packages/apps/Nfc"; then
if [ "$DOS_GRAPHENE_CONSTIFY" = true ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod.patch"; fi; #Constify JNINativeMethod tables (GrapheneOS)
fi;
@ -443,6 +447,11 @@ if enterAndClear "system/update_engine"; then
git revert --no-edit ac104e8990f3be3a3f111241e9328e7f98bfb912; #Do not skip payload signature verification
fi;
if enterAndClear "tools/apksig"; then
git am $DOS_PATCHES/ASB-2023-10/apksig-*.patch;
fi;
if enterAndClear "vendor/lineage"; then
rm build/target/product/security/lineage.x509.pem; #Remove Lineage keys
rm -rf overlay/common/lineage-sdk/packages/LineageSettingsProvider/res/values/defaults.xml; #Remove analytics