Skip to content

Commit

Permalink
Merge pull request #4 from SujitSingh/master
Browse files Browse the repository at this point in the history
Magisk package checks
  • Loading branch information
karandpr authored Jun 12, 2018
2 parents 1b7b4db + 7d3e0c5 commit 1ea75ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/android/build-extras.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ repositories{
}

dependencies {
compile 'com.github.scottyab:rootbeer:0.0.6'
compile 'com.github.scottyab:rootbeer:1a87fc43254349a7bfe72a8e57e8aa2662f07130'
}
15 changes: 12 additions & 3 deletions src/android/com/rb/cdvRootBeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,20 @@ public boolean execute(String action, JSONArray args, final CallbackContext call
callbackContext.error("false");
}
break;
default:
callbackContext.error("false");
case "checkForMagiskBinary":
try {
callbackContext.success(rootBeer.checkForMagiskBinary() ? "true" : "false");
Log.i(TAG, "Magisk " + (rootBeer.checkForMagiskBinary() ? "detected" : "not detected"));
} catch (Exception e) {
Log.e(TAG, "Error" + e);
callbackContext.error("false");
}
break;
default:
callbackContext.error("false");

}
return true;
}

}
}
3 changes: 3 additions & 0 deletions www/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ var cdvRootBeer = {
},
detectTestKeys: function (cb,err) {
exec(cb, err, PLUGIN_NAME, 'detectTestKeys', []);
},
checkForMagiskBinary: function (cb,err) {
exec(cb, err, PLUGIN_NAME, 'checkForMagiskBinary', []);
}
};

Expand Down

0 comments on commit 1ea75ee

Please sign in to comment.