Skip to content

Commit

Permalink
Fix whitespace errors and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
friederbluemle committed May 11, 2017
1 parent f846492 commit f2ea0bd
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 49 deletions.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,3 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

48 changes: 22 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# RootBeer ![image](./app/src/main/res/mipmap-xhdpi/ic_launcher.png)

A tasty root checker library and sample app. We've scoured the internets for different methods of answering that age old question... **Has this device got root?**
A tasty root checker library and sample app. We've scoured the internets for different methods of answering that age old question... **Has this device got root?**

# Root checks
These are the current checks/tricks we are using to give an indication of root.
These are the current checks/tricks we are using to give an indication of root.

**Java checks**

* CheckRootManagementApps
* CheckRootManagementApps
* CheckPotentiallyDangerousAppss
* CheckRootCloakingApps
* CheckTestKeys
* CheckTestKeys
* checkForDangerousProps
* checkForBusyBoxBinary
* checkForSuBinary
Expand All @@ -19,40 +19,36 @@ These are the current checks/tricks we are using to give an indication of root.

**Native checks**

We call through to our native root checker to run some of it's own checks. Native checks are typically harder to cloak, so some root cloak apps just block the loading of native libraries that contain certain key words.
* checkForSuBinary
We call through to our native root checker to run some of its own checks. Native checks are typically harder to cloak, so some root cloak apps just block the loading of native libraries that contain certain keywords.

* checkForSuBinary


## Disclaimer and limitations!

