@@ -24,6 +24,7 @@ import com.sevtinge.hyperceiler.hook.module.hook.systemui.base.api.MiuiStub
2424import com.sevtinge.hyperceiler.hook.utils.StateFlowHelper.newReadonlyStateFlow
2525import com.sevtinge.hyperceiler.hook.utils.api.ProjectApi.isDebug
2626import com.sevtinge.hyperceiler.hook.utils.callMethod
27+ import com.sevtinge.hyperceiler.hook.utils.devicesdk.isMoreAndroidVersion
2728import com.sevtinge.hyperceiler.hook.utils.getObjectField
2829import com.sevtinge.hyperceiler.hook.utils.getObjectFieldAs
2930import com.sevtinge.hyperceiler.hook.utils.getStaticObjectField
@@ -45,10 +46,20 @@ object WifiStandard : BaseHook() {
4546 bridge.findMethod {
4647 matcher {
4748 declaredClass {
48- className(" viewmodel.WifiViewModel\$ special" , StringMatchType .Contains )
49+ if (isMoreAndroidVersion(36 )) {
50+ className($$" WifiViewModelInject$special $" , StringMatchType .Contains )
51+ } else {
52+ className($$" viewmodel.WifiViewModel$special " , StringMatchType .Contains )
53+ }
4954 }
5055 usingNumbers(5 , 0 )
5156 addInvoke(" Ljava/lang/Integer;-><init>(I)V" )
57+
58+ if (isMoreAndroidVersion(36 )) {
59+ addUsingField {
60+ name($$" $this_unsafeFlow " )
61+ }
62+ }
5263 }
5364 }.singleOrNull()
5465 } as ? Method
@@ -63,7 +74,7 @@ object WifiStandard : BaseHook() {
6374 if (isDebug()) {
6475 val wifiStandard = it.thisObject.getObjectFieldAs<Any >(" wifiStandard" )
6576 MiuiStub .javaAdapter.alwaysCollectFlow<Int >(wifiStandard) { i ->
66- logD(" wifiStandard $i " )
77+ logD(TAG , lpparam.packageName, " wifiStandard $i " )
6778 }
6879
6980 // it.thisObject.setObjectField("inoutLeft", newReadonlyStateFlow(true))
@@ -83,7 +94,7 @@ object WifiStandard : BaseHook() {
8394 val wifiStandard = it.args[0 ]
8495 val continuation = it.args[1 ]
8596 if (wifiStandard != 0 && continuation.getObjectField(" label" ) != 0 ) {
86- val flow = it.thisObject.getObjectFieldAs<Any >(" \ $ this_unsafeFlow" )
97+ val flow = it.thisObject.getObjectFieldAs<Any >($$ " $this_unsafeFlow " )
8798 val obj = flow.callMethod(" emit" , wifiStandard, continuation)
8899 it.result = if (obj == suspended) {
89100 suspended
0 commit comments