├── ios
├── Assets
│ └── .gitkeep
├── Classes
│ ├── FlutterAlibcPlugin.h
│ ├── FlutterAlibcPlugin.m
│ ├── FlutterAlibcConstKey
│ │ └── FlutterAlibcConstKey.swift
│ ├── Tools
│ │ └── FlutterAlibcTools.swift
│ ├── SwiftFlutterAlibcPlugin.swift
│ └── WKWebView
│ │ └── AlibcWkWebView.swift
├── .gitignore
└── flutter_alibc.podspec
├── android
├── .idea
│ ├── .name
│ ├── .gitignore
│ ├── caches
│ │ └── build_file_checksums.ser
│ ├── compiler.xml
│ ├── vcs.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── gradle.xml
│ └── jarRepositories.xml
├── settings.gradle
├── gradle.properties
├── .gitignore
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ ├── gradle-wrapper
│ │ ├── gradle-cli-classpath.properties
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ ├── gradle-wrapper-classpath.properties
│ │ ├── org
│ │ │ └── gradle
│ │ │ │ ├── wrapper
│ │ │ │ ├── Logger.class
│ │ │ │ ├── Download.class
│ │ │ │ ├── Install.class
│ │ │ │ ├── Download$1.class
│ │ │ │ ├── IDownload.class
│ │ │ │ ├── Install$1.class
│ │ │ │ ├── PathAssembler.class
│ │ │ │ ├── WrapperExecutor.class
│ │ │ │ ├── GradleWrapperMain.class
│ │ │ │ ├── BootstrapMainStarter.class
│ │ │ │ ├── GradleUserHomeLookup.class
│ │ │ │ ├── WrapperConfiguration.class
│ │ │ │ ├── SystemPropertiesHandler.class
│ │ │ │ ├── ExclusiveFileAccessManager.class
│ │ │ │ ├── PathAssembler$LocalDistribution.class
│ │ │ │ └── Download$SystemPropertiesProxyAuthenticator.class
│ │ │ │ └── cli
│ │ │ │ ├── CommandLineOption.class
│ │ │ │ ├── CommandLineParser.class
│ │ │ │ ├── ParsedCommandLine.class
│ │ │ │ ├── CommandLineConverter.class
│ │ │ │ ├── CommandLineParser$1.class
│ │ │ │ ├── ParsedCommandLineOption.class
│ │ │ │ ├── AbstractCommandLineConverter.class
│ │ │ │ ├── CommandLineArgumentException.class
│ │ │ │ ├── CommandLineParser$AfterOptions.class
│ │ │ │ ├── CommandLineParser$OptionString.class
│ │ │ │ ├── CommandLineParser$ParserState.class
│ │ │ │ ├── CommandLineParser$OptionComparator.class
│ │ │ │ ├── CommandLineParser$OptionParserState.class
│ │ │ │ ├── ProjectPropertiesCommandLineConverter.class
│ │ │ │ ├── SystemPropertiesCommandLineConverter.class
│ │ │ │ ├── AbstractPropertiesCommandLineConverter.class
│ │ │ │ ├── CommandLineParser$AfterFirstSubCommand.class
│ │ │ │ ├── CommandLineParser$BeforeFirstSubCommand.class
│ │ │ │ ├── CommandLineParser$KnownOptionParserState.class
│ │ │ │ ├── CommandLineParser$MissingOptionArgState.class
│ │ │ │ ├── CommandLineParser$OptionAwareParserState.class
│ │ │ │ ├── CommandLineParser$OptionStringComparator.class
│ │ │ │ ├── CommandLineParser$UnknownOptionParserState.class
│ │ │ │ └── CommandLineParser$CaseInsensitiveStringComparator.class
│ │ └── build-receipt.properties
│ │ └── gradle-wrapper.properties
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── res
│ │ └── layout
│ │ │ └── webview_activity.xml
│ │ └── kotlin
│ │ └── com
│ │ └── wxwx
│ │ └── flutter_alibc
│ │ ├── PluginConstants.kt
│ │ ├── PluginResponse.kt
│ │ ├── PluginUtil.kt
│ │ ├── FlutterAlibcPlugin.kt
│ │ ├── web
│ │ └── WebViewActivity.kt
│ │ └── FlutterAlibcHandle.kt
├── build.gradle
├── gradlew.bat
└── gradlew
├── example
├── android
│ ├── settings_aar.gradle
│ ├── gradle.properties
│ ├── app
│ │ ├── release.keystore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── drawable
│ │ │ │ │ │ ├── yw_1222_baic.jpg
│ │ │ │ │ │ ├── yw_1222_baichuan.jpg
│ │ │ │ │ │ └── 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
│ │ │ │ │ ├── drawable-v21
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── values
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ └── values-night
│ │ │ │ │ │ └── styles.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── wxwx
│ │ │ │ │ │ └── flutter_alibc_example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ ├── proguard-rules.pro
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper
│ │ │ ├── gradle-cli-classpath.properties
│ │ │ ├── META-INF
│ │ │ │ └── MANIFEST.MF
│ │ │ ├── gradle-wrapper-classpath.properties
│ │ │ └── build-receipt.properties
│ │ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ ├── settings.gradle
│ └── build.gradle
├── ios
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── yw_1222_baichuan.jpg
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── 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-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── mtopsdk_configuration.plist
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── .gitignore
│ ├── Podfile
│ └── Podfile.lock
├── .metadata
├── README.md
├── .gitignore
├── test
│ └── widget_test.dart
├── pubspec.yaml
├── pubspec.lock
└── lib
│ └── main.dart
├── .idea
├── .gitignore
├── vcs.xml
├── misc.xml
├── libraries
│ ├── Flutter_Plugins.xml
│ └── Dart_SDK.xml
├── runConfigurations
│ └── example_lib_main_dart.xml
├── runConfigurations.xml
├── modules.xml
├── flutter_alibc.iml
└── workspace.xml
├── .gitignore
├── test
├── enum_test.dart
└── flutter_alibc_test.dart
├── .metadata
├── LICENSE
├── flutter_alibc.iml
├── CHANGELOG.md
├── .github
└── workflows
│ └── publish.yml
├── lib
├── alibc_const_key.dart
├── albc_tools.dart
├── alibc_model.dart
└── flutter_alibc.dart
├── pubspec.yaml
├── pubspec.lock
└── README.md
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/android/.idea/.name:
--------------------------------------------------------------------------------
1 | flutter_alibc
--------------------------------------------------------------------------------
/example/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'flutter_alibc'
2 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/android/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/app/release.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/android/app/release.keystore
--------------------------------------------------------------------------------
/example/ios/Runner/yw_1222_baichuan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/yw_1222_baichuan.jpg
--------------------------------------------------------------------------------
/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/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/gradle-cli-classpath.properties:
--------------------------------------------------------------------------------
1 | #module definition
2 | #Mon Dec 21 22:16:20 CET 2015
3 | projects=
4 | runtime=
5 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Implementation-Title: Gradle
3 | Implementation-Version: 2.10
4 |
5 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper/gradle-cli-classpath.properties:
--------------------------------------------------------------------------------
1 | #module definition
2 | #Mon Dec 21 22:16:20 CET 2015
3 | projects=
4 | runtime=
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/gradle-wrapper-classpath.properties:
--------------------------------------------------------------------------------
1 | #module definition
2 | #Mon Dec 21 22:16:44 CET 2015
3 | projects=gradle-cli
4 | runtime=
5 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Implementation-Title: Gradle
3 | Implementation-Version: 2.10
4 |
5 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper/gradle-wrapper-classpath.properties:
--------------------------------------------------------------------------------
1 | #module definition
2 | #Mon Dec 21 22:16:44 CET 2015
3 | projects=gradle-cli
4 | runtime=
5 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/yw_1222_baic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/android/app/src/main/res/drawable/yw_1222_baic.jpg
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/yw_1222_baichuan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/android/app/src/main/res/drawable/yw_1222_baichuan.jpg
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Logger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Logger.class
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Download.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Download.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Install.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Install.class
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Download$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Download$1.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/IDownload.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/IDownload.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Install$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Install$1.class
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineOption.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineOption.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/ParsedCommandLine.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/ParsedCommandLine.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/PathAssembler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/PathAssembler.class
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/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/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineConverter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineConverter.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$1.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/WrapperExecutor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/WrapperExecutor.class
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/android/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/GradleWrapperMain.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/GradleWrapperMain.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/ParsedCommandLineOption.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/ParsedCommandLineOption.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/BootstrapMainStarter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/BootstrapMainStarter.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/GradleUserHomeLookup.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/GradleUserHomeLookup.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/WrapperConfiguration.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/WrapperConfiguration.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/SystemPropertiesHandler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/SystemPropertiesHandler.class
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/AbstractCommandLineConverter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/AbstractCommandLineConverter.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineArgumentException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineArgumentException.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$AfterOptions.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$AfterOptions.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionString.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionString.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$ParserState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$ParserState.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/ExclusiveFileAccessManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/ExclusiveFileAccessManager.class
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/wxwx/flutter_alibc_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/test/enum_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_alibc/alibc_const_key.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 |
4 | main() {
5 | test('enum test', () {
6 | print(AlibcOpenType.values.toString());
7 | });
8 | }
9 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionComparator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionComparator.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionParserState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionParserState.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/PathAssembler$LocalDistribution.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/PathAssembler$LocalDistribution.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/ProjectPropertiesCommandLineConverter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/ProjectPropertiesCommandLineConverter.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/SystemPropertiesCommandLineConverter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/SystemPropertiesCommandLineConverter.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/AbstractPropertiesCommandLineConverter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/AbstractPropertiesCommandLineConverter.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$AfterFirstSubCommand.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$AfterFirstSubCommand.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$BeforeFirstSubCommand.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$BeforeFirstSubCommand.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$KnownOptionParserState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$KnownOptionParserState.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$MissingOptionArgState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$MissingOptionArgState.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionAwareParserState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionAwareParserState.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionStringComparator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$OptionStringComparator.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$UnknownOptionParserState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$UnknownOptionParserState.class
--------------------------------------------------------------------------------
/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.1.1-all.zip
6 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Download$SystemPropertiesProxyAuthenticator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/wrapper/Download$SystemPropertiesProxyAuthenticator.class
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$CaseInsensitiveStringComparator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_alibc/HEAD/android/gradle/wrapper/gradle-wrapper/org/gradle/cli/CommandLineParser$CaseInsensitiveStringComparator.class
--------------------------------------------------------------------------------
/.idea/libraries/Flutter_Plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/example/ios/Runner/mtopsdk_configuration.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DefaultID
6 | OPEN
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Classes/FlutterAlibcPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 | #import
5 | #import
6 | @interface FlutterAlibcPlugin : NSObject
7 | @end
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/example_lib_main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: 1d9032c7e1d867f071f2277eb1673e8f9b0274e3
8 | channel: stable
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/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 and should not be manually edited.
5 |
6 | version:
7 | revision: 1d9032c7e1d867f071f2277eb1673e8f9b0274e3
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper/build-receipt.properties:
--------------------------------------------------------------------------------
1 | buildNumber=none
2 | buildTimestamp=20151221211504+0000
3 | commitId=276bdcded730f53aa8c11b479986aafa58e124a6
4 | hostname=dev1.gradle.org
5 | isSnapshot=false
6 | javaVersion=1.7.0_02
7 | osName=Linux
8 | osVersion=3.13.0-62-generic
9 | project=gradle
10 | rcNumber=
11 | username=tcagent1
12 | versionBase=2.10
13 | versionNumber=2.10
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper/build-receipt.properties:
--------------------------------------------------------------------------------
1 | buildNumber=none
2 | buildTimestamp=20151221211504+0000
3 | commitId=276bdcded730f53aa8c11b479986aafa58e124a6
4 | hostname=dev1.gradle.org
5 | isSnapshot=false
6 | javaVersion=1.7.0_02
7 | osName=Linux
8 | osVersion=3.13.0-62-generic
9 | project=gradle
10 | rcNumber=
11 | username=tcagent1
12 | versionBase=2.10
13 | versionNumber=2.10
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/webview_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/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/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/wxwx/flutter_alibc/PluginConstants.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc
2 |
3 | class PluginConstants {
4 | companion object{
5 | var key_OpenType = "openType"
6 | var key_ClientType = "schemeType"
7 | var key_BackUrl = "backUrl"
8 | var key_NativeFailMode = "nativeFailMode"
9 |
10 | var Tmall_ClientType = "0"
11 | var TaoBao_ClientType = "1"
12 |
13 | var Auto_OpenType = "0"
14 | var Native_OpenType = "1"
15 |
16 | var JumpH5_FailMode = "0"
17 | var JumpDownloadPage_FailMode = "1"
18 | var None_FailMode = "2"
19 | }
20 | }
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/wxwx/flutter_alibc/PluginResponse.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc
2 |
3 | import java.util.*
4 |
5 | class PluginResponse constructor(var errorCode: String?, var errorMessage: String?, var data: Any?){
6 |
7 | companion object{
8 | fun success(obj: Any?): PluginResponse {
9 | return PluginResponse("0", "成功", obj)
10 | }
11 | }
12 |
13 | fun toMap(): Map? {
14 | val map = HashMap()
15 | map["errorCode"] = errorCode
16 | map["errorMessage"] = errorMessage
17 | map["data"] = data
18 | return map
19 | }
20 | }
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # flutter_alibc_example
2 |
3 | Demonstrates how to use the flutter_alibc 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://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/ios/Classes/FlutterAlibcPlugin.m:
--------------------------------------------------------------------------------
1 | #import "FlutterAlibcPlugin.h"
2 | #if __has_include()
3 | #import
4 | #else
5 | // Support project import fallback if the generated compatibility header
6 | // is not copied when this plugin is created as a library.
7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
8 | #import "flutter_alibc-Swift.h"
9 | #endif
10 |
11 | @implementation FlutterAlibcPlugin
12 | + (void)registerWithRegistrar:(NSObject*)registrar {
13 | [SwiftFlutterAlibcPlugin registerWithRegistrar:registrar];
14 | }
15 | @end
16 |
--------------------------------------------------------------------------------
/test/flutter_alibc_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 | import 'package:flutter_alibc/flutter_alibc.dart';
4 |
5 | void main() {
6 | const MethodChannel channel = MethodChannel('flutter_alibc');
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 FlutterAlibc.platformVersion, '42');
22 | });
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.4.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
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 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/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 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.idea/flutter_alibc.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ios/Classes/FlutterAlibcConstKey/FlutterAlibcConstKey.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FlutterAlibcConstKey.swift
3 | // flutter_alibc
4 | //
5 | // Created by xing.wu on 2021/5/15.
6 | //
7 |
8 | import Foundation
9 |
10 | struct FlutterAlibcConstKey {
11 | static let ErrorCode :String = "errorCode"
12 | static let ErrorMessage:String = "errorMessage"
13 | static let Data: String = "data"
14 | // 随便定义一个数组,如果等于他就是空
15 | static let EmptyNum : NSNumber = NSNumber(integerLiteral: 5285)
16 | // 定义一些返回用的方法名
17 | enum CallBackString:String{
18 | case AlibcTaobaoLogin = "AlibcTaobaoLogin"
19 | case AlibcTaokeLogin = "AlibcTaokeLogin"
20 | case AlibcTaokeLoginForCode = "AlibcTaokeLoginForCode"
21 | case AlibcOpenURL = "AlibcOpenURL"
22 | case AlibcOpenCar = "AlibcOpenCar"
23 | case AlibcOpenDetail = "AlibcOpenDetail"
24 | case AlibcOpenShop = "AlibcOpenShop"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | -keepattributes Signature
2 | -ignorewarnings
3 | -keep class javax.ws.rs.** { *; }
4 | -keep class com.alibaba.fastjson.** { *; }
5 | -dontwarn com.alibaba.fastjson.**
6 | -keep class sun.misc.Unsafe { *; }
7 | -dontwarn sun.misc.**
8 | -keep class com.taobao.** {*;}
9 | -keep class com.alibaba.** {*;}
10 | -keep class com.alipay.** {*;}
11 |
12 | -dontwarn com.taobao.**
13 | -dontwarn com.alibaba.**
14 | -dontwarn com.alipay.**
15 |
16 | -keep class com.ut.** {*;}
17 | -dontwarn com.ut.**
18 |
19 | -keep class com.ta.** {*;}
20 | -dontwarn com.ta.**
21 | -keep class org.json.** {*;}
22 | -keep class com.ali.auth.** {*;}
23 | -dontwarn com.ali.auth.**
24 |
25 | -keep class com.taobao.securityjni.** {*;}
26 | -keep class com.taobao.wireless.security.** {*;}
27 | -keep class com.taobao.dp.**{*;}
28 | -keep class com.alibaba.wireless.security.**{*;}
29 |
30 | -keep interface mtopsdk.mtop.global.init.IMtopInitTask {*;}
31 | -keep class * implements mtopsdk.mtop.global.init.IMtopInitTask {*;}
--------------------------------------------------------------------------------
/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 that Flutter provides. 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_alibc_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(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 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 FlutterTaoBaoKe
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 |
--------------------------------------------------------------------------------
/flutter_alibc.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 0.0.1
2 | 完成开发
3 | * TODO: Describe initial release.
4 | ## 0.0.2
5 | 修改readme
6 | ## 0.0.3
7 | Android 修正缺少的接口参数
8 |
9 | ## 0.0.4
10 |
11 | AndroidX 测试
12 |
13 | ## 0.0.5
14 | 1.修复Android与iOS逻辑不一致的地方
15 | 2.修复枚举混乱的问题
16 | 3.修复Android返回参数不正确的问题
17 | 4.通过openurl,openItem,openShop,openCart的返回值在失败的情况下,移除tradeFailResult这个失败的回调data(因为Android没有)
18 |
19 | ## 0.0.6
20 | 升级到百川V4.0.2版本
21 | 具体升级变动[百川官方更新说明](https://baichuan.taobao.com/docs/doc.htm?spm=a3c0d.7629140.0.0.749bbe48KRlbQC&treeId=129&articleId=106383&docType=1#s1)
22 |
23 | ## 0.0.7
24 | 1.修正iOS的回调,感谢[JarvanMo](https://github.com/JarvanMo)
25 | 2.修正iOS不传入backUrl导致的崩溃问题
26 | ## 0.0.8
27 | 新增二次授权获取accessToken用于二次授权登录
28 |
29 | ## 0.0.8
30 | 1.新增淘客登录返回token用于服务端二次登录
31 |
32 | ## 0.0.9
33 | 更新百川sdk到4.0.8
34 |
35 | ## 0.0.12
36 | iOS 更新到 4.0.1.0
37 | UIwebview换成Wkwebview
38 | Android4.0.0.8
39 |
40 | ## 0.0.13
41 | iOS 更新到 4.0.1.0
42 | UIwebview换成Wkwebview
43 | 支持swift
44 | Android4.0.0.8
45 |
46 | ## 0.0.14
47 | iOS 4.0.1.0
48 | Android4.0.0.8
49 | iOS的依赖不再保存百川的库了,请自行添加淘宝pod源拉取
50 |
51 |
52 | ## 0.0.15
53 | iOS升级
54 | iOS 4.0.1.6
55 | Android4.0.0.8
56 |
57 | ## 0.0.16
58 | iOS 4.0.1.6
59 | Android4.0.0.8
60 | 修复iOS在某些情况下第一次打开二次授权页面不正常的情况
61 | 来自:892371707的修复建议
62 |
63 | ## 0.0.17
64 | iOS 4.0.1.6
65 | Android4.0.0.8
66 | 重构
67 |
68 | ## 0.0.18
69 | 和17一样的代码,测试持续集成用
70 |
71 | ## 0.0.21-nullsafety
72 | 支持空安全
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish to Pub.dev
2 |
3 | # 触发时机
4 | on:
5 | push:
6 | tags:
7 | - '*'
8 |
9 | # 流程需要执行的任务
10 | jobs:
11 | # job名称
12 | publishing:
13 | # 跑在什么环境上
14 | runs-on: ubuntu-latest
15 |
16 | # 任务步骤
17 | steps:
18 |
19 | # 获取触发的tag
20 | # - name: Get version
21 | # id: get_version
22 | # run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
23 |
24 | # 拉代码
25 | - name: "checkout"
26 | uses: actions/checkout@v2
27 | with:
28 | # tag_name: ${{ steps.get_version.outputs.VERSION }}
29 | ref: ${{ github.ref }}
30 | # java环境
31 | # - name: "java环境"
32 | # uses: actions/setup-java@v1
33 | # with:
34 | # java-version: '12.x'
35 | # flutter环境
36 | - name: "flutter env"
37 | uses: subosito/flutter-action@v1
38 | with:
39 | channel: "stable"
40 | - run: flutter pub get
41 |
42 | # 发布插件
43 | # - name: ">>Dart package<<"
44 | # uses: k-paxian/dart-package-publisher@1.0
45 | # with:
46 | # accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
47 | # refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
48 | - name: Publish
49 | uses: sakebook/actions-flutter-pub-publisher@v1.3.1
50 | with:
51 | credential: ${{ secrets.CREDENTIAL_JSON }}
52 | skip_test: true
53 |
--------------------------------------------------------------------------------
/ios/flutter_alibc.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
3 | # Run `pod lib lint flutter_alibc.podspec` to validate before publishing.
4 | #
5 | Pod::Spec.new do |s|
6 | s.name = 'flutter_alibc'
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.dependency 'Flutter'
18 | s.dependency 'AlibcTradeSDK','4.0.1.15'
19 | s.dependency 'AliAuthSDK','1.1.0.41-bc'
20 | s.dependency 'mtopSDK','3.0.0.5'
21 | s.dependency 'securityGuard','5.4.191'
22 | s.dependency 'AliLinkPartnerSDK','4.0.0.24'
23 | s.dependency 'BCUserTrack','5.2.0.18-appkeys'
24 | s.dependency 'UTDID','1.5.0.91'
25 | s.dependency 'WindVane','8.5.0.46-bc11'
26 | s.platform = :ios, '8.0'
27 |
28 | s.frameworks = "CoreTelephony","CoreMotion","UIKit","Foundation"
29 | s.libraries = "z","c++","sqlite3.0"
30 | # Flutter.framework does not contain a i386 slice.
31 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
32 | s.swift_version = '5.0'
33 | end
34 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 | source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git'
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 | # use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/alibc_const_key.dart:
--------------------------------------------------------------------------------
1 | import 'package:collection/collection.dart' show IterableExtension;
2 | ///
3 | /// @Author: 无星
4 | /// @Date: 2019-08-30 15:55:44
5 | /// @Last Modified by: 无星
6 | /// @Last Modified time: 2019-08-30 17:17:07
7 | ///
8 |
9 | import 'package:flutter/foundation.dart';
10 |
11 | class AlibcConstKey {
12 | // 错误码
13 | static String errorCode = "errorCode";
14 | // 错误信息
15 | static String errorMessage = "errorMessage";
16 | // 平台,iOS为iOS,Android为Android
17 | static String platform = "platform";
18 | // result
19 | static String data = "data";
20 |
21 | static String platform_ios = "iOS";
22 | static String platform_andriod = "andriod";
23 | }
24 |
25 | /// 成功支付
26 | /// 成功添加到购物车
27 | enum TradeResultType {
28 | AlibcTradeResultTypePaySuccess,
29 | AlibcTradeResultTypeAddCard
30 | }
31 |
32 | /// 智能判断
33 | /// 强制拉端(手淘/天猫)
34 | enum AlibcOpenType { AlibcOpenTypeAuto, AlibcOpenTypeNative }
35 |
36 | // 拉起手淘失败后的处理策略
37 |
38 | // - AlibcNativeFailModeJumpH5: 当拉起手淘/天猫失败, 则在 webview 中跳转对应 H5 页面; 默认选项
39 | // - AlibcNativeFailModeJumpDownloadPage: 当拉起手淘/天猫失败, 则跳转对应 App 下载页面
40 | // - AlibcNativeFailModeNone: 当拉起手淘/天猫失败, 不做额外操作
41 | enum AlibcNativeFailMode {
42 | AlibcNativeFailModeJumpH5,
43 | AlibcNativeFailModeJumpDownloadPage,
44 | AlibcNativeFailModeNone
45 | }
46 | // 天猫
47 | // 淘宝
48 | enum AlibcSchemeType { AlibcSchemeTmall, AlibcSchemeTaoBao }
49 |
50 | enum CallBackType {
51 | AlibcTaobaoLogin,
52 | AlibcTaokeLogin,
53 | AlibcTaokeLoginForCode,
54 | AlibcOpenURL,
55 | AlibcOpenCar,
56 | AlibcOpenDetail,
57 | AlibcOpenShop
58 | }
59 |
60 | T? enumFromString(Iterable values, String value) {
61 | return values.firstWhereOrNull((type) => type.toString().split('.').last == value);
62 | }
63 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/wxwx/flutter_alibc/PluginUtil.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc
2 |
3 | import com.alibaba.baichuan.android.trade.model.OpenType
4 | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType
5 | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams
6 | import com.wxwx.flutter_alibc.PluginConstants.*
7 | import com.wxwx.flutter_alibc.PluginConstants.Companion as Constants
8 |
9 | class PluginUtil {
10 | companion object{
11 | fun getOpenType(open: String?): OpenType? {
12 | return if (Constants.Auto_OpenType == open) {
13 | OpenType.Auto
14 | } else {
15 | OpenType.Native
16 | }
17 | }
18 |
19 | fun getClientType(client: String): String? {
20 | return if (client == Constants.Tmall_ClientType) {
21 | "tmall"
22 | } else {
23 | "taobao"
24 | }
25 | }
26 |
27 | fun getFailModeType(mode: String?): AlibcFailModeType? {
28 | return if (Constants.JumpH5_FailMode == mode) {
29 | AlibcFailModeType.AlibcNativeFailModeJumpH5
30 | } else if (Constants.JumpDownloadPage_FailMode == mode) {
31 | AlibcFailModeType.AlibcNativeFailModeJumpDOWNLOAD
32 | } else {
33 | AlibcFailModeType.AlibcNativeFailModeNONE
34 | }
35 | }
36 |
37 | fun getTaokeParams(taokePar: Map): AlibcTaokeParams? {
38 | val pid = taokePar["pid"] as String?
39 | val taokeParams = AlibcTaokeParams("", "", "")
40 | if (pid != null) {
41 | taokeParams.setPid(pid)
42 | }
43 | val extParams = taokePar["extParams"]
44 | //TODO 其他参数待添加
45 | return taokeParams
46 | }
47 | }
48 |
49 | }
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/lib/albc_tools.dart:
--------------------------------------------------------------------------------
1 | ///
2 | /// @Description: 工具类
3 | /// @Author: wuxing
4 | /// @Date: 2019-09-06 22:51:22
5 | /// @LastEditors: wuxing
6 | /// @LastEditTime: 2019-09-06 22:52:48
7 | ///
8 |
9 | import 'alibc_const_key.dart';
10 | import 'alibc_model.dart';
11 |
12 | class AlibcTools {
13 | // -------------------------------------------//
14 | // --------这里是工具类,不要从这获取-------------//
15 | // -------------------------------------------//
16 |
17 | // 获取返回数据
18 | static TradeResult getTradeResult(Map result) {
19 | // 如果失败
20 | if (result[AlibcConstKey.errorCode] != "0") {
21 | return TradeResult(
22 | result[AlibcConstKey.errorCode],
23 | result[AlibcConstKey.errorMessage],
24 | );
25 | }
26 |
27 | // 判断类型
28 | if (result[AlibcConstKey.data]["type"] ==
29 | TradeResultType.AlibcTradeResultTypePaySuccess) {
30 | // 付款成功
31 | return TradeResult(
32 | result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage],
33 | type: TradeResultType.AlibcTradeResultTypePaySuccess,
34 | payResult: PayResult(
35 | result[AlibcConstKey.data]["paySuccessOrders"],
36 | result[AlibcConstKey.data]["payFailedOrders"],
37 | ));
38 | } else {
39 | // 添加购物车成功
40 | return TradeResult(
41 | result[AlibcConstKey.errorCode],
42 | result[AlibcConstKey.errorMessage],
43 | type: TradeResultType.AlibcTradeResultTypeAddCard,
44 | );
45 | }
46 | }
47 |
48 | // 设置淘宝客数据
49 | static Map? getTaokeMap(TaokeParams? taokeParams) {
50 | Map? taoKe;
51 | if (taokeParams != null) {
52 | taoKe = {
53 | "adzoneId": taokeParams.adzoneId ?? "",
54 | "pid": taokeParams.pid ?? "",
55 | "unionId": taokeParams.unionId ?? "",
56 | "subPid": taokeParams.subPid ?? "",
57 | "extParams": taokeParams.extParams ?? {}
58 | };
59 | }
60 | return taoKe;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AliAuthSDK (1.1.0.41-bc)
3 | - AlibcTradeSDK (4.0.1.15)
4 | - AliLinkPartnerSDK (4.0.0.24)
5 | - BCUserTrack (5.2.0.18-appkeys):
6 | - UTDID
7 | - Flutter (1.0.0)
8 | - flutter_alibc (0.0.1):
9 | - AliAuthSDK (= 1.1.0.41-bc)
10 | - AlibcTradeSDK (= 4.0.1.15)
11 | - AliLinkPartnerSDK (= 4.0.0.24)
12 | - BCUserTrack (= 5.2.0.18-appkeys)
13 | - Flutter
14 | - mtopSDK (= 3.0.0.5)
15 | - securityGuard (= 5.4.191)
16 | - UTDID (= 1.5.0.91)
17 | - WindVane (= 8.5.0.46-bc11)
18 | - mtopSDK (3.0.0.5)
19 | - securityGuard (5.4.191)
20 | - UTDID (1.5.0.91)
21 | - WindVane (8.5.0.46-bc11):
22 | - WindVane/Basic (= 8.5.0.46-bc11)
23 | - WindVane/Core (= 8.5.0.46-bc11)
24 | - WindVane/WindVane (= 8.5.0.46-bc11)
25 | - WindVane/Basic (8.5.0.46-bc11)
26 | - WindVane/Core (8.5.0.46-bc11)
27 | - WindVane/WindVane (8.5.0.46-bc11)
28 |
29 | DEPENDENCIES:
30 | - Flutter (from `Flutter`)
31 | - flutter_alibc (from `.symlinks/plugins/flutter_alibc/ios`)
32 |
33 | SPEC REPOS:
34 | http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git:
35 | - AliAuthSDK
36 | - AlibcTradeSDK
37 | - AliLinkPartnerSDK
38 | - BCUserTrack
39 | - mtopSDK
40 | - securityGuard
41 | - UTDID
42 | - WindVane
43 |
44 | EXTERNAL SOURCES:
45 | Flutter:
46 | :path: Flutter
47 | flutter_alibc:
48 | :path: ".symlinks/plugins/flutter_alibc/ios"
49 |
50 | SPEC CHECKSUMS:
51 | AliAuthSDK: 7018e8f3c8be3382e60f69d3b517c7de34c351e0
52 | AlibcTradeSDK: c7316224913498ea3d447386849cf0abf9e53fe6
53 | AliLinkPartnerSDK: c5778cdfdcee7bfe342238d39a77766184d36a46
54 | BCUserTrack: 49251c6fb7c65cbbc221a492bbd3f3e142f1fb0f
55 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
56 | flutter_alibc: 41b70776ad73e2dc99294b43967320755253dd17
57 | mtopSDK: 9458d64bb4143a4e3e057552526ed82536827879
58 | securityGuard: 9c04c44a3b663f36e15064042abfc107fa07133c
59 | UTDID: 7860884a89209c8f1306740ff22cf117d72b6d8a
60 | WindVane: 56e096abae757397ccd3accb66a959f3ffcbf949
61 |
62 | PODFILE CHECKSUM: bd1c75573ad4ab2d9dd61c2da7cd06af40ad01e8
63 |
64 | COCOAPODS: 1.10.1
65 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_alibc_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleURLTypes
22 |
23 |
24 | CFBundleTypeRole
25 | Editor
26 | CFBundleURLSchemes
27 |
28 | tbopen27822502
29 |
30 |
31 |
32 | CFBundleVersion
33 | $(FLUTTER_BUILD_NUMBER)
34 | LSApplicationQueriesSchemes
35 |
36 | tbopen
37 | tmall
38 | alitrip
39 | alipays
40 | fleamar
41 | youku
42 |
43 | LSRequiresIPhoneOS
44 |
45 | NSAppTransportSecurity
46 |
47 | NSAllowsArbitraryLoads
48 |
49 |
50 | UILaunchStoryboardName
51 | LaunchScreen
52 | UIMainStoryboardFile
53 | Main
54 | UISupportedInterfaceOrientations
55 |
56 | UIInterfaceOrientationPortrait
57 | UIInterfaceOrientationLandscapeLeft
58 | UIInterfaceOrientationLandscapeRight
59 |
60 | UISupportedInterfaceOrientations~ipad
61 |
62 | UIInterfaceOrientationPortrait
63 | UIInterfaceOrientationPortraitUpsideDown
64 | UIInterfaceOrientationLandscapeLeft
65 | UIInterfaceOrientationLandscapeRight
66 |
67 | UIViewControllerBasedStatusBarAppearance
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_alibc
2 | description: flutter_alibc,flutter版本的阿里百川,android V4.0.0.8 ios V4.0.1。更新日期:2021-5-15
3 | version: 0.0.21-nullsafety
4 | homepage: https://github.com/FlutterTaoBaoKe/flutter_alibc.git
5 |
6 | environment:
7 | sdk: '>=2.12.0 <3.0.0'
8 | flutter: ">=1.20.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 | collection: ^1.15.0-nullsafety.4
14 |
15 | dev_dependencies:
16 | flutter_test:
17 | sdk: flutter
18 |
19 | # For information on the generic Dart part of this file, see the
20 | # following page: https://dart.dev/tools/pub/pubspec
21 |
22 | # The following section is specific to Flutter.
23 | flutter:
24 | # This section identifies this Flutter project as a plugin project.
25 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily
26 | # be modified. They are used by the tooling to maintain consistency when
27 | # adding or updating assets for this project.
28 | plugin:
29 | platforms:
30 | android:
31 | package: com.wxwx.flutter_alibc
32 | pluginClass: FlutterAlibcPlugin
33 | ios:
34 | pluginClass: FlutterAlibcPlugin
35 |
36 | # To add assets to your plugin package, add an assets section, like this:
37 | # assets:
38 | # - images/a_dot_burr.jpeg
39 | # - images/a_dot_ham.jpeg
40 | #
41 | # For details regarding assets in packages, see
42 | # https://flutter.dev/assets-and-images/#from-packages
43 | #
44 | # An image asset can refer to one or more resolution-specific "variants", see
45 | # https://flutter.dev/assets-and-images/#resolution-aware.
46 |
47 | # To add custom fonts to your plugin package, add a fonts section here,
48 | # in this "flutter" section. Each entry in this list should have a
49 | # "family" key with the font family name, and a "fonts" key with a
50 | # list giving the asset and other descriptors for the font. For
51 | # example:
52 | # fonts:
53 | # - family: Schyler
54 | # fonts:
55 | # - asset: fonts/Schyler-Regular.ttf
56 | # - asset: fonts/Schyler-Italic.ttf
57 | # style: italic
58 | # - family: Trajan Pro
59 | # fonts:
60 | # - asset: fonts/TrajanPro.ttf
61 | # - asset: fonts/TrajanPro_Bold.ttf
62 | # weight: 700
63 | #
64 | # For details regarding fonts in packages, see
65 | # https://flutter.dev/custom-fonts/#from-packages
66 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
8 |
15 |
19 |
23 |
28 |
32 |
33 |
34 |
35 |
36 |
37 |
39 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.wxwx.flutter_alibc'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | ext.kotlin_version = '1.3.50'
6 | repositories {
7 | google()
8 | jcenter()
9 | maven{ url 'https://maven.aliyun.com/repository/google'}
10 | maven {
11 | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/"
12 | }
13 | }
14 |
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.4.0'
17 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
18 | }
19 | }
20 |
21 | rootProject.allprojects {
22 | repositories {
23 | google()
24 | jcenter()
25 | maven{ url 'https://maven.aliyun.com/repository/google'}
26 | maven {
27 | url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories/"
28 | }
29 | }
30 | }
31 |
32 | apply plugin: 'com.android.library'
33 | apply plugin: 'kotlin-android'
34 |
35 | android {
36 | compileSdkVersion 28
37 |
38 | sourceSets {
39 | main.java.srcDirs += 'src/main/kotlin'
40 | }
41 | defaultConfig {
42 | minSdkVersion 16
43 | }
44 | lintOptions {
45 | disable 'InvalidPackage'
46 | }
47 | }
48 |
49 | dependencies {
50 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
51 | implementation 'com.alibaba:fastjson:1.2.52'
52 | //security
53 | implementation 'com.taobao.android:securityguardaar3:5.4.171@aar'
54 | implementation 'com.taobao.android:securitybodyaar3:5.4.99@aar'
55 | implementation 'com.taobao.android:avmpaar3:5.4.36@aar'
56 | implementation 'com.taobao.android:sgmiddletieraar3:5.4.9@aar'
57 |
58 | //mtop
59 | implementation 'com.taobao.android:mtopsdk_allinone_open:3.1.2.5@jar'
60 |
61 | //appLink
62 | implementation 'com.alibaba.sdk.android:alibc_link_partner:4.1.15@aar'
63 |
64 | //core
65 | implementation 'com.alibaba.sdk.android:AlibcTradeCommon:4.0.0.16@aar'
66 | implementation 'com.alibaba.sdk.android:AlibcTradeBiz:4.0.0.16@aar'
67 | implementation 'com.alibaba.sdk.android:nb_trade:4.0.0.16@aar'
68 |
69 | //login
70 | implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.11@aar'
71 | implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.11@aar'
72 | implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.11@aar'
73 |
74 | //ut
75 | implementation 'com.taobao.android:utdid4all:1.5.2'
76 | implementation 'com.alibaba.mtl:app-monitor-sdk:2.6.4.5_for_bc'
77 | }
78 |
--------------------------------------------------------------------------------
/android/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_alibc_example
2 | description: Demonstrates how to use the flutter_alibc plugin.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `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:
12 | flutter:
13 | sdk: flutter
14 |
15 | flutter_alibc: 0.0.21-nullsafety
16 | # When depending on this package from a real application you should use:
17 | # flutter_alibc: ^x.y.z
18 | # See https://dart.dev/tools/pub/dependencies#version-constraints
19 | # The example app is bundled with the plugin so we use a path dependency on
20 | # the parent directory to use the current plugin's version.
21 | # path: ../
22 |
23 | # The following adds the Cupertino Icons font to your application.
24 | # Use with the CupertinoIcons class for iOS style icons.
25 | cupertino_icons: ^1.0.2
26 |
27 | dev_dependencies:
28 | flutter_test:
29 | sdk: flutter
30 |
31 | # For information on the generic Dart part of this file, see the
32 | # following page: https://dart.dev/tools/pub/pubspec
33 |
34 | # The following section is specific to Flutter.
35 | flutter:
36 |
37 | # The following line ensures that the Material Icons font is
38 | # included with your application, so that you can use the icons in
39 | # the material Icons class.
40 | uses-material-design: true
41 |
42 | # To add assets to your application, add an assets section, like this:
43 | # assets:
44 | # - images/a_dot_burr.jpeg
45 | # - images/a_dot_ham.jpeg
46 |
47 | # An image asset can refer to one or more resolution-specific "variants", see
48 | # https://flutter.dev/assets-and-images/#resolution-aware.
49 |
50 | # For details regarding adding assets from package dependencies, see
51 | # https://flutter.dev/assets-and-images/#from-packages
52 |
53 | # To add custom fonts to your application, add a fonts section here,
54 | # in this "flutter" section. Each entry in this list should have a
55 | # "family" key with the font family name, and a "fonts" key with a
56 | # list giving the asset and other descriptors for the font. For
57 | # example:
58 | # fonts:
59 | # - family: Schyler
60 | # fonts:
61 | # - asset: fonts/Schyler-Regular.ttf
62 | # - asset: fonts/Schyler-Italic.ttf
63 | # style: italic
64 | # - family: Trajan Pro
65 | # fonts:
66 | # - asset: fonts/TrajanPro.ttf
67 | # - asset: fonts/TrajanPro_Bold.ttf
68 | # weight: 700
69 | #
70 | # For details regarding fonts from package dependencies,
71 | # see https://flutter.dev/custom-fonts/#from-packages
72 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/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 30
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | defaultConfig {
36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37 | applicationId "com.wxwx.flutter_alibc_example"
38 | minSdkVersion 16
39 | targetSdkVersion 30
40 | versionCode flutterVersionCode.toInteger()
41 | versionName flutterVersionName
42 | }
43 |
44 | signingConfigs {
45 | debug {
46 | storeFile file("release.keystore")
47 | storePassword 'cater123'
48 | keyAlias 'release.keystore'
49 | keyPassword 'cater123'
50 | }
51 | release {
52 | storeFile file("release.keystore")
53 | storePassword 'cater123'
54 | keyAlias 'release.keystore'
55 | keyPassword 'cater123'
56 | }
57 | }
58 |
59 | buildTypes {
60 | debug{
61 | signingConfig signingConfigs.debug
62 | minifyEnabled true
63 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
64 | }
65 | release {
66 | // TODO: Add your own signing config for the release build.
67 | // Signing with the debug keys for now, so `flutter run --release` works.
68 | signingConfig signingConfigs.debug
69 | minifyEnabled true
70 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
71 | }
72 | }
73 | }
74 |
75 | flutter {
76 | source '../..'
77 | }
78 |
79 | dependencies {
80 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
81 | }
82 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/wxwx/flutter_alibc/FlutterAlibcPlugin.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc
2 |
3 | import android.os.Build
4 | import android.util.Log
5 | import io.flutter.embedding.engine.plugins.FlutterPlugin
6 | import io.flutter.embedding.engine.plugins.activity.ActivityAware
7 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
8 | import io.flutter.plugin.common.MethodCall
9 | import io.flutter.plugin.common.MethodChannel
10 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler
11 | import io.flutter.plugin.common.MethodChannel.Result
12 |
13 | /** FlutterAlibcPlugin */
14 | class FlutterAlibcPlugin: FlutterPlugin, MethodCallHandler, ActivityAware {
15 | /// The MethodChannel that will the communication between Flutter and native Android
16 | ///
17 | /// This local reference serves to register the plugin with the Flutter Engine and unregister it
18 | /// when the Flutter Engine is detached from the Activity
19 | private var channel : MethodChannel? = null
20 | private var handle: FlutterAlibcHandle? = null
21 |
22 | override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
23 | Log.e("FlutterAlibcPlugin", "onAttachedToEngine ")
24 | channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter_alibc")
25 | channel!!.setMethodCallHandler(this)
26 | handle = FlutterAlibcHandle(channel)
27 | }
28 |
29 | override fun onMethodCall(call: MethodCall, result: Result) {
30 | if (call.method == "getPlatformVersion") {
31 | result.success("Android " + Build.VERSION.RELEASE)
32 | } else if (call.method == "initAlibc") {
33 | handle?.initAlibc(result)
34 | } else if (call.method == "openItemDetail") {
35 | handle?.openItemDetail(call, result)
36 | } else if (call.method == "loginTaoBao") {
37 | handle?.loginTaoBao()
38 | } else if (call.method == "taoKeLogin") {
39 | handle?.taoKeLogin(call)
40 | } else if (call.method == "taoKeLoginForCode") {
41 | handle?.taoKeLoginForCode(call)
42 | } else if (call.method == "loginOut") {
43 | handle?.logoutTaoBao(result)
44 | } else if (call.method == "openByUrl") {
45 | handle?.openByUrl(call, result)
46 | } else if (call.method == "openShop") {
47 | handle?.openShop(call, result)
48 | } else if (call.method == "openCart") {
49 | handle?.openCart(call, result)
50 | } else if (call.method == "syncForTaoke") {
51 | handle?.syncForTaoke(call)
52 | } else if (call.method == "useAlipayNative") {
53 | handle?.useAlipayNative(call)
54 | } else {
55 | result.notImplemented()
56 | }
57 | }
58 |
59 | override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
60 | Log.e("FlutterAlibcPlugin", "onDetachedFromEngine ")
61 | channel?.setMethodCallHandler(null)
62 | handle?.disposed()
63 | }
64 |
65 | override fun onAttachedToActivity(binding: ActivityPluginBinding) {
66 | Log.e("FlutterAlibcPlugin", "onAttachedToActivity ")
67 | handle?.activity = binding.activity
68 | }
69 |
70 | override fun onDetachedFromActivityForConfigChanges() {
71 | }
72 |
73 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
74 | }
75 |
76 | override fun onDetachedFromActivity() {
77 | Log.e("FlutterAlibcPlugin", "onAttachedToActivity ")
78 | handle?.activity = null
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Classes/Tools/FlutterAlibcTools.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FlutterAlibcTools.swift
3 | // flutter_alibc
4 | //
5 | // Created by xing.wu on 2021/5/15.
6 | //
7 |
8 | import Foundation
9 |
10 | class FlutterAlibcTools: NSObject {
11 | class func isNil(_ string: String?) -> Bool {
12 | if string == nil {
13 | return true
14 | }
15 |
16 | if (string is NSNull) {
17 | return true
18 | }
19 | return (string?.trimmingCharacters(in: CharacterSet.whitespaces).count ?? 0) == 0
20 | }
21 |
22 | // Converted to Swift 5.1 by Swiftify v5.1.33915 - https://objectivec2swift.com/
23 | class func dictionary(withJsonString jsonString: String?) -> [AnyHashable : Any]? {
24 | if jsonString == nil {
25 | return nil
26 | }
27 |
28 | let jsonData = jsonString?.data(using: .utf8)
29 | var err: Error?
30 | var dic: [AnyHashable : Any]? = nil
31 | do {
32 | if let jsonData = jsonData {
33 | dic = try JSONSerialization.jsonObject(with: jsonData, options: .mutableContainers) as? [AnyHashable : Any]
34 | }
35 | } catch let err {
36 | }
37 | if err != nil {
38 | if let err = err {
39 | print("json解析失败:\(err)")
40 | }
41 | return nil
42 | }
43 | return dic
44 | }
45 |
46 | // Converted to Swift 5.1 by Swiftify v5.1.33915 - https://objectivec2swift.com/
47 | class func null(toNil obj: Any?) -> Any? {
48 | if (obj is NSNull) {
49 | return nil
50 | }
51 | return obj
52 | }
53 |
54 |
55 | class func changeType(_ myObj: Any?) -> Any? {
56 | if (myObj is [AnyHashable : Any]) {
57 | return self.nullDic(myObj as? [AnyHashable : Any])
58 | } else if (myObj is [AnyHashable]) {
59 | return self.nullArr(myObj as? [AnyHashable])
60 | } else if (myObj is String) {
61 | return self.string(to: myObj as? String)
62 | } else if (myObj is NSNull) {
63 | return self.nullToString()
64 | } else {
65 | return myObj
66 | }
67 | }
68 | // ------------------------------//
69 |
70 | // Converted to Swift 5.1 by Swiftify v5.1.33915 - https://objectivec2swift.com/
71 |
72 | //将NSDictionary中的Null类型的项目转化成@""
73 | class func nullDic(_ myDic: [AnyHashable : Any]?) -> [AnyHashable : Any]? {
74 | let keyArr = myDic?.keys
75 | var resDic: [AnyHashable : Any] = [:]
76 | // for i in 0..<(keyArr?.count ?? 0) {
77 | // var obj: Any? = nil
78 | // if let aKeyArr = keyArr?[i] {
79 | // obj = myDic?[aKeyArr]
80 | // }
81 | // obj = self.changeType(obj)
82 | // resDic[keyArr?[i]] = obj
83 | // }
84 | return resDic
85 | }
86 |
87 | //将NSArray中的Null类型的项目转化成@""
88 | class func nullArr(_ myArr: [AnyHashable]?) -> [AnyHashable]? {
89 | var resArr: [AnyHashable] = []
90 | for i in 0..<(myArr?.count ?? 0) {
91 | var obj = myArr?[i]
92 | obj = self.changeType(obj) as? AnyHashable
93 | if let obj = obj {
94 | resArr.append(obj)
95 | }
96 | }
97 | return resArr
98 | }
99 |
100 | //将NSString类型的原路返回
101 | class func string(to string: String?) -> String? {
102 | return string
103 | }
104 |
105 | //将Null类型的项目转化成@""
106 | class func nullToString() -> String? {
107 | // return @"";
108 | return ""
109 | }
110 |
111 |
112 | }
113 |
114 |
115 |
--------------------------------------------------------------------------------
/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 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.6.1"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.2.0"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: "direct main"
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.15.0"
46 | fake_async:
47 | dependency: transitive
48 | description:
49 | name: fake_async
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.2.0"
53 | flutter:
54 | dependency: "direct main"
55 | description: flutter
56 | source: sdk
57 | version: "0.0.0"
58 | flutter_test:
59 | dependency: "direct dev"
60 | description: flutter
61 | source: sdk
62 | version: "0.0.0"
63 | matcher:
64 | dependency: transitive
65 | description:
66 | name: matcher
67 | url: "https://pub.dartlang.org"
68 | source: hosted
69 | version: "0.12.10"
70 | meta:
71 | dependency: transitive
72 | description:
73 | name: meta
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "1.3.0"
77 | path:
78 | dependency: transitive
79 | description:
80 | name: path
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "1.8.0"
84 | sky_engine:
85 | dependency: transitive
86 | description: flutter
87 | source: sdk
88 | version: "0.0.99"
89 | source_span:
90 | dependency: transitive
91 | description:
92 | name: source_span
93 | url: "https://pub.dartlang.org"
94 | source: hosted
95 | version: "1.8.1"
96 | stack_trace:
97 | dependency: transitive
98 | description:
99 | name: stack_trace
100 | url: "https://pub.dartlang.org"
101 | source: hosted
102 | version: "1.10.0"
103 | stream_channel:
104 | dependency: transitive
105 | description:
106 | name: stream_channel
107 | url: "https://pub.dartlang.org"
108 | source: hosted
109 | version: "2.1.0"
110 | string_scanner:
111 | dependency: transitive
112 | description:
113 | name: string_scanner
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "1.1.0"
117 | term_glyph:
118 | dependency: transitive
119 | description:
120 | name: term_glyph
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.2.0"
124 | test_api:
125 | dependency: transitive
126 | description:
127 | name: test_api
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "0.3.0"
131 | typed_data:
132 | dependency: transitive
133 | description:
134 | name: typed_data
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.3.0"
138 | vector_math:
139 | dependency: transitive
140 | description:
141 | name: vector_math
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "2.1.0"
145 | sdks:
146 | dart: ">=2.12.0 <3.0.0"
147 | flutter: ">=1.20.0"
148 |
--------------------------------------------------------------------------------
/lib/alibc_model.dart:
--------------------------------------------------------------------------------
1 | // 初始化阿里百川的model
2 | import 'alibc_const_key.dart';
3 |
4 | class InitModel {
5 | // 错误码
6 | String? errorCode;
7 | // 错误信息
8 | String? errorMessage;
9 |
10 | InitModel(this.errorCode, this.errorMessage);
11 |
12 | InitModel.fromJson(Map map) {
13 | this.errorCode = map['errorCode'];
14 | this.errorMessage = map['errorMessage'];
15 | }
16 |
17 | Map toJson() {
18 | var data = new Map();
19 | data['errorCode'] = this.errorCode;
20 | data['errorMessage'] = this.errorMessage;
21 | return data;
22 | }
23 | }
24 |
25 | class LoginModel {
26 | // 错误码
27 | String? errorCode;
28 | // 错误信息
29 | String? errorMessage;
30 |
31 | UserModel? data;
32 |
33 | LoginModel(this.errorCode, this.errorMessage, {this.data});
34 |
35 | LoginModel.fromJson(Map map) {
36 | this.errorCode = map['errorCode'];
37 | this.errorMessage = map['errorMessage'];
38 | this.data = map['data'];
39 | }
40 |
41 | Map toJson() {
42 | var data = new Map();
43 | data['errorCode'] = this.errorCode;
44 | data['errorMessage'] = this.errorMessage;
45 | data['data'] = this.data;
46 | return data;
47 | }
48 | }
49 |
50 | // 用户信息
51 | class UserModel {
52 | // 用户昵称
53 | final String? nick;
54 | // 头像地址
55 | final String? avatarUrl;
56 | final String? openId;
57 | final String? openSid;
58 | final String? topAccessToken;
59 | final String? topAuthCode;
60 | UserModel(this.nick, this.avatarUrl, this.openId, this.openSid,
61 | this.topAccessToken, this.topAuthCode);
62 | }
63 |
64 | // 淘宝客的参数
65 | class TaokeParams {
66 | //有adzoneId则pid失效
67 | String? adzoneId;
68 | String? pid;
69 | String? unionId;
70 | String? subPid;
71 | Map? extParams;
72 | TaokeParams(
73 | {this.adzoneId, this.pid, this.unionId, this.subPid, this.extParams});
74 | }
75 |
76 | // url打开或者page打开等的数据
77 | class TradeResult {
78 | // 错误码,0为成功,非0为失败
79 | final String? errorCode;
80 | // 错误信息
81 | final String? errorMessage;
82 |
83 | TradeResultType? type;
84 |
85 | PayResult? payResult;
86 | // AddCardResult addCardResult;
87 | // Android没有,所以去掉
88 | // TradeFailResult tradeFailResult;
89 |
90 | TradeResult(
91 | this.errorCode,
92 | this.errorMessage, {
93 | this.type,
94 | this.payResult,
95 | // this.tradeFailResult,
96 | });
97 | }
98 |
99 | // 付款成功的result
100 | class PayResult {
101 | // 支付成功的订单
102 | final List? paySuccessOrders;
103 | // 支付失败的订单
104 | final List? payFailedOrders;
105 |
106 | PayResult(this.paySuccessOrders, this.payFailedOrders);
107 | }
108 |
109 | // 添加购物车成功的result
110 | // 因为没什么好返回的,所以不写
111 | // class AddCardResult {}
112 |
113 | // 失败,Android没有,所以去掉
114 | // class TradeFailResult {
115 | // // 失败的订单list
116 | // final List orderIdList;
117 |
118 | // TradeFailResult(this.orderIdList);
119 | // }
120 |
121 | // class TaoKeParams {
122 | // // 淘客ID
123 | // final String pid;
124 | // // 不知道什么id
125 | // final String subPid;
126 | // // 不知道什么id
127 | // final String unionId;
128 |
129 | // TaoKeParams(this.pid, this.subPid, this.unionId);
130 | // }
131 |
132 | // class TradeResult {
133 | // // 是否成功
134 | // final int openResultCode;
135 | // // 平台
136 | // final String platform;
137 | // // // 是否成功
138 | // // final bool isSuccessful;
139 | // // errorCode
140 | // final int errorCode;
141 | // // 错误信息
142 | // final String errorMessage;
143 | // // 打开配型
144 | // final TradeResultType tradeResultType;
145 | // // 成功付款商品
146 | // final List paySuccessOrders;
147 | // // 付款失败商品
148 | // final List payFailedOrders;
149 |
150 | // TradeResult({
151 | // this.openResultCode,
152 | // this.platform,
153 | // // this.isSuccessful,
154 | // this.errorCode,
155 | // this.errorMessage,
156 | // this.tradeResultType,
157 | // this.paySuccessOrders,
158 | // this.payFailedOrders
159 | // });
160 | // }
161 |
--------------------------------------------------------------------------------
/ios/Classes/SwiftFlutterAlibcPlugin.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 |
4 | public class SwiftFlutterAlibcPlugin: NSObject, FlutterPlugin {
5 |
6 | var alibchandler : FlutterAlibcHandle? = nil;
7 | public static func register(with registrar: FlutterPluginRegistrar) {
8 | let channel = FlutterMethodChannel(name: "flutter_alibc", binaryMessenger: registrar.messenger())
9 | let instance = SwiftFlutterAlibcPlugin()
10 | instance.alibchandler = FlutterAlibcHandle(channel: channel)
11 |
12 | registrar.addMethodCallDelegate(instance, channel: channel)
13 | registrar.addApplicationDelegate(instance)
14 | }
15 |
16 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
17 | // result("iOS " + UIDevice.current.systemVersion)
18 | if call.method == "getPlatformVersion"{
19 | result("iOS " + UIDevice.current.systemVersion)
20 | } else if call.method == "initAlibc"{
21 | alibchandler?.initAlibc(call: call, result: result)
22 | } else if call.method == "loginTaoBao" {
23 | alibchandler?.loginTaoBao(call: call, result: result)
24 | } else if call.method == "taoKeLogin" {
25 | alibchandler?.openByAsyncWebView(call: call, result: result, callBackString: FlutterAlibcConstKey.CallBackString.AlibcTaokeLogin.rawValue)
26 | } else if call.method == "loginOut" {
27 | alibchandler?.loginOut(call: call, result: result)
28 | } else if call.method == "taoKeLoginForCode" {
29 | alibchandler?.openByAsyncWebView(call: call, result: result, callBackString: FlutterAlibcConstKey.CallBackString.AlibcTaokeLoginForCode.rawValue)
30 | } else if call.method == "openByUrl" {
31 | alibchandler?.openByUrl(call: call, result: result, callBackString: FlutterAlibcConstKey.CallBackString.AlibcOpenURL.rawValue)
32 | } else if call.method == "openItemDetail"{
33 | alibchandler?.openItemDetail(call: call, result: result, callBackString: FlutterAlibcConstKey.CallBackString.AlibcOpenDetail.rawValue)
34 | } else if call.method == "openShop"{
35 | alibchandler?.openShop(call: call, result: result, callBackString: FlutterAlibcConstKey.CallBackString.AlibcOpenShop.rawValue)
36 | } else if call.method == "openCart"{
37 | alibchandler?.openCart(call: call, result: result, callBackString: FlutterAlibcConstKey.CallBackString.AlibcOpenCar.rawValue)
38 | } else if call.method == "syncForTaoke"{
39 | alibchandler?.syncForTaoke(call: call, result: result)
40 | } else if call.method == "useAlipayNative"{
41 | alibchandler?.useAlipayNative(call: call, result: result)
42 | }else{
43 | result(FlutterMethodNotImplemented)
44 | }
45 | }
46 |
47 | // MARK:- 百川处理应用跳转
48 | public func application(_ application: UIApplication, open url: URL, sourceApplication: String, annotation: Any) -> Bool {
49 | if !(AlibcTradeSDK.sharedInstance()?.application(application, open: url, sourceApplication: sourceApplication, annotation: annotation))! {
50 | return true
51 | }
52 | return false
53 | }
54 | //IOS9.0 系统新的处理openURL 的API
55 | public func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
56 | if #available(iOS 9.0, *) {
57 | var op : [String : Any] = [:];
58 | for (key,value) in options {
59 | op[key.rawValue] = value
60 | }
61 |
62 | // 转换
63 | let isHandledByALBBSDK : Bool = (AlibcTradeSDK.sharedInstance()?.application(application, open: url, options: op))!;
64 |
65 | // let isHandledByALBBSDK : Bool = (AlibcTradeSDK.sharedInstance()?.application(application, open: url, options:[:]))!
66 |
67 | return isHandledByALBBSDK
68 | } else {
69 | // Fallback on earlier versions
70 | //处理其他app跳转到自己的app,如果百川处理过会返回YES
71 | }
72 |
73 | return false
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/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 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.6.1"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.2.0"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.15.0"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.0.3"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.2.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_alibc:
66 | dependency: "direct main"
67 | description:
68 | name: flutter_alibc
69 | url: "https://pub.dartlang.org"
70 | source: hosted
71 | version: "0.0.21-nullsafety"
72 | flutter_test:
73 | dependency: "direct dev"
74 | description: flutter
75 | source: sdk
76 | version: "0.0.0"
77 | matcher:
78 | dependency: transitive
79 | description:
80 | name: matcher
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "0.12.10"
84 | meta:
85 | dependency: transitive
86 | description:
87 | name: meta
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.3.0"
91 | path:
92 | dependency: transitive
93 | description:
94 | name: path
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.8.0"
98 | sky_engine:
99 | dependency: transitive
100 | description: flutter
101 | source: sdk
102 | version: "0.0.99"
103 | source_span:
104 | dependency: transitive
105 | description:
106 | name: source_span
107 | url: "https://pub.dartlang.org"
108 | source: hosted
109 | version: "1.8.1"
110 | stack_trace:
111 | dependency: transitive
112 | description:
113 | name: stack_trace
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "1.10.0"
117 | stream_channel:
118 | dependency: transitive
119 | description:
120 | name: stream_channel
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "2.1.0"
124 | string_scanner:
125 | dependency: transitive
126 | description:
127 | name: string_scanner
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.1.0"
131 | term_glyph:
132 | dependency: transitive
133 | description:
134 | name: term_glyph
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.2.0"
138 | test_api:
139 | dependency: transitive
140 | description:
141 | name: test_api
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "0.3.0"
145 | typed_data:
146 | dependency: transitive
147 | description:
148 | name: typed_data
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.3.0"
152 | vector_math:
153 | dependency: transitive
154 | description:
155 | name: vector_math
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "2.1.0"
159 | sdks:
160 | dart: ">=2.12.0 <3.0.0"
161 | flutter: ">=1.20.0"
162 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/wxwx/flutter_alibc/web/WebViewActivity.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc.web
2 |
3 | import android.app.Activity
4 | import android.graphics.Bitmap
5 | import android.os.Bundle
6 | import android.util.Log
7 | import android.webkit.WebChromeClient
8 | import android.webkit.WebView
9 | import android.webkit.WebViewClient
10 | import com.alibaba.baichuan.android.trade.AlibcTrade
11 | import com.alibaba.baichuan.android.trade.callback.AlibcTradeCallback
12 | import com.alibaba.baichuan.android.trade.model.AlibcShowParams
13 | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType
14 | import com.alibaba.baichuan.trade.biz.context.AlibcTradeResult
15 | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams
16 | import com.wxwx.flutter_alibc.PluginUtil
17 | import com.wxwx.flutter_alibc.R
18 | import java.net.URLDecoder
19 | import java.util.*
20 | import com.wxwx.flutter_alibc.PluginConstants.Companion as Constants
21 |
22 | class WebViewActivity : Activity() {
23 | companion object{
24 | var callBack: Callback? = null
25 | }
26 |
27 | interface Callback {
28 | fun success(accessToken: String?)
29 | fun failed(errorMsg: String?)
30 | }
31 |
32 | override fun onDestroy() {
33 | callBack?.failed("取消授权")
34 | callBack = null
35 | super.onDestroy()
36 | }
37 |
38 | override fun onCreate(savedInstanceState: Bundle?) {
39 | super.onCreate(savedInstanceState)
40 | setContentView(R.layout.webview_activity)
41 | if (intent != null){
42 | val url = intent.getStringExtra("url") as String
43 | val arguments = intent.getSerializableExtra("arguments") as HashMap
44 | val webView = findViewById(R.id.webview)
45 | //启用支持JavaScript
46 | //启用支持JavaScript
47 | webView.settings.javaScriptEnabled = true
48 | //启用支持DOM Storage
49 | //启用支持DOM Storage
50 | webView.settings.domStorageEnabled = true
51 | openByUrl(url, webView, arguments)
52 | }
53 | }
54 |
55 | private fun openByUrl(url: String, webView: WebView, argument: HashMap) {
56 | val showParams = AlibcShowParams()
57 | var taokeParams: AlibcTaokeParams? = AlibcTaokeParams("", "", "")
58 | showParams.backUrl = argument[Constants.key_BackUrl].toString()
59 | if (argument[Constants.key_OpenType] != null) {
60 | showParams.openType = PluginUtil.getOpenType(argument[Constants.key_OpenType].toString())
61 | }
62 | if (argument[Constants.key_ClientType] != null) {
63 | showParams.clientType = PluginUtil.getClientType(argument[Constants.key_ClientType].toString())
64 | }
65 | if (argument["taokeParams"] != null) {
66 | taokeParams = PluginUtil.getTaokeParams(argument["taokeParams"] as HashMap)
67 | }
68 | if ("false" == argument["isNeedCustomNativeFailMode"]) {
69 | showParams.nativeOpenFailedMode = AlibcFailModeType.AlibcNativeFailModeNONE
70 | } else if (argument[Constants.key_NativeFailMode] != null) {
71 | showParams.nativeOpenFailedMode = PluginUtil.getFailModeType(argument[Constants.key_NativeFailMode].toString())
72 | }
73 | val trackParams: Map = HashMap()
74 | val client: WebViewClient = object : WebViewClient() {
75 | override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
76 | return false
77 | }
78 |
79 | override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
80 | Log.e("", "onPageStarted url : $url")
81 | super.onPageStarted(view, url, favicon)
82 |
83 | if (url?.contains("access_token=") == true && (url.contains("oauth.taobao.com") || url.contains("oauth.m.taobao.com"))) {
84 | val accessToken: String = getURLParam("access_token", url)
85 | Log.e("", "onPageStarted accessToken $accessToken")
86 | callBack?.success(accessToken)
87 | callBack = null
88 | finish()
89 | }
90 | if (url?.contains("code=") == true) {
91 | val code: String = getURLParam("code", url)
92 | Log.e("", "onPageStarted code $code")
93 | callBack?.success(code)
94 | callBack = null
95 | finish()
96 | }
97 | }
98 |
99 | override fun onPageFinished(view: WebView?, url: String?) {
100 | Log.e("", "onPageFinished url : $url")
101 | super.onPageFinished(view, url)
102 | }
103 |
104 | override fun onLoadResource(view: WebView?, url: String?) {
105 | super.onLoadResource(view, url)
106 | }
107 | }
108 | AlibcTrade.openByUrl(this@WebViewActivity, "", url, webView,
109 | client, WebChromeClient(),
110 | showParams, taokeParams, trackParams, object : AlibcTradeCallback {
111 | override fun onTradeSuccess(tradeResult: AlibcTradeResult) {} //不会回调
112 | override fun onFailure(code: Int, msg: String) {} //不会回调
113 | })
114 | }
115 |
116 | private fun getURLParam(paramKey: String, url: String): String {
117 | try {
118 | var startIndex = url.indexOf(paramKey)
119 | var subStr = url.substring(startIndex)
120 | val tempUrl = URLDecoder.decode(subStr, "UTF-8")
121 | var endIndex = tempUrl.indexOf("&")
122 | if (endIndex < 0) {
123 | endIndex = tempUrl.length
124 | }
125 | subStr = tempUrl.substring(0, endIndex)
126 | startIndex = subStr.indexOf("=")
127 | subStr = subStr.substring(startIndex + 1)
128 | return subStr
129 | } catch (e: Exception) {
130 | e.printStackTrace()
131 | }
132 | return ""
133 | }
134 | }
--------------------------------------------------------------------------------
/ios/Classes/WKWebView/AlibcWkWebView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AlibcWkWebView.swift
3 | // flutter_alibc
4 | //
5 | // Created by 吴兴 on 2021/5/15.
6 | //
7 |
8 | import Foundation
9 | import WebKit
10 |
11 | protocol AlibcWkWebViewDelegate : NSObject {
12 | func noticeToken(result:String)
13 | func noticeCode(result:String)
14 | }
15 |
16 | class AlibcWkWebView: UIViewController{
17 | // 同步调用的目的,是token还是code
18 | var fuctionType:String!
19 | var openUrl:String?
20 | var webview : WKWebView!
21 | var delegate: AlibcWkWebViewDelegate?
22 | init() {
23 | super.init(nibName: nil, bundle: nil)
24 | WVURLProtocolService.setSupportWKURLProtocol(true)
25 | self.webview = WKWebView.init(frame: view.frame)
26 | self.webview.autoresizingMask = [.flexibleWidth , .flexibleHeight]
27 | self.webview.scrollView.isScrollEnabled = true;
28 | self.webview.navigationDelegate = self
29 | // webview.addObserver(self, forKeyPath: "URL", optionsNSKeyValueObservingOptions.new, context: nil)
30 | // self.webview.backgroundColor = UIColor.red
31 | self.view.addSubview(webview)
32 | }
33 |
34 | required init?(coder: NSCoder) {
35 | fatalError("init(coder:) has not been implemented")
36 | }
37 |
38 |
39 | override func viewDidLoad() {
40 | super.viewDidLoad()
41 | //创建wkwebview
42 |
43 | self.title = "淘你喜欢"
44 | let doneBtn = UIButton(type: UIButton.ButtonType.system)
45 | doneBtn.setTitle("关闭", for: UIControl.State.normal)
46 | doneBtn.addTarget(self, action: #selector(doneBtnAction), for: UIControl.Event.touchUpInside)
47 | self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: doneBtn)
48 |
49 | self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView:doneBtn);
50 |
51 | // UIBarButtonItem.appearance().setTitlePositionAdjustment(UIOffset(horizontal: 0,vertical: -60), for: .default)
52 | //添加wkwebview
53 |
54 | }
55 | public func getWebView() -> WKWebView{
56 | return webview
57 | }
58 | // override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
59 | // print("url------------")
60 | // print("url------------")
61 | // print("处理")
62 | // }
63 |
64 | @objc private func doneBtnAction (){
65 | // 关闭
66 | // 拿到token了,该关闭当前页面了
67 | self.navigationController?.dismiss(animated: true, completion: {
68 | // 回调回去
69 | if self.fuctionType == "token" {
70 | self.delegate?.noticeToken(result: "")
71 | }else {
72 | self.delegate?.noticeCode(result: "")
73 | }
74 | })
75 | }
76 | }
77 |
78 | extension AlibcWkWebView : WKNavigationDelegate{
79 | func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
80 | decisionHandler(WKNavigationActionPolicy.allow)
81 | }
82 |
83 | func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
84 | print("页面开始加载")
85 | }
86 |
87 | func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) {
88 | print("重定向")
89 | }
90 |
91 | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
92 | print(webview.url?.absoluteString as Any)
93 | // 判断是否存在accesstoken或者code
94 | let urlStr = webview.url?.absoluteString
95 | var range: NSRange
96 | var rangeCode : NSRange
97 | range = (urlStr! as NSString).range(of: "access_token")
98 | rangeCode = (urlStr! as NSString).range(of: "code=")
99 | if range.location != NSNotFound {
100 | let accessString = (urlStr! as NSString).substring(from: range.location)
101 | // 截止到&
102 | let range2 = (accessString as NSString).range(of: "&")
103 |
104 | let access_token_string = (accessString as NSString).substring(with: NSRange(location: 0, length: range2.location))
105 | print(access_token_string)
106 | // 拿到token了,该关闭当前页面了
107 | self.navigationController?.dismiss(animated: true, completion: {
108 | // 回调回去
109 | self.delegate?.noticeToken(result: access_token_string)
110 | })
111 | }else if rangeCode.location != NSNotFound {
112 | var dic = [String:String]()
113 | let arr = urlStr!.components(separatedBy:"&")
114 | for item in arr {
115 | let arr2 = item.components(separatedBy:"=")
116 | let key = arr2[0]
117 | let val = arr2[1]
118 | dic[key] = val
119 | }
120 | let codeString = "code=" + dic["code"]!
121 |
122 | // 拿到token了,该关闭当前页面了
123 | self.navigationController?.dismiss(animated: true, completion: {
124 | // 回调回去
125 | self.delegate?.noticeCode(result: codeString)
126 | })
127 | }
128 | }
129 |
130 |
131 | // MARK:自签名证书信任
132 | func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
133 | if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {
134 | let card = URLCredential.init(trust: challenge.protectionSpace.serverTrust!)
135 | completionHandler(URLSession.AuthChallengeDisposition.useCredential,card)
136 | }
137 | }
138 |
139 | }
140 |
141 | extension AlibcWkWebView : WKScriptMessageHandler{
142 | func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
143 |
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_alibc
2 |
3 | Flutter版本的阿里百川
4 | android V4.0.0.8版本
5 | ios V4.0.1.6 版本
6 |
7 | pub地址:[flutter_alibc](https://pub.dev/packages/flutter_alibc)
8 | github地址:[flutter_alibc](https://github.com/FlutterTaoBaoKe/flutter_alibc.git)
9 |
10 | 可以给个star🐴,混口饭吃
11 |
12 | 支持Android和iOS
13 |
14 | 邮箱:
15 |
16 | Android:983598009@qq.com
17 |
18 | iOS:329106954@qq.com
19 | P.S:另有开普勒插件[flutter_kepler](https://github.com/FlutterTaoBaoKe/flutter_kepler)
20 | ## Getting Started
21 |
22 | ### 工程性配置
23 |
24 | 参考[阿里百川官网](https://baichuan.taobao.com/docs/doc.htm?spm=a3c0d.7629140.0.0.3043be48zxxuk5&treeId=129&articleId=118102&docType=1)
25 | Android: 注意在新版本gradle编译时,会强制校验远程仓库是否存在.pom文件, 阿里百川仓库目前缺少.pom文件, 因此目前先使用较低版本gradle
26 |
27 | ### 引入
28 | [如何引入项目](https://pub.dev/packages/flutter_alibc#-installing-tab-)
29 | iOS请在podfile文件非注释的第一行,加入淘宝源,如果有其他源,请放在其他源下方,没有其他源只需要加这一个即可
30 | ```
31 | source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git'
32 | ```
33 | 看不懂这句话就看下demo中的example/ios/podfile文件第4行代码,第3行是其他源的示例可以不加
34 |
35 | ### 支持swift了
36 | ### 感谢[@a4081675](https://github.com/a4081675)同学
37 | [issues44](https://github.com/FlutterTaoBaoKe/flutter_alibc/issues/44)
38 | ### 方法说明
39 | * 头文件引入
40 | ```
41 | import 'package:flutter_alibc/flutter_alibc.dart';
42 | ```
43 |
44 | * 初始化
45 |
46 | ```
47 | /**
48 | * 初始化
49 | * version:当前app版本
50 | * appName:当前app名称
51 | * result:{
52 | * errorCode, //0为初始化成功,其他为失败
53 | * errorMessage, //message
54 | * }
55 | */
56 | var result = await FlutterAlibc.initAlibc(version:"",appName:"");
57 | ```
58 |
59 | * 登录淘宝
60 | ```
61 | /**
62 | * 登录淘宝
63 | * result :{
64 | * errorCode, //0为初始化成功,其他为失败
65 | * errorMessage, //message
66 | * data:{ //登录成功的情况下返回data,为用户数据
67 | * //nick 用户昵称,avatarUrl 头像地址
68 | * nick,avatarUrl,openId,openSid,topAccessToken,topAuthCode
69 | * }
70 | * }
71 | * 备注:登录过会直接返回淘宝用户的信息,不会多次唤醒淘宝,请放心
72 | */
73 | FlutterAlibc.loginTaoBao(callback:(result){
74 | print("登录淘宝 ${result.data.nick} ${result.data.topAccessToken}");
75 | });
76 | ```
77 |
78 | * 淘宝登出
79 | ```
80 | FlutterAlibc.loginOut();
81 | ```
82 |
83 | * 淘客登录,二次授权获取access_token
84 |
85 | ```
86 | /**
87 | * @description: 获取access_token
88 | * @param
89 | * url:用于授权登录的url
90 | * openType:打开类型,默认auto
91 | * isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
92 | * nativeFailMode:唤端失败策略,默认None
93 | * schemeType:唤起哪个端,默认天猫
94 | * taokeParams:淘客数据
95 | * backUrl: 跳转回来的url
96 | * result: {"data":{"accessToken":"xxx"},"errorMessage":"成功","errorCode":"0"}//获取成功为token,获取失败为空字符串
97 | */
98 | FlutterAlibc.taoKeLogin(
99 | url:"", //必须参数,用于授权登录的url
100 | openType : AlibcOpenType.AlibcOpenTypeAuto,
101 | isNeedCustomNativeFailMode : false,
102 | nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
103 | schemeType : AlibcSchemeType.AlibcSchemeTmall,
104 | taokeParams : {},
105 | backUrl:"",
106 | callback: (result){
107 | print('淘客登录 ' + json.encode(result));
108 | });
109 | ```
110 |
111 | * 淘客登录,二次授权获取code
112 |
113 | ```
114 | /**
115 | * @description: 获取code
116 | * @param
117 | * url:用于授权登录的url
118 | * openType:打开类型,默认auto
119 | * isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
120 | * nativeFailMode:唤端失败策略,默认None
121 | * schemeType:唤起哪个端,默认天猫
122 | * taokeParams:淘客数据
123 | * backUrl: 跳转回来的url
124 | * result: {"data":{"code":"xxx"},"errorMessage":"成功","errorCode":"0"}//获取成功为code,获取失败为空字符串
125 | */
126 | FlutterAlibc.taoKeLoginForCode(
127 | url:"", //必须参数,用于授权登录的url
128 | openType : AlibcOpenType.AlibcOpenTypeAuto,
129 | isNeedCustomNativeFailMode : false,
130 | nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
131 | schemeType : AlibcSchemeType.AlibcSchemeTmall,
132 | taokeParams : {},
133 | backUrl:"",
134 | callback: (result){
135 | print('淘客登录 ' + json.encode(result));
136 | });
137 | ```
138 |
139 | * 唤起淘宝,openByUrl方式
140 |
141 | ```
142 | /**
143 | * @description: 通过url打开,包括h5,唤起手淘等
144 | * @param
145 | * url:目标url
146 | * openType:打开类型,默认auto
147 | * isNeedCustomNativeFailMode:是否需要设置唤端失败策略,默认false
148 | * nativeFailMode:唤端失败策略,默认None
149 | * schemeType:唤起哪个端,默认天猫
150 | * taokeParams:淘客数据
151 | * backUrl: 跳转回来的url
152 | * result: {
153 | * errorCode,
154 | * errorMessage,
155 | * type, //0为添加购物车,1为付款成功
156 | * payResult, //type为1时返回
157 | * }
158 | */
159 | FlutterAlibc.openByUrl(
160 | url:"", //必须参数
161 | openType : AlibcOpenType.AlibcOpenTypeAuto,
162 | isNeedCustomNativeFailMode : false,
163 | nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
164 | schemeType : AlibcSchemeType.AlibcSchemeTmall,
165 | taokeParams : {},
166 | backUrl:"",
167 | callback: (result){
168 | print('openByURL ' + json.encode(result));
169 | });
170 | ```
171 |
172 | * 唤起淘宝,openItemDetail方式
173 | ```
174 | /**
175 | * @description: 打开商品详情
176 | * @param
177 | * itemID 商品id,可以是真实的也可以是混淆的,必须参数
178 | * trackParam 需要额外追踪的业务数据
179 | * 其他同上
180 | * @return: 同openByUrl
181 | */
182 | FlutterAlibc.openItemDetail(
183 | itemID:"", //必须参数
184 | openType : AlibcOpenType.AlibcOpenTypeAuto,
185 | isNeedCustomNativeFailMode : false,
186 | nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
187 | schemeType : AlibcSchemeType.AlibcSchemeTmall,
188 | taokeParams : {},
189 | trackParam : {}, //需要额外追踪的业务数据
190 | backUrl:"",
191 | callback: (result){
192 | print('openItemDetail ' + json.encode(result));
193 | });
194 | ```
195 |
196 | * 打开店铺,openShop方式
197 | ```
198 | /**
199 | * @description: 打开店铺
200 | * @param
201 | * shopId 店铺id,必须参数
202 | * 其他同上
203 | * result: 同openByUrl
204 | */
205 | FlutterAlibc.openShop(
206 | shopId:"", //必须参数
207 | openType : AlibcOpenType.AlibcOpenTypeAuto,
208 | isNeedCustomNativeFailMode : false,
209 | nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
210 | schemeType : AlibcSchemeType.AlibcSchemeTmall,
211 | taokeParams : {},
212 | trackParam : {}, //需要额外追踪的业务数据
213 | backUrl:"",
214 | callback: (result){
215 | print('openShop ' + json.encode(result));
216 | });
217 | ```
218 |
219 | * 打开购物车,openCart方式
220 | ```
221 | /**
222 | * @description: 打开购物车
223 | * @param
224 | * 无必须参数
225 | * 其他同上
226 | * result: 同openByUrl
227 | */
228 | FlutterAlibc.openCart(
229 | openType : AlibcOpenType.AlibcOpenTypeAuto,
230 | isNeedCustomNativeFailMode : false,
231 | nativeFailMode : AlibcNativeFailMode.AlibcNativeFailModeNone,
232 | schemeType : AlibcSchemeType.AlibcSchemeTmall,
233 | taokeParams : {},
234 | trackParam : {}, //需要额外追踪的业务数据
235 | backUrl:"",
236 | callback: (result){
237 | print('openShop ' + json.encode(result));
238 | });
239 | ```
240 |
241 |
242 | * 是否设置同步打点
243 | ```
244 | FlutterAlibc.syncForTaoke(true);
245 | ````
246 |
247 | * 是否使用Native Alipay
248 | ```
249 | FlutterAlibc.useAlipayNative(true);
250 | ```
251 |
252 |
253 |
254 | [](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")
255 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter/services.dart';
6 | import 'package:flutter_alibc/alibc_const_key.dart';
7 | import 'package:flutter_alibc/alibc_model.dart';
8 | import 'package:flutter_alibc/flutter_alibc.dart';
9 |
10 | void main() => runApp(MyApp());
11 |
12 | class MyApp extends StatefulWidget {
13 | @override
14 | _MyAppState createState() => _MyAppState();
15 | }
16 |
17 | class _MyAppState extends State {
18 | String? _platformVersion = 'Unknown';
19 | String _info = '';
20 |
21 | List test() {
22 | return List.generate(2, (i) => '$i');
23 | }
24 |
25 | @override
26 | void initState() {
27 | super.initState();
28 | // FlutterAlibc.responseFromShare.listen((data) {
29 | // debugPrint(data);
30 | // });
31 | initPlatformState();
32 | }
33 |
34 | // Platform messages are asynchronous, so we initialize in an async method.
35 | Future initPlatformState() async {
36 | String? platformVersion;
37 | // Platform messages may fail, so we use a try/catch PlatformException.
38 | try {
39 | platformVersion = await FlutterAlibc.platformVersion;
40 | } on PlatformException {
41 | platformVersion = 'Failed to get platform version.';
42 | }
43 |
44 | // If the widget was removed from the tree while the asynchronous platform
45 | // message was in flight, we want to discard the reply rather than calling
46 | // setState to update our non-existent appearance.
47 | if (!mounted) return;
48 |
49 | setState(() {
50 | _platformVersion = platformVersion;
51 | });
52 |
53 | /* try {
54 | var initRes = await FlutterAlibc.initAlibc();
55 | } on Exception {}*/
56 |
57 | try {
58 | // var waite3s = await FlutterAlibc.openItemDetail(itemID: "12345");
59 | //var result = await FlutterAlibc.initAlibc();
60 | //print(result);
61 | } on Exception {}
62 | }
63 |
64 | @override
65 | Widget build(BuildContext context) {
66 | return MaterialApp(
67 | home: Scaffold(
68 | appBar: AppBar(
69 | title: const Text('Plugin example app'),
70 | ),
71 | body: Center(
72 | child: Column(
73 | children: [
74 | Container(
75 | child: Text('info: $_info'),
76 | ),
77 | TextButton(
78 | child: Text("初始化阿里百川"),
79 | onPressed: () async {
80 | try {
81 | // 如果什么都不给
82 | var result =
83 | await FlutterAlibc.initAlibc(version: '1', appName: "2");
84 | print(json.encode(result));
85 | setState(() {
86 | _info = json.encode(result);
87 | });
88 | } on Exception {}
89 | },
90 | ),
91 | TextButton(
92 | child: Text("登录淘宝"),
93 | onPressed: () async {
94 | FlutterAlibc.loginTaoBao(loginCallback: (result) {
95 | print(
96 | "登录淘宝 ${result.data?.nick} ${result.data?.topAccessToken}");
97 | setState(() {
98 | _info = json.encode(result);
99 | });
100 | });
101 | },
102 | ),
103 | TextButton(
104 | child: Text("登出淘宝"),
105 | onPressed: () {
106 | FlutterAlibc.loginOut();
107 | },
108 | ),
109 | TextButton(
110 | child: Text("淘客登录,二次授权"),
111 | onPressed: () async {
112 | FlutterAlibc.taoKeLogin(
113 | url:
114 | "https://oauth.taobao.com/authorize?response_type=token&client_id=27875713&state=1212&view=wap",
115 | openType: AlibcOpenType.AlibcOpenTypeNative,
116 | isNeedCustomNativeFailMode: true,
117 | nativeFailMode:
118 | AlibcNativeFailMode.AlibcNativeFailModeJumpH5,
119 | taokeCallback: (map) {
120 | print('淘客登录 ' + json.encode(map));
121 | setState(() {
122 | _info = json.encode(map);
123 | });
124 | });
125 | // print("access token ${result["accessToken"]}");
126 | },
127 | ),
128 | TextButton(
129 | child: Text("淘客登录,二次授权获取code"),
130 | onPressed: () async {
131 | ///redirect_uri 这里对应 开发者管理端 应用回调url demo设置的是 http://www.163.com
132 | var result = FlutterAlibc.taoKeLoginForCode(
133 | url:
134 | "https://oauth.taobao.com/authorize?response_type=code&client_id=27824900&redirect_uri=http://www.163.com&state=1212&view=web",
135 | openType: AlibcOpenType.AlibcOpenTypeNative,
136 | isNeedCustomNativeFailMode: true,
137 | taokeCallback: (map) {
138 | print('淘客登录 ' + json.encode(map));
139 | },
140 | nativeFailMode:
141 | AlibcNativeFailMode.AlibcNativeFailModeJumpH5);
142 | },
143 | ),
144 | TextButton(
145 | child: Text("唤起淘宝,openByUrl方式"),
146 | onPressed: () async {
147 | FlutterAlibc.openByUrl(
148 | url:
149 | "https://uland.taobao.com/coupon/edetail?e=0I2EBL%2BTWswGQASttHIRqRXxIesJCFV0jSsDEwaP11URqogtr65NL3IIxArmwXZQtYdj3OrQBBwJkllDQLUC%2B79fwBwwUiqlvyfAqbG%2BQWkG6QT52O7rmXYefz8NXcoYTJnbK5InWzlFfSAQOJJoy8NEaV3mm%2FQSzjZt5gElMznom9kMiklcP0KJ92VgfYGd&traceId=0b0d82cf15669814548736276e3d95&union_lens=lensId:0b0b6466_0c0d_16cd75f7c39_528f&xId=6MboRwsAi2s8Glbqt3lJLAwSlyrPyBLCZ01KOk6QzKCNhw8C6RjXgA1bNbZdKzp30gOqd1J5j1k7ei7HYId1QZ&ut_sk=1.utdid_null_1566981455011.TaoPassword-Outside.taoketop&sp_tk=77+lTU5nMllrdHRqSVLvv6U=",
150 | //backUrl: "tbopen27822502:https://h5.m.taobao.com",
151 | isNeedCustomNativeFailMode: true,
152 | nativeFailMode:
153 | AlibcNativeFailMode.AlibcNativeFailModeJumpH5,
154 | taokeParams: TaokeParams()
155 | ..pid = "mm_112883640_11584347_72287650277",
156 | callback: (result) {
157 | print(result);
158 | });
159 | },
160 | ),
161 | TextButton(
162 | child: Text("唤起淘宝,openItemDetail方式"),
163 | onPressed: () async {
164 | FlutterAlibc.openItemDetail(
165 | itemID: "575688730394",
166 | schemeType: AlibcSchemeType.AlibcSchemeTaoBao,
167 | isNeedCustomNativeFailMode: true,
168 | nativeFailMode:
169 | AlibcNativeFailMode.AlibcNativeFailModeJumpH5,
170 | callback: (result) {
171 | print(result);
172 | });
173 | },
174 | ),
175 | TextButton(
176 | child: Text("打开店铺,openShop方式"),
177 | onPressed: () async {
178 | FlutterAlibc.openShop(
179 | shopId: "71955116",
180 | callback: (result) {
181 | print(result);
182 | });
183 | },
184 | ),
185 | TextButton(
186 | child: Text("打开购物车,openCart方式"),
187 | onPressed: () async {
188 | FlutterAlibc.openCart(callback: (result) {
189 | print(result);
190 | });
191 | },
192 | ),
193 | TextButton(
194 | child: Text("允许打点"),
195 | onPressed: () {
196 | FlutterAlibc.syncForTaoke(true);
197 | },
198 | ),
199 | TextButton(
200 | child: Text("使用native Alipay"),
201 | onPressed: () {
202 | FlutterAlibc.useAlipayNative(true);
203 | },
204 | ),
205 | ],
206 | )),
207 | ),
208 | );
209 | }
210 | }
211 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | 1621051719593
70 |
71 |
72 | 1621051719593
73 |
74 |
75 |
76 |
77 |
78 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 | file://$PROJECT_DIR$/android/build.gradle
155 | 42
156 |
157 |
158 |
159 |
160 |
161 |
--------------------------------------------------------------------------------
/lib/flutter_alibc.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:ffi';
3 |
4 | import 'package:flutter/services.dart';
5 | import 'package:flutter_alibc/albc_tools.dart';
6 | import 'package:flutter_alibc/alibc_const_key.dart';
7 | import 'package:flutter_alibc/alibc_model.dart';
8 |
9 | typedef LoginCallback = void Function(LoginModel model);
10 | typedef OpenCallback = void Function(TradeResult model);
11 | typedef CommonCallback = void Function(Map map);
12 |
13 | class FlutterAlibc {
14 | // 通信的桥接类
15 | static final MethodChannel _channel = const MethodChannel("flutter_alibc")
16 | ..setMethodCallHandler(_platformCallHandler);
17 |
18 | static Map _callBackMaps = {
19 | CallBackType.AlibcTaobaoLogin: null,
20 | CallBackType.AlibcTaokeLogin: null,
21 | CallBackType.AlibcTaokeLoginForCode: null,
22 | CallBackType.AlibcOpenURL: null,
23 | CallBackType.AlibcOpenCar: null,
24 | CallBackType.AlibcOpenDetail: null,
25 | CallBackType.AlibcOpenShop: null,
26 | };
27 |
28 | static Future get platformVersion async {
29 | final String? version = await _channel.invokeMethod('getPlatformVersion');
30 | return version;
31 | }
32 |
33 | ///初始化
34 | ///version:当前app版本
35 | ///appName:当前app名称
36 | ///result:{
37 | /// errorCode, //0为初始化成功,其他为失败
38 | /// errorMessage, //message
39 | ///}
40 | static Future initAlibc({String? version, String? appName}) async {
41 | Map result = await _channel
42 | .invokeMethod("initAlibc", {"version": version, "appName": appName});
43 | return InitModel(
44 | result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage]);
45 | }
46 |
47 | ///
48 | /// @description: 登录淘宝
49 | ///
50 | /// @return: 成功则返回的data为用户信息,失败则没有data
51 | ///
52 | static void loginTaoBao({required LoginCallback loginCallback}) async {
53 | _channel.invokeMethod("loginTaoBao");
54 | _callBackMaps[CallBackType.AlibcTaobaoLogin] = loginCallback;
55 | // 判断成功还是失败
56 | }
57 |
58 | ///
59 | /// @description: 退出淘宝登录
60 | /// @param {type}
61 | /// @return:
62 | ///
63 | static loginOut() {
64 | _channel.invokeMethod("loginOut");
65 | }
66 |
67 | ///
68 | /// @description: 渠道授权,获取access_token
69 | /// 「对应官方文档【Client-side flow】方式」 {https://open.taobao.com/doc.htm?docId=118&docType=1}
70 | /// @param {type}
71 | /// @return:
72 | /// Map
73 | static void taoKeLogin(
74 | {required String url,
75 | AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto,
76 | bool isNeedCustomNativeFailMode = false,
77 | AlibcNativeFailMode nativeFailMode =
78 | AlibcNativeFailMode.AlibcNativeFailModeNone,
79 | AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTaoBao,
80 | TaokeParams? taokeParams,
81 | String? backUrl,
82 | required CommonCallback taokeCallback}) async {
83 | Map? taoKe = AlibcTools.getTaokeMap(taokeParams);
84 | _channel.invokeMethod("taoKeLogin", {
85 | "url": url,
86 | "openType": openType.index,
87 | "isNeedCustomNativeFailMode": isNeedCustomNativeFailMode,
88 | "nativeFailMode": nativeFailMode.index,
89 | "schemeType": schemeType.index,
90 | "taokeParams": taoKe,
91 | "backUrl": backUrl,
92 | });
93 | _callBackMaps[CallBackType.AlibcTaokeLogin] = taokeCallback;
94 | }
95 |
96 | ///
97 | /// @description: 关闭淘客登录的webview
98 | /// @param {type}
99 | /// @return:
100 | ///
101 | static closeAlibcWebview() {
102 | _channel.invokeMethod("closeAlibcWebview");
103 | }
104 |
105 | ///
106 | /// @description: 渠道授权,获取 code 授权码
107 | /// 「对应官方文档【Server-side flow】方式」 {https://open.taobao.com/doc.htm?docId=118&docType=1}
108 | /// @param {type}
109 | /// @return:
110 | /// Map
111 | static void taoKeLoginForCode({
112 | required String url,
113 | AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto,
114 | bool isNeedCustomNativeFailMode = false,
115 | AlibcNativeFailMode nativeFailMode =
116 | AlibcNativeFailMode.AlibcNativeFailModeNone,
117 | AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTaoBao,
118 | TaokeParams? taokeParams,
119 | String? backUrl,
120 | required CommonCallback taokeCallback,
121 | }) async {
122 | Map? taoKe = AlibcTools.getTaokeMap(taokeParams);
123 | _channel.invokeMethod("taoKeLoginForCode", {
124 | "url": url,
125 | "openType": openType.index,
126 | "isNeedCustomNativeFailMode": isNeedCustomNativeFailMode,
127 | "nativeFailMode": nativeFailMode.index,
128 | "schemeType": schemeType.index,
129 | "taokeParams": taoKe,
130 | "backUrl": backUrl
131 | });
132 | _callBackMaps[CallBackType.AlibcTaokeLoginForCode] = taokeCallback;
133 | }
134 |
135 | static Future _platformCallHandler(MethodCall call) async {
136 | var argu = call.arguments;
137 | print(
138 | 'call.name ${call.method} call.arguments ${call.arguments.toString()}');
139 | CallBackType? type = enumFromString(CallBackType.values, call.method);
140 | print(argu.runtimeType.toString());
141 | var temp = Map();
142 | (argu as Map).forEach((key, value) {
143 | temp['$key'] = value;
144 | });
145 | switch (type) {
146 | case CallBackType.AlibcTaobaoLogin:
147 | argu = LoginModel(
148 | argu[AlibcConstKey.errorCode], argu[AlibcConstKey.errorMessage],
149 | data: UserModel(
150 | argu[AlibcConstKey.data]["nick"],
151 | argu[AlibcConstKey.data]["avatarUrl"],
152 | argu[AlibcConstKey.data]["openId"],
153 | argu[AlibcConstKey.data]["openSid"],
154 | argu[AlibcConstKey.data]["topAccessToken"],
155 | argu[AlibcConstKey.data]["topAuthCode"]));
156 | break;
157 | case CallBackType.AlibcTaokeLogin:
158 | case CallBackType.AlibcTaokeLoginForCode:
159 | //暂时不转换类型
160 | argu = temp;
161 | break;
162 | case CallBackType.AlibcOpenURL:
163 | case CallBackType.AlibcOpenCar:
164 | case CallBackType.AlibcOpenDetail:
165 | case CallBackType.AlibcOpenShop:
166 | TradeResult tradeResult = AlibcTools.getTradeResult(temp);
167 | argu = tradeResult;
168 | break;
169 | default:
170 | print("unsupport method handler");
171 | return;
172 | }
173 | Function? f = _callBackMaps[type];
174 | if (f != null) {
175 | f(argu);
176 | _callBackMaps[type!] = null;
177 | }
178 | }
179 |
180 | ///
181 | /// @description: 通过url打开,包括h5,唤起手淘等
182 | /// @param
183 | /// url:目标url
184 | /// openType:打开类型
185 | /// isNeedCustomNativeFailMode:是否需要设置唤端失败策略
186 | /// nativeFailMode:唤端失败策略
187 | /// schemeType:唤起哪个端
188 | /// taokeParams:淘客数据
189 | /// backUrl: 跳转回来的url
190 | /// @return:
191 | ///
192 | static void openByUrl({
193 | required String url,
194 | AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto,
195 | bool isNeedCustomNativeFailMode = false,
196 | AlibcNativeFailMode nativeFailMode =
197 | AlibcNativeFailMode.AlibcNativeFailModeNone,
198 | AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall,
199 | TaokeParams? taokeParams,
200 | String? backUrl,
201 | OpenCallback? callback,
202 | }) async {
203 | Map? taoKe = AlibcTools.getTaokeMap(taokeParams);
204 | _channel.invokeMethod("openByUrl", {
205 | "url": url,
206 | "openType": openType.index,
207 | "isNeedCustomNativeFailMode": isNeedCustomNativeFailMode,
208 | "nativeFailMode": nativeFailMode.index,
209 | "schemeType": schemeType.index,
210 | "taokeParams": taoKe,
211 | "backUrl": backUrl
212 | });
213 | _callBackMaps[CallBackType.AlibcOpenURL] = callback;
214 | }
215 |
216 | ///
217 | /// @description: 打开商品详情
218 | /// @param
219 | /// 同上
220 | /// itemID 商品id,可以是真实的也可以是混淆的
221 | /// isNeedPush iOS独占
222 | /// @return:
223 | ///
224 | static void openItemDetail(
225 | {required String itemID,
226 | // iOS独占
227 | // bool isNeedPush = false,
228 | AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto,
229 | bool isNeedCustomNativeFailMode = false,
230 | AlibcNativeFailMode nativeFailMode =
231 | AlibcNativeFailMode.AlibcNativeFailModeNone,
232 | AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall,
233 | TaokeParams? taokeParams,
234 | // 额外需要追踪的业务数据
235 | Map? trackParam,
236 | String? backUrl,
237 | OpenCallback? callback}) async {
238 | Map? taoKe = AlibcTools.getTaokeMap(taokeParams);
239 | _channel.invokeMethod("openItemDetail", {
240 | "itemID": itemID,
241 | // "isNeedPush": isNeedPush,
242 | "openType": openType.index,
243 | "isNeedCustomNativeFailMode": isNeedCustomNativeFailMode,
244 | "nativeFailMode": nativeFailMode.index,
245 | "schemeType": schemeType.index,
246 | "taokeParams": taoKe,
247 | "trackParam": trackParam,
248 | "backUrl": backUrl
249 | });
250 | _callBackMaps[CallBackType.AlibcOpenDetail] = callback;
251 | }
252 |
253 | ///
254 | /// @description: 打开店铺
255 | /// @param {type}
256 | /// shopId 店铺id
257 | /// @return:
258 | ///
259 | static void openShop(
260 | {required String shopId,
261 | // iOS独占
262 | // bool isNeedPush = false,
263 | AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto,
264 | bool isNeedCustomNativeFailMode = false,
265 | AlibcNativeFailMode nativeFailMode =
266 | AlibcNativeFailMode.AlibcNativeFailModeNone,
267 | AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall,
268 | TaokeParams? taokeParams,
269 | // 额外需要追踪的业务数据
270 | Map? trackParam,
271 | String? backUrl,
272 | OpenCallback? callback}) async {
273 | Map? taoKe = AlibcTools.getTaokeMap(taokeParams);
274 |
275 | _channel.invokeMethod("openShop", {
276 | "shopId": shopId,
277 | // "isNeedPush": isNeedPush,
278 | "openType": openType.index,
279 | "isNeedCustomNativeFailMode": isNeedCustomNativeFailMode,
280 | "nativeFailMode": nativeFailMode.index,
281 | "schemeType": schemeType.index,
282 | "taokeParams": taoKe,
283 | "trackParam": trackParam,
284 | "backUrl": backUrl
285 | });
286 | _callBackMaps[CallBackType.AlibcOpenShop] = callback;
287 | }
288 |
289 | ///
290 | /// @description: 打开购物车
291 | /// @param {type}
292 | /// @return:
293 | ///
294 | static void openCart(
295 | {
296 | // iOS独占
297 | // bool isNeedPush = false,
298 | AlibcOpenType openType = AlibcOpenType.AlibcOpenTypeAuto,
299 | bool isNeedCustomNativeFailMode = false,
300 | AlibcNativeFailMode nativeFailMode =
301 | AlibcNativeFailMode.AlibcNativeFailModeNone,
302 | AlibcSchemeType schemeType = AlibcSchemeType.AlibcSchemeTmall,
303 | TaokeParams? taokeParams,
304 | // 额外需要追踪的业务数据
305 | Map? trackParam,
306 | String? backUrl,
307 | OpenCallback? callback}) async {
308 | Map? taoKe = AlibcTools.getTaokeMap(taokeParams);
309 |
310 | _channel.invokeMethod("openCart", {
311 | // "isNeedPush": isNeedPush,
312 | "openType": openType.index,
313 | "isNeedCustomNativeFailMode": isNeedCustomNativeFailMode,
314 | "nativeFailMode": nativeFailMode.index,
315 | "schemeType": schemeType.index,
316 | "taokeParams": taoKe,
317 | "trackParam": trackParam,
318 | "backUrl": backUrl
319 | });
320 | _callBackMaps[CallBackType.AlibcOpenCar] = callback;
321 | }
322 |
323 | // 是否需要设置打点
324 | static syncForTaoke(bool isSync) {
325 | _channel.invokeMethod("syncForTaoke", {"isSync": isSync});
326 | }
327 |
328 | // 是否需要 Native AliPay 接口
329 | static useAlipayNative(bool isNeed) {
330 | _channel.invokeMethod("useAlipayNative", {"isNeed": isNeed});
331 | }
332 | }
333 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/wxwx/flutter_alibc/FlutterAlibcHandle.kt:
--------------------------------------------------------------------------------
1 | package com.wxwx.flutter_alibc
2 | import android.app.Activity
3 | import android.app.Application
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.webkit.WebChromeClient
7 | import android.webkit.WebViewClient
8 | import com.alibaba.baichuan.android.trade.AlibcTrade
9 | import com.alibaba.baichuan.android.trade.AlibcTradeSDK
10 | import com.alibaba.baichuan.android.trade.callback.AlibcTradeCallback
11 | import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback
12 | import com.alibaba.baichuan.android.trade.model.AlibcShowParams
13 | import com.alibaba.baichuan.android.trade.page.AlibcBasePage
14 | import com.alibaba.baichuan.android.trade.page.AlibcDetailPage
15 | import com.alibaba.baichuan.android.trade.page.AlibcMyCartsPage
16 | import com.alibaba.baichuan.android.trade.page.AlibcShopPage
17 | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType
18 | import com.alibaba.baichuan.trade.biz.context.AlibcResultType
19 | import com.alibaba.baichuan.trade.biz.context.AlibcTradeResult
20 | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams
21 | import com.alibaba.baichuan.trade.biz.login.AlibcLogin
22 | import com.alibaba.baichuan.trade.biz.login.AlibcLoginCallback
23 | import com.wxwx.flutter_alibc.web.WebViewActivity
24 | import io.flutter.plugin.common.MethodCall
25 | import io.flutter.plugin.common.MethodChannel
26 | import java.util.*
27 |
28 | class FlutterAlibcHandle(var methodChannel: MethodChannel?){
29 | var activity:Activity? = null
30 | fun disposed(){
31 | this.methodChannel = null
32 | this.activity = null
33 | }
34 |
35 | /**
36 | * 初始化阿里百川
37 | * @param call
38 | * @param result
39 | */
40 | fun initAlibc(result: MethodChannel.Result){
41 | AlibcTradeSDK.asyncInit(activity!!.application, object : AlibcTradeInitCallback {
42 | override fun onSuccess() {
43 | result.success(PluginResponse.success(null).toMap())
44 | }
45 |
46 | override fun onFailure(code: Int, msg: String?) {
47 | result.success(PluginResponse(code.toString(), msg, null).toMap())
48 | }
49 | })
50 | }
51 |
52 | /**
53 | * 登陆淘宝
54 | * @param result
55 | */
56 | fun loginTaoBao(){
57 | val alibcLogin = AlibcLogin.getInstance()
58 | if(alibcLogin.isLogin){
59 | val session = alibcLogin.session
60 | val userInfo: MutableMap = HashMap()
61 | userInfo["nick"] = session.nick
62 | userInfo["avatarUrl"] = session.avatarUrl
63 | userInfo["openId"] = session.openId
64 | userInfo["openSid"] = session.openSid
65 | userInfo["topAccessToken"] = session.topAccessToken
66 | userInfo["topAuthCode"] = session.topAuthCode
67 | methodChannel!!.invokeMethod("AlibcTaobaoLogin", PluginResponse.success(userInfo).toMap())
68 | return
69 | }
70 | alibcLogin.showLogin(object : AlibcLoginCallback {
71 | override fun onSuccess(loginResult: Int, openId: String?, nickName: String?) {
72 | val userInfo: MutableMap = HashMap()
73 | val session = alibcLogin.session
74 | userInfo["nick"] = session.nick
75 | userInfo["avatarUrl"] = session.avatarUrl
76 | userInfo["openId"] = session.openId
77 | userInfo["openSid"] = session.openSid
78 | userInfo["topAccessToken"] = session.topAccessToken
79 | userInfo["topAuthCode"] = session.topAuthCode
80 | methodChannel!!.invokeMethod("AlibcTaobaoLogin", PluginResponse.success(userInfo).toMap())
81 |
82 | }
83 |
84 | override fun onFailure(code: Int, msg: String?) {
85 | // code:错误码 msg: 错误信息
86 | methodChannel!!.invokeMethod("AlibcTaobaoLogin", PluginResponse(code.toString(), msg, null).toMap())
87 | }
88 | })
89 | }
90 |
91 | /**
92 | * 登出
93 | * @param result
94 | */
95 | fun logoutTaoBao(result: MethodChannel.Result){
96 | val alibcLogin = AlibcLogin.getInstance()
97 | alibcLogin.logout(object : AlibcLoginCallback {
98 | override fun onSuccess(p0: Int, p1: String?, p2: String?) {
99 | result.success(PluginResponse.success(null).toMap())
100 | }
101 |
102 | override fun onFailure(code: Int, msg: String?) {
103 | result.success(PluginResponse(code.toString(), msg, null).toMap())
104 | }
105 | })
106 | }
107 |
108 | /**
109 | * 淘宝授权登陆 获取access_token
110 | * 官方说明文档 {https://open.taobao.com/doc.htm?docId=118&docType=1}
111 | * @param call
112 | * @param result
113 | */
114 | fun taoKeLogin(call: MethodCall){
115 | val map = call.arguments as HashMap
116 | val url = call.argument("url")
117 | WebViewActivity.callBack = object : WebViewActivity.Callback {
118 | override fun success(accessToken: String?) {
119 | val resMap: HashMap = HashMap()
120 | resMap["accessToken"] = accessToken
121 | methodChannel!!.invokeMethod("AlibcTaokeLogin", PluginResponse.success(resMap).toMap())
122 | }
123 |
124 | override fun failed(errorMsg: String?) {
125 | val code = -1
126 | methodChannel!!.invokeMethod("AlibcTaokeLogin", PluginResponse(code.toString(), errorMsg, null).toMap())
127 | }
128 | }
129 | val intent = Intent(activity!!, WebViewActivity::class.java)
130 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
131 | intent.putExtra("url", url)
132 | intent.putExtra("arguments", map)
133 | activity!!.startActivity(intent)
134 | }
135 |
136 | /**
137 | * 淘宝授权登陆 获取code 授权码
138 | * 官方说明文档 {https://open.taobao.com/doc.htm?docId=118&docType=1}
139 | * @param call
140 | * @param result
141 | */
142 | fun taoKeLoginForCode(call: MethodCall){
143 | val map = call.arguments as HashMap<*, *>
144 | val url = call.argument("url")
145 | WebViewActivity.callBack = object : WebViewActivity.Callback {
146 | override fun success(accessToken: String?) {
147 | val resMap: HashMap = HashMap()
148 | resMap["code"] = accessToken
149 | methodChannel!!.invokeMethod("AlibcTaokeLoginForCode", PluginResponse.success(resMap).toMap())
150 | }
151 |
152 | override fun failed(errorMsg: String?) {
153 | var code = -1
154 | methodChannel!!.invokeMethod("AlibcTaokeLoginForCode", PluginResponse(code.toString(), errorMsg, null).toMap())
155 | }
156 | }
157 | val intent = Intent(activity!!, WebViewActivity::class.java)
158 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
159 | intent.putExtra("url", url)
160 | intent.putExtra("arguments", map)
161 | activity!!.startActivity(intent)
162 | }
163 |
164 | /**
165 | * 通过URL方式打开淘宝
166 | * @param call
167 | * @param result
168 | */
169 | fun openByUrl(call: MethodCall, result: MethodChannel.Result){
170 | val showParams = AlibcShowParams()
171 | var taokeParams: AlibcTaokeParams? = AlibcTaokeParams("", "", "")
172 |
173 | showParams.backUrl = call.argument(PluginConstants.key_BackUrl)
174 |
175 | if (call.argument(PluginConstants.key_OpenType) != null) {
176 | println("openType" + call.argument(PluginConstants.key_OpenType))
177 | showParams.openType = PluginUtil.getOpenType("" + call.argument(PluginConstants.key_OpenType))
178 | }
179 | if (call.argument(PluginConstants.key_ClientType) != null) {
180 | println("clientType " + call.argument(PluginConstants.key_ClientType))
181 | showParams.clientType = PluginUtil.getClientType("" + call.argument(PluginConstants.key_ClientType))
182 | }
183 | if (call.argument("taokeParams") != null) {
184 | taokeParams = PluginUtil.getTaokeParams(call.argument