Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writable dex file is not allowed #56

Closed
Mygod opened this issue Jun 8, 2023 · 2 comments · Fixed by #57
Closed

Writable dex file is not allowed #56

Mygod opened this issue Jun 8, 2023 · 2 comments · Fixed by #57

Comments

@Mygod
Copy link

Mygod commented Jun 8, 2023

It fails to work when targeting API 34 due to this: https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

@hushenghao
Copy link
Contributor

It looks like this is an issue that has to be fixed, and it can be replicated on Android U preview.

09:26:46.979 de.android_eggs          E  Attempt to load writable dex file: /data/user/0/com.dede.android_eggs/code_cache/1687051606978.dex
09:26:46.980 Compatibil...geReporter  D  Compat change id reported: 218865702; UID 10168; state: ENABLED
09:26:46.981 System.err               W  java.lang.SecurityException: Writable dex file '/data/user/0/com.dede.android_eggs/code_cache/1687051606978.dex' is not allowed.
09:26:46.981 System.err               W  	at dalvik.system.DexFile.openDexFileNative(Native Method)
09:26:46.982 System.err               W  	at dalvik.system.DexFile.openDexFile(DexFile.java:406)
09:26:46.982 System.err               W  	at dalvik.system.DexFile.<init>(DexFile.java:128)
09:26:46.982 System.err               W  	at dalvik.system.DexFile.<init>(DexFile.java:113)
09:26:46.982 System.err               W  	at dalvik.system.DexFile.<init>(DexFile.java:87)
09:26:46.983 System.err               W  	at me.weishu.reflection.Reflection.unsealByDexFile(Reflection.java:58)
09:26:46.983 System.err               W  	at me.weishu.reflection.Reflection.unseal(Reflection.java:38)
09:26:46.983 System.err               W  	at com.dede.android_eggs.startup.ReflectionInitializer.create(ReflectionInitializer.kt:11)
09:26:46.984 System.err               W  	at com.dede.android_eggs.startup.ReflectionInitializer.create(ReflectionInitializer.kt:8)
09:26:46.985 System.err               W  	at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)
09:26:46.985 System.err               W  	at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)
09:26:46.985 System.err               W  	at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)
09:26:46.985 System.err               W  	at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
09:26:46.986 System.err               W  	at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
09:26:46.986 System.err               W  	at android.content.ContentProvider.attachInfo(ContentProvider.java:2510)
09:26:46.986 System.err               W  	at android.content.ContentProvider.attachInfo(ContentProvider.java:2480)
09:26:46.987 System.err               W  	at android.app.ActivityThread.installProvider(ActivityThread.java:7716)
09:26:46.987 System.err               W  	at android.app.ActivityThread.installContentProviders(ActivityThread.java:7227)
09:26:46.987 System.err               W  	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6946)
09:26:46.987 System.err               W  	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
09:26:46.988 System.err               W  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2222)
09:26:46.988 System.err               W  	at android.os.Handler.dispatchMessage(Handler.java:106)
09:26:46.989 System.err               W  	at android.os.Looper.loopOnce(Looper.java:205)
09:26:46.989 System.err               W  	at android.os.Looper.loop(Looper.java:294)
09:26:46.989 System.err               W  	at android.app.ActivityThread.main(ActivityThread.java:8128)
09:26:46.989 System.err               W  	at java.lang.reflect.Method.invoke(Native Method)
09:26:46.989 System.err               W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
09:26:46.990 System.err               W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:946)

@tiann tiann closed this as completed in #57 Jun 20, 2023
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
mohsenoid pushed a commit to loopsocial/firework-android-sdk-examples that referenced this issue Feb 16, 2024
**What**
- Fixing the write dex file crash

**Why**
- tiann/FreeReflection#56
- https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

**How**
- Downgrading the compile & targetSdk to 33

Signed-off-by: Mohsen Mirhoseini <mohsen@fireworkhq.com>
@amanyadavpims
Copy link

Just uninstall the existing app from mobile or emulator will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants