mirror of
https://gitea.winboll.cc/Studio/OriginMaster.git
synced 2026-02-04 10:31:31 +08:00
正在制作模块“发送Action 让Termux自行Bash命令。”。。。
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Mon Jan 19 03:38:37 GMT 2026
|
||||
#Mon Jan 19 03:57:58 GMT 2026
|
||||
stageCount=11
|
||||
libraryProject=
|
||||
baseVersion=15.11
|
||||
publishVersion=15.11.10
|
||||
buildCount=7
|
||||
buildCount=12
|
||||
baseBetaVersion=15.11.11
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package cc.winboll.studio.winboll.unittest;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import cc.winboll.studio.libaes.utils.WinBoLLActivityManager;
|
||||
import cc.winboll.studio.libappbase.LogUtils;
|
||||
import cc.winboll.studio.libappbase.ToastUtils;
|
||||
import cc.winboll.studio.winboll.MainActivity;
|
||||
import cc.winboll.studio.winboll.R;
|
||||
import cc.winboll.studio.winboll.activities.BaseWinBoLLActivity;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* @Author 豆包&ZhanGSKen<zhangsken@qq.com>
|
||||
@@ -121,5 +123,25 @@ public class TermuxEnvTestActivity extends BaseWinBoLLActivity {
|
||||
String fileListStr = readTermuxHomeFileList();
|
||||
tvMessage.append(fileListStr);
|
||||
}
|
||||
|
||||
public void onTestTermuxCMD(View view) {
|
||||
// pkg update && pkg upgrade -y
|
||||
// pkg install termux-api -y
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setPackage("com.termux");
|
||||
intent.setAction("com.termux.RUN_COMMAND");
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
intent.putExtra("com.termux.RUN_COMMAND_PATH", "/data/data/com.termux/files/home");
|
||||
intent.putExtra("com.termux.RUN_COMMAND_ARGUMENTS", new String[]{"ls"});
|
||||
intent.putExtra("com.termux.RUN_COMMAND_WAIT_FOR_RESULT", false);
|
||||
intent.putExtra("com.termux.RUN_COMMAND_BACKGROUND", false);
|
||||
if (intent.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(intent);
|
||||
} else {
|
||||
Toast.makeText(this, "Termux或Termux:API未正确安装", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TestTermuxCMD"
|
||||
android:onClick="onTestTermuxCMD"/>
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user