From f156117b318dd658376fdcd383ae0ddce2fe6261 Mon Sep 17 00:00:00 2001 From: endureblaze Date: Thu, 4 Jul 2019 13:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=BD=E5=90=8D=E5=92=8C=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/caches/build_file_checksums.ser | Bin 589 -> 598 bytes .idea/caches/gradle_models.ser | Bin 175816 -> 178931 bytes README.md | 42 ++++++++++-------- build.gradle | 3 +- executeshell_lib/build.gradle | 6 +-- .../executeshell/ExecuteShell.java | 16 +++---- sample/build.gradle | 6 +-- .../ExecuteShellActivity.java | 13 +++--- 8 files changed, 46 insertions(+), 40 deletions(-) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index b4b77002956c886f41096b3be3108511530712d1..30084fb3b545d7a28539a7eb5187ebbc84b3dd93 100644 GIT binary patch delta 188 zcmV;t07L)H1l9zQm;}3Uq+^ksb`bMr#c)LXAeog_7cx#Boz;^f0Y?WDb75_8Y-N*i z0T(%+ACo=zRbC%%$dd+QQ;m*v01RSvX>4RJXL4a=Y-M$E0Db@l0000GrF039HGv8W z4If#be%t!!lkou^5PXysjtmmz!NRpANla&p6_XwU9wX3Q!A%*=j2z*-WM#xBm?m@p q9c6fBV|8?8b7*C3Y+r0?Vv}(J7ZHR+=JSoIlupfrGGT;y-yC=aO-fM! delta 153 zcmV;K0A~Nz1kD7Hm;|-PxqXqGb`XiHMnFBj>kY3cOc5WkTm6$F0Y?ZFY-wV0VRCts zZ~+$(wT~o7Lf=-ANeWy4nw+&BlV<@S6VR~}?C`N~m?j^_1{-$r>U01MlW_qS5c(5k z{#~y+Ljc|{469eEjg!Cu9T0ATN7L&#td#b-6x|e`Ei#ks0Ui-$n@dX3eaTekTOl;H HaE_~ZTJAw{ diff --git a/.idea/caches/gradle_models.ser b/.idea/caches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*G1vz^N^+_4WP16CURKh}W_tO8UcRE2tMqc8UTW!u zK8@GXXZPAbdTCBC@$}MzUWU-iSbF(@UgpvZt^Ku|=%tEYPSVR2dbu}Y0J+ldKD6{% zw2nTX*9Fi^GkRf9I#cPd!Sq7!xO7qxrFaTY!FlwufL<2T%VNAtgdYBgMhGMu{XQN$8m?{%L|@?Sc5;Wr8L#|z<@{FOs9upgDo@O98B+=^>A0Ri3UVEJ64{!CB$ zw+{3R2>Q81BYf%$7)C!(r$`ubDRHA;&`TdkkPjxD=wCOu(GR30i2P+k2jtz3eiv)` zTw+nF%l{W4abh8{OEdvq~~D|n`N{E@tC zA+Oi#w~HY!hB8~vTD9KrU+;wQZ-Mh^yy>e3_SVHYLRu*%mGlBDg#!JZ zBZfAa`U%Ys=cZIielg_if|CxxaDV!xHR({#GEyP+Y$~K?Kj)y2&!pj+L*$#Rv#7;~ z{;qbJ?olNV@QFRWDGx`4jT|_}@ diff --git a/README.md b/README.md index 274b367..c38b114 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ExecuteShell [![](https://jitpack.io/v/EndureBlaze/executeshell.svg)](https://jitpack.io/#EndureBlaze/executeshell) -ExecuteShell 是一个可以在你的 Android 项目上快速使用 shell 命令的开源库 +ExecuteShell 是一个可以让你在你的 Android 项目上方便快速使用 shell 指令的开源库 ## 性能 -便捷,快速,所有功能一行代码完成调用 +便捷,快速,所有功能均可一行代码完成调用 ## 配置要求 ExecuteShell 最低支持到Android [Ice Cream Sandwich](https://developer.android.com/about/versions/android-4.0-highlights.html) (API 14) ## 开始使用 @@ -14,10 +14,10 @@ ExecuteShell 最低支持到Android [Ice Cream Sandwich](https://developer.andro } } ``` -2.在模块的 build.gradle 中添加依赖 +2.在需要使用模块(一般为app)的 build.gradle 中添加依赖 ```Java dependencies { - implementation 'com.github.EndureBlaze:executeshell:1.0' + implementation 'com.github.EndureBlaze:executeshell:1.1' } ``` ### Maven @@ -35,45 +35,51 @@ dependencies { com.github.EndureBlaze executeshell - 1.0 + 1.1 ``` -### 功能说明 -#### 检测 root 状态 +## 功能说明 +### 检测 root 状态 ```Java ExecuteShell.haveRoot(); ``` -使用后返回 boolean 类型数据 -true 为有 root 权限 -false 为无 root 权限 +使用后返回 boolean 类型数据 +返回 true 为有 root 权限 +返回 false 为无 root 权限 ### 执行 shell 指令且返回详细结果 ```Java -ExecuteShell.execRootCmd(shell_str); +ExecuteShell.execRootShell(shell_str); ``` shell_str 是转换为 String 类型的 shell 指令 执行成功后返回 String 类型的结果 -如果执行失败则返回 +执行失败则返回 ```Java "" ``` -空白的 String (非 null) +即空白的 String (非 null) ### 执行 shell 指令不返回详细结果 ```Java -ExecuteShell.execRootCmdSilent(shell_str); +ExecuteShell.execRootShellSilent(shell_str); ``` -shell_str 是转换为 String 类型的 shell 指令 -执行成功后返回 int 类型的结果 +shell_str 是转换为 String 类型的 shell 指令 +执行成功后返回 int 类型的结果 返回 0 代表执行成功 -返回 1 代表执行失败 +返回其他数字代表执行失败 + +## 演示 +可以在 [smaple](https://github.com/EndureBlaze/executeshell/tree/master/sample) 查看详细使用,或者下载 [apk](https://github.com/EndureBlaze/executeshell/blob/master/sample.apk) 实际查看使用结果 ## 关于依赖库 本项目没有使用任何依赖库 +## 反馈 +在使用中如果有麻烦,或者出现bug请及时提交 issues + ## 混淆(Proguard) 如果你有使用 Proguard 请添加如下代码 ```Java --keep public class cn.ednureblaze.executeshell.** +-keep public class cn.endureblaze.executeshell.ExecuteShell ``` ## 其他作品 [Kirby Assistant](https://github.com/EndureBlaze/Kirby-Assistant) diff --git a/build.gradle b/build.gradle index 3d22bed..1b4bd2c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ buildscript { google() jcenter() maven { url "https://maven.google.com" } + maven { url 'https://jitpack.io' } } dependencies { @@ -19,7 +20,7 @@ allprojects { repositories { google() jcenter() - + maven { url 'https://jitpack.io' } } } diff --git a/executeshell_lib/build.gradle b/executeshell_lib/build.gradle index e636f55..6bb1dd9 100644 --- a/executeshell_lib/build.gradle +++ b/executeshell_lib/build.gradle @@ -4,10 +4,10 @@ android { compileSdkVersion 29 buildToolsVersion "29.0.0" defaultConfig { - minSdkVersion 15 + minSdkVersion 14 targetSdkVersion 29 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.1" } buildTypes { release { diff --git a/executeshell_lib/src/main/java/cn/endureblaze/executeshell/ExecuteShell.java b/executeshell_lib/src/main/java/cn/endureblaze/executeshell/ExecuteShell.java index 5880047..84ceb36 100644 --- a/executeshell_lib/src/main/java/cn/endureblaze/executeshell/ExecuteShell.java +++ b/executeshell_lib/src/main/java/cn/endureblaze/executeshell/ExecuteShell.java @@ -8,7 +8,7 @@ public final class ExecuteShell { - private static final String TAG = "RootCmd"; + private static final String TAG = "RootShell"; private static boolean mHaveRoot = false; /** * 判断机器Android是否已经root,即是否获取root权限 @@ -17,7 +17,7 @@ public static boolean haveRoot() { if (!mHaveRoot) { - int ret = execRootCmdSilent("echo test"); // 通过执行测试命令来检测 + int ret = execRootShellSilent("echo test"); // 通过执行测试命令来检测 if (ret != -1) { Log.i(TAG, "have root!"); @@ -38,7 +38,7 @@ public static boolean haveRoot() /** * 执行命令并且输出结果 */ - public static String execRootCmd(String cmd) + public static String execRootShell(String shell) { String result = ""; DataOutputStream dos = null; @@ -50,8 +50,8 @@ public static String execRootCmd(String cmd) dos = new DataOutputStream(p.getOutputStream()); dis = new DataInputStream(p.getInputStream()); - Log.i(TAG, cmd); - dos.writeBytes(cmd + "\n"); + Log.i(TAG, shell); + dos.writeBytes(shell + "\n"); dos.flush(); dos.writeBytes("exit\n"); dos.flush(); @@ -98,7 +98,7 @@ public static String execRootCmd(String cmd) /** * 执行命令但不关注结果输出 */ - public static int execRootCmdSilent(String cmd) + public static int execRootShellSilent(String shell) { int result = -1; DataOutputStream dos = null; @@ -108,8 +108,8 @@ public static int execRootCmdSilent(String cmd) Process p = Runtime.getRuntime().exec("su"); dos = new DataOutputStream(p.getOutputStream()); - Log.i(TAG, cmd); - dos.writeBytes(cmd + "\n"); + Log.i(TAG, shell); + dos.writeBytes(shell + "\n"); dos.flush(); dos.writeBytes("exit\n"); dos.flush(); diff --git a/sample/build.gradle b/sample/build.gradle index 308b61d..251a0cc 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -5,10 +5,10 @@ android { buildToolsVersion "29.0.0" defaultConfig { applicationId "cn.endureblaze.executeshellsample" - minSdkVersion 15 + minSdkVersion 14 targetSdkVersion 29 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.1" } buildTypes { release { diff --git a/sample/src/main/java/cn/endureblaze/executeshellsample/ExecuteShellActivity.java b/sample/src/main/java/cn/endureblaze/executeshellsample/ExecuteShellActivity.java index d23736f..755908e 100644 --- a/sample/src/main/java/cn/endureblaze/executeshellsample/ExecuteShellActivity.java +++ b/sample/src/main/java/cn/endureblaze/executeshellsample/ExecuteShellActivity.java @@ -7,21 +7,20 @@ import cn.endureblaze.executeshell.ExecuteShell; public class ExecuteShellActivity extends AppCompatActivity { - private String is_root_str; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //判断是否有root权限 + String is_root_str; if(ExecuteShell.haveRoot()){ - is_root_str="true";//有权限 + is_root_str ="true";//有权限 }else{ - is_root_str="false";//无权限 + is_root_str ="false";//无权限 } TextView is_root = findViewById(R.id.isroot_textView); - is_root.setText("是否有root权限:"+is_root_str); - + is_root.setText("是否有root权限:"+ is_root_str); final EditText edit=findViewById(R.id.editText); final TextView output_root = findViewById(R.id.output); final Button start_btn=findViewById(R.id.start_btn); @@ -31,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) @Override public void onClick(View view) { String shell_str = edit.getText().toString(); - String return_str = ExecuteShell.execRootCmd(shell_str); + String return_str = ExecuteShell.execRootShell(shell_str); //显示结果 output_root.setText(return_str); } @@ -42,7 +41,7 @@ public void onClick(View view) { @Override public void onClick(View view) { String shell_str = edit.getText().toString(); - int return_int = ExecuteShell.execRootCmdSilent(shell_str); + int return_int = ExecuteShell.execRootShellSilent(shell_str); output_root.setText(""+return_int); } });