Logo
Explore Help
Sign In
TheArchive/Magisk
1
0
Fork 0
You've already forked Magisk
mirror of https://github.com/topjohnwu/Magisk.git synced 2025-05-17 22:58:23 +00:00
Code Issues Packages Projects Releases Wiki Activity
Magisk/app/test/proguard-rules.pro

14 lines
354 B
Prolog
Raw Permalink Normal View History

Redesign test APK architecture The test APK and the main APK share the same process and classloader, and in the non-hidden case, the test APK's classes take precedence over the ones in the main APK. This causes issues because the test APK and main APK share some dependencies, but don't always use the same version. This is especially problematic for the Kotlin stdlib and AndroidX dependencies. The solution here is to rely on R8's obfuscation feature and repackage all potentially conflicting classes into a separate package in the test APK. To ensure that the test classes are always using the same classes as the main APK, we have to directly implement all tests inside the main APK, making the test APK purely a "test runner with test dependencies". As a result, the test APK can only be used when built in release mode, because R8 no longer allow class obfuscation to be enabled when building for debug versions.
2024-12-25 20:17:57 -08:00
# Keep all test dependencies
-keep class org.junit.** { *; }
-keep class androidx.test.** { *; }
# Make sure the classloader constructor is kept
-keepclassmembers class com.topjohnwu.magisk.test.TestClassLoader { <init>(); }
# Repackage dependencies
-repackageclasses 'deps'
-allowaccessmodification
# Keep attributes for stacktrace
-keepattributes *
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 162ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API