瀏覽代碼

1.升价百川SDK

tags/0.2.2
huaxuan 2 年之前
父節點
當前提交
f885b001d1
共有 45 個文件被更改,包括 121 次插入60 次删除
  1. +2
    -3
      android/build.gradle
  2. 二進制
     
  3. 二進制
     
  4. 二進制
     
  5. 二進制
     
  6. 二進制
     
  7. 二進制
     
  8. 二進制
     
  9. 二進制
     
  10. 二進制
     
  11. 二進制
     
  12. 二進制
     
  13. 二進制
     
  14. 二進制
     
  15. 二進制
     
  16. 二進制
     
  17. 二進制
     
  18. 二進制
     
  19. 二進制
     
  20. 二進制
     
  21. 二進制
     
  22. 二進制
     
  23. +45
    -15
      android/src/main/java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java
  24. +16
    -22
      android/src/main/java/com/wxwx/flutter_alibc/WebActivity.java
  25. +6
    -1
      android/src/main/java/com/wxwx/flutter_alibc/web/WebViewActivity.java
  26. +1
    -1
      example/.flutter-plugins-dependencies
  27. +17
    -15
      example/android/app/build.gradle
  28. 二進制
     
  29. 二進制
     
  30. 二進制
     
  31. 二進制
     
  32. 二進制
     
  33. 二進制
     
  34. 二進制
     
  35. 二進制
     
  36. 二進制
     
  37. 二進制
     
  38. 二進制
     
  39. 二進制
     
  40. 二進制
     
  41. 二進制
     
  42. 二進制
     
  43. +2
    -1
      example/android/app/src/main/AndroidManifest.xml
  44. +31
    -1
      example/android/build.gradle
  45. +1
    -1
      example/android/gradle/wrapper/gradle-wrapper.properties

+ 2
- 3
android/build.gradle 查看文件

