Skip to content

Commit

Permalink
support android8
Browse files Browse the repository at this point in the history
fixed bugs
  • Loading branch information
PangBaiWork committed Mar 10, 2024
1 parent 32034b0 commit 077dd54
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 10 deletions.
4 changes: 4 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Read this in other languages: [English](README.md) , [简体中文](README-CN.md),

[![CI](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/PangBaiWork/WeBlog/actions/workflows/main.yml)
[![QQ](https://img.shields.io/badge/Join-QQ_Group-ff69b4)](https://qm.qq.com/q/1wJcBUfst2)
----
## 引言
博客是什么?它是我们的另一片天地,在这里你可以说你想说的话,分享自己学到的新东西,美好的事,是温馨的小窝。
它是不被世俗打扰的净土,没有人在这里教你做事,你可以倾心陈述一切。
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Read this in other languages: [English](README.md) , [简体中文](README-CN.md)

[![CI](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/PangBaiWork/WeBlog/actions/workflows/main.yml)
[![QQ](https://img.shields.io/badge/Join-QQ_Group-ff69b4)](https://qm.qq.com/q/1wJcBUfst2)
----
## Introduction
What is a blog? It is another world for us,also a warm nest where you can say what you want to say,
share new and beautiful things you have learned.
Expand Down
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ android {
// buildToolsVersion "33.0.0"

lintOptions {

abortOnError false

}
packagingOptions {
jniLibs {
Expand All @@ -31,7 +29,8 @@ android {
versionCode 2
versionName "1.1"
ndk {//让gradle知道ndk的配置
abiFilter "arm64-v8a"//so文件的平
// abiFilter "arm64-v8a,"//so文件的平

}
vectorDrawables {
useSupportLibrary true
Expand Down
Binary file modified app/src/main/assets/libexec.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ public SuperTerminalView(Context context, AttributeSet attributes) {
}

public void setTerminal(String cwd) {
String[] n = {Init.linker,Init.busyboxPath,"sh"};
setProcess(Init.linker, cwd, n,Init.envp, 0);
if (Init.android10) {
String[] n = {Init.linker, Init.busyboxPath, "sh"};
setProcess(Init.linker, cwd, n, Init.envp, 0);
}else {
setProcess(Init.busyboxPath, cwd,new String[] {"sh"}, Init.envp, 0);
}
// setProcess(Init.shell, cwd, null,new String[]{ "PATH=" + Init.binDir}, 0);
runProcess();
//cmdView.requestFocus();
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/com/pangbai/weblog/execute/cmdExer.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ public static int execute(String command, boolean su, boolean wait) {

// 设置环境变量
// environment.put("LD_LIBRARY_PATH", Init.filesDirPath + "/usr/lib");

processBuilder.command(Init.linker,Init.busyboxPath,shell, "-c",command);
if (Init.android10) {
processBuilder.command(Init.linker, Init.busyboxPath, shell, "-c", command);
}else {
processBuilder.command(Init.busyboxPath,shell, "-c", command);
}
processBuilder.redirectErrorStream(true);

try {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/com/pangbai/weblog/tool/Init.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class Init {
final public static String sdcardPath = "/storage/emulated/0/";
final public static String linker = "/system/bin/linker64";
public static String keyPath;
final public static boolean android10=Build.VERSION.SDK_INT>=29;
boolean result;

AlertDialog dialog;
Expand Down Expand Up @@ -75,6 +76,7 @@ public Init(Activity ct) {
"PS1=\\[\\e[1\\;31m\\])➜ \\[\\e[1;36m\\]\\W\\[\\e[m\\] ",
"TERM=xterm-256color",
"LANG=en_US.UTF-8",
android10?"ANDROID10=1":"ANDROID10=0",
"ANDROID_DATA=/data",
"ANDROID_ROOT=/system"
};
Expand Down Expand Up @@ -109,6 +111,9 @@ public void run() {
checkPermission(ct);

});
else
checkPermission(ct);



});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ public void refreshList(){
@SuppressLint("NotifyDataSetChanged")
public void setList(File files) {
if (!files.exists() || !files.canRead()) {

Snackbar.make(parent, "Can Not Open This Folder", Snackbar.LENGTH_SHORT).show();
if (parent!=null) Snackbar.make(parent, "Can Not Open This Folder", Snackbar.LENGTH_SHORT).show();

return;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dowork_TOOLCHAIN_VERSION := 4.9
APP_STL := c++_static
APP_ABI := arm64-v8a
APP_ABI := arm64-v8a,x86_64
APP_PLATFORM := android-24

0 comments on commit 077dd54

Please sign in to comment.