10000 remove service tests, they are now in their own branch · githublucas420/RootCommands@8f98970 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f98970

Browse files
author
Dominik Schürmann
committed
remove service tests, they are now in their own branch
1 parent 8d0ee34 commit 8f98970

File tree

17 files changed

+4
-458
lines changed

17 files changed

+4
-458
lines changed

RootCommands-Demo/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<uses-sdk
88
android:minSdkVersion="7"
9-
android:targetSdkVersion="14" />
9+
android:targetSdkVersion="17" />
1010

1111
<application
1212
android:icon="@drawable/ic_launcher"
-4.56 KB
Binary file not shown.

RootCommands-Demo/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1212

1313
# Project target.
14-
target=android-15
14+
target=Google Inc.:Google APIs:17
1515
android.library.reference.1=../RootCommands-Library

RootCommands-Demo/res/layout/main.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,4 @@
3131
android:onClick="binariesTestOnClick"
3232
android:text="Binaries Test" />
3333

34-
<Button
35-
android:id="@+id/btest_button4"
36-
android:layout_width="match_parent"
37-
android:layout_height="wrap_content"
38-
android:onClick="serviceTestOnClick"
39-
android:text="Service Test" />
40-
41-
42-
<Button
43-
android:id="@+id/btest_button5"
44-
android:layout_width="match_parent"
45-
android:layout_height="wrap_content"
46-
android:onClick="service2TestOnClick"
47-
android:text="Service 2 Test" />
48-
4934
</LinearLayout>

RootCommands-Demo/src/org/sufficientlysecure/rootcommands/IRootCommandsService.aidl

Lines changed: 0 additions & 13 deletions
This file was deleted.

RootCommands-Demo/src/org/sufficientlysecure/rootcommands/demo/BaseActivity.java

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@
1616

1717
package org.sufficientlysecure.rootcommands.demo;
1818

19-
import java.io.FileOutputStream;
20-
import java.io.IOException;
21-
import java.io.InputStream;
22-
import java.io.OutputStream;
23-
import java.lang.reflect.Method;
24-
25-
import org.sufficientlysecure.rootcommands.IRootCommandsService;
2619
import org.sufficientlysecure.rootcommands.RootCommands;
2720
import org.sufficientlysecure.rootcommands.Shell;
2821
import org.sufficientlysecure.rootcommands.Toolbox;
@@ -32,10 +25,7 @@
3225
import org.sufficientlysecure.rootcommands.demo.R;
3326

3427
import android.app.Activity;
35-
import android.content.Context;
36-
import android.content.res.AssetManager;
3728
import android.os.Bundle;
38-
import android.os.IBinder;
3929
import android.util.Log;
4030
import android.view.View;
4131

@@ -151,76 +141,4 @@ public void binariesTestOnClick(View view) {
151141
}
152142
}
153143

154-
public void serviceTestOnClick(View view) {
155-
try {
156-
157-
AssetManager assetManager = getAssets();
158-
159-
InputStream stream = assetManager.open("classes-dex.jar");
160-
161-
FileOutputStream writer = openFileOutput("service.jar", Context.MODE_PRIVATE);
162-
163-
// copy the binary to the local file
164-
copy(stream, writer, 4096);
165-
166-
// close the filehandle
167-
writer.close();
168-
169-
Shell shell = Shell.startRootShell();
170-
171-
Toolbox tb = new Toolbox(shell);
172-
173-
if (tb.isRootAccessGiven()) {
174-
Log.d(TAG, "Root access given!");
175-
} else {
176-
Log.d(TAG, "No root access!");
177-
}
178-
179-
String basePath = getFilesDir().getAbsolutePath();
180-
181-
shell.add(
182-
new SimpleCommand("export CLASSPATH=" + basePath + "/service.jar",
183-
"exec app_process /system/bin org.sufficientlysecure.rootcommands.RootCommandsRun &"))
184-
.waitForFinish();
185-
186-
shell.close();
187-
} catch (Exception e) {
188-
Log.e(TAG, "Exception!", e);
189-
}
190-
}
191-
192-
public void service2TestOnClick(View view) {
193-
194-
IBinder b = null;
195-
try {
196-
// ServiceManager.getService("RootCommandsService")
197-
Class<?> serviceManagerCls = Class.forName("android.os.ServiceManager");
198-
Method methodGetService = serviceManagerCls.getMethod("getService", String.class);
199-
200-
Log.d(RootCommands.TAG, "getService");
201-
b = (IBinder) methodGetService.invoke(null, new String("RootCommandsService"));
202-
} catch (Exception e) {
203-
Log.e(RootCommands.TAG, "Exception", e);
204-
}
205-
206-
IRootCommandsService om = IRootCommandsService.Stub.asInterface(b);
207-
try {
208-
Log.d(RootCommands.TAG, "Going to call service");
209-
om.setValue(20);
210-
Log.d(RootCommands.TAG, "Service called succesfully");
211-
} catch (Exception e) {
212-
Log.d(RootCommands.TAG, "FAILED to call service");
213-
e.printStackTrace();
214-
}
215-
}
216-
217-
private static void copy(InputStream in, OutputStream out, int bufferSize) throws IOException {
218-
// Read bytes and write to destination until eof
219-
220-
byte[] buf = new byte[bufferSize];
221-
int len = 0;
222-
while ((len = in.read(buf)) >= < 10000 span class=pl-c1>0) {
223-
out.write(buf, 0, len);
224-
}
225-
}
226144
}

RootCommands-Library/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
<uses-sdk
88
android:minSdkVersion="7"
9-
android:targetSdkVersion="14" />
9+
android:targetSdkVersion="17" />
1010

1111
</manifest>

RootCommands-Library/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1212

1313
# Project target.
14-
target=android-15
14+
target=Google Inc.:Google APIs:17
1515
android.library=true

RootCommands-Service/.gitignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

RootCommands-Service/AndroidManifest.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

RootCommands-Service/build.xml

Lines changed: 0 additions & 92 deletions
This file was deleted.

RootCommands-Service/proguard-project.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

RootCommands-Service/project.properties

Lines changed: 0 additions & 15 deletions
This file was deleted.

RootCommands-Service/res/.readme

Lines changed: 0 additions & 1 deletion
This file was deleted.

RootCommands-Service/src/org/sufficientlysecure/rootcommands/IRootCommandsService.aidl

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0