Auto Update APK Doesn't work with Nougat
Closed this issue · 2 comments
Because you try to save the file as Context.MODE_WORLD_READABLE a security exception is thrown and the app crashes.
I confirm AutoUpdateAPK does not work on Nougat
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:318)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
at android.app.ContextImpl.checkMode(ContextImpl.java:2184)
at android.app.ContextImpl.openFileOutput(ContextImpl.java:497)
at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:192)
at com.nbeghin.app.utils.AutoUpdateApk$checkUpdateTask.doInBackground(AutoUpdateApk.java:339)
at com.nbeghin.app.utils.AutoUpdateApk$checkUpdateTask.doInBackground(AutoUpdateApk.java:277)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
Should work now, thanks to Nicola!