├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── leanflutter │ └── plugins │ └── flutter_tencent_captcha │ ├── FlutterTencentCaptchaPlugin.java │ ├── TencentCaptchaActivity.java │ ├── TencentCaptchaListener.java │ └── TencentCaptchaSender.java ├── assets └── captcha.html ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── leanflutter │ │ │ │ │ └── plugins │ │ │ │ │ └── flutter_tencent_captcha_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── FlutterTencentCaptchaPlugin.h │ ├── FlutterTencentCaptchaPlugin.m │ ├── TXCaptchaViewController.h │ ├── TXCaptchaViewController.m │ ├── TXCaptchaWebView.h │ └── TXCaptchaWebView.m └── flutter_tencent_captcha.podspec ├── lib ├── flutter_tencent_captcha.dart ├── tencent_captcha.dart └── tencent_captcha_config.dart ├── pubspec.yaml ├── screenshots ├── flutter_tencent_captcha-android.jpeg └── flutter_tencent_captcha-ios.png └── test └── flutter_tencent_captcha_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 8 | channel: unknown 9 | 10 | project_type: plugin 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 17 | base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 18 | 19 | # User provided section 20 | 21 | # List of Local paths (relative to this file) that should be 22 | # ignored by the migrate tool. 23 | # 24 | # Files that are not part of the templates will be ignored by default. 25 | unmanaged_files: 26 | - 'lib/main.dart' 27 | - 'ios/Runner.xcodeproj/project.pbxproj' 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.2 2 | 3 | * 更新js验证码地址 #9 4 | 5 | ## 0.1.1 6 | 7 | * fix: TencentCaptchaListener NullPointerException #7 8 | 9 | ## 0.1.0 10 | 11 | * bump flutter to 3.3.2 12 | 13 | ## 0.0.3 14 | 15 | * 空安全支持 16 | * 修复因 Ssl 导致内容无法加载完成的问题 17 | 18 | ## 0.0.1 19 | 20 | * Initial release. 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2023 JianyingLi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_tencent_captcha 2 | 3 | 适用于 Flutter 的腾讯云验证码插件 4 | 5 | [![pub version][pub-image]][pub-url] 6 | 7 | [pub-image]: https://img.shields.io/pub/v/flutter_tencent_captcha.svg 8 | [pub-url]: https://pub.dev/packages/flutter_tencent_captcha 9 | 10 | 11 | 12 | 13 | - [屏幕截图](#%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE) 14 | - [快速开始](#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B) 15 | - [安装](#%E5%AE%89%E8%A3%85) 16 | - [用法](#%E7%94%A8%E6%B3%95) 17 | - [获取 SDK 版本](#%E8%8E%B7%E5%8F%96-sdk-%E7%89%88%E6%9C%AC) 18 | - [初始化 SDK](#%E5%88%9D%E5%A7%8B%E5%8C%96-sdk) 19 | - [开始验证](#%E5%BC%80%E5%A7%8B%E9%AA%8C%E8%AF%81) 20 | - [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81) 21 | 22 | 23 | 24 | ## 屏幕截图 25 | 26 |
27 | 28 | 29 |
30 | 31 | ## 快速开始 32 | 33 | ### 安装 34 | 35 | 将此添加到包的 pubspec.yaml 文件中: 36 | 37 | ```yaml 38 | dependencies: 39 | flutter_tencent_captcha: ^0.1.2 40 | ``` 41 | 42 | 您可以从命令行安装软件包: 43 | 44 | ```bash 45 | $ flutter packages get 46 | ``` 47 | 48 | ### 用法 49 | 50 | #### 获取 SDK 版本 51 | 52 | ```dart 53 | String sdkVersion = await TencentCaptcha.sdkVersion; 54 | ``` 55 | 56 | #### 初始化 SDK 57 | 58 | ```dart 59 | TencentCaptcha.init(''); 60 | ``` 61 | 62 | #### 开始验证 63 | 64 | > 详细参数请参见:https://cloud.tencent.com/document/product/1110/36841 65 | 66 | ```dart 67 | TencentCaptchaConfig config = TencentCaptchaConfig( 68 | bizState: 'tencent-captcha', 69 | enableDarkMode: true, 70 | ); 71 | await TencentCaptcha.verify( 72 | config: config, 73 | onLoaded: (dynamic data) { 74 | _addLog('onLoaded', data); 75 | }, 76 | onSuccess: (dynamic data) { 77 | _addLog('onSuccess', data); 78 | }, 79 | onFail: (dynamic data) { 80 | _addLog('onFail', data); 81 | }, 82 | ); 83 | ``` 84 | 85 | ## 许可证 86 | 87 | [MIT](./LICENSE) 88 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'org.leanflutter.plugins.flutter_tencent_captcha' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.5.0' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 28 26 | 27 | defaultConfig { 28 | minSdkVersion 16 29 | } 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_tencent_captcha' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/leanflutter/plugins/flutter_tencent_captcha/FlutterTencentCaptchaPlugin.java: -------------------------------------------------------------------------------- 1 | package org.leanflutter.plugins.flutter_tencent_captcha; 2 | 3 | import android.app.Activity; 4 | import android.app.ActivityOptions; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.util.Log; 8 | 9 | import androidx.annotation.NonNull; 10 | 11 | import org.json.JSONException; 12 | import org.json.JSONObject; 13 | 14 | import java.util.HashMap; 15 | import java.util.Iterator; 16 | import java.util.Map; 17 | 18 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 19 | import io.flutter.embedding.engine.plugins.activity.ActivityAware; 20 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; 21 | import io.flutter.plugin.common.BinaryMessenger; 22 | import io.flutter.plugin.common.EventChannel; 23 | import io.flutter.plugin.common.MethodCall; 24 | import io.flutter.plugin.common.MethodChannel; 25 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 26 | import io.flutter.plugin.common.MethodChannel.Result; 27 | import io.flutter.plugin.common.PluginRegistry.Registrar; 28 | 29 | /** 30 | * FlutterTencentCaptchaPlugin 31 | */ 32 | public class FlutterTencentCaptchaPlugin implements FlutterPlugin, MethodCallHandler, EventChannel.StreamHandler, ActivityAware { 33 | private static final String CHANNEL_NAME = "flutter_tencent_captcha"; 34 | private static final String EVENT_CHANNEL_NAME = "flutter_tencent_captcha/event_channel"; 35 | 36 | /// The MethodChannel that will the communication between Flutter and native Android 37 | /// 38 | /// This local reference serves to register the plugin with the Flutter Engine and unregister it 39 | /// when the Flutter Engine is detached from the Activity 40 | private MethodChannel channel; 41 | private EventChannel eventChannel; 42 | private EventChannel.EventSink eventSink; 43 | 44 | private Context context; 45 | private Activity activity; 46 | 47 | private String captchaHtmlPath; 48 | private String appId; 49 | 50 | private void setupChannel(BinaryMessenger messenger, Context context) { 51 | this.context = context; 52 | 53 | this.channel = new MethodChannel(messenger, CHANNEL_NAME); 54 | this.channel.setMethodCallHandler(this); 55 | 56 | this.eventChannel = new EventChannel(messenger, EVENT_CHANNEL_NAME); 57 | this.eventChannel.setStreamHandler(this); 58 | } 59 | 60 | private void teardownChannel() { 61 | this.context = null; 62 | 63 | this.channel.setMethodCallHandler(null); 64 | this.channel = null; 65 | 66 | this.eventChannel.setStreamHandler(null); 67 | this.eventChannel = null; 68 | } 69 | 70 | @Override 71 | public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { 72 | this.captchaHtmlPath = flutterPluginBinding.getFlutterAssets().getAssetFilePathBySubpath("assets/captcha.html", "flutter_tencent_captcha"); 73 | this.setupChannel(flutterPluginBinding.getBinaryMessenger(), flutterPluginBinding.getApplicationContext()); 74 | } 75 | 76 | @Override 77 | public void onDetachedFromEngine(@NonNull FlutterPlugin.FlutterPluginBinding binding) { 78 | this.teardownChannel(); 79 | } 80 | 81 | @Override 82 | public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) { 83 | this.activity = activityPluginBinding.getActivity(); 84 | } 85 | 86 | @Override 87 | public void onDetachedFromActivityForConfigChanges() { 88 | 89 | } 90 | 91 | @Override 92 | public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) { 93 | this.activity = activityPluginBinding.getActivity(); 94 | } 95 | 96 | @Override 97 | public void onDetachedFromActivity() { 98 | this.activity = null; 99 | } 100 | 101 | @Override 102 | public void onListen(Object args, EventChannel.EventSink eventSink) { 103 | this.eventSink = eventSink; 104 | } 105 | 106 | @Override 107 | public void onCancel(Object args) { 108 | this.eventSink = null; 109 | } 110 | 111 | // This static function is optional and equivalent to onAttachedToEngine. It supports the old 112 | // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting 113 | // plugin registration via this function while apps migrate to use the new Android APIs 114 | // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. 115 | // 116 | // It is encouraged to share logic between onAttachedToEngine and registerWith to keep 117 | // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called 118 | // depending on the user's project. onAttachedToEngine or registerWith must both be defined 119 | // in the same class. 120 | public static void registerWith(Registrar registrar) { 121 | FlutterTencentCaptchaPlugin plugin = new FlutterTencentCaptchaPlugin(); 122 | plugin.setupChannel(registrar.messenger(), registrar.activeContext()); 123 | } 124 | 125 | @Override 126 | public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { 127 | if (call.method.equals("getSDKVersion")) { 128 | handleMethodGetSDKVersion(call, result); 129 | } else if (call.method.equals("init")) { 130 | handleMethodInit(call, result); 131 | } else if (call.method.equals("verify")) { 132 | handleMethodVerify(call, result); 133 | } else { 134 | result.notImplemented(); 135 | } 136 | } 137 | 138 | 139 | private void handleMethodGetSDKVersion(@NonNull MethodCall call, @NonNull Result result) { 140 | result.success("0.0.1"); 141 | } 142 | 143 | private void handleMethodInit(@NonNull MethodCall call, @NonNull Result result) { 144 | this.appId = call.argument("appId"); 145 | result.success(true); 146 | } 147 | 148 | private void handleMethodVerify(@NonNull MethodCall call, @NonNull final Result result) { 149 | String configJsonString = "{}"; 150 | 151 | if (call.hasArgument("config")) 152 | configJsonString = call.argument("config"); 153 | 154 | TencentCaptchaSender.getInstance().listene(new TencentCaptchaListener() { 155 | @Override 156 | public void onLoaded(String data) { 157 | final Map result = new HashMap<>(); 158 | result.put("method", "onLoaded"); 159 | result.put("data", convertMsgToMap(data)); 160 | 161 | eventSink.success(result); 162 | } 163 | 164 | @Override 165 | public void onSuccess(String data) { 166 | final Map result = new HashMap<>(); 167 | result.put("method", "onSuccess"); 168 | result.put("data", convertMsgToMap(data)); 169 | 170 | eventSink.success(result); 171 | } 172 | 173 | @Override 174 | public void onFail(String msg) { 175 | final Map result = new HashMap<>(); 176 | result.put("method", "onFail"); 177 | result.put("data", convertMsgToMap(msg)); 178 | 179 | eventSink.success(result); 180 | } 181 | }); 182 | 183 | Intent intent = new Intent(activity, TencentCaptchaActivity.class); 184 | intent.putExtra("captchaHtmlPath", this.captchaHtmlPath); 185 | intent.putExtra("configJsonString", configJsonString); 186 | activity.startActivity(intent); 187 | activity.overridePendingTransition(0, 0); 188 | 189 | result.success(true); 190 | } 191 | 192 | private static Map convertMsgToMap(String jsonString) { 193 | Map map = new HashMap(); 194 | JSONObject jsonObject = null; 195 | try { 196 | jsonObject = new JSONObject(jsonString); 197 | map = toMap(jsonObject); 198 | } catch (JSONException ex) { 199 | // skip; 200 | } 201 | return map; 202 | } 203 | 204 | private static Map toMap(JSONObject jsonObject) throws JSONException { 205 | Map map = new HashMap(); 206 | Iterator keys = jsonObject.keys(); 207 | while (keys.hasNext()) { 208 | String key = keys.next(); 209 | Object value = jsonObject.get(key); 210 | if (value instanceof JSONObject) { 211 | value = toMap((JSONObject) value); 212 | } 213 | map.put(key, value); 214 | } 215 | return map; 216 | } 217 | } 218 | -------------------------------------------------------------------------------- /android/src/main/java/org/leanflutter/plugins/flutter_tencent_captcha/TencentCaptchaActivity.java: -------------------------------------------------------------------------------- 1 | package org.leanflutter.plugins.flutter_tencent_captcha; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Activity; 5 | import android.content.DialogInterface; 6 | import android.content.Intent; 7 | import android.graphics.Bitmap; 8 | import android.graphics.Color; 9 | import android.net.Uri; 10 | import android.net.http.SslError; 11 | import android.os.Build; 12 | import android.os.Bundle; 13 | import android.os.Handler; 14 | import android.os.Looper; 15 | import android.view.Window; 16 | import android.view.WindowManager; 17 | import android.webkit.JavascriptInterface; 18 | import android.webkit.SslErrorHandler; 19 | import android.webkit.ValueCallback; 20 | import android.webkit.WebSettings; 21 | import android.webkit.WebView; 22 | import android.webkit.WebViewClient; 23 | 24 | import androidx.annotation.Nullable; 25 | import androidx.annotation.RequiresApi; 26 | 27 | class TencentCaptchaJsInterface { 28 | private Handler handler = new Handler(Looper.getMainLooper()); 29 | private DialogInterface.OnDismissListener listener; 30 | 31 | public TencentCaptchaJsInterface(DialogInterface.OnDismissListener listener) { 32 | this.listener = listener; 33 | } 34 | 35 | @JavascriptInterface 36 | public void onLoaded(final String data) { 37 | Runnable runnable = new Runnable() { 38 | @Override 39 | public void run() { 40 | TencentCaptchaSender.getInstance().onLoaded(data); 41 | } 42 | }; 43 | handler.post(runnable); 44 | } 45 | 46 | @JavascriptInterface 47 | public void onSuccess(final String data) { 48 | Runnable runnable = new Runnable() { 49 | @Override 50 | public void run() { 51 | TencentCaptchaSender.getInstance().onSuccess(data); 52 | 53 | listener.onDismiss(null); 54 | } 55 | }; 56 | handler.post(runnable); 57 | } 58 | 59 | @JavascriptInterface 60 | public void onFail(final String data) { 61 | Runnable runnable = new Runnable() { 62 | @Override 63 | public void run() { 64 | TencentCaptchaSender.getInstance().onFail(data); 65 | listener.onDismiss(null); 66 | } 67 | }; 68 | handler.post(runnable); 69 | } 70 | } 71 | 72 | public class TencentCaptchaActivity extends Activity implements DialogInterface.OnDismissListener { 73 | private String configJsonString; 74 | 75 | private WebView webView; 76 | private WebSettings webSettings; 77 | private WebViewClient webViewClient = new WebViewClient() { 78 | @RequiresApi(api = Build.VERSION_CODES.KITKAT) 79 | @Override 80 | public void onPageFinished(WebView view, String url) { 81 | super.onPageFinished(view, url); 82 | 83 | String jsCode = String.format("window._verify('%s');", configJsonString); 84 | webView.evaluateJavascript(jsCode, new ValueCallback() { 85 | @Override 86 | public void onReceiveValue(String value) { 87 | } 88 | }); 89 | } 90 | 91 | @Override 92 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 93 | if (url != null && (url.startsWith("http://") || url.startsWith("https://"))) { 94 | view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); 95 | return true; 96 | } 97 | return false; 98 | } 99 | 100 | @Override 101 | public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { 102 | handler.cancel(); 103 | } 104 | }; 105 | 106 | @SuppressLint({"ResourceAsColor", "AddJavascriptInterface", "SetJavaScriptEnabled"}) 107 | @Override 108 | protected void onCreate(@Nullable Bundle savedInstanceState) { 109 | super.onCreate(savedInstanceState); 110 | 111 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 112 | Window window = getWindow(); 113 | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 114 | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 115 | 116 | window.setStatusBarColor(Color.parseColor("#99000000")); 117 | } 118 | 119 | this.webView = new WebView(this); 120 | 121 | this.webView.setBackgroundColor(android.R.color.transparent); 122 | this.webView.setWebViewClient(this.webViewClient); 123 | this.webView.addJavascriptInterface(new TencentCaptchaJsInterface(this), "messageHandlers"); 124 | 125 | this.webSettings = this.webView.getSettings(); 126 | this.webSettings.setJavaScriptEnabled(true); 127 | this.webSettings.setAllowFileAccessFromFileURLs(true); 128 | this.webSettings.setJavaScriptCanOpenWindowsAutomatically(true); 129 | this.webView.requestFocus(); 130 | 131 | Intent intent = getIntent(); 132 | if (intent.hasExtra("configJsonString")) { 133 | this.configJsonString = intent.getStringExtra("configJsonString"); 134 | } 135 | if (intent.hasExtra("captchaHtmlPath")) { 136 | String captchaHtmlPath = intent.getStringExtra("captchaHtmlPath"); 137 | this.webView.loadUrl("file:///android_asset/" + captchaHtmlPath); 138 | } 139 | 140 | this.setContentView(this.webView); 141 | } 142 | 143 | @Override 144 | protected void onPause() { 145 | overridePendingTransition(0, 0); 146 | super.onPause(); 147 | } 148 | 149 | @Override 150 | public void onDismiss(DialogInterface dialog) { 151 | this.finish(); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /android/src/main/java/org/leanflutter/plugins/flutter_tencent_captcha/TencentCaptchaListener.java: -------------------------------------------------------------------------------- 1 | package org.leanflutter.plugins.flutter_tencent_captcha; 2 | 3 | public interface TencentCaptchaListener { 4 | void onLoaded(String data); 5 | 6 | void onSuccess(String data); 7 | 8 | void onFail(String data); 9 | } 10 | -------------------------------------------------------------------------------- /android/src/main/java/org/leanflutter/plugins/flutter_tencent_captcha/TencentCaptchaSender.java: -------------------------------------------------------------------------------- 1 | package org.leanflutter.plugins.flutter_tencent_captcha; 2 | 3 | public class TencentCaptchaSender { 4 | private static TencentCaptchaSender instance = new TencentCaptchaSender(); 5 | 6 | public static TencentCaptchaSender getInstance() { 7 | return instance; 8 | } 9 | 10 | TencentCaptchaListener listener; 11 | 12 | void listene(TencentCaptchaListener listener) { 13 | this.listener = listener; 14 | } 15 | 16 | void onLoaded(String data) { 17 | if (this.listener == null) return; 18 | this.listener.onLoaded(data); 19 | } 20 | 21 | void onSuccess(String data) { 22 | if (this.listener == null) return; 23 | this.listener.onSuccess(data); 24 | } 25 | 26 | void onFail(String data) { 27 | if (this.listener == null) return; 28 | this.listener.onFail(data); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assets/captcha.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 20 | 21 | 22 | 23 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 8 | channel: unknown 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 17 | base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 18 | - platform: ios 19 | create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 20 | base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_tencent_captcha_example 2 | 3 | Demonstrates how to use the flutter_tencent_captcha plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | defaultConfig { 38 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 39 | applicationId "org.leanflutter.plugins.flutter_tencent_captcha_example" 40 | // You can update the following values to match your application needs. 41 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 42 | minSdkVersion flutter.minSdkVersion 43 | targetSdkVersion flutter.targetSdkVersion 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/org/leanflutter/plugins/flutter_tencent_captcha_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package org.leanflutter.plugins.flutter_tencent_captcha_example; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 6 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 32 | end 33 | 34 | post_install do |installer| 35 | installer.pods_project.targets.each do |target| 36 | flutter_additional_ios_build_settings(target) 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_tencent_captcha (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `Flutter`) 8 | - flutter_tencent_captcha (from `.symlinks/plugins/flutter_tencent_captcha/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: Flutter 13 | flutter_tencent_captcha: 14 | :path: ".symlinks/plugins/flutter_tencent_captcha/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 18 | flutter_tencent_captcha: 4853c2caa88a285990eb470f26ba7568f26689b4 19 | 20 | PODFILE CHECKSUM: e5ee00144d04e7b168ba7ea28a9753540e444f3d 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 91AC991A645D45EDD2BD3ABD /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28699468C0F26AEC22BBD82F /* libPods-Runner.a */; }; 13 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 14 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 15 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 16 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 17 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXCopyFilesBuildPhase section */ 21 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 22 | isa = PBXCopyFilesBuildPhase; 23 | buildActionMask = 2147483647; 24 | dstPath = ""; 25 | dstSubfolderSpec = 10; 26 | files = ( 27 | ); 28 | name = "Embed Frameworks"; 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXCopyFilesBuildPhase section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 28699468C0F26AEC22BBD82F /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 338EF785F623A37ED9D35A58 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 38 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 39 | 5339E87EFE32ADF5D1100800 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 40 | 77B8ABD930759B1D0099C723 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 41 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 42 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 43 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 44 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 45 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 46 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 48 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 91AC991A645D45EDD2BD3ABD /* libPods-Runner.a in Frameworks */, 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | 0D04B15E1CD01B6089F65407 /* Pods */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 5339E87EFE32ADF5D1100800 /* Pods-Runner.debug.xcconfig */, 70 | 77B8ABD930759B1D0099C723 /* Pods-Runner.release.xcconfig */, 71 | 338EF785F623A37ED9D35A58 /* Pods-Runner.profile.xcconfig */, 72 | ); 73 | name = Pods; 74 | path = Pods; 75 | sourceTree = ""; 76 | }; 77 | 7BE3F8860E31D2CF32E9F665 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 28699468C0F26AEC22BBD82F /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 9740EEB11CF90186004384FC /* Flutter */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 89 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 90 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 91 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 92 | ); 93 | name = Flutter; 94 | sourceTree = ""; 95 | }; 96 | 97C146E51CF9000F007C117D = { 97 | isa = PBXGroup; 98 | children = ( 99 | 9740EEB11CF90186004384FC /* Flutter */, 100 | 97C146F01CF9000F007C117D /* Runner */, 101 | 97C146EF1CF9000F007C117D /* Products */, 102 | 0D04B15E1CD01B6089F65407 /* Pods */, 103 | 7BE3F8860E31D2CF32E9F665 /* Frameworks */, 104 | ); 105 | sourceTree = ""; 106 | }; 107 | 97C146EF1CF9000F007C117D /* Products */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 97C146EE1CF9000F007C117D /* Runner.app */, 111 | ); 112 | name = Products; 113 | sourceTree = ""; 114 | }; 115 | 97C146F01CF9000F007C117D /* Runner */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 119 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 120 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 121 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 122 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 123 | 97C147021CF9000F007C117D /* Info.plist */, 124 | 97C146F11CF9000F007C117D /* Supporting Files */, 125 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 126 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 127 | ); 128 | path = Runner; 129 | sourceTree = ""; 130 | }; 131 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 97C146F21CF9000F007C117D /* main.m */, 135 | ); 136 | name = "Supporting Files"; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 97C146ED1CF9000F007C117D /* Runner */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 145 | buildPhases = ( 146 | CAA3C8F68B5BCEA4892754F8 /* [CP] Check Pods Manifest.lock */, 147 | 9740EEB61CF901F6004384FC /* Run Script */, 148 | 97C146EA1CF9000F007C117D /* Sources */, 149 | 97C146EB1CF9000F007C117D /* Frameworks */, 150 | 97C146EC1CF9000F007C117D /* Resources */, 151 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 152 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = Runner; 159 | productName = Runner; 160 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | /* End PBXNativeTarget section */ 164 | 165 | /* Begin PBXProject section */ 166 | 97C146E61CF9000F007C117D /* Project object */ = { 167 | isa = PBXProject; 168 | attributes = { 169 | LastUpgradeCheck = 1300; 170 | ORGANIZATIONNAME = ""; 171 | TargetAttributes = { 172 | 97C146ED1CF9000F007C117D = { 173 | CreatedOnToolsVersion = 7.3.1; 174 | }; 175 | }; 176 | }; 177 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 178 | compatibilityVersion = "Xcode 9.3"; 179 | developmentRegion = en; 180 | hasScannedForEncodings = 0; 181 | knownRegions = ( 182 | en, 183 | Base, 184 | ); 185 | mainGroup = 97C146E51CF9000F007C117D; 186 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 187 | projectDirPath = ""; 188 | projectRoot = ""; 189 | targets = ( 190 | 97C146ED1CF9000F007C117D /* Runner */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXResourcesBuildPhase section */ 196 | 97C146EC1CF9000F007C117D /* Resources */ = { 197 | isa = PBXResourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 201 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 202 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 203 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXResourcesBuildPhase section */ 208 | 209 | /* Begin PBXShellScriptBuildPhase section */ 210 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 211 | isa = PBXShellScriptBuildPhase; 212 | alwaysOutOfDate = 1; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 218 | ); 219 | name = "Thin Binary"; 220 | outputPaths = ( 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | shellPath = /bin/sh; 224 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 225 | }; 226 | 9740EEB61CF901F6004384FC /* Run Script */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | alwaysOutOfDate = 1; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | ); 232 | inputPaths = ( 233 | ); 234 | name = "Run Script"; 235 | outputPaths = ( 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | shellPath = /bin/sh; 239 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 240 | }; 241 | CAA3C8F68B5BCEA4892754F8 /* [CP] Check Pods Manifest.lock */ = { 242 | isa = PBXShellScriptBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | inputFileListPaths = ( 247 | ); 248 | inputPaths = ( 249 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 250 | "${PODS_ROOT}/Manifest.lock", 251 | ); 252 | name = "[CP] Check Pods Manifest.lock"; 253 | outputFileListPaths = ( 254 | ); 255 | outputPaths = ( 256 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | shellPath = /bin/sh; 260 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 261 | showEnvVarsInLog = 0; 262 | }; 263 | /* End PBXShellScriptBuildPhase section */ 264 | 265 | /* Begin PBXSourcesBuildPhase section */ 266 | 97C146EA1CF9000F007C117D /* Sources */ = { 267 | isa = PBXSourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 271 | 97C146F31CF9000F007C117D /* main.m in Sources */, 272 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXSourcesBuildPhase section */ 277 | 278 | /* Begin PBXVariantGroup section */ 279 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 97C146FB1CF9000F007C117D /* Base */, 283 | ); 284 | name = Main.storyboard; 285 | sourceTree = ""; 286 | }; 287 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 288 | isa = PBXVariantGroup; 289 | children = ( 290 | 97C147001CF9000F007C117D /* Base */, 291 | ); 292 | name = LaunchScreen.storyboard; 293 | sourceTree = ""; 294 | }; 295 | /* End PBXVariantGroup section */ 296 | 297 | /* Begin XCBuildConfiguration section */ 298 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | CLANG_ANALYZER_NONNULL = YES; 303 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 304 | CLANG_CXX_LIBRARY = "libc++"; 305 | CLANG_ENABLE_MODULES = YES; 306 | CLANG_ENABLE_OBJC_ARC = YES; 307 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 308 | CLANG_WARN_BOOL_CONVERSION = YES; 309 | CLANG_WARN_COMMA = YES; 310 | CLANG_WARN_CONSTANT_CONVERSION = YES; 311 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 312 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 313 | CLANG_WARN_EMPTY_BODY = YES; 314 | CLANG_WARN_ENUM_CONVERSION = YES; 315 | CLANG_WARN_INFINITE_RECURSION = YES; 316 | CLANG_WARN_INT_CONVERSION = YES; 317 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 318 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 319 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 321 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 322 | CLANG_WARN_STRICT_PROTOTYPES = YES; 323 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 324 | CLANG_WARN_UNREACHABLE_CODE = YES; 325 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 326 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 327 | COPY_PHASE_STRIP = NO; 328 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 329 | ENABLE_NS_ASSERTIONS = NO; 330 | ENABLE_STRICT_OBJC_MSGSEND = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_NO_COMMON_BLOCKS = YES; 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 340 | MTL_ENABLE_DEBUG_INFO = NO; 341 | SDKROOT = iphoneos; 342 | SUPPORTED_PLATFORMS = iphoneos; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | VALIDATE_PRODUCT = YES; 345 | }; 346 | name = Profile; 347 | }; 348 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 349 | isa = XCBuildConfiguration; 350 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 351 | buildSettings = { 352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 353 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 354 | DEVELOPMENT_TEAM = G83H824X6L; 355 | ENABLE_BITCODE = NO; 356 | INFOPLIST_FILE = Runner/Info.plist; 357 | LD_RUNPATH_SEARCH_PATHS = ( 358 | "$(inherited)", 359 | "@executable_path/Frameworks", 360 | ); 361 | PRODUCT_BUNDLE_IDENTIFIER = org.leanflutter.plugins.example; 362 | PRODUCT_NAME = "$(TARGET_NAME)"; 363 | VERSIONING_SYSTEM = "apple-generic"; 364 | }; 365 | name = Profile; 366 | }; 367 | 97C147031CF9000F007C117D /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | CLANG_ANALYZER_NONNULL = YES; 372 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 373 | CLANG_CXX_LIBRARY = "libc++"; 374 | CLANG_ENABLE_MODULES = YES; 375 | CLANG_ENABLE_OBJC_ARC = YES; 376 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 377 | CLANG_WARN_BOOL_CONVERSION = YES; 378 | CLANG_WARN_COMMA = YES; 379 | CLANG_WARN_CONSTANT_CONVERSION = YES; 380 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 381 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 382 | CLANG_WARN_EMPTY_BODY = YES; 383 | CLANG_WARN_ENUM_CONVERSION = YES; 384 | CLANG_WARN_INFINITE_RECURSION = YES; 385 | CLANG_WARN_INT_CONVERSION = YES; 386 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 388 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 389 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 390 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 391 | CLANG_WARN_STRICT_PROTOTYPES = YES; 392 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 393 | CLANG_WARN_UNREACHABLE_CODE = YES; 394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 396 | COPY_PHASE_STRIP = NO; 397 | DEBUG_INFORMATION_FORMAT = dwarf; 398 | ENABLE_STRICT_OBJC_MSGSEND = YES; 399 | ENABLE_TESTABILITY = YES; 400 | GCC_C_LANGUAGE_STANDARD = gnu99; 401 | GCC_DYNAMIC_NO_PIC = NO; 402 | GCC_NO_COMMON_BLOCKS = YES; 403 | GCC_OPTIMIZATION_LEVEL = 0; 404 | GCC_PREPROCESSOR_DEFINITIONS = ( 405 | "DEBUG=1", 406 | "$(inherited)", 407 | ); 408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 410 | GCC_WARN_UNDECLARED_SELECTOR = YES; 411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 412 | GCC_WARN_UNUSED_FUNCTION = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 415 | MTL_ENABLE_DEBUG_INFO = YES; 416 | ONLY_ACTIVE_ARCH = YES; 417 | SDKROOT = iphoneos; 418 | TARGETED_DEVICE_FAMILY = "1,2"; 419 | }; 420 | name = Debug; 421 | }; 422 | 97C147041CF9000F007C117D /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ALWAYS_SEARCH_USER_PATHS = NO; 426 | CLANG_ANALYZER_NONNULL = YES; 427 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 428 | CLANG_CXX_LIBRARY = "libc++"; 429 | CLANG_ENABLE_MODULES = YES; 430 | CLANG_ENABLE_OBJC_ARC = YES; 431 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 432 | CLANG_WARN_BOOL_CONVERSION = YES; 433 | CLANG_WARN_COMMA = YES; 434 | CLANG_WARN_CONSTANT_CONVERSION = YES; 435 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 436 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 437 | CLANG_WARN_EMPTY_BODY = YES; 438 | CLANG_WARN_ENUM_CONVERSION = YES; 439 | CLANG_WARN_INFINITE_RECURSION = YES; 440 | CLANG_WARN_INT_CONVERSION = YES; 441 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 442 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 443 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 444 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 445 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 446 | CLANG_WARN_STRICT_PROTOTYPES = YES; 447 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 448 | CLANG_WARN_UNREACHABLE_CODE = YES; 449 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 450 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 451 | COPY_PHASE_STRIP = NO; 452 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 453 | ENABLE_NS_ASSERTIONS = NO; 454 | ENABLE_STRICT_OBJC_MSGSEND = YES; 455 | GCC_C_LANGUAGE_STANDARD = gnu99; 456 | GCC_NO_COMMON_BLOCKS = YES; 457 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 458 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 459 | GCC_WARN_UNDECLARED_SELECTOR = YES; 460 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 461 | GCC_WARN_UNUSED_FUNCTION = YES; 462 | GCC_WARN_UNUSED_VARIABLE = YES; 463 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 464 | MTL_ENABLE_DEBUG_INFO = NO; 465 | SDKROOT = iphoneos; 466 | SUPPORTED_PLATFORMS = iphoneos; 467 | TARGETED_DEVICE_FAMILY = "1,2"; 468 | VALIDATE_PRODUCT = YES; 469 | }; 470 | name = Release; 471 | }; 472 | 97C147061CF9000F007C117D /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 475 | buildSettings = { 476 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 477 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 478 | DEVELOPMENT_TEAM = G83H824X6L; 479 | ENABLE_BITCODE = NO; 480 | INFOPLIST_FILE = Runner/Info.plist; 481 | LD_RUNPATH_SEARCH_PATHS = ( 482 | "$(inherited)", 483 | "@executable_path/Frameworks", 484 | ); 485 | PRODUCT_BUNDLE_IDENTIFIER = org.leanflutter.plugins.example; 486 | PRODUCT_NAME = "$(TARGET_NAME)"; 487 | VERSIONING_SYSTEM = "apple-generic"; 488 | }; 489 | name = Debug; 490 | }; 491 | 97C147071CF9000F007C117D /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 494 | buildSettings = { 495 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 496 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 497 | DEVELOPMENT_TEAM = G83H824X6L; 498 | ENABLE_BITCODE = NO; 499 | INFOPLIST_FILE = Runner/Info.plist; 500 | LD_RUNPATH_SEARCH_PATHS = ( 501 | "$(inherited)", 502 | "@executable_path/Frameworks", 503 | ); 504 | PRODUCT_BUNDLE_IDENTIFIER = org.leanflutter.plugins.example; 505 | PRODUCT_NAME = "$(TARGET_NAME)"; 506 | VERSIONING_SYSTEM = "apple-generic"; 507 | }; 508 | name = Release; 509 | }; 510 | /* End XCBuildConfiguration section */ 511 | 512 | /* Begin XCConfigurationList section */ 513 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 97C147031CF9000F007C117D /* Debug */, 517 | 97C147041CF9000F007C117D /* Release */, 518 | 249021D3217E4FDB00AE95B9 /* Profile */, 519 | ); 520 | defaultConfigurationIsVisible = 0; 521 | defaultConfigurationName = Release; 522 | }; 523 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 524 | isa = XCConfigurationList; 525 | buildConfigurations = ( 526 | 97C147061CF9000F007C117D /* Debug */, 527 | 97C147071CF9000F007C117D /* Release */, 528 | 249021D4217E4FDB00AE95B9 /* Profile */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | /* End XCConfigurationList section */ 534 | }; 535 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 536 | } 537 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'dart:async'; 5 | 6 | import 'package:flutter/services.dart'; 7 | import 'package:flutter_tencent_captcha/flutter_tencent_captcha.dart'; 8 | 9 | void main() { 10 | WidgetsFlutterBinding.ensureInitialized(); 11 | 12 | // 请填写你自己的 AppId 13 | TencentCaptcha.init(''); 14 | 15 | runApp(const MyApp()); 16 | } 17 | 18 | class MyApp extends StatefulWidget { 19 | const MyApp({Key? key}) : super(key: key); 20 | 21 | @override 22 | State createState() => _MyAppState(); 23 | } 24 | 25 | class _MyAppState extends State { 26 | String _sdkVersion = 'Unknown'; 27 | final List _logs = []; 28 | 29 | @override 30 | void initState() { 31 | super.initState(); 32 | initPlatformState(); 33 | } 34 | 35 | // Platform messages are asynchronous, so we initialize in an async method. 36 | Future initPlatformState() async { 37 | String sdkVersion; 38 | // Platform messages may fail, so we use a try/catch PlatformException. 39 | try { 40 | sdkVersion = await TencentCaptcha.sdkVersion; 41 | } on PlatformException { 42 | sdkVersion = 'Failed to get platform version.'; 43 | } 44 | 45 | // If the widget was removed from the tree while the asynchronous platform 46 | // message was in flight, we want to discard the reply rather than calling 47 | // setState to update our non-existent appearance. 48 | if (!mounted) return; 49 | 50 | setState(() { 51 | _sdkVersion = sdkVersion; 52 | }); 53 | } 54 | 55 | void _handleClickVerify() async { 56 | TencentCaptchaConfig config = TencentCaptchaConfig( 57 | bizState: 'tencent-captcha', 58 | enableDarkMode: true, 59 | ); 60 | await TencentCaptcha.verify( 61 | config: config, 62 | onLoaded: (dynamic data) { 63 | _addLog('onLoaded', data); 64 | }, 65 | onSuccess: (dynamic data) { 66 | _addLog('onSuccess', data); 67 | }, 68 | onFail: (dynamic data) { 69 | _addLog('onFail', data); 70 | }, 71 | ); 72 | } 73 | 74 | void _addLog(String method, dynamic data) { 75 | _logs.add('>>>$method'); 76 | if (data != null) _logs.add(json.encode(data)); 77 | _logs.add(' '); 78 | setState(() {}); 79 | } 80 | 81 | @override 82 | Widget build(BuildContext context) { 83 | return MaterialApp( 84 | home: Scaffold( 85 | appBar: AppBar( 86 | title: const Text('Plugin example app'), 87 | ), 88 | body: Container( 89 | padding: const EdgeInsets.all(16), 90 | child: Column( 91 | mainAxisSize: MainAxisSize.max, 92 | crossAxisAlignment: CrossAxisAlignment.start, 93 | children: [ 94 | Container( 95 | alignment: Alignment.center, 96 | child: Column( 97 | children: [ 98 | Text('SDKVersion: $_sdkVersion'), 99 | const SizedBox(height: 10), 100 | ElevatedButton( 101 | child: const Text('验证'), 102 | onPressed: () => _handleClickVerify(), 103 | ), 104 | const SizedBox(height: 10), 105 | ], 106 | ), 107 | ), 108 | Expanded( 109 | child: SingleChildScrollView( 110 | child: Column( 111 | mainAxisSize: MainAxisSize.max, 112 | mainAxisAlignment: MainAxisAlignment.start, 113 | crossAxisAlignment: CrossAxisAlignment.start, 114 | children: [ 115 | for (var log in _logs) 116 | Text( 117 | log, 118 | ), 119 | ], 120 | ), 121 | ), 122 | ), 123 | ], 124 | ), 125 | ), 126 | ), 127 | ); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.1" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.5" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" 70 | url: "https://pub.dev" 71 | source: hosted 72 | version: "2.0.2" 73 | flutter_tencent_captcha: 74 | dependency: "direct main" 75 | description: 76 | path: ".." 77 | relative: true 78 | source: path 79 | version: "0.1.2" 80 | flutter_test: 81 | dependency: "direct dev" 82 | description: flutter 83 | source: sdk 84 | version: "0.0.0" 85 | js: 86 | dependency: transitive 87 | description: 88 | name: js 89 | sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "0.6.7" 93 | lints: 94 | dependency: transitive 95 | description: 96 | name: lints 97 | sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "2.1.1" 101 | matcher: 102 | dependency: transitive 103 | description: 104 | name: matcher 105 | sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "0.12.15" 109 | material_color_utilities: 110 | dependency: transitive 111 | description: 112 | name: material_color_utilities 113 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "0.2.0" 117 | meta: 118 | dependency: transitive 119 | description: 120 | name: meta 121 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" 122 | url: "https://pub.dev" 123 | source: hosted 124 | version: "1.9.1" 125 | path: 126 | dependency: transitive 127 | description: 128 | name: path 129 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" 130 | url: "https://pub.dev" 131 | source: hosted 132 | version: "1.8.3" 133 | sky_engine: 134 | dependency: transitive 135 | description: flutter 136 | source: sdk 137 | version: "0.0.99" 138 | source_span: 139 | dependency: transitive 140 | description: 141 | name: source_span 142 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "1.9.1" 146 | stack_trace: 147 | dependency: transitive 148 | description: 149 | name: stack_trace 150 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.11.0" 154 | stream_channel: 155 | dependency: transitive 156 | description: 157 | name: stream_channel 158 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "2.1.1" 162 | string_scanner: 163 | dependency: transitive 164 | description: 165 | name: string_scanner 166 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.2.0" 170 | term_glyph: 171 | dependency: transitive 172 | description: 173 | name: term_glyph 174 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "1.2.1" 178 | test_api: 179 | dependency: transitive 180 | description: 181 | name: test_api 182 | sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "0.5.1" 186 | vector_math: 187 | dependency: transitive 188 | description: 189 | name: vector_math 190 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "2.1.4" 194 | sdks: 195 | dart: ">=3.0.0 <4.0.0" 196 | flutter: ">=3.3.0" 197 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_tencent_captcha_example 2 | description: Demonstrates how to use the flutter_tencent_captcha plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=2.12.0 <3.0.0" 10 | 11 | # Dependencies specify other packages that your package needs in order to work. 12 | # To automatically upgrade your package dependencies to the latest versions 13 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 14 | # dependencies can be manually updated by changing the version numbers below to 15 | # the latest version available on pub.dev. To see which dependencies have newer 16 | # versions available, run `flutter pub outdated`. 17 | dependencies: 18 | flutter: 19 | sdk: flutter 20 | 21 | flutter_tencent_captcha: 22 | # When depending on this package from a real application you should use: 23 | # flutter_tencent_captcha: ^x.y.z 24 | # See https://dart.dev/tools/pub/dependencies#version-constraints 25 | # The example app is bundled with the plugin so we use a path dependency on 26 | # the parent directory to use the current plugin's version. 27 | path: ../ 28 | 29 | # The following adds the Cupertino Icons font to your application. 30 | # Use with the CupertinoIcons class for iOS style icons. 31 | cupertino_icons: ^1.0.2 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | # The "flutter_lints" package below contains a set of recommended lints to 38 | # encourage good coding practices. The lint set provided by the package is 39 | # activated in the `analysis_options.yaml` file located at the root of your 40 | # package. See that file for information about deactivating specific lint 41 | # rules and activating additional ones. 42 | flutter_lints: ^2.0.0 43 | 44 | # For information on the generic Dart part of this file, see the 45 | # following page: https://dart.dev/tools/pub/pubspec 46 | 47 | # The following section is specific to Flutter packages. 48 | flutter: 49 | 50 | # The following line ensures that the Material Icons font is 51 | # included with your application, so that you can use the icons in 52 | # the material Icons class. 53 | uses-material-design: true 54 | 55 | # To add assets to your application, add an assets section, like this: 56 | # assets: 57 | # - images/a_dot_burr.jpeg 58 | # - images/a_dot_ham.jpeg 59 | 60 | # An image asset can refer to one or more resolution-specific "variants", see 61 | # https://flutter.dev/assets-and-images/#resolution-aware 62 | 63 | # For details regarding adding assets from package dependencies, see 64 | # https://flutter.dev/assets-and-images/#from-packages 65 | 66 | # To add custom fonts to your application, add a fonts section here, 67 | # in this "flutter" section. Each entry in this list should have a 68 | # "family" key with the font family name, and a "fonts" key with a 69 | # list giving the asset and other descriptors for the font. For 70 | # example: 71 | # fonts: 72 | # - family: Schyler 73 | # fonts: 74 | # - asset: fonts/Schyler-Regular.ttf 75 | # - asset: fonts/Schyler-Italic.ttf 76 | # style: italic 77 | # - family: Trajan Pro 78 | # fonts: 79 | # - asset: fonts/TrajanPro.ttf 80 | # - asset: fonts/TrajanPro_Bold.ttf 81 | # weight: 700 82 | # 83 | # For details regarding fonts from package dependencies, 84 | # see https://flutter.dev/custom-fonts/#from-packages 85 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_tencent_captcha_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/FlutterTencentCaptchaPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "TXCaptchaViewController.h" 3 | 4 | @interface FlutterTencentCaptchaPlugin : NSObject 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Classes/FlutterTencentCaptchaPlugin.m: -------------------------------------------------------------------------------- 1 | #import "FlutterTencentCaptchaPlugin.h" 2 | 3 | #define kScreenWidth [UIScreen mainScreen].bounds.size.width 4 | #define kScreenHeight [UIScreen mainScreen].bounds.size.height 5 | 6 | @implementation FlutterTencentCaptchaPlugin { 7 | FlutterEventSink _eventSink; 8 | NSString* captchaHtmlPath; 9 | } 10 | 11 | + (void)registerWithRegistrar:(NSObject*)registrar { 12 | FlutterMethodChannel* channel = [FlutterMethodChannel 13 | methodChannelWithName:@"flutter_tencent_captcha" 14 | binaryMessenger:[registrar messenger]]; 15 | 16 | 17 | NSString* captchaHtmlKey = [registrar lookupKeyForAsset:@"assets/captcha.html" fromPackage:@"flutter_tencent_captcha"]; 18 | NSString* captchaHtmlPath = [[NSBundle mainBundle] pathForResource:captchaHtmlKey ofType:nil]; 19 | 20 | FlutterTencentCaptchaPlugin* instance = [[FlutterTencentCaptchaPlugin alloc] initWithCaptchaHtmlPath:captchaHtmlPath]; 21 | 22 | [registrar addMethodCallDelegate:instance channel:channel]; 23 | 24 | FlutterEventChannel* eventChannel = 25 | [FlutterEventChannel eventChannelWithName:@"flutter_tencent_captcha/event_channel" 26 | binaryMessenger:[registrar messenger]]; 27 | [eventChannel setStreamHandler:instance]; 28 | } 29 | 30 | - (instancetype)initWithCaptchaHtmlPath:(NSString*)captchaHtmlPath 31 | { 32 | self = [super init]; 33 | if (self) { 34 | self->captchaHtmlPath = captchaHtmlPath; 35 | } 36 | return self; 37 | } 38 | 39 | 40 | - (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink { 41 | _eventSink = eventSink; 42 | 43 | return nil; 44 | } 45 | 46 | - (FlutterError*)onCancelWithArguments:(id)arguments { 47 | _eventSink = nil; 48 | 49 | return nil; 50 | } 51 | 52 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { 53 | if ([@"getSDKVersion" isEqualToString:call.method]) { 54 | [self handleMethodGetSDKVersion:call result:result]; 55 | } else if ([@"verify" isEqualToString:call.method]) { 56 | [self handleMethodVerify:call result:result]; 57 | } else { 58 | result(FlutterMethodNotImplemented); 59 | } 60 | } 61 | 62 | 63 | - (void)handleMethodGetSDKVersion:(FlutterMethodCall*)call 64 | result:(FlutterResult)result 65 | { 66 | NSString *sdkVersion = @"0.0.1"; 67 | 68 | result(sdkVersion); 69 | } 70 | 71 | - (void)handleMethodVerify:(FlutterMethodCall*)call 72 | result:(FlutterResult)result 73 | { 74 | UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController]; 75 | 76 | NSString *config = call.arguments[@"config"]; 77 | 78 | TXCaptchaViewController *controller = [[TXCaptchaViewController alloc] initWithConfig: config captchaHtmlPath:self->captchaHtmlPath]; 79 | [controller setModalPresentationStyle: UIModalPresentationOverFullScreen]; 80 | controller.onLoaded = ^(NSDictionary * _Nonnull data) { 81 | NSDictionary *eventData = @{ 82 | @"method": @"onLoaded", 83 | @"data": data, 84 | }; 85 | self->_eventSink(eventData); 86 | }; 87 | controller.onSuccess = ^(NSDictionary * _Nonnull data) { 88 | NSDictionary *eventData = @{ 89 | @"method": @"onSuccess", 90 | @"data": data, 91 | }; 92 | self->_eventSink(eventData); 93 | }; 94 | controller.onFail = ^(NSDictionary * _Nonnull data) { 95 | NSDictionary *eventData = @{ 96 | @"method": @"onFail", 97 | @"data": data, 98 | }; 99 | self->_eventSink(eventData); 100 | }; 101 | 102 | [rootViewController presentViewController:controller animated:NO completion:nil]; 103 | result([NSNumber numberWithBool:YES]); 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /ios/Classes/TXCaptchaViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TXCaptchaViewController.h 3 | // flutter_tencent_captcha 4 | // 5 | // Created by Lijy91 on 2020/8/3. 6 | // 7 | 8 | #import 9 | #import "TXCaptchaWebView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef void (^TXCaptchaCallback)(NSDictionary *data); 14 | 15 | @interface TXCaptchaViewController : UIViewController 16 | - (instancetype)initWithConfig:(NSString*)config captchaHtmlPath:(NSString*) path; 17 | 18 | @property (nonatomic, copy) TXCaptchaCallback onLoaded; 19 | @property (nonatomic, copy) TXCaptchaCallback onSuccess; 20 | @property (nonatomic, copy) TXCaptchaCallback onFail; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /ios/Classes/TXCaptchaViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TXCaptchaViewController.m 3 | // flutter_tencent_captcha 4 | // 5 | // Created by Lijy91 on 2020/8/3. 6 | // 7 | 8 | #import "TXCaptchaViewController.h" 9 | @import WebKit; 10 | 11 | @interface TXCaptchaViewController () 12 | @property (nonatomic, assign) NSString* captchaHtmlPath; 13 | @property (nonatomic, strong) NSString* configJsonString; 14 | @property (nonatomic, strong) TXCaptchaWebView* webView; 15 | @property (nonatomic, strong) WKWebViewConfiguration * webViewConfiguration; 16 | @end 17 | 18 | @implementation TXCaptchaViewController 19 | 20 | - (instancetype)initWithConfig:(NSString*)configJsonString captchaHtmlPath:(NSString*) path 21 | { 22 | self = [super init]; 23 | if (self) { 24 | self.configJsonString = configJsonString; 25 | self.captchaHtmlPath = path; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | 33 | self.view.backgroundColor = [UIColor clearColor]; 34 | 35 | self.webView = [[TXCaptchaWebView alloc] initWithFrame:self.view.frame configuration:self.webViewConfiguration]; 36 | self.webView.navigationDelegate = self; 37 | self.webView.UIDelegate = self; 38 | 39 | self.webView.backgroundColor = [UIColor clearColor]; 40 | self.webView.scrollView.backgroundColor = [UIColor clearColor]; 41 | self.webView.opaque = false; 42 | 43 | [self.view addSubview:self.webView]; 44 | } 45 | 46 | -(void)viewDidAppear:(BOOL)animated { 47 | [super viewDidAppear:animated]; 48 | 49 | NSURL* url = [NSURL fileURLWithPath:self.captchaHtmlPath]; 50 | 51 | if (@available(iOS 9.0, *)) { 52 | [self.webView loadFileURL:url allowingReadAccessToURL:url]; 53 | } else { 54 | // Fallback on earlier versions 55 | } 56 | } 57 | 58 | -(void)viewDidDisappear:(BOOL)animated { 59 | [super viewDidDisappear:animated]; 60 | self.webView = nil; 61 | self.webViewConfiguration = nil; 62 | } 63 | 64 | - (void)didReceiveMemoryWarning { 65 | [super didReceiveMemoryWarning]; 66 | // Dispose of any resources that can be recreated. 67 | } 68 | 69 | -(WKWebViewConfiguration*) webViewConfiguration { 70 | if (!_webViewConfiguration) { 71 | // Create WKWebViewConfiguration instance 72 | _webViewConfiguration = [[WKWebViewConfiguration alloc]init]; 73 | 74 | WKUserContentController* userContentController = [[WKUserContentController alloc] init]; 75 | [userContentController addScriptMessageHandler:self name:@"onLoaded"]; 76 | [userContentController addScriptMessageHandler:self name:@"onSuccess"]; 77 | [userContentController addScriptMessageHandler:self name:@"onFail"]; 78 | 79 | _webViewConfiguration.userContentController = userContentController; 80 | 81 | _webViewConfiguration.preferences.javaScriptEnabled = YES; 82 | _webViewConfiguration.preferences.javaScriptCanOpenWindowsAutomatically = YES; 83 | } 84 | return _webViewConfiguration; 85 | 86 | } 87 | 88 | #pragma mark -WKScriptMessageHandler 89 | - (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message { 90 | 91 | NSDictionary *messageBody = message.body; 92 | 93 | if ([message.name isEqualToString:@"onLoaded"]) { 94 | self.onLoaded(messageBody); 95 | } else if ([message.name isEqualToString:@"onSuccess"]) { 96 | self.onSuccess(messageBody); 97 | [self dismissViewControllerAnimated:NO completion:nil]; 98 | } else if ([message.name isEqualToString:@"onFail"]) { 99 | self.onFail(messageBody); 100 | [self dismissViewControllerAnimated:NO completion:nil]; 101 | } 102 | } 103 | 104 | #pragma mark - WKNavigationDelegate 105 | - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { 106 | NSString *jsCode = [NSString stringWithFormat:@"window._verify('%@');", self.configJsonString]; 107 | [self.webView evaluateJavaScript:jsCode completionHandler:^(id response, NSError * _Nullable error) { 108 | // skip 109 | }]; 110 | } 111 | 112 | - (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { 113 | [self dismissViewControllerAnimated:NO completion:nil]; 114 | } 115 | 116 | #pragma mark - WKUIDelegate 117 | - (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{ 118 | 119 | if (navigationAction.request.URL) { 120 | 121 | NSURL *url = navigationAction.request.URL; 122 | NSString *urlPath = url.absoluteString; 123 | if ([urlPath rangeOfString:@"https://"].location != NSNotFound || [urlPath rangeOfString:@"http://"].location != NSNotFound) { 124 | 125 | [[UIApplication sharedApplication] openURL:url]; 126 | } 127 | } 128 | return nil; 129 | } 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /ios/Classes/TXCaptchaWebView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TXCaptchaWebView.h 3 | // flutter_tencent_captcha 4 | // 5 | // Created by Lijy91 on 2020/8/5. 6 | // 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface TXCaptchaWebView : WKWebView 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /ios/Classes/TXCaptchaWebView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TXCaptchaWebView.m 3 | // flutter_tencent_captcha 4 | // 5 | // Created by Lijy91 on 2020/8/5. 6 | // 7 | 8 | #import "TXCaptchaWebView.h" 9 | 10 | @implementation TXCaptchaWebView 11 | 12 | -(UIEdgeInsets) safeAreaInsets { 13 | return UIEdgeInsetsMake(0,0,0,0); 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/flutter_tencent_captcha.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint flutter_tencent_captcha.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'flutter_tencent_captcha' 7 | s.version = '0.0.1' 8 | s.summary = 'A new flutter plugin project.' 9 | s.description = <<-DESC 10 | A new flutter plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.h' 18 | s.dependency 'Flutter' 19 | s.platform = :ios, '8.0' 20 | 21 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 22 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 23 | end 24 | -------------------------------------------------------------------------------- /lib/flutter_tencent_captcha.dart: -------------------------------------------------------------------------------- 1 | export 'tencent_captcha.dart'; 2 | export 'tencent_captcha_config.dart'; -------------------------------------------------------------------------------- /lib/tencent_captcha.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | import 'tencent_captcha_config.dart'; 6 | 7 | const _kMethodChannelName = 'flutter_tencent_captcha'; 8 | const _kEventChannelName = 'flutter_tencent_captcha/event_channel'; 9 | 10 | class TencentCaptcha { 11 | static const MethodChannel _methodChannel = 12 | MethodChannel(_kMethodChannelName); 13 | static const EventChannel _eventChannel = EventChannel(_kEventChannelName); 14 | 15 | static bool _eventChannelReadied = false; 16 | 17 | static String? sdkAppId; 18 | static Function(dynamic)? _verifyOnLoaded; 19 | static Function(dynamic)? _verifyOnSuccess; 20 | static Function(dynamic)? _verifyOnFail; 21 | 22 | static Future get sdkVersion async { 23 | final String sdkVersion = 24 | await _methodChannel.invokeMethod('getSDKVersion'); 25 | return sdkVersion; 26 | } 27 | 28 | static Future init(String appId) async { 29 | if (_eventChannelReadied != true) { 30 | _eventChannel.receiveBroadcastStream().listen(_handleVerifyOnEvent); 31 | _eventChannelReadied = true; 32 | } 33 | 34 | sdkAppId = appId; 35 | 36 | return true; 37 | } 38 | 39 | static Future verify({ 40 | TencentCaptchaConfig? config, 41 | Function(dynamic data)? onLoaded, 42 | Function(dynamic data)? onSuccess, 43 | Function(dynamic data)? onFail, 44 | }) async { 45 | _verifyOnLoaded = onLoaded; 46 | _verifyOnSuccess = onSuccess; 47 | _verifyOnFail = onFail; 48 | 49 | config ??= TencentCaptchaConfig(); 50 | config.appId ??= sdkAppId; 51 | 52 | return await _methodChannel.invokeMethod('verify', { 53 | 'config': json.encode(config.toJson()), 54 | }); 55 | } 56 | 57 | static _handleVerifyOnEvent(dynamic event) { 58 | String method = '${event['method']}'; 59 | dynamic data = event['data']; 60 | 61 | switch (method) { 62 | case 'onLoaded': 63 | if (_verifyOnLoaded != null) _verifyOnLoaded!(data); 64 | break; 65 | case 'onSuccess': 66 | if (_verifyOnSuccess != null) _verifyOnSuccess!(data); 67 | break; 68 | case 'onFail': 69 | if (_verifyOnFail != null) _verifyOnFail!(data); 70 | break; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/tencent_captcha_config.dart: -------------------------------------------------------------------------------- 1 | class TencentCaptchaConfig { 2 | String? appId; 3 | // 自定义透传参数,业务可用该字段传递少量数据,该字段的内容会被带入callback回调的对象中 4 | dynamic bizState; 5 | // 开启自适应深夜模式 6 | bool? enableDarkMode; 7 | // 示例 {"width": 140, "height": 140} 8 | // 移动端原生webview调用时传入,为设置的验证码弹框大小。 9 | Map? sdkOpts; 10 | 11 | TencentCaptchaConfig({ 12 | this.appId, 13 | this.bizState, 14 | this.enableDarkMode, 15 | this.sdkOpts, 16 | }); 17 | 18 | Map toJson() { 19 | Map jsonObject = {}; 20 | if (appId != null) jsonObject.putIfAbsent("appId", () => appId); 21 | if (bizState != null) jsonObject.putIfAbsent("bizState", () => bizState); 22 | if (enableDarkMode != null) { 23 | jsonObject.putIfAbsent("enableDarkMode", () => enableDarkMode); 24 | } 25 | if (sdkOpts != null) jsonObject.putIfAbsent("sdkOpts", () => sdkOpts); 26 | 27 | return jsonObject; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_tencent_captcha 2 | description: 适用于 Flutter 的腾讯云验证码插件 3 | version: 0.1.2 4 | homepage: https://github.com/leanflutter/flutter_tencent_captcha 5 | 6 | environment: 7 | sdk: ">=2.18.0 <4.0.0" 8 | flutter: ">=3.3.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | flutter_lints: ^2.0.0 18 | 19 | flutter: 20 | plugin: 21 | platforms: 22 | android: 23 | package: org.leanflutter.plugins.flutter_tencent_captcha 24 | pluginClass: FlutterTencentCaptchaPlugin 25 | ios: 26 | pluginClass: FlutterTencentCaptchaPlugin 27 | 28 | assets: 29 | - assets/captcha.html 30 | -------------------------------------------------------------------------------- /screenshots/flutter_tencent_captcha-android.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/screenshots/flutter_tencent_captcha-android.jpeg -------------------------------------------------------------------------------- /screenshots/flutter_tencent_captcha-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lijy91-archives-repos/flutter_tencent_captcha/25f2a729b4318a25b21f5d5f5d880951be19cd8e/screenshots/flutter_tencent_captcha-ios.png -------------------------------------------------------------------------------- /test/flutter_tencent_captcha_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_tencent_captcha/flutter_tencent_captcha.dart'; 4 | 5 | void main() { 6 | const MethodChannel channel = MethodChannel('flutter_tencent_captcha'); 7 | 8 | TestWidgetsFlutterBinding.ensureInitialized(); 9 | 10 | setUp(() { 11 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 12 | return '42'; 13 | }); 14 | }); 15 | 16 | tearDown(() { 17 | channel.setMockMethodCallHandler(null); 18 | }); 19 | 20 | test('getPlatformVersion', () async { 21 | expect(await TencentCaptcha.sdkVersion, '42'); 22 | }); 23 | } 24 | --------------------------------------------------------------------------------