mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-06-20 02:21:51 +08:00
修正适配 Android Q 本地分享 & TIM/QQLite
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
## 1.0.4 - 2019.12.16
|
||||
|
||||
* 适配 Android Q 本地分享适配(别问为什么,腾讯有毒!)
|
||||
|
||||
## 1.0.3 - 2019.12.05
|
||||
|
||||
* 升级 Android SDK
|
||||
|
@ -47,6 +47,15 @@ android {
|
||||
# 混淆已打入 Library,随 Library 引用,自动添加到 apk 打包混淆
|
||||
```
|
||||
|
||||
```
|
||||
<!-- 腾讯有毒吧,文档都不写,SDK里居然写死 android:authorities 为 com.tencent.tauth.fileprovider,而非不同应用不同 android:authorities -->
|
||||
<manifest>
|
||||
<!-- targetSdkVersion >= 29, 豁免 Android Q 的外部存储沙箱限制 -->
|
||||
<application android:requestLegacyExternalStorage="true">
|
||||
</application>
|
||||
</manifest>
|
||||
```
|
||||
|
||||
## ios
|
||||
|
||||
```
|
||||
|
@ -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)) {
|
||||
|
@ -93,7 +93,9 @@ static NSString *const SCHEME_FILE = @"file";
|
||||
}
|
||||
result(nil);
|
||||
} else if ([METHOD_ISINSTALLED isEqualToString:call.method]) {
|
||||
result([NSNumber numberWithBool:[TencentOAuth iphoneQQInstalled]]);
|
||||
// 普通大众版 > 办公简洁版
|
||||
BOOL isInstalled = [TencentOAuth iphoneQQInstalled] || [TencentOAuth iphoneTIMInstalled];
|
||||
result([NSNumber numberWithBool:isInstalled]);
|
||||
} else if ([METHOD_LOGIN isEqualToString:call.method]) {
|
||||
[self login:call result:result];
|
||||
} else if ([METHOD_LOGOUT isEqualToString:call.method]) {
|
||||
|
Reference in New Issue
Block a user