67 lines
1.9 KiB
Java
67 lines
1.9 KiB
Java
package com.aoleyun.sn.hook;
|
|
|
|
import android.app.IActivityController;
|
|
import android.content.Intent;
|
|
import android.util.Log;
|
|
|
|
import com.aoleyun.sn.comm.CommonConfig;
|
|
import com.aoleyun.sn.utils.JgyUtils;
|
|
import com.tencent.mmkv.MMKV;
|
|
|
|
public class AoleyunActivityController extends IActivityController.Stub {
|
|
private static final String TAG = "AoleyunActivityController";
|
|
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
|
|
|
@Override
|
|
public boolean activityStarting(Intent intent, String pkg) {
|
|
Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent);
|
|
|
|
// if (JgyUtils.getInstance().isHidedApp(pkg)) {
|
|
// return false;
|
|
// }
|
|
|
|
//false 则不会启动,直接返回。
|
|
if (JgyUtils.getInstance().isCloudLessonMod(pkg)) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean activityResuming(String pkg) {
|
|
Log.e(TAG, "activityResuming: " + pkg);
|
|
// String default_launcher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
|
// if (default_launcher.equals(pkg)) {
|
|
// return false;
|
|
// }
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public int appEarlyNotResponding(String processName, int pid, String annotation) {
|
|
Log.e(TAG, "appEarlyNotResponding: " + processName);
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public boolean appCrashed(String processName, int pid, String shortMsg, String longMsg, long timeMillis, String stackTrace) {
|
|
Log.e(TAG, "appCrashed: " + processName);
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public int appNotResponding(String processName, int pid, String processStats) {
|
|
Log.e(TAG, "appNotResponding: " + processName);
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public int systemNotResponding(String msg) {
|
|
Log.e(TAG, "systemNotResponding: " + msg);
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
|