提交 20637ec4 authored 作者: 史晓晨's avatar 史晓晨

feat:适配 flutter 3.38(face_auth插件待处理)

上级 403f3632
group 'com.clx.account_center'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.8.10'
repositories {
maven { setUrl("https://maven.aliyun.com/repository/central") }
maven { setUrl("https://maven.aliyun.com/repository/jcenter") }
maven { setUrl("https://maven.aliyun.com/repository/google") }
maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") }
maven { setUrl("https://maven.aliyun.com/repository/public") }
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven { setUrl("https://maven.aliyun.com/repository/central") }
maven { setUrl("https://maven.aliyun.com/repository/jcenter") }
maven { setUrl("https://maven.aliyun.com/repository/google") }
maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") }
maven { setUrl("https://maven.aliyun.com/repository/public") }
google()
mavenCentral()
}
// flatDir {
// dirs project(':aliyun_face_plugin').file('libs')
// }
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 31
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// packagingOptions {
// /// 阿里和pdf插件 so库冲突
// pickFirst "lib/arm64-v8a/libc++_shared.so"
// pickFirst "lib/armeabi-v7a/libc++_shared.so"
// }
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 19
}
viewBinding {
enabled = true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'pub.devrel:easypermissions:3.0.0'
// compile('pub.devrel:easypermissions:1.1.2') {
// exclude group: 'com.android.support'
// }
}
group = "com.clx.account_center"
version = "1.0-SNAPSHOT"
allprojects {
repositories {
google()
mavenCentral()
}
}
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
rootProject.layout.buildDirectory.value(newBuildDir)
subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
project.layout.buildDirectory.value(newSubprojectBuildDir)
}
subprojects {
project.evaluationDependsOn(":app")
}
plugins {
id("com.android.library")
id("kotlin-android")
}
android {
namespace = "com.clx.account_center"
compileSdk = flutter.compileSdkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
minSdk = flutter.minSdkVersion
}
buildFeatures {
viewBinding = true
}
dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.4.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("pub.devrel:easypermissions:3.0.0")
}
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clx.account_center">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
......@@ -9,25 +8,23 @@
<!-- 必要权限,安装权限 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!--拨打电话权限-->
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<!--允许获取精确位置,精准定位必选-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--允许获取粗略位置,粗略定位必选-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<application
android:usesCleartextTraffic="true"
>
<application android:usesCleartextTraffic="true">
<activity
android:theme="@style/AppTheme"
android:name="com.clx.account_center.H5Activity"
android:exported="true">
android:exported="true"
android:theme="@style/AppTheme">
<!-- 深度链接配置 -->
</activity>
</application>
......
......@@ -180,7 +180,7 @@ class AccountCenterPlugin : FlutterPlugin, MethodCallHandler {
return type
}
/* 获取文件的后缀名 */
val end: String = fName.substring(dotIndex).toLowerCase()
val end: String = fName.substring(dotIndex).lowercase()
if (end.equals("")) return type
//在MIME和文件类型的匹配表中找到对应的MIME类型。
for (strings in MIME_MapTable) {
......
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.clx.account_center_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
packagingOptions {
/// 阿里和pdf插件 so库冲突
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/armeabi-v7a/libc++_shared.so"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
android {
namespace = "com.clx.account_center_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.clx.account_center_example"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
multiDexEnabled = true
}
packagingOptions {
/// 阿里和pdf插件 so库冲突
pickFirst("lib/arm64-v8a/libc++_shared.so")
pickFirst("lib/armeabi-v7a/libc++_shared.so")
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
}
}
}
flutter {
source = "../.."
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clx.account_center_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clx.account_center_example">
<uses-permission android:name="android.permission.INTERNET"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
......@@ -10,40 +10,40 @@
<!-- 必要权限,安装权限 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!--拨打电话权限-->
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<!--允许获取精确位置,精准定位必选-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--允许获取粗略位置,粗略定位必选-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:label="account_center_example"
android:name="${applicationName}"
android:icon="@drawable/img">
android:icon="@drawable/img"
android:label="account_center_example">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
......@@ -53,11 +53,13 @@
<!-- 深度链接配置 -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="clx"
android:host="msl-detection-app" /> <!-- 自己产品的productCode -->
android:host="msl-detection-app"
android:scheme="clx" /> <!-- 自己产品的productCode -->
</intent-filter>
</activity>
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clx.account_center_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
buildscript {
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
flatDir {
dirs project(':aliyun_face_plugin').file('libs')
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
allprojects {
repositories {
google()
mavenCentral()
}
}
val newBuildDir: Directory =
rootProject.layout.buildDirectory
.dir("../../build")
.get()
rootProject.layout.buildDirectory.value(newBuildDir)
subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
project.layout.buildDirectory.value(newSubprojectBuildDir)
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx2048M
android.useAndroidX=true
android.enableJetifier=true
......@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
\ No newline at end of file
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
pluginManagement {
val flutterSdkPath =
run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.11.1" apply false
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
}
include(":app")
差异被折叠。
......@@ -28,17 +28,12 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
uuid: ^4.2.2
flutter_clx_base:
git:
url: https://t.clxkj.cn/openSourceLibrary/flutter_clx_base.git
ref: v1.0.2
cupertino_icons: ^1.0.8
uuid: ^4.5.2
dependency_overrides:
package_info_plus: 3.1.2
ffi: 2.0.1
# package_info_plus: 3.1.2
# ffi: 2.0.1
dev_dependencies:
flutter_test:
sdk: flutter
......
import 'dart:io';
import 'package:device_info/device_info.dart';
import 'package:device_info_plus/device_info_plus.dart';
class DeviceInfo {
String deviceId;
......@@ -29,7 +29,7 @@ class DeviceInfo {
// 根据 Android 设备信息创建 DeviceInfo 对象
factory DeviceInfo.fromAndroidDeviceInfo(AndroidDeviceInfo androidInfo) {
return DeviceInfo(
deviceId: androidInfo.androidId,
deviceId: androidInfo.id, // TODO: 2026/2/2 Android唯一标识
deviceName: androidInfo.model,
systemVersion: androidInfo.version.release,
brand: androidInfo.brand);
......@@ -38,7 +38,7 @@ class DeviceInfo {
// 根据 iOS 设备信息创建 DeviceInfo 对象
factory DeviceInfo.fromIosDeviceInfo(IosDeviceInfo iosInfo) {
return DeviceInfo(
deviceId: iosInfo.identifierForVendor,
deviceId: iosInfo.identifierForVendor ?? "",
deviceName: AppleDeviceModelMapper.getModelName(iosInfo.utsname.machine),
systemVersion: iosInfo.systemVersion,
);
......
......@@ -5,8 +5,8 @@ import 'package:account_center/account_center.dart';
import 'package:account_center/api/base_model.dart';
import 'package:account_center/page/account_center/widget/Identity_doing.dart';
import 'package:account_center/page/account_center/widget/identity_success.dart';
import 'package:aliyun_face_plugin/core/aliyun_face_plugin.dart';
import 'package:aliyun_face_plugin/utils/face_auth_utils.dart';
// import 'package:aliyun_face_plugin/core/aliyun_face_plugin.dart';
// import 'package:aliyun_face_plugin/utils/face_auth_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
......@@ -76,29 +76,29 @@ abstract class IdentificationUtil {
}
static Future<dynamic> startFaceVerify() async {
LoadingUtils.showLoading();
var mataInfos = await AliyunFacePlugin().getMetaInfos();
var result = await fetchAsync(Method.post,
url: '/msl-user/app/user/realName/getUserFaceRealNameInit',
params: {
'metaInfo': mataInfos,
'productChannel': Platform.isIOS ? 'ios_app' : 'android_app'
});
LoadingUtils.dismiss();
if (result.isError) {
return null;
}
var certifyResult = result.data;
var certifyId = certifyResult['certifyId'];
debugPrint('认证结果:$certifyId');
var verifyResult =
await FaceAuthUtils.instance.startVerify(certifyId: certifyId);
if (verifyResult == null) return certifyId;
var resultArr = verifyResult.split(',');
if (resultArr.getElement(0) != '1000') {
return certifyId;
}
return certifyId;
// LoadingUtils.showLoading();
// var mataInfos = await AliyunFacePlugin().getMetaInfos();
// var result = await fetchAsync(Method.post,
// url: '/msl-user/app/user/realName/getUserFaceRealNameInit',
// params: {
// 'metaInfo': mataInfos,
// 'productChannel': Platform.isIOS ? 'ios_app' : 'android_app'
// });
// LoadingUtils.dismiss();
// if (result.isError) {
// return null;
// }
// var certifyResult = result.data;
// var certifyId = certifyResult['certifyId'];
// debugPrint('认证结果:$certifyId');
// var verifyResult =
// await FaceAuthUtils.instance.startVerify(certifyId: certifyId);
// if (verifyResult == null) return certifyId;
// var resultArr = verifyResult.split(',');
// if (resultArr.getElement(0) != '1000') {
// return certifyId;
// }
// return certifyId;
}
static Future<bool> startVerifyWeb(String url) async {
......
......@@ -10,33 +10,37 @@ environment:
dependencies:
flutter:
sdk: flutter
device_info: ^2.0.0
flutter_svg: ^2.0.6
external_path: ^1.0.3
file_picker: ^5.3.1
url_launcher: ^6.1.2
device_info_plus: ^12.3.0
flutter_svg: ^2.2.3
external_path: ^2.2.0
file_picker: ^10.3.10
url_launcher: ^6.3.2
# 打开文件
open_filex: ^4.3.2
flutter_widget_from_html_core: ^0.10.1
open_filex: ^4.7.0
flutter_widget_from_html_core: ^0.17.0
open_store: ^0.5.0
connectivity_plus: ^5.0.2
flutter_pdfview: 1.4.0
connectivity_plus: ^7.0.0
flutter_pdfview: ^1.4.4
flutter_oss_aliyun: ^6.4.2
aliyun_face_plugin:
# aliyun_face_plugin:
# git:
# url: https://dev:devfortesting@t.clxkj.cn/openSourceLibrary/aliyun_face_plugin.git
# ref: v1.0.4_f3.38
flutter_clx_base:
git:
url: https://dev:devfortesting@t.clxkj.cn/openSourceLibrary/aliyun_face_plugin.git
ref: v1.0.4
url: https://t.clxkj.cn/openSourceLibrary/flutter_clx_base.git
ref: v1.0.3_f3.38
dependency_overrides:
ffi: 2.0.1
# ffi: 2.0.1
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.1
flutter_clx_base:
git:
url: https://t.clxkj.cn/openSourceLibrary/flutter_clx_base.git
ref: v1.0.2
flutter_lints: ^6.0.0
# flutter_clx_base:
# git:
# url: https://t.clxkj.cn/openSourceLibrary/flutter_clx_base.git
# ref: v1.0.2
flutter:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论