mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-08-06 09:29:58 +08:00
修正适配 Android Q 本地分享 & TIM/QQLite
This commit is contained in:
@ -33,8 +33,8 @@
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
|
||||
<!-- Android Q 的外部存储沙箱限制 -->
|
||||
<!-- 腾讯有毒吧,文档都不写 -->
|
||||
<provider
|
||||
<!-- 腾讯有毒吧,文档都不写,SDK里居然写死 android:authorities 为 com.tencent.tauth.fileprovider,而非不同应用不同 android:authorities -->
|
||||
<!-- <provider
|
||||
android:name=".content.TencentKitFileProvider"
|
||||
android:authorities="com.tencent.tauth.fileprovider"
|
||||
android:exported="false"
|
||||
@ -43,6 +43,6 @@
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/tencent_kit_file_paths" />
|
||||
</provider>
|
||||
</provider> -->
|
||||
</application>
|
||||
</manifest>
|
||||
|
@ -114,14 +114,21 @@ public class TencentKitPlugin implements MethodCallHandler, PluginRegistry.Activ
|
||||
tencent = Tencent.createInstance(appId, registrar.context().getApplicationContext());
|
||||
result.success(null);
|
||||
} else if (METHOD_ISINSTALLED.equals(call.method)) {
|
||||
boolean isQQInstalled = false;
|
||||
try {
|
||||
final PackageManager packageManager = registrar.context().getPackageManager();
|
||||
PackageInfo info = packageManager.getPackageInfo("com.tencent.mobileqq", 0);
|
||||
isQQInstalled = info != null;
|
||||
} catch (PackageManager.NameNotFoundException ignore) {
|
||||
boolean isInstalled = false;
|
||||
PackageManager packageManager = registrar.context().getPackageManager();
|
||||
List<PackageInfo> infos = packageManager.getInstalledPackages(0);
|
||||
if (infos != null && !infos.isEmpty()) {
|
||||
for (PackageInfo info : infos) {
|
||||
// 普通大众版 > 办公简洁版 > 急速轻聊版
|
||||
if ("com.tencent.mobileqq".equals(info.packageName)
|
||||
|| "com.tencent.tim".equals(info.packageName)
|
||||
|| "com.tencent.qqlite".equals(info.packageName)) {
|
||||
isInstalled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
result.success(isQQInstalled);
|
||||
result.success(isInstalled);
|
||||
} else if (METHOD_LOGIN.equals(call.method)) {
|
||||
login(call, result);
|
||||
} else if (METHOD_LOGOUT.equals(call.method)) {
|
||||
|
Reference in New Issue
Block a user