@@ -17,7 +17,7 @@ public static byte[] backupKuroGame(Context context) {
1717 String accountsDatabaseFile = context .getDatabasePath ("zz_sdk_db" ).getAbsolutePath ();
1818 String deviceIdFile = context .getFilesDir ().getAbsolutePath () + "/shared_prefs/devicesyn.xml" ;
1919 try {
20- unprotectFilesWithRoot (accountsDatabaseFile , deviceIdFile );
20+ unprotectFilesWithRoot (accountsDatabaseFile + "*" , deviceIdFile );
2121 JSONObject root = new JSONObject ();
2222 StringBuilder builder = new StringBuilder ();
2323 try (SQLiteDatabase db = SQLiteDatabase .openDatabase (accountsDatabaseFile , null , SQLiteDatabase .OPEN_READONLY );
@@ -42,15 +42,15 @@ public static byte[] backupKuroGame(Context context) {
4242 } catch (Exception e ) {
4343 throw new RuntimeException (e );
4444 } finally {
45- protectFilesWithRoot (accountsDatabaseFile , deviceIdFile );
45+ protectFilesWithRoot (accountsDatabaseFile + "*" , deviceIdFile );
4646 }
4747 }
4848
4949 public static void restoreKuroGame (Context context , byte [] data ) {
5050 String accountsDatabaseFile = context .getDatabasePath ("zz_sdk_db" ).getAbsolutePath ();
5151 String deviceIdFile = context .getFilesDir ().getAbsolutePath () + "/shared_prefs/devicesyn.xml" ;
5252 try {
53- unprotectFilesWithRoot (accountsDatabaseFile , deviceIdFile );
53+ unprotectFilesWithRoot (accountsDatabaseFile + "*" , deviceIdFile );
5454 JSONObject root = new JSONObject (new String (data ));
5555 String accounts = root .getString ("accounts" );
5656 try (SQLiteDatabase db = SQLiteDatabase .openDatabase (accountsDatabaseFile , null , SQLiteDatabase .OPEN_READWRITE )) {
@@ -63,7 +63,7 @@ public static void restoreKuroGame(Context context, byte[] data) {
6363 } catch (Exception e ) {
6464 throw new RuntimeException (e );
6565 } finally {
66- protectFilesWithRoot (accountsDatabaseFile , deviceIdFile );
66+ protectFilesWithRoot (accountsDatabaseFile + "*" , deviceIdFile );
6767 }
6868 }
6969
@@ -86,6 +86,6 @@ private static void protectFilesWithRoot(String ...files){
8686 builder .append (" " );
8787 }
8888 }
89- Shell .su ("setenforce 1" , "chmod 644 " + builder .toString ()).exec ();
89+ Shell .su ("setenforce 1" , "chmod 600 " + builder .toString ()).exec ();
9090 }
9191}
0 commit comments