Skip to content

Commit 793878a

Browse files
committed
Uppercase some constants
1 parent e4d8974 commit 793878a

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

librootjava/src/main/java/eu/chainfire/librootjava/AppProcess.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.io.IOException;
2828
import java.util.List;
2929
import java.util.Locale;
30-
import java.util.UUID;
3130

3231
/**
3332
* Utility methods to determine the location and bits of the app_process executable to be used.<br>
@@ -43,20 +42,20 @@ public class AppProcess {
4342
/**
4443
* Toolbox or toybox?
4544
*/
46-
public static final String box = Build.VERSION.SDK_INT < 23 ? "toolbox" : "toybox";
45+
public static final String BOX = Build.VERSION.SDK_INT < 23 ? "toolbox" : "toybox";
4746

4847
/**
4948
* Used to create unique filenames in common locations
5049
*/
51-
public static final String uuid = getUUID();
50+
public static final String UUID = getUUID();
5251

5352
/**
5453
* @return uuid that doesn't contain 32 or 64, as to not confuse bit-choosing code
5554
*/
5655
private static String getUUID() {
5756
String uuid = null;
5857
while ((uuid == null) || uuid.contains("32") || uuid.contains("64")) {
59-
uuid = UUID.randomUUID().toString();
58+
uuid = java.util.UUID.randomUUID().toString();
6059
}
6160
return uuid;
6261
}
@@ -325,14 +324,14 @@ public static String getAppProcessRelocate(Context context, String appProcessBas
325324

326325
String appProcessCopy;
327326
if (guessIfAppProcessIs64Bits(appProcessBase)) {
328-
appProcessCopy = path + "/.app_process64_" + uuid;
327+
appProcessCopy = path + "/.app_process64_" + UUID;
329328
} else {
330-
appProcessCopy = path + "/.app_process32_" + uuid;
329+
appProcessCopy = path + "/.app_process32_" + UUID;
331330
}
332-
preLaunch.add(String.format(Locale.ENGLISH, "%s cp %s %s >/dev/null 2>/dev/null", box, appProcessBase, appProcessCopy));
333-
preLaunch.add(String.format(Locale.ENGLISH, "%s chmod %s %s >/dev/null 2>/dev/null", box, onData ? "0766" : "0700", appProcessCopy));
331+
preLaunch.add(String.format(Locale.ENGLISH, "%s cp %s %s >/dev/null 2>/dev/null", BOX, appProcessBase, appProcessCopy));
332+
preLaunch.add(String.format(Locale.ENGLISH, "%s chmod %s %s >/dev/null 2>/dev/null", BOX, onData ? "0766" : "0700", appProcessCopy));
334333
if (onData) preLaunch.add(String.format(Locale.ENGLISH, "restorecon %s >/dev/null 2>/dev/null", appProcessCopy));
335-
postExecution.add(String.format(Locale.ENGLISH, "%s rm %s >/dev/null 2>/dev/null", box, appProcessCopy));
334+
postExecution.add(String.format(Locale.ENGLISH, "%s rm %s >/dev/null 2>/dev/null", BOX, appProcessCopy));
336335
return appProcessCopy;
337336
}
338337
}

librootjavadaemon/src/main/java/eu/chainfire/librootjavadaemon/RootDaemon.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ public static List<String> patchLaunchScript(Context context, List<String> scrip
7575

7676
// copy our executable
7777
String libSrc = RootJava.getLibraryPath(context, "daemonize");
78-
String libDest = app_process_path + "/.daemonize_" + AppProcess.uuid;
78+
String libDest = app_process_path + "/.daemonize_" + AppProcess.UUID;
7979
boolean onData = libDest.startsWith("/data/");
8080

81-
ret.add(String.format(Locale.ENGLISH, "%s cp %s %s >/dev/null 2>/dev/null", AppProcess.box, libSrc, libDest));
82-
ret.add(String.format(Locale.ENGLISH, "%s chmod %s %s >/dev/null 2>/dev/null", AppProcess.box, onData ? "0766" : "0700", libDest));
81+
ret.add(String.format(Locale.ENGLISH, "%s cp %s %s >/dev/null 2>/dev/null", AppProcess.BOX, libSrc, libDest));
82+
ret.add(String.format(Locale.ENGLISH, "%s chmod %s %s >/dev/null 2>/dev/null", AppProcess.BOX, onData ? "0766" : "0700", libDest));
8383
if (onData) ret.add(String.format(Locale.ENGLISH, "restorecon %s >/dev/null 2>/dev/null", libDest));
8484

8585
// inject executable into command

0 commit comments

Comments
 (0)