Tencent / Shadow

零反射全动态Android插件框架
BSD 3-Clause "New" or "Revised" License
7.47k stars 1.31k forks source link

插件内可以调用qq分享吗? #1276

Closed laiyi55 closed 11 months ago

laiyi55 commented 11 months ago

目前遇到的问题有几个: 1、qq分享后返回按钮按钮不对,和qq团队沟通需要传入宿主activity image 2、qq分享接口要传入activity,解决1后shadow的transform会改成shadowactivity导致类型错误 3、解决2后,调用和qq sdk都不修改activity,但是qq sdk的class有个地方是androidx.app.Fragment.getActivty,导致class verify报错,这个是androidx方法,不能禁止transform修改,否则会影响其他功能

java.lang.VerifyError: Verifier rejected class com.tencent.connect.auth.QQAuth: int com.tencent.connect.auth.QQAuth.login(androidx.fragment.app.Fragment, java.lang.String, com.tencent.tauth.IUiListener, java.lang.String) failed to verify: int com.tencent.connect.auth.QQAuth.login(androidx.fragment.app.Fragment, java.lang.String, com.tencent.tauth.IUiListener, java.lang.String): [0x1F] register v1 has type Reference: androidx.fragment.app.FragmentActivity but expected Reference: android.app.Activity int com.tencent.connect.auth.QQAuth.login(androidx.fragment.app.Fragment, java.lang.String, com.tencent.tauth.IUiListener, java.lang.String, boolean) failed to verify: int com.tencent.connect.auth.QQAuth.login(androidx.fragment.app.Fragment, java.lang.String, com.tencent.tauth.IUiListener, java.lang.String, boolean): [0x20] register v1 has type Reference: androidx.fragment.app.FragmentActivity but expected Reference: android.app.Activity (declaration of 'com.tencent.connect.auth.QQAuth' appears in /data/user/0/com.tencent.estvdemo/files/EstvShadowDir/Unpacked/estv-dynamic-manager/fb83c07386443d05f7429ec79ec08957/estv-plugin-local.zip/shadow-app-release.apk) at com.tencent.connect.auth.QQAuth.createInstance(Unknown Source:0) at com.tencent.tauth.Tencent.<init>(Unknown Source:3) at com.tencent.tauth.Tencent.createInstance(Unknown Source:54)

问题到此,目前没想到其他办法了,退而求其次,使用白名单机制使用宿主的qq sdk,这里是没有通过transform修改,进过验证可以,但是这样会导致插件的qq sdk依赖宿主的qq sdk版本,不知道这里有其他办法可以解决吗?