@@ -17,17 +17,14 @@ class ExploitHandler(
1717 context.getSharedPreferences(BuildConfig .APPLICATION_ID , Context .MODE_PRIVATE )
1818
1919 override fun onPreExecute () {
20- context.getString(R .string.please_wait ).toast(context, true )
20+ context.getString(R .string.executing_script ).toast(context, true )
2121 }
2222
2323 override fun doInBackground (): ExploitResult {
2424 with (context) {
2525 if (filesDir.absoluteFile.listFiles()?.isEmpty() == true ||
26- preferences.getString(
27- PREF_EXTRACTED_BY_VERSION ,
28- String ()
29- ) != BuildConfig .VERSION_NAME
30- ) {
26+ preferences.getString(PREF_EXTRACTED_BY_VERSION , String ()) != BuildConfig .VERSION_NAME ||
27+ BuildConfig .DEBUG ) {
3128
3229 preferences.edit(true ) {
3330 putString(PREF_EXTRACTED_BY_VERSION , BuildConfig .VERSION_NAME )
@@ -50,14 +47,13 @@ class ExploitHandler(
5047 )
5148 else -> File (filesDir.absoluteFile, name)
5249 }
53- val output = FileOutputStream (file)
54- assets.open(name).copyTo(output, 512 )
55- output.close()
56- file.apply {
50+ val output = FileOutputStream (file.apply {
5751 setExecutable(true , true )
5852 setReadable(true , true )
59- setWritable(false )
60- }
53+ setWritable(true , true )
54+ })
55+ assets.open(name).copyTo(output, 512 )
56+ output.close()
6157 }
6258 }
6359 }
0 commit comments