Skip to content

Commit 1afa0e4

Browse files
committed
Bug 1520: Android 14 (SDK API 34): Fix Writable dex file is not allowed
Simply set the copied apk dex-file to read-only.
1 parent 59de183 commit 1afa0e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/java/jogamp/android/launcher/ClassLoaderUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@ private static synchronized ClassLoader createClassLoaderImpl(final Context ctx,
168168
final File dst = new File(userAPK);
169169
try {
170170
copyFile(src, dst);
171+
dst.setReadOnly();
171172
} catch (final IOException e) {
172173
Log.d(TAG, "error copying <"+src+"> -> <"+dst+">: "+e, e);
173174
return null;
174175
}
175-
Log.d(TAG, "APK["+apkCount+"] copied: <"+src+"> -> <"+dst+">");
176+
Log.d(TAG, "APK["+apkCount+"] copied: <"+src+"> -> <"+dst+">, writable="+dst.canWrite());
176177
}
177178
apks.append(userAPK);
178179
Log.d(TAG, "APK["+apkCount+"] found: <"+lastUserPackageName+"> -> <"+userAPK+">");

0 commit comments

Comments
 (0)