@@ -4,7 +4,7 @@ version '1.0-SNAPSHOT'
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
flatDir {
dirs 'libs'
@@ -22,7 +22,7 @@ buildscript {
rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
}
@@ -100,7 +100,6 @@ dependencies{
// implementation 'com.taobao.android:avmpaar3:5.0.0.9-v5@aar'
// implementation 'com.taobao.android:sgmiddletieraar3:5.0.0.9-v5@aar'


compileOnly fileTree(include: ['*.jar','*.aar'], dir: 'libs')
// implementation(name: 'cardview-1.0.0', ext: 'aar')



二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


+ 45
- 15
android/src/main/java/com/wxwx/flutter_alibc/FlutterAlibcHandle.java 查看文件

@@ -32,10 +32,10 @@ import com.alibaba.alibcprotocol.param.AlibcShowParams;
import com.alibaba.alibcprotocol.param.AlibcTaokeParams;
import com.alibaba.alibcprotocol.route.proxy.IAlibcLoginProxy;
import com.baichuan.nb_trade.AlibcTrade;
import com.baichuan.nb_trade.auth.TopAuth;
import com.baichuan.nb_trade.callback.AlibcTradeInitCallback;
import com.baichuan.nb_trade.callback.AuthCallback;
import com.baichuan.nb_trade.core.AlibcTradeSDK;
import com.randy.alibcextend.auth.AuthCallback;
import com.randy.alibcextend.auth.TopAuth;
import com.ut.device.UTDevice;
import com.wxwx.flutter_alibc.web.WebViewActivity;

@@ -119,16 +119,20 @@ public class FlutterAlibcHandle {

@Override
public void onSuccess(String s, String s1) {
Map<String, Object> userInfo = new HashMap<>();
try {
Map<String, Object> userInfo = new HashMap<>();
// Session session = AlibcLogin.getInstance().getSession();
Session session = new LoginServiceImpl().getSession();
userInfo.put("nick", session.nick);
userInfo.put("avatarUrl", session.avatarUrl);
userInfo.put("openId", session.openId);
userInfo.put("openSid", session.openSid);
userInfo.put("topAccessToken", session.topAccessToken);
userInfo.put("topAuthCode", session.topAuthCode);
result.success(PluginResponse.success(userInfo).toMap());
Session session = new LoginServiceImpl().getSession();
userInfo.put("nick", session.nick);
userInfo.put("avatarUrl", session.avatarUrl);
userInfo.put("openId", session.openId);
userInfo.put("openSid", session.openSid);
userInfo.put("topAccessToken", session.topAccessToken);
userInfo.put("topAuthCode", session.topAuthCode);
result.success(PluginResponse.success(userInfo).toMap());
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
@@ -208,6 +212,7 @@ public class FlutterAlibcHandle {
AlibcLogin.getInstance().showLogin(new AlibcLoginCallback() {
@Override
public void onSuccess(String s, String s1) {

TopAuth.showAuthDialog(register.activity(), R.mipmap.ic_launcher, name, alibcAppKey, new AuthCallback() {
@Override
public void onSuccess(String accessToken, String expireTime) {
@@ -313,7 +318,11 @@ public class FlutterAlibcHandle {
// Intent intent = new Intent(register.context(), WebActivity.class);
// intent.putExtra("url", (String) call.argument("url"));
// register.activity().startActivityForResult(intent, 1111);
taoKeLoginNew(call, result);
try {
taoKeLoginNew(call, result);
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
@@ -365,16 +374,24 @@ public class FlutterAlibcHandle {
// results.put("paySuccessOrders", tradeResult.payResult.paySuccessOrders);
// }
// result.success(PluginResponse.success(results).toMap());
// }

// @Override
// public void onSuccess(int i) {
// Map<String, Object> results = new HashMap<>();
// result.success(PluginResponse.success(results).toMap());
// }

@Override
public void onSuccess(int i) {
public void onSuccess(int i, Object o) {
Log.d("错误", o.toString());
Map<String, Object> results = new HashMap<>();
result.success(PluginResponse.success(results).toMap());
}

@Override
public void onFailure(int code, String msg) {
Log.d("错误", msg);
result.success(new PluginResponse(Integer.toString(code), msg, null).toMap());
}
});
@@ -450,10 +467,23 @@ public class FlutterAlibcHandle {
// results.put("paySuccessOrders", tradeResult.payResult.paySuccessOrders);
// }
// result.success(PluginResponse.success(results).toMap());
// }

// @Override
// public void onSuccess(int i) {
// Map<String, Object> results = new HashMap<>();
//// if (AlibcResultType.TYPECART == tradeResult.resultType) {
//// results.put("type", 1);
//// } else if (AlibcResultType.TYPEPAY == tradeResult.resultType) {
//// results.put("type", 0);
//// results.put("payFailedOrders", tradeResult.payResult.payFailedOrders);
//// results.put("paySuccessOrders", tradeResult.payResult.paySuccessOrders);
//// }
// result.success(PluginResponse.success(results).toMap());
// }

@Override
public void onSuccess(int i) {
public void onSuccess(int i, Object o) {
Map<String, Object> results = new HashMap<>();
// if (AlibcResultType.TYPECART == tradeResult.resultType) {
// results.put("type", 1);
@@ -492,7 +522,7 @@ public class FlutterAlibcHandle {
}

public void getUdid(MethodCall call, Result result1) {
String udid = UTDevice.getUtdid(getApplicationContext());
String udid = UTDevice.getUtdid(getApplicationContext());
Map<String, String> resMap = new HashMap();
resMap.put("udid", udid);
result1.success(resMap);


+ 16
- 22
android/src/main/java/com/wxwx/flutter_alibc/WebActivity.java 查看文件

@@ -23,7 +23,6 @@ import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.Toast;


import com.alibaba.alibclogin.AlibcLogin;
@@ -69,23 +68,18 @@ public class WebActivity extends Activity {
// alibcTaokeParams.extraParams.put("taokeAppkey", SPUtils.getPrefString(mActivity, Pkey.APP_alliance_appkey, ""));
AlibcShowParams showParams = new AlibcShowParams();
showParams.setBackUrl("alisdk://");
AlibcTrade.openByUrl(WebActivity.this, url, showParams,
new AlibcTaokeParams("", "", ""), exParams, new AlibcTradeCallback() {
// AlibcTrade.openByUrl(WebActivity.this, url, showParams,
// new AlibcTaokeParams("", "", ""), exParams, new AlibcTradeCallback() {
// @Override
// public void onTradeSuccess(AlibcTradeResult alibcTradeResult) {
// public void onSuccess(int i, Object o) {
//
// }

@Override
public void onSuccess(int i) {

}

@Override
public void onFailure(int i, String s) {

}
});
//
// @Override
// public void onFailure(int i, String s) {
//
// }
// });
}

//用于百川授权的简化的WebClient
@@ -110,13 +104,8 @@ public class WebActivity extends Activity {
showParams.setBackUrl("alisdk://");
AlibcTrade.openByUrl(WebActivity.this, url,showParams,
new AlibcTaokeParams("", "", ""), exParams, new AlibcTradeCallback() {
// @Override
// public void onTradeSuccess(AlibcTradeResult alibcTradeResult) {
// Log.d("cg", alibcTradeResult.toString());
// }

@Override
public void onSuccess(int i) {
public void onSuccess(int i, Object o) {

}

@@ -350,10 +339,15 @@ public class WebActivity extends Activity {
// @Override
// public void onTradeSuccess(AlibcTradeResult alibcTradeResult) {
//
// }
//
// @Override
// public void onSuccess(int i) {
//
// }

@Override
public void onSuccess(int i) {
public void onSuccess(int i, Object o) {

}



+ 6
- 1
android/src/main/java/com/wxwx/flutter_alibc/web/WebViewActivity.java 查看文件

@@ -118,8 +118,13 @@ public class WebViewActivity extends Activity {
// @Override
// public void onTradeSuccess(AlibcTradeResult tradeResult) {}//不会回调

// @Override
// public void onSuccess(int i) {
//
// }

@Override
public void onSuccess(int i) {
public void onSuccess(int i, Object o) {

}



+ 1
- 1
example/.flutter-plugins-dependencies 查看文件

@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_alibc","path":"/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/","dependencies":[]}],"android":[{"name":"flutter_alibc","path":"/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_alibc","dependencies":[]}],"date_created":"2022-03-30 14:23:23.445986","version":"2.10.3"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_alibc","path":"/Users/fnuo123/Documents/fnuo_project_two/zhiying_flutter_alibc/","dependencies":[]}],"android":[{"name":"flutter_alibc","path":"/Users/fnuo123/Documents/fnuo_project_two/zhiying_flutter_alibc/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_alibc","dependencies":[]}],"date_created":"2022-09-13 09:39:00.780891","version":"2.10.3"}

+ 17
- 15
example/android/app/build.gradle 查看文件

@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
compileSdkVersion 31

lintOptions {
disable 'InvalidPackage'
@@ -78,19 +78,21 @@ dependencies {
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')

implementation(name: 'alibcad-5.0.0.13', ext: 'aar')
implementation(name: 'alibcapplink-5.0.0.13', ext: 'aar')
implementation(name: 'alibclogin-5.0.0.13', ext: 'aar')
implementation(name: 'alibcnbtrade-5.0.0.13', ext: 'aar')
implementation(name: 'alibcprotocol-5.0.0.13', ext: 'aar')
implementation(name: 'alibctradecommon-5.0.0.13', ext: 'aar')
implementation(name: 'alibctriver-5.0.0.13', ext: 'aar')
implementation(name: 'alibctriver_live-5.0.0.13', ext: 'aar')
implementation(name: 'alibcwebview-5.0.0.13', ext: 'aar')

implementation(name: 'avmpaar3-5.0.0.9-v5', ext: 'aar')
implementation(name: 'securitybodyaar3-5.0.0.9-v5', ext: 'aar')
implementation(name: 'securityguardaar3-5.0.0.9-v5', ext: 'aar')
implementation(name: 'sgmiddletieraar3-5.0.0.9-v5', ext: 'aar')
// implementation(name: 'alibcad-5.0.0.13', ext: 'aar')
// implementation(name: 'alibcapplink-5.0.0.13', ext: 'aar')
// implementation(name: 'alibclogin-5.0.0.13', ext: 'aar')
// implementation(name: 'alibcnbtrade-5.0.0.13', ext: 'aar')
// implementation(name: 'alibcprotocol-5.0.0.13', ext: 'aar')
// implementation(name: 'alibctradecommon-5.0.0.13', ext: 'aar')
// implementation(name: 'alibctriver-5.0.0.13', ext: 'aar')
// implementation(name: 'alibctriver_live-5.0.0.13', ext: 'aar')
// implementation(name: 'alibcwebview-5.0.0.13', ext: 'aar')
// implementation(name: 'cpp_shared-0.0.3', ext: 'aar')
//
// implementation(name: 'avmpaar3-5.0.0.9-v5', ext: 'aar')
// implementation(name: 'securitybodyaar3-5.0.0.9-v5', ext: 'aar')
// implementation(name: 'securityguardaar3-5.0.0.9-v5', ext: 'aar')
// implementation(name: 'sgmiddletieraar3-5.0.0.9-v5', ext: 'aar')
}

二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


+ 2
- 1
example/android/app/src/main/AndroidManifest.xml 查看文件

@@ -10,8 +10,9 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:label="flutter_alibc_example"
tools:replace="android:label">
tools:replace="android:label,android:allowBackup">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"


+ 31
- 1
example/android/build.gradle 查看文件

@@ -1,16 +1,46 @@
buildscript {
repositories {
mavenCentral()
// 百川
maven(){
url "https://maven.aliyun.com/repository/public/"
}
maven {
url "https://mvn.mob.com/android/"
}
maven {
url 'https://artifact.bytedance.com/repository/pangle'
}
google()

flatDir {
dirs 'libs'
}
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:4.1.0'
}
}

allprojects {
repositories {
mavenCentral()
// 百川
maven(){
url "https://maven.aliyun.com/repository/public/"
}
maven {
url "https://mvn.mob.com/android/"
}
maven {
url 'https://artifact.bytedance.com/repository/pangle'
}
google()

flatDir {
dirs 'libs'
}
flatDir {
dirs 'libs'
}


+ 1
- 1
example/android/gradle/wrapper/gradle-wrapper.properties 查看文件

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

Loading…
取消
儲存