Skip to content

Commit f3f310c

Browse files
author
tiann
committed
1. change the suffix of the test plugin in assets to .jar( becasuse the .gitignore ignore all the apk file)
2. add some comments
1 parent d89122c commit f3f310c

File tree

7 files changed

+10
-6
lines changed

7 files changed

+10
-6
lines changed
22.4 KB
Binary file not shown.

receiver-management/src/main/java/com/weishu/upf/receiver_management/app/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public void onClick(View v) {
3737
}
3838
});
3939

40-
Utils.extractAssets(this, "test.apk");
41-
File testPlugin = getFileStreamPath("test.apk");
40+
Utils.extractAssets(this, "test.jar");
41+
File testPlugin = getFileStreamPath("test.jar");
4242
try {
4343
ReceiverHelper.preLoadReceiver(this, testPlugin);
4444
Log.i(getClass().getSimpleName(), "hook success");

service-management/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
</intent-filter>
1515
</activity>
1616

17-
<service android:name="com.weishu.upf.service_management.app.ProxyService"/>
17+
<service
18+
android:name="com.weishu.upf.service_management.app.ProxyService"
19+
android:process="plugin01"/>
1820

1921
</application>
2022

28.6 KB
Binary file not shown.

service-management/src/main/java/com/weishu/upf/service_management/app/ProxyService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ public void onCreate() {
2222
@Override
2323
public void onStart(Intent intent, int startId) {
2424
Log.d(TAG, "onStart() called with " + "intent = [" + intent + "], startId = [" + startId + "]");
25+
26+
// 分发Service
2527
ServiceManager.getInstance().onStart(intent, startId);
2628
super.onStart(intent, startId);
2729
}
2830

2931
@Override
3032
public IBinder onBind(Intent intent) {
33+
// TODO: 16/5/11 bindService实现
3134
return null;
3235
}
3336

service-management/src/main/java/com/weishu/upf/service_management/app/ServiceManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public synchronized static ServiceManager getInstance() {
5050
public void onStart(Intent proxyIntent, int startId) {
5151

5252
Intent targetIntent = proxyIntent.getParcelableExtra(AMSHookHelper.EXTRA_TARGET_INTENT);
53-
5453
ServiceInfo serviceInfo = selectPluginService(targetIntent);
5554

5655
if (serviceInfo == null) {

service-management/src/main/java/com/weishu/upf/service_management/app/UPFApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ protected void attachBaseContext(Context base) {
2626
try {
2727
// 拦截startService, stopService等操作
2828
AMSHookHelper.hookActivityManagerNative();
29-
Utils.extractAssets(base, "test.apk");
30-
File apkFile = getFileStreamPath("test.apk");
29+
Utils.extractAssets(base, "test.jar");
30+
File apkFile = getFileStreamPath("test.jar");
3131
File odexFile = getFileStreamPath("test.odex");
3232

3333
// Hook ClassLoader, 让插件中的类能够被成功加载

0 commit comments

Comments
 (0)