We love root! both [Scott](https://github.com/scottyab) and [Mat](https://github.com/stealthcopter) (the main contributors) use rooted devices. But we appreciate sometimes you might want to have a indication your app is running on a rooted handset. Plus we wanted to see if we could beat the root cloakers. So that's what this library gives you, an *indication* of root.
We love root! both [Scott](https://github.com/scottyab) and [Mat](https://github.com/stealthcopter) (the main contributors) use rooted devices. But we appreciate sometimes you might want to have a indication your app is running on a rooted handset. Plus we wanted to see if we could beat the root cloakers. So that's what this library gives you, an *indication* of root.

Remember **root==god**, so there's no 100% way to check for root.

<img src="./art/rootbeerjesus.png" width=200 />


### Root cloakers
We've tested the Rootbeer lib and it shows an indication of root when testing with the following root cloak apps. However Rootbeer is defeated when using a combination of the root cloakers activated at the same time.
We've tested the Rootbeer lib and it shows an indication of root when testing with the following root cloak apps. However Rootbeer is defeated when using a combination of the root cloakers activated at the same time.

Tested cloakers:

* [RootCloak Plus (Cydia)](https://play.google.com/store/apps/details?id=com.devadvance.rootcloakplus&hl=en_GB) requires [Cydia Substrate](http://play.google.com/store/apps/details?id=com.saurik.substrate)
* [RootCloak](http://repo.xposed.info/module/com.devadvance.rootcloak) - requires [Xposed Framework](http://repo.xposed.info/module/de.robv.android.xposed.installer)


## Usage


```java
RootBeer rootBeer = new RootBeer(context);
if(rootBeer.isRooted()){
if (rootBeer.isRooted()) {
//we found indication of root

}else{
} else {
//we didn't find indication of root

}
```

Expand All @@ -71,25 +67,28 @@ The following devices are known the have the busybox binary present on the stock
* Moto E

### Dependency
Avaibile on [maven central](https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22rootbeer-lib%22), to include using gradle just add the following:

Available on [maven central](https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22rootbeer-lib%22), to include using Gradle just add the following:

```java
dependencies {
compile 'com.scottyab:rootbeer-lib:0.0.6'
}
```

Or use this [Jitpack.io link](https://jitpack.io/#scottyab/rootbeer)

### Building
### Building

The native library in this application will now be built via Gradle and the latest Android Studio without having to resort to the command line. However the .so files are also distributed in this repository for those who cannot compile using the NDK for some reason.

### Sample app

The sample app is published on Google play to allow you to quickly and easier test the library. Enjoy! And please do feedback to us if your tests produce different results.
The sample app is published on Google play to allow you to quickly and easier test the library. Enjoy! And please do feedback to us if your tests produce different results.


<a href="https://play.google.com/store/apps/details?id=com.scottyab.rootbeer.sample&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"><img width="200" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" /></a>

<img width="200" alt="screenshot" src="./art/ss_got_root_fail.png">


Expand All @@ -99,23 +98,21 @@ There must be more root checks to make this more complete. If you have one pleas

### Thanks

* Kevin Kowalewski and others from this popular [Stackoverflow post](https://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device?rq=1)
* Kevin Kowalewski and others from this popular [StackOverflow post](https://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device?rq=1)
* Eric Gruber's - Android Root Detection Techniques [article](https://blog.netspi.com/android-root-detection-techniques/)


## Other libraries
If you dig this, you might like:


If you dig this, you might like:

* Tim Strazzere's [Anti emulator checks](https://github.com/strazzere/anti-emulator/) project
* Scott Alexander-Bown's [SafetyNet Helper library](https://github.com/scottyab/safetynethelper) - coupled with server side validation this is one of the best root detection approaches. See the [Google SafetyNet helper docs](https://developer.android.com/training/safetynet/index.html).

# Licence


Apache License, Version 2.0



Copyright (C) 2015, Scott Alexander-Bown, Mat Rollings

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -129,4 +126,3 @@ Apache License, Version 2.0
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

10 changes: 9 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/scottab/dev/adt-bundle-mac-x86_64/sdk-macosx-v2/tools/proguard/proguard-android.txt
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
Expand All @@ -15,3 +15,11 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_lock_open_white_24dp"/>

</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,4 @@
app:customFont="SubwayNovella.ttf"/>

</RelativeLayout>
</ScrollView>
</ScrollView>
2 changes: 1 addition & 1 deletion app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
<declare-styleable name="TextViewPlus">
<attr name="customFont" format="string"/>
</declare-styleable>
</resources>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="action_github">Get on Github</string>
<string name="action_github">Get on GitHub</string>
<string name="action_info">info</string>
<string name="info_details">This is a sample app for RootBeer - a simple to use root checking Android library. Rootbeer gives an indication of root. Remember root==god, so there\'s no 100% way to check for root.</string>

Expand Down
2 changes: 1 addition & 1 deletion changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* updated NDK build
* Added method to do root checks but ignoring the busybox due to false positives
* Allow setting of logging level
* UI tweeks to sample app
* UI tweeks to sample app
3 changes: 0 additions & 3 deletions rootbeerlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ android {
path 'src/main/jni/Android.mk'
}
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:$supportLibVer"
}


apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

2 changes: 1 addition & 1 deletion rootbeerlib/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Module Gradle settings.
POM_NAME=rootbeer
POM_ARTIFACT_ID=rootbeer-lib
POM_PACKAGING=jar
POM_PACKAGING=jar
10 changes: 9 additions & 1 deletion rootbeerlib/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/scottab/dev/adt-bundle-mac-x86_64/sdk-macosx-v2/tools/proguard/proguard-android.txt
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
Expand All @@ -15,3 +15,11 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static String getTrace() {

/**
* Prints the stack trace to mubaloo log and standard log
*
*
* @param e
*/
public static void handleException(final Exception e) {
Expand All @@ -134,4 +134,4 @@ public static void handleException(final Exception e) {

private QLog() {
}
}
}
2 changes: 0 additions & 2 deletions rootbeerlib/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ LOCAL_SRC_FILES := toolChecker.cpp
LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)


2 changes: 1 addition & 1 deletion rootbeerlib/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APP_ABI := all
APP_ABI := all
2 changes: 0 additions & 2 deletions rootbeerlib/src/main/jni/toolChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,3 @@ int Java_com_scottyab_rootbeer_RootBeerNative_checkForRoot( JNIEnv* env, jobject

return binariesFound>0;
}


4 changes: 2 additions & 2 deletions rootbeerlib/src/main/jni/toolChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern "C" {
#include <jni.h>

void Java_com_scottyab_rootbeer_RootBeerNative_setLogDebugMessages( JNIEnv* env, jobject thiz, jboolean debug);

int Java_com_scottyab_rootbeer_RootBeerNative_checkForRoot( JNIEnv* env, jobject thiz , jobjectArray pathsArray );

}
}

0 comments on commit f2ea0bd

Please sign in to comment.