Closed Fantasy156 closed 4 years ago
Looks like the signature of dispatchIntent
changed in Android Q to
void dispatchIntent(Intent intent, String permission, String appOp, Bundle opts, BroadcastReceiver resultReceiver, UserHandle user, int subId)
看起来像
dispatchIntent
在Android Q 中更改为void dispatchIntent(Intent intent, String permission, String appOp, Bundle opts, BroadcastReceiver resultReceiver, UserHandle user, int subId)
Hope to update if you can, this is a very useful app
I'll try, but since I don't have any devices on Android Q with Xposed, I'll need some help testing. Will put up a change soon.
I can test
I have managed to solve this problem.
The signature of dispatchIntent
is changed in Android Q to
dispatchIntent(Intent intent, String permission, int appOp, Bundle opts, BroadcastReceiver resultReceiver, UserHandle user, int subId)
There is a new parameter at the end. See https://android.googlesource.com/platform/frameworks/opt/telephony/+/refs/tags/android-10.0.0_r32/src/java/com/android/internal/telephony/InboundSmsHandler.java (line 1178) for details.
I've rebuilt this module with the right parameter types and it worked! Cheers!
However, this method is labeled with @UnsupportedAppUsage
annotation, which means this API is not part of the standard SDK and is discouraged to use. See these official documentations for details:
https://android-developers.googleblog.com/2018/02/improving-stability-by-reducing-usage.html
https://developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces
https://developer.android.com/about/versions/10/non-sdk-q
It's better to find some more stable hook points.
Yes, that was partially done in #68, though it needs some work to support all versions of Android Q. Also UnsupportedAppUsage
means nothing to Xposed, everything we're doing was relying on undocumented internal APIs from the start.
Yes, that was partially done in #68, though it needs some work to support all versions of Android Q. Also
UnsupportedAppUsage
means nothing to Xposed, everything we're doing was relying on undocumented internal APIs from the start.
Great! Didn't see the PR before. I am wondering why there isn't a new release? Or perhaps I didn't see it? Another advice: you can get all methods of target class by reflection and filt it by name to get the right parameter types. I tested it on my device and it worked. In case I am not clear enough, here are my sample code (in kotlin):
val clazz = classLoader.loadClass("com.android.internal.telephony.InboundSmsHandler")
val methods = clazz.declaredMethods.filter { method -> method.name == "dispatchIntent" }
Log.i(LOG_TAG, "${methods.size} method(s).")
val method = if (methods.isNotEmpty()) methods[0] else return
method.parameterTypes.forEach { paraType -> Log.i(LOG_TAG, paraType.name) }
On my device, the output is
1 method(s).
android.content.Intent
java.lang.String
int
android.os.Bundle
android.content.BroadcastReceiver
android.os.UserHandle
int
Hope this will help.
Another option is using XposedBridge.hookAllMethods()
method, but you still need to figure out the index of the BroadcastReceiver
parameter. This can be done by looping over all parameters and checking their types.
I am wondering why there isn't a new release?
Basically, because I don't have time (or a device) to test it, and I'm not going to release a version without having people validate it first. Personally I no longer even root my devices, just don't have the time to deal with broken crap nowadays (already do enough of that at work ;-p)
you can get all methods of target class by reflection and filt it by name to get the right parameter types
That's actually a pretty good idea, given the increasing number of function signatures it might be necessary now.
I have built NekoSMS with this pull request https://github.com/apsun/NekoSMS/pull/68 and verified that it works in Android 10 (Paranoid Android).
I have built NekoSMS with this pull request #68 and verified that it works in Android 10 (Paranoid Android).
it also works on my device (Pixel 2XL Android 10 official Rom)
Fair enough. In that case I'll merge it and publish a new build.
Looks like it's been 2 weeks. Is the publishing process blocked? Anything we can help to move things forward?
Looks like it's been 2 weeks. Is the publishing process blocked? Anything we can help to move things forward?
Ah I just never got around to it, been busy with work, I'll put something out this weekend.
Done. Going to close this issue now, please open a new one if you experience any issues on Android Q.
Write your issue description here. Can't block SMS
If you are submitting a bug report and do not include the following info, your issue will be ignored!
Please paste your Xposed logs (Xposed Installer -> Logs -> Menu -> Save to SD card) below:
Thank you for helping us help you help us all.