Skip to content

Commit

Permalink
fix session creation in rooted installer
Browse files Browse the repository at this point in the history
increment version
  • Loading branch information
Aefyr committed Aug 29, 2019
1 parent 755469d commit 06ffc52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.aefyr.sai"
minSdkVersion 21
targetSdkVersion 28
versionCode 33
versionName "2.3"
versionCode 34
versionName "2.4"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,25 @@ private int createSession() throws RuntimeException {
List<Pair<String, String>> attemptedCommands = new ArrayList<>();

for (String commandToAttempt : commandsToAttempt) {
String result = ensureCommandSucceeded(Root.exec(commandToAttempt));
attemptedCommands.add(new Pair<>(commandToAttempt, result));
Root.Result result = Root.exec(commandToAttempt);
attemptedCommands.add(new Pair<>(commandToAttempt, result.toString()));

Integer sessionId = extractSessionId(result);
if (!result.isSuccessful()) {
Log.w(TAG, String.format("Command failed: %s > %s", commandToAttempt, result));
continue;
}

Integer sessionId = extractSessionId(result.out);
if (sessionId != null)
return sessionId;
else
Log.w(TAG, String.format("Command failed: %s > %s", commandToAttempt, result));
}

StringBuilder exceptionMessage = new StringBuilder("Unable to create session, attempted commands: ");
int i = 1;
for (Pair<String, String> attemptedCommand : attemptedCommands) {
exceptionMessage.append("\n\n==========================\n")
exceptionMessage.append("\n\n").append(i++).append(") ==========================\n")
.append(attemptedCommand.first)
.append("\nVVVVVVVVVVVVVVVV\n")
.append(attemptedCommand.second);
Expand Down

0 comments on commit 06ffc52

Please sign in to comment.