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