升级 Android SDK

This commit is contained in:
v7lin 2022-01-28 21:08:09 +08:00
parent c7a6645c70
commit 3502b7fcdf
14 changed files with 85 additions and 46 deletions

View File

@ -1,3 +1,7 @@
## 3.1.0
* Android SDK
## 3.0.0
*

View File

@ -1,5 +1,5 @@
group 'io.github.v7lin.weibo_kit'
version '3.0.0'
version '3.1.0'
buildscript {
repositories {
@ -22,7 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
compileSdkVersion 31
defaultConfig {
minSdkVersion 16
@ -50,5 +50,5 @@ android {
dependencies {
// v10.10.0
vendorImplementation 'androidx.appcompat:appcompat:1.0.0'
vendorImplementation 'io.github.sinaweibosdk:core:11.11.2@aar'
vendorImplementation 'io.github.sinaweibosdk:core:11.12.0@aar'
}

View File

@ -1,12 +1,17 @@
package io.github.v7lin.weibo_kit;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.net.Uri;
import android.os.Build;
import androidx.annotation.NonNull;
import com.sina.weibo.sdk.api.ImageObject;
import com.sina.weibo.sdk.api.MultiImageObject;
import com.sina.weibo.sdk.api.TextObject;
import com.sina.weibo.sdk.api.WebpageObject;
import com.sina.weibo.sdk.api.WeiboMultiMessage;
@ -14,10 +19,13 @@ import com.sina.weibo.sdk.auth.AuthInfo;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.sina.weibo.sdk.auth.WbAuthListener;
import com.sina.weibo.sdk.common.UiError;
import com.sina.weibo.sdk.content.FileProvider;
import com.sina.weibo.sdk.openapi.IWBAPI;
import com.sina.weibo.sdk.openapi.WBAPIFactory;
import com.sina.weibo.sdk.share.WbShareCallback;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@ -265,6 +273,25 @@ public class WeiboKitPlugin implements FlutterPlugin, ActivityAware, PluginRegis
message.textObject = object;
}
if (iwbapi != null && iwbapi.isWBAppSupportMultipleImage() && call.hasArgument(ARGUMENT_KEY_IMAGEURI)) {
final MultiImageObject object = new MultiImageObject();
String imageUri = call.argument(ARGUMENT_KEY_IMAGEURI);
ArrayList<Uri> images = new ArrayList<>();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
try {
final ProviderInfo providerInfo = applicationContext.getPackageManager().getProviderInfo(new ComponentName(applicationContext, FileProvider.class), PackageManager.MATCH_DEFAULT_ONLY);
final Uri shareFileUri = FileProvider.getUriForFile(applicationContext, providerInfo.authority, new File(Uri.parse(imageUri).getPath()));
applicationContext.grantUriPermission("com.sina.weibo", shareFileUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
images.add(shareFileUri);
} catch (PackageManager.NameNotFoundException e) {
images.add(Uri.parse(imageUri));
}
} else {
images.add(Uri.parse(imageUri));
}
object.imageList = images;
message.mediaObject = object;
} else {
final ImageObject object = new ImageObject();
if (call.hasArgument(ARGUMENT_KEY_IMAGEDATA)) {
object.imageData = call.argument(ARGUMENT_KEY_IMAGEDATA);// 2 * 1024 * 1024
@ -272,8 +299,8 @@ public class WeiboKitPlugin implements FlutterPlugin, ActivityAware, PluginRegis
String imageUri = call.argument(ARGUMENT_KEY_IMAGEURI);
object.imagePath = Uri.parse(imageUri).getPath();// 512 - 10 * 1024 * 1024
}
message.mediaObject = object;
}
} else if (METHOD_SHAREWEBPAGE.equals(call.method)) {
final WebpageObject object = new WebpageObject();
object.identify = UUID.randomUUID().toString();

View File

@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
compileSdkVersion 31
lintOptions {
disable 'InvalidPackage'
@ -35,7 +35,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.github.v7lin.weibo_kit_example"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>

View File

@ -8,10 +8,10 @@ PODS:
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- weibo_kit (3.0.0):
- weibo_kit (3.1.0):
- Flutter
- weibo_kit/vendor (= 3.0.0)
- weibo_kit/vendor (3.0.0):
- weibo_kit/vendor (= 3.1.0)
- weibo_kit/vendor (3.1.0):
- Flutter
- Weibo_SDK (~> 3.3.0)
- Weibo_SDK (3.3.0)
@ -38,13 +38,13 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/weibo_kit/ios"
SPEC CHECKSUMS:
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
weibo_kit: 328750aa285afbc1b25a16e7c8aae9c30a4ab377
weibo_kit: 2b9acdf65bf6effde4231759e53e136db0c01380
Weibo_SDK: 7478846cccb43c4785ba76b214115fb7ec9dc0d4
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
COCOAPODS: 1.10.1
COCOAPODS: 1.11.2

View File

@ -166,7 +166,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@ -433,7 +433,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -482,7 +482,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -14,7 +14,7 @@ packages:
name: analyzer
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.1"
version: "1.7.2"
archive:
dependency: transitive
description:
@ -35,7 +35,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.6.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
@ -105,14 +105,14 @@ packages:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
@ -215,7 +215,7 @@ packages:
name: flutter_cache_manager
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0-nullsafety.1"
version: "3.3.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -304,14 +304,14 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "1.7.0"
mime:
dependency: transitive
description:
@ -526,7 +526,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
version: "0.4.3"
timing:
dependency: transitive
description:
@ -554,7 +554,7 @@ packages:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.1.1"
watcher:
dependency: transitive
description:
@ -575,7 +575,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.0.0"
version: "3.1.0"
win32:
dependency: transitive
description:
@ -605,5 +605,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.24.0-10"

View File

@ -27,7 +27,7 @@ dependencies:
cupertino_icons: ^1.0.2
image: ^3.0.1
flutter_cache_manager: ^3.0.0-nullsafety.1
flutter_cache_manager: ^3.0.0
json_annotation: ^4.0.0

View File

@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'weibo_kit'
s.version = '3.0.0'
s.version = '3.1.0'
s.summary = 'A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.'
s.description = <<-DESC
A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.

View File

@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.6.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
@ -98,14 +98,14 @@ packages:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
@ -262,14 +262,14 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "1.7.0"
mime:
dependency: transitive
description:
@ -393,7 +393,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
version: "0.4.3"
timing:
dependency: transitive
description:
@ -414,7 +414,7 @@ packages:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "2.1.1"
watcher:
dependency: transitive
description:
@ -437,5 +437,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.20.0"

View File

@ -1,6 +1,6 @@
name: weibo_kit
description: A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.
version: 3.0.0
version: 3.1.0
# author: v7lin <v7lin@qq.com>
homepage: https://github.com/rxreader/weibo_kit.git