Skip to content

Commit 649c0a6

Browse files
committed
Remove unnecessary native check
1 parent 8e28127 commit 649c0a6

File tree

8 files changed

+12
-97
lines changed

8 files changed

+12
-97
lines changed

app/build.gradle

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ plugins {
77

88
android {
99
compileSdk 32
10-
ndkVersion '25.0.8775105'
1110
buildToolsVersion '33.0.0'
1211
defaultConfig {
1312
applicationId "com.android1500.yard"
@@ -16,28 +15,18 @@ android {
1615
versionCode 1
1716
versionName "1.0"
1817
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
19-
signingConfig signingConfigs.debug
20-
externalNativeBuild {
21-
ndkBuild {
22-
arguments "-j${Runtime.runtime.availableProcessors()}"
23-
}
24-
}
18+
2519

2620
}
2721
buildFeatures {
28-
prefab true
2922
viewBinding true
3023
}
3124

32-
externalNativeBuild {
33-
ndkBuild.path 'src/main/jni/Android.mk'
34-
}
35-
36-
3725

3826
buildTypes {
3927
release {
40-
minifyEnabled false
28+
minifyEnabled true
29+
shrinkResources true
4130
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
4231
}
4332
}
@@ -48,13 +37,6 @@ android {
4837
kotlinOptions {
4938
jvmTarget = '1.8'
5039
}
51-
sourceSets {
52-
main {
53-
jni {
54-
srcDirs'src\\main\\jni'
55-
}
56-
}
57-
}
5840

5941
}
6042

@@ -67,7 +49,6 @@ dependencies {
6749
testImplementation 'junit:junit:4.13.2'
6850
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
6951
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
70-
implementation 'io.github.vvb2060.ndk:xposeddetector:2.2'
7152
implementation 'com.scottyab:rootbeer-lib:0.1.0'
7253

7354
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"

app/proguard-rules.pro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
-repackageclasses
23+
-allowaccessmodification
24+
-keepclasseswithmembernames,includedescriptorclasses class * {
25+
native <methods>;
26+
}

app/src/main/java/com/android1500/yard/App.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ package com.android1500.yard
33
import android.app.Application
44

55
class App : Application() {
6-
init {
7-
System.loadLibrary("app")
8-
}
96

107

118
}

app/src/main/java/com/android1500/yard/CheckForRoot.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.scottyab.rootbeer.RootBeer
66
class CheckForRoot(context : Context) {
77
private val rootBeer = RootBeer(context)
88
operator fun invoke(): List<RootItemResult> = getRootResults()
9-
private external fun getXposedStat() :Int
9+
1010

1111
private fun getRootResults() = listOf(
1212
RootItemResult("Root Management Apps", rootBeer.detectRootManagementApps()),
@@ -19,19 +19,8 @@ class CheckForRoot(context : Context) {
1919
RootItemResult("For RW Paths", rootBeer.checkForRWPaths()),
2020
RootItemResult("Dangerous Props", rootBeer.checkForDangerousProps()),
2121
RootItemResult("Root via native check", rootBeer.checkForRootNative()),
22-
RootItemResult("Xposed Detect", isXposed()),
2322
RootItemResult("Magisk specific checks", rootBeer.checkForMagiskBinary())
2423
)
25-
private fun isXposed(): Boolean {
26-
return when (getXposedStat()) {
27-
0 -> return false
28-
1 -> return true
29-
2 -> return true
30-
else -> {
31-
return false
32-
}
33-
}
34-
}
3524

3625

3726
}

app/src/main/jni/Android.mk

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/src/main/jni/Application.mk

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/src/main/jni/app.cpp

Lines changed: 0 additions & 38 deletions
This file was deleted.

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ kotlin.code.style=official
2020
# Enables namespacing of each library's R class so that its R class includes only the
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
23-
android.nonTransitiveRClass=true
23+
android.nonTransitiveRClass=true
24+
android.enableJetifier=true

0 commit comments

Comments
 (0)