Skip to content

Commit 580cbe0

Browse files
authored
Merge pull request #23 from DerGoogler/1.6.3
1.6.3
2 parents 031aaf1 + a2201bf commit 580cbe0

File tree

94 files changed

+27281
-10782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+27281
-10782
lines changed

Android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId 'com.dergoogler.mmrl'
1515
minSdk 26
1616
targetSdk 33
17-
versionName '1.6.2'
18-
versionCode 162
17+
versionName '1.6.3'
18+
versionCode 163
1919
externalNativeBuild {
2020
cmake {
2121
cppFlags "-llog"

Android/app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 161,
15-
"versionName": "1.6.1",
14+
"versionCode": 163,
15+
"versionName": "1.6.3",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

Android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<queries>
1414
<package android:name="com.topjohnwu.magisk" />
1515
<package android:name="io.github.huskydg.magisk" />
16+
<package android:name="me.weishu.kernelsu" />
1617
</queries>
1718

1819
<application
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.dergoogler.core;
2+
3+
import android.content.Context;
4+
import android.content.ContextWrapper;
5+
import android.os.Environment;
6+
import android.webkit.JavascriptInterface;
7+
8+
public class NativeEnvironment {
9+
10+
private final Context ctx;
11+
12+
public NativeEnvironment(Context ctx) {
13+
this.ctx = ctx;
14+
}
15+
16+
@JavascriptInterface
17+
public String getExternalStorageDir() {
18+
return Environment.getExternalStorageDirectory().getAbsolutePath();
19+
}
20+
21+
@JavascriptInterface
22+
public String getPackageDataDir() {
23+
return this.ctx.getExternalFilesDir(null).getAbsolutePath();
24+
}
25+
26+
@JavascriptInterface
27+
public String getPublicDir(String type) {
28+
return Environment.getExternalStoragePublicDirectory(type).getAbsolutePath();
29+
}
30+
31+
@JavascriptInterface
32+
public String getDataDir() {
33+
return new ContextWrapper(this.ctx).getFilesDir().getPath();
34+
}
35+
36+
}

Android/app/src/main/java/com/dergoogler/core/NativeFs.java

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

Android/app/src/main/java/com/dergoogler/core/NativeShell.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topjohnwu.superuser.Shell;
88
import com.topjohnwu.superuser.ShellUtils;
99

10+
import java.io.IOException;
1011
import java.util.ArrayList;
1112

1213

@@ -28,6 +29,27 @@ public String result(String command) {
2829
return ShellUtils.fastCmd(command);
2930
}
3031

32+
@JavascriptInterface
33+
public void isSuccess(String command) {
34+
Shell.cmd(command).exec().isSuccess();
35+
}
36+
37+
@JavascriptInterface
38+
public void getCode(String command) {
39+
Shell.cmd(command).exec().getCode();
40+
}
41+
42+
@JavascriptInterface
43+
public boolean isSuAvailable() {
44+
try {
45+
Runtime.getRuntime().exec("su --version");
46+
return true;
47+
} catch (IOException e) {
48+
// java.io.IOException: Cannot run program "su": error=2, No such file or directory
49+
return false;
50+
}
51+
}
52+
3153
@JavascriptInterface
3254
public boolean isAppGrantedRoot() {
3355
return Shell.cmd("if grep ' / ' /proc/mounts | grep -q '/dev/root' &> /dev/null; " +

0 commit comments

Comments
 (0)