Skip to content

Commit

Permalink
Merge pull request scottyab#14 from DevFactory/release/local-variable…
Browse files Browse the repository at this point in the history
…s-should-not-be-declared-and-then-immediately-returned-or-thrown,utility-classes-should-not-have-public-constructors-fix-1

squid:S1488, squid:S1118 - Local Variables should not be declared and…
  • Loading branch information
scottyab committed Mar 16, 2016
2 parents 42c4094 + bb88041 commit a649adb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 5 additions & 1 deletion rootbeerlib/src/main/java/com/scottyab/rootbeer/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
/**
* Created by mat on 19/06/15.
*/
public class Const {
public final class Const {

private Const() throws InstantiationException {
throw new InstantiationException("This class is not for instantiation");
}

public static final String[] knownRootAppsPackages = {
"com.noshufou.android.su",
Expand Down
7 changes: 2 additions & 5 deletions rootbeerlib/src/main/java/com/scottyab/rootbeer/RootBeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ public boolean isRooted() {
boolean testSuExists = checkSuExists();
boolean testRootNative = checkForRootNative();

boolean result = rootManagement || potentiallyDangerousApps || suBinary
return rootManagement || potentiallyDangerousApps || suBinary
|| busyboxBinary || dangerousProps || rwSystem || testKeys || testSuExists || testRootNative;

return result;
}

/**
Expand Down Expand Up @@ -330,8 +328,7 @@ public boolean checkForRootNative() {

RootBeerNative rootBeerNative = new RootBeerNative();
rootBeerNative.setLogDebugMessages(true);
boolean nativeRoot = rootBeerNative.checkForRoot(paths) > 0;
return nativeRoot;
return rootBeerNative.checkForRoot(paths) > 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ private static String getTrace() {
int lineNo = elements[depth].getLineNumber();
int i = callerClassPath.lastIndexOf('.');
String callerClassName = callerClassPath.substring(i + 1);
String trace = callerClassName + ": " + callerMethodName + "() ["
return callerClassName + ": " + callerMethodName + "() ["
+ lineNo + "] - ";
return trace;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
/**
* Created by scottab on 30/06/15.
*/
public class Utils {
public final class Utils {

private Utils() throws InstantiationException {
throw new InstantiationException("This class is not for instantiation");
}
/**
* In Development - an idea of ours was to check the if selinux is enforcing - this could be disabled for some rooting apps
* Checking for selinux mode
Expand Down

0 comments on commit a649adb

Please sign in to comment.