Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 0c2d9b5

Browse files
committed
1.0.1
1 parent fe6cab6 commit 0c2d9b5

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="ru.meefik.wshell"
4-
android:versionCode="1"
5-
android:versionName="1.0" >
4+
android:versionCode="2"
5+
android:versionName="1.0.1" >
66

77
<uses-sdk
88
android:minSdkVersion="7"

assets/pkill

648 KB
Binary file not shown.

res/values/strings.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
<string name="title_localhost_preference">Localhost</string>
2222
<string name="summary_localhost_preference">Only listen on 127.0.0.1</string>
2323

24-
<string name="title_autostart_preference">Root</string>
25-
<string name="summary_autostart_preference">Require superuser permissions</string>
24+
<string name="title_root_preference">Root</string>
25+
<string name="summary_root_preference">Require superuser permissions</string>
2626

27-
<string name="title_root_preference">Autostart</string>
28-
<string name="summary_root_preference">Run when the application opens</string>
27+
<string name="title_autostart_preference">Autostart</string>
28+
<string name="summary_autostart_preference">Run when the application opens</string>
2929

3030
<string name="title_shell_preference">Shell</string>
3131
<string name="dialog_title_shell_preference">Shell</string>

src/ru/meefik/wshell/MainActivity.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public void onResume() {
102102
}
103103

104104
private void loadPrefs() {
105-
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
105+
SharedPreferences sp = PreferenceManager
106+
.getDefaultSharedPreferences(getApplicationContext());
106107

107108
PORT = sp.getString("port", getString(R.string.port));
108109
LOCALHOST = sp.getBoolean("localhost", getString(R.string.localhost).equals("true"));
@@ -182,6 +183,11 @@ private void extractData() {
182183
copyFile(SHELL_IN_A_BOX, file);
183184
file.setExecutable(true);
184185
}
186+
file = new File(FILES_DIR + File.separator + "pkill");
187+
if (!file.exists()) {
188+
copyFile("pkill", file);
189+
file.setExecutable(true);
190+
}
185191
}
186192

187193
private void start(boolean restart) {
@@ -197,7 +203,7 @@ private void start(boolean restart) {
197203
list.add("sh");
198204
}
199205
if (restart) {
200-
list.add("pkill -9 " + SHELL_IN_A_BOX);
206+
list.add(FILES_DIR + File.separator + "pkill -9 " + SHELL_IN_A_BOX);
201207
list.add("sleep 1");
202208
}
203209
list.add(cmd);
@@ -212,7 +218,7 @@ private void stop() {
212218
} else {
213219
list.add("sh");
214220
};
215-
String cmd = "pkill -9 " + SHELL_IN_A_BOX;
221+
String cmd = FILES_DIR + File.separator + "pkill -9 " + SHELL_IN_A_BOX;
216222
list.add(cmd);
217223
new Thread(new ExecCmd(list)).start();
218224
ACTIVE = false;

0 commit comments

Comments
 (0)