This repository was archived by the owner on Jun 14, 2018. It is now read-only.
MUL-1501 security improvements, moved all security methods to class, new core lib fix#221
Open
altvnv wants to merge 4 commits intoAppscrunch:masterfrom
altvnv:master
Open
MUL-1501 security improvements, moved all security methods to class, new core lib fix#221altvnv wants to merge 4 commits intoAppscrunch:masterfrom altvnv:master
altvnv wants to merge 4 commits intoAppscrunch:masterfrom
altvnv:master
Conversation
AndreyGrowl
suggested changes
Jun 1, 2018
|
|
||
| public static boolean preventRootIfDetected(AppCompatActivity activity) { | ||
| if (isRooted(activity)) { | ||
| if (SecurityHelper.notSecured(activity)) { |
Collaborator
There was a problem hiding this comment.
should be isSecured or !isSecured.
|
|
||
| public class SecurityHelper { | ||
|
|
||
| private static Random mRandom = new SecureRandom(); |
Collaborator
There was a problem hiding this comment.
mStyle is for official google reps contributors. We use our default code style described at convention (see wiki).
|
|
||
| private static Random mRandom = new SecureRandom(); | ||
| private static String mResult; | ||
| private static boolean Pass; |
Collaborator
There was a problem hiding this comment.
only classses should start from uppercase letter
| JSONObject jsonObj = new JSONObject(decodedPayload); | ||
| Pass = jsonObj.getString("basicIntegrity").equals("true"); | ||
| } catch (final JSONException e) { | ||
| Log.e("Error", "Json parsing: " + e.getMessage()); |
Collaborator
There was a problem hiding this comment.
always do e.printStackTrace while catching exceptions
|
|
||
| if (e instanceof ApiException) { | ||
| ApiException apiException = (ApiException) e; | ||
| Log.d("Error", CommonStatusCodes.getStatusCodeString(apiException.getStatusCode()) + ": " + apiException); |
Collaborator
There was a problem hiding this comment.
Also use Timber.log for logs
|
|
||
| public static boolean notSecured(AppCompatActivity activity){ | ||
| RootBeer rootBeer = new RootBeer(activity); | ||
|
|
Collaborator
There was a problem hiding this comment.
too much spaces\newlines
AndreyGrowl
approved these changes
Jun 1, 2018
| byteStream.write(bytes); | ||
| byteStream.write(data.getBytes()); | ||
| } catch (IOException e) { | ||
| return null; |
Collaborator
There was a problem hiding this comment.
where is your e.printStackTraces again
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added Google SafetyNET API
Some corelib fixes (according to latest version)
Created SecurityHelper class