apsun / NekoSMS

A pattern-based text message blocker for Android.
GNU General Public License v3.0
417 stars 44 forks source link

SMS blocking doesn't work anymore #67

Closed Fantasy156 closed 4 years ago

Fantasy156 commented 4 years ago

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:

--------- beginning of head
EdXposed Log
Powered by Log Catcher
QQ support group: 855219808
Telegram support group: @Code_Of_MeowCat
Telegram channel: @EdXposed
--------- beginning of information
Manufacturer: OnePlus
Brand: OnePlus
Device: OnePlus3T
Product: OnePlus3
Model: ONEPLUS A3010
Fingerprint: OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1911042108:user/release-keys
ROM description: OnePlus3-user 9 PKQ1.181203.001 1911042108 release-keys
Architecture: arm64-v8a
Android build: QQ1D.200105.002
Android version: 10
Android sdk: 29
EdXposed version: v0.4.6.1 (4504)-tdgptedc (SandHook)
EdXposed api: 90.0
Riru version: v19.6 (28)
Riru api: 4
Magisk: 20.4-ed58cf95:MAGISKSU (20304)
--------- beginning of main
--------- beginning of system
02-06 23:59:03.896   584   584 I EdXposed-Bridge: Loading modules from /data/app/com.raincat.unblockneteasemusic-mGRbEansW4tDTV4i6DugwQ==/base.apk
02-06 23:59:03.970   584   584 I EdXposed-Bridge:   Loading class com.raincat.unblockneteasemusic.MainHook
02-06 23:59:03.975   584   584 I EdXposed-Bridge: Loading modules from /data/app/com.crossbowffs.nekosms-SqV5TlHfgY_K710vmcRLIw==/base.apk
02-06 23:59:04.101   584   584 I EdXposed-Bridge:   Loading class com.crossbowffs.nekosms.xposed.SmsHandlerHook
02-06 23:59:04.104   584   584 I EdXposed-Bridge:   Loading class com.crossbowffs.nekosms.xposed.XposedUtilsHook
02-06 23:59:04.105   584   584 I EdXposed-Bridge: Loading modules from /data/app/com.android.z-GnpG_mQa5sBLAAt9WwpbZw==/base.apk
02-06 23:59:04.289   584   584 I EdXposed-Bridge:   Loading class com.android.z.XHook.ZuperHook
02-06 23:59:05.046  1151  1151 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:12.539  1970  1970 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:13.579  2114  2114 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:14.149  2166  2166 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:14.391  2190  2190 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:14.444  2240  2240 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:14.773  2201  2201 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:14.983  2218  2218 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:15.021  2280  2280 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:15.179  2289  2289 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:15.611  2227  2227 E EdXposed-Bridge: Cannot load any modules because /data/user_de/0/org.meowcat.edxposed.manager/conf/modules.list was not found
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge: java.lang.NoSuchMethodError: com.android.internal.telephony.InboundSmsHandler#dispatchIntent(android.content.Intent,java.lang.String,int,android.os.Bundle,android.content.BroadcastReceiver,android.os.UserHandle)#exact
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.XposedHelpers.findMethodExact(XposedHelpers.java:344)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:185)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:260)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.crossbowffs.nekosms.xposed.SmsHandlerHook.hookDispatchIntent23(SmsHandlerHook.java:290)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.crossbowffs.nekosms.xposed.SmsHandlerHook.hookDispatchIntent(SmsHandlerHook.java:310)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.crossbowffs.nekosms.xposed.SmsHandlerHook.hookSmsHandler(SmsHandlerHook.java:320)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.crossbowffs.nekosms.xposed.SmsHandlerHook.handleLoadPackage(SmsHandlerHook.java:337)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:37)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:61)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:117)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.elderdrivers.riru.edxp._hooker.impl.LoadedApkGetCL.afterHookedMethod(LoadedApkGetCL.java:68)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at de.robv.android.xposed.XC_MethodHook.callAfterHookedMethod(XC_MethodHook.java:68)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.swift.sandhook.xposedcompat.hookstub.HookStubManager.hookBridge(HookStubManager.java:388)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at SandHookerNew_35f4vrpdo2vmlbkhbqk0r22p8o.hook(Unknown Source:46)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.LoadedApk.getResources(LoadedApk.java:1188)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.ContextImpl.createAppContext(ContextImpl.java:2462)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.ContextImpl.createAppContext(ContextImpl.java:2454)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6343)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at java.lang.reflect.Method.invoke(Native Method)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.swift.sandhook.SandHook.callOriginMethod(SandHook.java:185)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.swift.sandhook.xposedcompat.hookstub.HookStubManager.hookBridge(HookStubManager.java:375)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at SandHookerNew_5sm3dthec8858ee0to4kj3c1ge.hook(Unknown Source:51)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.ActivityThread.access$1300(ActivityThread.java:219)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.os.Handler.dispatchMessage(Handler.java:107)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.os.Looper.loop(Looper.java:214)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at android.app.ActivityThread.main(ActivityThread.java:7356)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at java.lang.reflect.Method.invoke(Native Method)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
02-06 23:59:15.640  2240  2240 E EdXposed-Bridge:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915)
02-06 23:59:16.632  2438  2438 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:17.649  2527  2527 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:19.976  2630  2630 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:23.974  2827  2827 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:24.141   585   585 I EdXposed-Bridge: Loading modules from /data/app/com.raincat.unblockneteasemusic-mGRbEansW4tDTV4i6DugwQ==/base.apk
02-06 23:59:24.230  2854  2854 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:24.267  2893  2893 E EdXposed-Bridge: Cannot load any modules because /data/user_de/0/org.meowcat.edxposed.manager/conf/modules.list was not found
02-06 23:59:24.331   585   585 I EdXposed-Bridge:   Loading class com.raincat.unblockneteasemusic.MainHook
02-06 23:59:24.333   585   585 I EdXposed-Bridge: Loading modules from /data/app/com.crossbowffs.nekosms-SqV5TlHfgY_K710vmcRLIw==/base.apk
02-06 23:59:24.488  2900  2900 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:24.510  2949  2949 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:24.584  2873  2873 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:24.752   585   585 I EdXposed-Bridge:   Loading class com.crossbowffs.nekosms.xposed.SmsHandlerHook
02-06 23:59:24.773   585   585 I EdXposed-Bridge:   Loading class com.crossbowffs.nekosms.xposed.XposedUtilsHook
02-06 23:59:24.774   585   585 I EdXposed-Bridge: Loading modules from /data/app/com.android.z-GnpG_mQa5sBLAAt9WwpbZw==/base.apk
02-06 23:59:25.305   585   585 I EdXposed-Bridge:   Loading class com.android.z.XHook.ZuperHook
02-06 23:59:25.981  2921  2921 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:26.607  3023  3023 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:27.227  3032  3032 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:28.719  3053  3053 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:31.390  3244  3244 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:31.599  3269  3269 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:35.934  3511  3511 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:36.365  3596  3596 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:36.627  3538  3538 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:39.371  3759  3759 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:42.443  3883  3883 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:42.865  3911  3911 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:43.363  3921  3921 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:44.589  4057  4057 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:44.748  4035  4035 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:46.042  4106  4106 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:48.369  3953  3953 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:48.468  4196  4196 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:49.585  4244  4244 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:52.741  4419  4419 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:53.625  4520  4520 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:55.215  4589  4589 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:55.568  4628  4628 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:58.735  4782  4782 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-06 23:59:59.365  4831  4831 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:02.838  4918  4918 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:09.590  5361  5361 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:11.929  5435  5435 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:19.615  5623  5623 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:27.761  5803  5803 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:30.521  5891  5891 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:31.514  5927  5927 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:35.269  6014  6014 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:35.638  6035  6035 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:46.343  6281  6281 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:51.212  6538  6538 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:00:52.211  6563  6563 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:12.465  6862  6862 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:19.718  7034  7034 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:19.777  7042  7042 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:23.543  7166  7166 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:27.685  7244  7244 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:31.463  7333  7333 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:32.651  7408  7408 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:36.934  7554  7554 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:37.789  7630  7630 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:39.626  7690  7690 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:42.086  7736  7736 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:44.787  7807  7807 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:48.347  7894  7894 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:49.742  7919  7919 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:52.272  7986  7986 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:56.093  8049  8049 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:01:57.139  8082  8082 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:02:00.954  8363  8363 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:02:01.159  8387  8387 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:02:03.212  8534  8534 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:02:05.018  8650  8650 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====
02-07 00:02:06.359  8756  8756 I EdXposed-Bridge: ===== Zuper Bypass Signature Activated =====

Thank you for helping us help you help us all.

apsun commented 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)
Fantasy156 commented 4 years ago

看起来像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

apsun commented 4 years ago

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.

Fantasy156 commented 4 years ago

I can test

chouqibao commented 4 years ago

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.

apsun commented 4 years ago

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.

chouqibao commented 4 years ago

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.

chouqibao commented 4 years ago

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.

apsun commented 4 years ago

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.

char101 commented 4 years ago

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).

lbwstco commented 4 years ago

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)

apsun commented 4 years ago

Fair enough. In that case I'll merge it and publish a new build.

crimx commented 4 years ago

Looks like it's been 2 weeks. Is the publishing process blocked? Anything we can help to move things forward?

apsun commented 4 years ago

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.

apsun commented 4 years ago

Done. Going to close this issue now, please open a new one if you experience any issues on Android Q.