Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6.3 #23

Merged
merged 62 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6b842ce
Explore improvements
DerGoogler Jul 13, 2023
9550382
Hide tabs if it runs on a non android
DerGoogler Jul 13, 2023
8fb8048
Some fixes
DerGoogler Jul 13, 2023
426a652
Handle module updates better
DerGoogler Jul 13, 2023
f62784a
Make user able to copy code fields
DerGoogler Jul 13, 2023
c0ac8dc
Validate fetched repo data #13
DerGoogler Jul 13, 2023
d72020b
DAPI Improvements
DerGoogler Jul 14, 2023
bb5a81e
.
DerGoogler Jul 14, 2023
5ef0e3f
Improve module sharing
DerGoogler Jul 14, 2023
6120db5
.
DerGoogler Jul 15, 2023
65c60bb
.
DerGoogler Jul 17, 2023
9b5d29b
Terminal improvements
DerGoogler Jul 17, 2023
f688756
.
DerGoogler Jul 17, 2023
48b8f92
Rename File to SuFile
DerGoogler Jul 18, 2023
e4c08b4
Changes to Shell Class
DerGoogler Jul 18, 2023
e98cd52
Custom repos improvements
DerGoogler Jul 18, 2023
b9c1d53
.
DerGoogler Jul 21, 2023
75f14cc
Changes to native
DerGoogler Jul 21, 2023
5ada093
bump version
DerGoogler Jul 21, 2023
9c691bf
Move Pagination to bottom
DerGoogler Jul 28, 2023
47f2610
Unwarp tabs
DerGoogler Aug 13, 2023
663a1cc
UI changes
DerGoogler Aug 13, 2023
ff434f4
addec account creation
DerGoogler Aug 13, 2023
af9efeb
.
DerGoogler Aug 13, 2023
af81542
Expand profiles
DerGoogler Aug 14, 2023
7855e80
.
DerGoogler Aug 14, 2023
be44a15
.
DerGoogler Aug 15, 2023
865b8f4
.
DerGoogler Aug 15, 2023
e8bbf2c
Update repo activty
DerGoogler Aug 15, 2023
d795005
.
DerGoogler Aug 16, 2023
fae0c69
Improve Firebase
DerGoogler Aug 19, 2023
828d4d8
Update account design
DerGoogler Aug 20, 2023
92a0256
.
DerGoogler Aug 20, 2023
e5300dc
Rework activity hook
DerGoogler Aug 20, 2023
04e3911
Fix participating modules search
DerGoogler Aug 20, 2023
5590777
Add profile pages
DerGoogler Aug 20, 2023
81164af
Improve darkmode and design
DerGoogler Aug 23, 2023
eba39c2
Improve darkmode, markdown a. add new module view
DerGoogler Aug 25, 2023
c883a65
Other improvements
DerGoogler Aug 26, 2023
8657cdb
Some imrpvements
DerGoogler Aug 26, 2023
8bcbb1a
Update DeviceModule
DerGoogler Aug 26, 2023
2301dfa
.
DerGoogler Aug 26, 2023
507e6fb
Update readme
DerGoogler Aug 26, 2023
5d9840e
Fix statusbar color apply
DerGoogler Aug 26, 2023
ebef149
.
DerGoogler Aug 27, 2023
fd18af3
design improvements
DerGoogler Aug 27, 2023
c934f79
^.
DerGoogler Aug 28, 2023
1620276
Add KernelSU support
DerGoogler Sep 10, 2023
12f5a73
Add device module customizing
DerGoogler Sep 10, 2023
0e87688
Show service scripts for installed modules
DerGoogler Sep 10, 2023
0cb6ab1
Update README.md
DerGoogler Sep 10, 2023
3685efd
Remove Account System
DerGoogler Sep 16, 2023
1e6053c
Change description layout
DerGoogler Sep 16, 2023
ff120b9
Improve light mode
DerGoogler Sep 16, 2023
022e2d9
Improve darkmode
DerGoogler Sep 16, 2023
1684eea
Some other fixes
DerGoogler Sep 16, 2023
f6854de
Add network checkts and small bug fixes
DerGoogler Sep 16, 2023
75b8240
Fixes
DerGoogler Sep 16, 2023
5f7adf4
.
DerGoogler Sep 16, 2023
c125829
.
DerGoogler Sep 17, 2023
45671ae
Inprove configure
DerGoogler Sep 17, 2023
a2201bf
Some configure adjustments
DerGoogler Sep 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId 'com.dergoogler.mmrl'
minSdk 26
targetSdk 33
versionName '1.6.2'
versionCode 162
versionName '1.6.3'
versionCode 163
externalNativeBuild {
cmake {
cppFlags "-llog"
Expand Down
4 changes: 2 additions & 2 deletions Android/app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 161,
"versionName": "1.6.1",
"versionCode": 163,
"versionName": "1.6.3",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.dergoogler.core;

import android.content.Context;
import android.content.ContextWrapper;
import android.os.Environment;
import android.webkit.JavascriptInterface;

public class NativeEnvironment {

private final Context ctx;

public NativeEnvironment(Context ctx) {
this.ctx = ctx;
}

@JavascriptInterface
public String getExternalStorageDir() {
return Environment.getExternalStorageDirectory().getAbsolutePath();
}

@JavascriptInterface
public String getPackageDataDir() {
return this.ctx.getExternalFilesDir(null).getAbsolutePath();
}

@JavascriptInterface
public String getPublicDir(String type) {
return Environment.getExternalStoragePublicDirectory(type).getAbsolutePath();
}

@JavascriptInterface
public String getDataDir() {
return new ContextWrapper(this.ctx).getFilesDir().getPath();
}

}
167 changes: 0 additions & 167 deletions Android/app/src/main/java/com/dergoogler/core/NativeFs.java

This file was deleted.

160 changes: 160 additions & 0 deletions Android/app/src/main/java/com/dergoogler/core/NativeSuFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
package com.dergoogler.core;

import android.webkit.JavascriptInterface;

import androidx.annotation.NonNull;

import com.dergoogler.mmrl.MainActivity;
import com.topjohnwu.superuser.io.SuFile;
import com.topjohnwu.superuser.io.SuFileInputStream;
import com.topjohnwu.superuser.io.SuFileOutputStream;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class NativeSuFile {
private final MainActivity ctx;

public NativeSuFile(MainActivity ctx) {
this.ctx = ctx;
}

@JavascriptInterface
public String readFile(String path) {
try {
try (BufferedReader br = new BufferedReader(new InputStreamReader(SuFileInputStream.open(path)))) {
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
sb.append('\n');
}
return sb.toString();
}
} catch (IOException e) {
e.printStackTrace();
return "";
}
}

@NonNull
@JavascriptInterface
public String listFiles(String path) {
String[] modules = new SuFile(path).list();
return String.join(",", modules);
}

@JavascriptInterface
public boolean createFile(String path) {
return new SuFile(path).createNewFile();
}

@JavascriptInterface
public boolean deleteFile(String path) {
return new SuFile(path).delete();
}

@JavascriptInterface
public void deleteRecursive(String path) {
new SuFile(path).deleteRecursive();
}

@JavascriptInterface
public boolean existFile(String path) {
return new SuFile(path).exists();
}


@JavascriptInterface
public static boolean downloadFile(final String url, final String savePath, final String saveName) {
try {
File savefilepath = new SuFile(savePath);
if (!savefilepath.exists()) {
savefilepath.mkdirs();
}
File savefile = new SuFile(savePath + saveName);
if (savefile.exists()) {
savefile.delete();
}
savefile.createNewFile();

URL u = new URL(url);
URLConnection conn = u.openConnection();
int contentLength = conn.getContentLength();

DataInputStream stream = new DataInputStream(u.openStream());

byte[] buffer = new byte[contentLength];
stream.readFully(buffer);
stream.close();

DataOutputStream fos = new DataOutputStream(SuFileOutputStream.open(
savePath + saveName, true));
fos.write(buffer);
fos.flush();
fos.close();
return true;
} catch (FileNotFoundException e) {
e.printStackTrace();
return false;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}

private void dirChecker(String filePath) {
File file = new File(filePath);
if (!file.exists()) {
file.mkdirs();
} else {

}
}

@JavascriptInterface
public boolean unzip(String _zipFile, String _targetLocation) {
//create target location folder if not exist
dirChecker(_targetLocation);

try {
FileInputStream fin = new FileInputStream(_zipFile);
ZipInputStream zin = new ZipInputStream(fin);
ZipEntry ze = null;
while ((ze = zin.getNextEntry()) != null) {

//create dir if required while unzipping
if (ze.isDirectory()) {
dirChecker(ze.getName());
} else {
FileOutputStream fout = new FileOutputStream(_targetLocation + ze.getName());

Check failure

Code scanning / CodeQL

Arbitrary file write during archive extraction ("Zip Slip")

Unsanitized archive entry, which may contain '..', is used in a [file system operation](1).
for (int c = zin.read(); c != -1; c = zin.read()) {
fout.write(c);
}

zin.closeEntry();
fout.close();
}

}
zin.close();
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
}
Loading