Skip to content

Commit

Permalink
Fixed auto start issue (#128)
Browse files Browse the repository at this point in the history
* Add support for Android 14/HyperOS

* Update hook class in AutoStartFix
  • Loading branch information
nelwang authored Nov 21, 2023
1 parent 13a589f commit adf1947
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ protected void beforeHookedMethod(MethodHookParam methodHookParam) {

try{
// hyperos
Class<?> BroadcastQueueImpl = XposedHelpers.findClass("com.android.server.am.BroadcastQueueModernStub",loadPackageParam.classLoader);
Class<?> BroadcastQueueImpl = XposedHelpers.findClass("com.android.server.am.BroadcastQueueModernStubImpl",loadPackageParam.classLoader);
XposedUtils.findAndHookMethodAnyParam(BroadcastQueueImpl,"checkApplicationAutoStart",new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam methodHookParam) {
Intent intent = (Intent) XposedHelpers.getObjectField(methodHookParam.args[1], "intent");
if("com.google.android.c2dm.intent.RECEIVE".equals(intent.getAction())){
String target = intent.getComponent() == null ? intent.getPackage() : intent.getComponent().getPackageName();
if(targetIsAllow(target)){
XposedHelpers.callMethod(methodHookParam.thisObject, "checkAbnormalBroadcastInQueueLocked", methodHookParam.args[0]);
//XposedHelpers.callMethod(methodHookParam.thisObject, "checkAbnormalBroadcastInQueueLocked", methodHookParam.args[0]);
printLog("Allow Auto Start: " + target);
methodHookParam.setResult(true);
}
Expand Down

0 comments on commit adf1947

Please sign in to comment.