From ef688691e1f5e82cbf3cc055cc836a16a101fb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Tue, 13 Apr 2021 09:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=8E=B7=E5=8F=96utdid?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java | 5 +++-- android/src/main/java/com/wxwx/flutter_alibc/Params.java | 9 +++++++++ example/.flutter-plugins-dependencies | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 android/src/main/java/com/wxwx/flutter_alibc/Params.java diff --git a/android/src/main/java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java b/android/src/main/java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java index dd1b5a9..e2b87c4 100644 --- a/android/src/main/java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java +++ b/android/src/main/java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java @@ -19,6 +19,7 @@ import java.util.HashMap; import android.app.AlertDialog; +import static com.ali.auth.third.core.context.KernelContext.getApplicationContext; import static com.wxwx.flutter_alibc.PluginConstants.*; import static com.wxwx.flutter_alibc.PluginUtil.*; @@ -490,8 +491,8 @@ public class FlutterAlibcHandle { // AlibcTradeSDK.setShouldUseAlipay(call.argument("isNeed")); } - public void getUdid(MethodCall call,Result result1) { - String udid = UTDevice.getUtdid(register.activity().getApplicationContext()); + public void getUdid(MethodCall call, Result result1) { + String udid = UTDevice.getUtdid(getApplicationContext()); Map resMap = new HashMap(); resMap.put("udid", udid); result1.success(resMap); diff --git a/android/src/main/java/com/wxwx/flutter_alibc/Params.java b/android/src/main/java/com/wxwx/flutter_alibc/Params.java new file mode 100644 index 0000000..3f85e8f --- /dev/null +++ b/android/src/main/java/com/wxwx/flutter_alibc/Params.java @@ -0,0 +1,9 @@ +package com.wxwx.flutter_alibc; + +import com.ut.device.UTDevice; + +import static com.ali.auth.third.core.context.KernelContext.getApplicationContext; + +public class Params { + static String udid = UTDevice.getUtdid(getApplicationContext()); +} diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index f90cd46..5a2b93e 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_alibc","path":"D:\\\\zy_project\\\\zhiying_flutter_alibc\\\\","dependencies":[]}],"android":[{"name":"flutter_alibc","path":"D:\\\\zy_project\\\\zhiying_flutter_alibc\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_alibc","dependencies":[]}],"date_created":"2021-04-09 09:35:59.437953","version":"1.22.1"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_alibc","path":"/Users/fnuser02/Documents/fnuoProject/yeying/zhiying_flutter_alibc/","dependencies":[]}],"android":[{"name":"flutter_alibc","path":"/Users/fnuser02/Documents/fnuoProject/yeying/zhiying_flutter_alibc/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_alibc","dependencies":[]}],"date_created":"2021-04-12 09:20:15.514784","version":"1.22.1"} \ No newline at end of file