-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
1.6.3 #23
Changes from 23 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
6b842ce
Explore improvements
DerGoogler 9550382
Hide tabs if it runs on a non android
DerGoogler 8fb8048
Some fixes
DerGoogler 426a652
Handle module updates better
DerGoogler f62784a
Make user able to copy code fields
DerGoogler c0ac8dc
Validate fetched repo data #13
DerGoogler d72020b
DAPI Improvements
DerGoogler bb5a81e
.
DerGoogler 5ef0e3f
Improve module sharing
DerGoogler 6120db5
.
DerGoogler 65c60bb
.
DerGoogler 9b5d29b
Terminal improvements
DerGoogler f688756
.
DerGoogler 48b8f92
Rename File to SuFile
DerGoogler e4c08b4
Changes to Shell Class
DerGoogler e98cd52
Custom repos improvements
DerGoogler b9c1d53
.
DerGoogler 75f14cc
Changes to native
DerGoogler 5ada093
bump version
DerGoogler 9c691bf
Move Pagination to bottom
DerGoogler 47f2610
Unwarp tabs
DerGoogler 663a1cc
UI changes
DerGoogler ff434f4
addec account creation
DerGoogler af9efeb
.
DerGoogler af81542
Expand profiles
DerGoogler 7855e80
.
DerGoogler be44a15
.
DerGoogler 865b8f4
.
DerGoogler e8bbf2c
Update repo activty
DerGoogler d795005
.
DerGoogler fae0c69
Improve Firebase
DerGoogler 828d4d8
Update account design
DerGoogler 92a0256
.
DerGoogler e5300dc
Rework activity hook
DerGoogler 04e3911
Fix participating modules search
DerGoogler 5590777
Add profile pages
DerGoogler 81164af
Improve darkmode and design
DerGoogler eba39c2
Improve darkmode, markdown a. add new module view
DerGoogler c883a65
Other improvements
DerGoogler 8657cdb
Some imrpvements
DerGoogler 8bcbb1a
Update DeviceModule
DerGoogler 2301dfa
.
DerGoogler 507e6fb
Update readme
DerGoogler 5d9840e
Fix statusbar color apply
DerGoogler ebef149
.
DerGoogler fd18af3
design improvements
DerGoogler c934f79
^.
DerGoogler 1620276
Add KernelSU support
DerGoogler 12f5a73
Add device module customizing
DerGoogler 0e87688
Show service scripts for installed modules
DerGoogler 0cb6ab1
Update README.md
DerGoogler 3685efd
Remove Account System
DerGoogler 1e6053c
Change description layout
DerGoogler ff120b9
Improve light mode
DerGoogler 022e2d9
Improve darkmode
DerGoogler 1684eea
Some other fixes
DerGoogler f6854de
Add network checkts and small bug fixes
DerGoogler 75b8240
Fixes
DerGoogler 5f7adf4
.
DerGoogler c125829
.
DerGoogler 45671ae
Inprove configure
DerGoogler a2201bf
Some configure adjustments
DerGoogler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Android/app/src/main/java/com/dergoogler/core/NativeEnvironment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
167
Android/app/src/main/java/com/dergoogler/core/NativeFs.java
This file was deleted.
Oops, something went wrong.
160 changes: 160 additions & 0 deletions
160
Android/app/src/main/java/com/dergoogler/core/NativeSuFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
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; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
Arbitrary file write during archive extraction ("Zip Slip")