Skip to content

Commit

Permalink
Updated gradle and ndk build files, needs retesting to ensure .so fil…
Browse files Browse the repository at this point in the history
…es are included.
  • Loading branch information
stealthcopter committed May 11, 2018
1 parent 72bf1ce commit eff3329
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 29 deletions.
16 changes: 5 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
ndkBuild {
path '../rootbeerlib/src/main/jni/Android.mk'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':rootbeerlib')
compile "com.android.support:appcompat-v7:$supportLibVer"
compile "com.android.support:design:$supportLibVer"
compile 'com.nineoldandroids:library:2.4.0'
compile 'uk.co.barbuzz:beerprogressview:0.0.4'
implementation project(':rootbeerlib')
implementation "com.android.support:appcompat-v7:$supportLibVer"
implementation "com.android.support:design:$supportLibVer"
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'uk.co.barbuzz:beerprogressview:0.0.4'
}
20 changes: 14 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -22,13 +26,17 @@ allprojects {

repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

subprojects {
ext.compileSdkVer = 25
ext.buildToolsVer = "25.0.3"
ext.minSdkVer = 10
ext.targetSdkVer = 25
ext.supportLibVer = "25.3.1"
ext.compileSdkVer = 27
ext.buildToolsVer = "27.0.3"
ext.minSdkVer = 15
ext.targetSdkVer = 27
ext.supportLibVer = "27.1.1"
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri May 12 00:31:25 SGT 2017
#Fri May 11 11:54:48 BST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
4 changes: 1 addition & 3 deletions rootbeerlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.mockito:mockito-core:2.10.0'
}

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
18 changes: 12 additions & 6 deletions rootbeerlib/src/main/java/com/scottyab/rootbeer/RootBeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,27 +199,27 @@ public void setLogging(boolean logging) {
}

private String[] propsReader() {
String[] result = new String[0];
try {
InputStream inputstream = Runtime.getRuntime().exec("getprop").getInputStream();
if (inputstream == null) return null;
String propVal = new Scanner(inputstream).useDelimiter("\\A").next();
result = propVal.split("\n");
return propVal.split("\n");
} catch (IOException | NoSuchElementException e) {
e.printStackTrace();
return null;
}
return result;
}

private String[] mountReader() {
String[] result = new String[0];
try {
InputStream inputstream = Runtime.getRuntime().exec("mount").getInputStream();
if (inputstream == null) return null;
String propVal = new Scanner(inputstream).useDelimiter("\\A").next();
result = propVal.split("\n");
return propVal.split("\n");
} catch (IOException | NoSuchElementException e) {
e.printStackTrace();
return null;
}
return result;
}

/**
Expand Down Expand Up @@ -259,6 +259,12 @@ public boolean checkForDangerousProps() {
boolean result = false;

String[] lines = propsReader();

if (lines == null){
// Could not read, assume false;
return result;
}

for (String line : lines) {
for (String key : dangerousProps.keySet()) {
if (line.contains(key)) {
Expand Down
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 := armeabi-v7a arm64-v8a x86 x86_64
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed rootbeerlib/src/main/jniLibs/mips/libtool-checker.so
Binary file not shown.
Binary file not shown.
Binary file removed rootbeerlib/src/main/jniLibs/x86/libtool-checker.so
Binary file not shown.
Binary file not shown.

0 comments on commit eff3329

Please sign in to comment.