mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-05-21 17:26:59 +08:00
升级Android SDK
This commit is contained in:
@ -47,15 +47,6 @@ 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
|
||||
|
||||
```
|
||||
|
@ -31,7 +31,7 @@ android {
|
||||
minSdkVersion 16
|
||||
|
||||
// library 混淆 -> 随 library 引用,自动添加到 apk 打包混淆
|
||||
consumerProguardFiles 'consumer-proguard-rules.pro'
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
Binary file not shown.
BIN
android/libs/open_sdk_r8353806_lite.jar
Normal file
BIN
android/libs/open_sdk_r8353806_lite.jar
Normal file
Binary file not shown.
@ -4,10 +4,9 @@
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||
<!--<uses-permission android:name="android.permission.WRITE_APN_SETTINGS"/>-->
|
||||
|
||||
<!-- 不建议使用 android:requestLegacyExternalStorage="true" 豁免 Android Q 的外部存储沙箱限制 -->
|
||||
<application
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:ignore="UnusedAttribute">
|
||||
@ -36,16 +35,15 @@
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
|
||||
<!-- Android Q 的外部存储沙箱限制 -->
|
||||
<!-- 腾讯有毒吧,文档都不写,SDK里居然写死 android:authorities 为 com.tencent.tauth.fileprovider,而非不同应用不同 android:authorities -->
|
||||
<!-- <provider
|
||||
<provider
|
||||
android:name=".content.TencentKitFileProvider"
|
||||
android:authorities="com.tencent.tauth.fileprovider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/tencent_kit_file_paths" />
|
||||
</provider> -->
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
|
@ -12,7 +12,6 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.arch.core.util.Function;
|
||||
|
||||
import com.tencent.connect.common.Constants;
|
||||
import com.tencent.connect.share.QQShare;
|
||||
@ -58,7 +57,6 @@ public class TencentKit implements MethodChannel.MethodCallHandler, PluginRegist
|
||||
private static final String METHOD_REGISTERAPP = "registerApp";
|
||||
private static final String METHOD_ISQQINSTALLED = "isQQInstalled";
|
||||
private static final String METHOD_ISTIMINSTALLED = "isTIMInstalled";
|
||||
private static final String METHOD_ISQQLITEINSTALLED = "isQQLiteInstalled";
|
||||
private static final String METHOD_LOGIN = "login";
|
||||
private static final String METHOD_LOGOUT = "logout";
|
||||
private static final String METHOD_SHAREMOOD = "shareMood";
|
||||
@ -71,7 +69,7 @@ public class TencentKit implements MethodChannel.MethodCallHandler, PluginRegist
|
||||
private static final String METHOD_ONSHARERESP = "onShareResp";
|
||||
|
||||
private static final String ARGUMENT_KEY_APPID = "appId";
|
||||
// private static final String ARGUMENT_KEY_UNIVERSALLINK = "universalLink";
|
||||
// private static final String ARGUMENT_KEY_UNIVERSALLINK = "universalLink";
|
||||
private static final String ARGUMENT_KEY_SCOPE = "scope";
|
||||
private static final String ARGUMENT_KEY_SCENE = "scene";
|
||||
private static final String ARGUMENT_KEY_TITLE = "title";
|
||||
@ -143,8 +141,6 @@ public class TencentKit implements MethodChannel.MethodCallHandler, PluginRegist
|
||||
result.success(isAppInstalled(applicationContext, "com.tencent.mobileqq"));
|
||||
} else if (METHOD_ISTIMINSTALLED.equals(call.method)) {
|
||||
result.success(isAppInstalled(applicationContext, "com.tencent.tim"));
|
||||
} else if (METHOD_ISQQLITEINSTALLED.equals(call.method)) {
|
||||
result.success(isAppInstalled(applicationContext, "com.tencent.qqlite"));
|
||||
} else if (METHOD_LOGIN.equals(call.method)) {
|
||||
login(call, result);
|
||||
} else if (METHOD_LOGOUT.equals(call.method)) {
|
||||
|
@ -1,13 +1,11 @@
|
||||
package io.github.v7lin.tencent_kit;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.arch.core.util.Function;
|
||||
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
|
||||
import io.flutter.plugin.common.PluginRegistry;
|
||||
import io.flutter.plugin.common.PluginRegistry.Registrar;
|
||||
|
||||
/**
|
||||
* TencentKitPlugin
|
||||
@ -22,7 +20,7 @@ public class TencentKitPlugin implements FlutterPlugin, ActivityAware {
|
||||
// them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
|
||||
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
|
||||
// in the same class.
|
||||
public static void registerWith(Registrar registrar) {
|
||||
public static void registerWith(PluginRegistry.Registrar registrar) {
|
||||
TencentKit tencentKit = new TencentKit(registrar.context(), registrar.activity());
|
||||
registrar.addActivityResultListener(tencentKit);
|
||||
tencentKit.startListening(registrar.messenger());
|
||||
|
@ -1,11 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--suppress AndroidDomInspection -->
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<root-path name="root" path="" />
|
||||
<files-path name="files" path="" />
|
||||
<cache-path name="cache" path="" />
|
||||
<external-path name="external" path="" />
|
||||
<external-files-path name="external_files" path="" />
|
||||
<external-cache-path name="external_cache" path="" />
|
||||
<external-media-path name="external_media" path="" />
|
||||
<paths>
|
||||
<external-files-path name="opensdk_external" path="Images/tmp"/>
|
||||
<root-path name="opensdk_root" path=""/>
|
||||
</paths>
|
@ -1,13 +1,7 @@
|
||||
package io.github.v7lin.tencent_kit_example;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterActivity;
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant;
|
||||
|
||||
public class MainActivity extends FlutterActivity {
|
||||
@Override
|
||||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ enum TencentRetCode {
|
||||
static NSString *const METHOD_REGISTERAPP = @"registerApp";
|
||||
static NSString *const METHOD_ISQQINSTALLED = @"isQQInstalled";
|
||||
static NSString *const METHOD_ISTIMINSTALLED = @"isTIMInstalled";
|
||||
static NSString *const METHOD_ISQQLITEINSTALLED = @"isQQLiteInstalled";
|
||||
static NSString *const METHOD_LOGIN = @"login";
|
||||
static NSString *const METHOD_LOGOUT = @"logout";
|
||||
static NSString *const METHOD_SHAREMOOD = @"shareMood";
|
||||
@ -99,8 +98,6 @@ static NSString *const SCHEME_FILE = @"file";
|
||||
result([NSNumber numberWithBool:[TencentOAuth iphoneQQInstalled]]);
|
||||
} else if ([METHOD_ISTIMINSTALLED isEqualToString:call.method]) {
|
||||
result([NSNumber numberWithBool:[TencentOAuth iphoneTIMInstalled]]);
|
||||
} else if ([METHOD_ISQQLITEINSTALLED isEqualToString:call.method]) {
|
||||
result([NSNumber numberWithBool:NO]);
|
||||
} 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