本帖最后由 qjmfktlf 于 2022-6-12 22:26 编辑
notificationlistener传递了一个intent,如下:
intent.getExtras().toString()
输出结果>>>>>Bundle[mParcelledData.dataSize=2096]
toString后是这样的
[Java] 纯文本查看 复制代码 Bundle[{
net.dinglisch.android.tasker.extras.HOST_CAPABILITIES=254,
proxy_operation_type=AUTO_REPLY,
com.balda.notificationlistener.extra.KEY=0|com.tencent.mm|2144300744|null|10247,
com.twofortyfouram.locale.intent.extra.BUNDLE=Bundle[mParcelledData.dataSize=652],
com.balda.notificationlistener.extra.INT_VERSION_CODE=118,
com.balda.notificationlistener.extra.AUTO_REPLY_TYPE=0,
net.dinglisch.android.tasker.EXTRA_TARGET_API=29,
com.balda.wakelockid=1,
com.twofortyfouram.locale.intent.extra.BLURB=回复: 回复文本:%TIME,
com.balda.notificationlistener.extra.OPERATION=4,
net.dinglisch.android.tasker.extras.HINTS=Bundle[mParcelledData.dataSize=48],
com.balda.notificationlistener.extra.REPLY=回复文本:20.47
}]
整个intent全部显示出来是这样的
[Java] 纯文本查看 复制代码 Bundle[{
net.dinglisch.android.tasker.extras.HOST_CAPABILITIES=254,
proxy_operation_type=AUTO_REPLY,
com.balda.notificationlistener.extra.KEY=0|com.tencent.mm|2144300744|null|10247,
com.twofortyfouram.locale.intent.extra.BUNDLE=Bundle[{
com.balda.notificationlistener.extra.KEY=0|com.tencent.mm|2144300744|null|10247,
com.balda.notificationlistener.extra.INT_VERSION_CODE=118,
com.balda.notificationlistener.extra.AUTO_REPLY_TYPE=0,
com.balda.notificationlistener.extra.OPERATION=4,
com.balda.notificationlistener.extra.REPLY=你好
}],
com.balda.notificationlistener.extra.INT_VERSION_CODE=118,
com.balda.notificationlistener.extra.AUTO_REPLY_TYPE=0,
net.dinglisch.android.tasker.EXTRA_TARGET_API=29,
com.twofortyfouram.locale.intent.extra.BLURB=回复: 你好,
com.balda.notificationlistener.extra.OPERATION=4,
net.dinglisch.android.tasker.extras.HINTS=Bundle[{
.hints.TIMEOUT=0
}],
com.balda.notificationlistener.extra.REPLY=你好
}]
下面是我自己打包的,但是为什么完全不一样啊!
[Java] 纯文本查看 复制代码 public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
if (lpparam.processName.equals(Hook_Package)) {
XposedBridge.log("通知监听器hook成功");
Class<?> classDb = XposedHelpers.findClassIfExists(Hook_Class, lpparam.classLoader);
XposedHelpers.findAndHookMethod(classDb, Hook_Method, Intent.class, new XC_MethodHook() {
final String NF_Key = "com.balda.notificationlistener.extra.KEY";
final String NF_Key_V = "0|com.tencent.mm|2144300744|null|10247";
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log(" \n ==S==>"+ Hook_Method +"<==S==");
Bundle bundle = new Bundle();
bundle.putInt("net.dinglisch.android.tasker.extras.HOST_CAPABILITIES",254);
bundle.putString("proxy_operation_type","AUTO_REPLY");
bundle.putString(NF_Key,NF_Key_V);
Bundle bundle1 = new Bundle();
bundle1.putString(NF_Key,NF_Key_V);
bundle1.putInt("com.balda.notificationlistener.extra.INT_VERSION_CODE",118);
bundle1.putInt("com.balda.notificationlistener.extra.AUTO_REPLY_TYPE",0);
bundle1.putInt("com.balda.notificationlistener.extra.OPERATION",4);
bundle1.putString("com.balda.notificationlistener.extra.REPLY","XPosedHook成功");
bundle.putParcelable("net.dinglisch.android.tasker.extras.BUNDLE",bundle1);
//bundle.putBundle("net.dinglisch.android.tasker.extras.BUNDLE",bundle1);
bundle.putInt("com.balda.notificationlistener.extra.INT_VERSION_CODE",118);
bundle.putInt("com.balda.notificationlistener.extra.AUTO_REPLY_TYPE",0);
bundle.putInt("net.dinglisch.android.tasker.EXTRA_TARGET_API",29);
bundle.putString("com.twofortyfouram.locale.intent.extra.BLURB","回复:XPosedHook成功");
bundle.putInt("com.balda.notificationlistener.extra.OPERATION",4);
Bundle bundle2 = new Bundle();
bundle2.putInt(".hints.TIMEOUT",0);
bundle.putParcelable("net.dinglisch.android.tasker.extras.HINTS",bundle2);
//bundle.putBundle("net.dinglisch.android.tasker.extras.HINTS",bundle2);
bundle.putString("com.balda.notificationlistener.extra.REPLY","XPosedHook成功");
Bundle b = new Bundle();
b.putAll(bundle);
String str = b.toString();
XposedBridge.log(" \n =====> "+ str +" <=====");
XposedBridge.log(" \n ==E==>"+ Hook_Method +"<==E==");
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.balda.notificationlistener","com.balda.notificationlistener.service.NotificationProxy"));
intent.putExtras(bundle);
param.args[0] = intent;
XposedBridge.log(" \n =====> "+ param.args[0].toString() +" <=====");
}
});
}
} |