app: harden security and clean up build & R8 rules

Harden external intent handling in MainActivity: only accept module
installation, and drop any other action, including uninstallation.
Require explicit user confirmation before flashing, unless the intent
carries the per-process token attached to our own one-shot module
download intents, which the user already chose to install. Hide
overlay windows while the confirmation is shown. Look up the file name
from the external provider with a timeout, and sanitize it and the
provider authority shown in the confirmation. Avoid external intent
indirection in HomeScreen when triggering uninstallation.

Restore callback-based confirm dialogs together with their content
after configuration changes. Dialogs awaited by a coroutine are not
restored, as nothing would receive their result.

Register dynamic USB receivers in InstallDialog as not exported via
registerRuntimeReceiver (RECEIVER_NOT_EXPORTED, enforced on API 33+).

Enable android:enableOnBackInvokedCallback in core manifest to support
predictive back gestures. Fix MagiskDialog modifier parameter ordering
to adhere to Compose lint rules.

Remove the obsolete release manifest and redundant R8 configuration in
core and apk modules: the Parcelable CREATOR and Continuation keep
rules and -allowaccessmodification are covered by
proguard-android-optimize.txt and library consumer rules, and
-shrinkunusedprotofields has no effect with Wire.

Assisted-by: Gemini 4 Argon
Assisted-by: Claude Opus 5.5
This commit is contained in:
topjohnwu
2026-10-24 13:01:45 -07:00
committed by John Wu
parent a51dc10f88
commit 7e4eeb4f8d
10 changed files with 193 additions and 66 deletions
-13
View File
@@ -1,8 +1,3 @@
# Parcelable
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}
# Kotlin
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
public static void check*(...);
@@ -21,13 +16,5 @@
public void d(**);
}
# Protobuf
-shrinkunusedprotofields
# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-dontwarn org.junit.**
-dontwarn org.apache.**
+1 -1
View File
@@ -36,7 +36,7 @@
<application
android:name=".App"
android:allowBackup="false"
android:enableOnBackInvokedCallback="false"
android:enableOnBackInvokedCallback="true"
android:icon="@drawable/ic_launcher"
android:label="Magisk"
android:requestLegacyExternalStorage="true"