mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
fix(shortcuts): move the accessibility service into an optional companion so Play Protect stops blocking the install (#2654)
* fix(shortcuts): move the accessibility service into an optional companion so Play Protect stops blocking the install * fix(shortcuts): bind only same-signer relays, recheck enablement per call, drop timed-out keys
This commit is contained in:
1 parent
5dd973587f
commit
de5f0fe6df
52 files changed
+750
-296
No files matched your search
+25
-11
@@ -40,23 +40,37 @@ if [ "$pkg" != "$P" ]; then
|
||||
&& die "$variant: the manifest still names $P in an authority or task"
|
||||
fi
|
||||
|
||||
"$BUILD_TOOLS/zipalign" -p -f 4 "$work/renamed.apk" "$work/aligned.apk"
|
||||
|
||||
"$BUILD_TOOLS/apksigner" rotate --out "$work/lineage" \
|
||||
--old-signer --ks "$TESTKEY" --ks-type PKCS12 --ks-pass env:TESTKEY_PASSWORD \
|
||||
--ks-key-alias testkey --key-pass env:TESTKEY_PASSWORD --set-rollback false \
|
||||
--new-signer --ks "$RELEASE_KEYSTORE" --ks-type PKCS12 --ks-pass env:RELEASE_STORE_PASSWORD \
|
||||
--ks-key-alias "$RELEASE_KEY_ALIAS" --key-pass env:RELEASE_STORE_PASSWORD
|
||||
|
||||
"$BUILD_TOOLS/apksigner" sign \
|
||||
--ks "$TESTKEY" --ks-type PKCS12 --ks-pass env:TESTKEY_PASSWORD \
|
||||
--ks-key-alias testkey --key-pass env:TESTKEY_PASSWORD \
|
||||
--next-signer --ks "$RELEASE_KEYSTORE" --ks-type PKCS12 --ks-pass env:RELEASE_STORE_PASSWORD \
|
||||
--ks-key-alias "$RELEASE_KEY_ALIAS" --key-pass env:RELEASE_STORE_PASSWORD \
|
||||
--lineage "$work/lineage" --rotation-min-sdk-version 28 \
|
||||
--v1-signing-enabled true --v2-signing-enabled true --v3-signing-enabled true --v4-signing-enabled false \
|
||||
--out "$out" "$work/aligned.apk"
|
||||
rm -f "$out.idsig"
|
||||
sign() {
|
||||
"$BUILD_TOOLS/apksigner" sign \
|
||||
--ks "$TESTKEY" --ks-type PKCS12 --ks-pass env:TESTKEY_PASSWORD \
|
||||
--ks-key-alias testkey --key-pass env:TESTKEY_PASSWORD \
|
||||
--next-signer --ks "$RELEASE_KEYSTORE" --ks-type PKCS12 --ks-pass env:RELEASE_STORE_PASSWORD \
|
||||
--ks-key-alias "$RELEASE_KEY_ALIAS" --key-pass env:RELEASE_STORE_PASSWORD \
|
||||
--lineage "$work/lineage" --rotation-min-sdk-version 28 \
|
||||
--v1-signing-enabled true --v2-signing-enabled true --v3-signing-enabled true --v4-signing-enabled false \
|
||||
--out "$2" "$1"
|
||||
rm -f "$2.idsig"
|
||||
}
|
||||
|
||||
companion=assets/shortcuts.apk
|
||||
if unzip -l "$work/renamed.apk" "$companion" >/dev/null 2>&1; then
|
||||
mkdir -p "$work/companion/assets"
|
||||
unzip -p "$work/renamed.apk" "$companion" > "$work/companion-in.apk"
|
||||
sign "$work/companion-in.apk" "$work/companion/$companion"
|
||||
companion_v3=$("$BUILD_TOOLS/apksigner" verify --min-sdk-version 28 --print-certs "$work/companion/$companion" | sed -n 's/^.*Signer.* certificate SHA-256 digest: //p' | sort -u)
|
||||
[ "$companion_v3" = "$expected" ] || die "$variant: the system keys companion is not signed with DroidDeck's key"
|
||||
(cd "$work/companion" && zip -q -0 "$work/renamed.apk" "$companion")
|
||||
fi
|
||||
|
||||
"$BUILD_TOOLS/zipalign" -p -f 4 "$work/renamed.apk" "$work/aligned.apk"
|
||||
|
||||
sign "$work/aligned.apk" "$out"
|
||||
|
||||
"$BUILD_TOOLS/apksigner" verify --min-sdk-version 26 "$out" >/dev/null || die "$variant: does not verify"
|
||||
listing=$(unzip -l "$out")
|
||||
|
||||
Reference in new issue
Block a user