Compare commits
865 Commits
master
...
dart3_supp
@ -0,0 +1,28 @@ |
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to |
||||||
|
# check for errors, warnings, and lints. |
||||||
|
# |
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled |
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be |
||||||
|
# invoked from the command line by running `flutter analyze`. |
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps, |
||||||
|
# packages, and plugins designed to encourage good coding practices. |
||||||
|
include: package:flutter_lints/flutter.yaml |
||||||
|
|
||||||
|
linter: |
||||||
|
# The lint rules applied to this project can be customized in the |
||||||
|
# section below to disable rules from the `package:flutter_lints/flutter.yaml` |
||||||
|
# included above or to enable additional rules. A list of all available lints |
||||||
|
# and their documentation is published at https://dart.dev/lints. |
||||||
|
# |
||||||
|
# Instead of disabling a lint rule for the entire project in the |
||||||
|
# section below, it can also be suppressed for a single line of code |
||||||
|
# or a specific dart file by using the `// ignore: name_of_lint` and |
||||||
|
# `// ignore_for_file: name_of_lint` syntax on the line or in the file |
||||||
|
# producing the lint. |
||||||
|
rules: |
||||||
|
# avoid_print: false # Uncomment to disable the `avoid_print` rule |
||||||
|
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule |
||||||
|
|
||||||
|
# Additional information about this file can be found at |
||||||
|
# https://dart.dev/guides/language/analysis-options |
@ -1,7 +0,0 @@ |
|||||||
<hbuilder version="1.9.9.80110" debug="false" syncDebug="false"> |
|
||||||
<apps> |
|
||||||
<app appid="__UNI__ACD00DA" appver="1.0"/> |
|
||||||
<app appid="__UNI__E60E056" appver="1.0"/> |
|
||||||
</apps> |
|
||||||
</hbuilder> |
|
||||||
|
|
@ -1,92 +0,0 @@ |
|||||||
<!DOCTYPE html> |
|
||||||
<html> |
|
||||||
<head> |
|
||||||
<meta charset="utf-8"/> |
|
||||||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> |
|
||||||
<meta name="HandheldFriendly" content="true"/> |
|
||||||
<meta name="MobileOptimized" content="320"/> |
|
||||||
<title>Error</title> |
|
||||||
<script type="text/javascript"> |
|
||||||
// H5 plus事件处理 |
|
||||||
var ws=null; |
|
||||||
function plusReady(){ |
|
||||||
// Android处理返回键 |
|
||||||
plus.key.addEventListener('backbutton',function(){ |
|
||||||
(history.length==1)&&ws.close(); |
|
||||||
var c=setTimeout(function(){ |
|
||||||
ws.close(); |
|
||||||
},1000); |
|
||||||
window.onbeforeunload=function(){ |
|
||||||
clearTimeout(c); |
|
||||||
} |
|
||||||
history.go(-2); |
|
||||||
},false); |
|
||||||
ws=plus.webview.currentWebview(); |
|
||||||
} |
|
||||||
if(window.plus){ |
|
||||||
plusReady(); |
|
||||||
}else{ |
|
||||||
document.addEventListener('plusready',plusReady,false); |
|
||||||
} |
|
||||||
document.addEventListener('touchstart',function(){ |
|
||||||
return false; |
|
||||||
},true); |
|
||||||
// 禁止选择 |
|
||||||
document.oncontextmenu=function(){ |
|
||||||
return false; |
|
||||||
}; |
|
||||||
// 获取错误信息 |
|
||||||
document.addEventListener("error",function(e){ |
|
||||||
info.innerText="请求的页面("+e.url+")无法打开"; |
|
||||||
console.log("请求的页面无法打开:"+e.href); |
|
||||||
},false); |
|
||||||
</script> |
|
||||||
<style> |
|
||||||
*{ |
|
||||||
-webkit-user-select: none; |
|
||||||
} |
|
||||||
html,body{ |
|
||||||
margin: 0px; |
|
||||||
padding: 0px; |
|
||||||
width: 100%; |
|
||||||
height: 100%; |
|
||||||
text-align: center; |
|
||||||
word-break: break-all; |
|
||||||
-webkit-touch-callout:none; |
|
||||||
-webkit-tap-highlight-color:rgba(0,0,0,0); |
|
||||||
} |
|
||||||
.button{ |
|
||||||
width: 50%; |
|
||||||
font-size: 18px; |
|
||||||
font-weight: normal; |
|
||||||
text-decoration: none; |
|
||||||
text-align: center; |
|
||||||
padding: .5em 0em; |
|
||||||
margin: .5em auto; |
|
||||||
color: #333333; |
|
||||||
background-color: #EEEEEE; |
|
||||||
border: 1px solid #CCCCCC; |
|
||||||
-webkit-border-radius: 5px; |
|
||||||
border-radius: 5px; |
|
||||||
} |
|
||||||
.button:active{ |
|
||||||
background-color: #CCCCCC; |
|
||||||
} |
|
||||||
</style> |
|
||||||
</head> |
|
||||||
<body> |
|
||||||
<div style="width:100%;height:20%;"></div> |
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 512 512" style="height:20%;width:30%"> |
|
||||||
<g id="icomoon-ignore"> |
|
||||||
<line stroke-width="1" x1="" y1="" x2="" y2="" stroke="#449FDB" opacity=""></line> |
|
||||||
</g> |
|
||||||
<path d="M256 0c-141.385 0-256 114.615-256 256s114.615 256 256 256 256-114.615 256-256-114.615-256-256-256zM352 128c17.673 0 32 14.327 32 32s-14.327 32-32 32-32-14.327-32-32 14.327-32 32-32zM160 128c17.673 0 32 14.327 32 32s-14.327 32-32 32-32-14.327-32-32 14.327-32 32-32zM352.049 390.37c-19.587-32.574-55.272-54.37-96.049-54.37s-76.462 21.796-96.049 54.37l-41.164-24.698c27.98-46.535 78.958-77.672 137.213-77.672s109.232 31.137 137.213 77.672l-41.164 24.698z" fill="#666666"></path> |
|
||||||
</svg> |
|
||||||
<p style="font-size:18px;font-weight:bolder;">We're sorry ...</p> |
|
||||||
<p id="info" style="font-size:12px;"></p> |
|
||||||
<!--<div class="button" onclick="history.back()">Retry</div>--> |
|
||||||
<div class="button" onclick="if(history.length == 1){ws.close();}else{ws.back();ws.back();}">Back</div> |
|
||||||
<div class="button" onclick="ws.close()">Close</div> |
|
||||||
<div class="button" onclick="plus.runtime.restart()">Restart</div> |
|
||||||
</body> |
|
||||||
</html> |
|
@ -1,73 +0,0 @@ |
|||||||
<properties> |
|
||||||
<features> |
|
||||||
<feature name="Barcode" value="io.dcloud.feature.barcode2.BarcodeFeatureImpl"/> |
|
||||||
<feature name="Speech" value="io.dcloud.feature.speech.SpeechFeatureImpl"> |
|
||||||
<module name="iFly" value="io.dcloud.feature.speech.IflySpeechEngine"/> |
|
||||||
<module name="baidu" value="io.dcloud.feature.speech.BaiduSpeechEngine"/> |
|
||||||
</feature> |
|
||||||
<feature name="Maps" value="io.dcloud.js.map.amap.JsMapPluginImpl"/> |
|
||||||
<!--<feature name="Maps" value="io.dcloud.js.map.JsMapPluginImpl"/>--> |
|
||||||
<feature name="Contacts" value="io.dcloud.feature.contacts.ContactsFeatureImpl"/> |
|
||||||
<feature name="Messaging" value="io.dcloud.adapter.messaging.MessagingPluginImpl"/> |
|
||||||
<feature name="Camera" value="io.dcloud.js.camera.CameraFeatureImpl"/> |
|
||||||
<feature name="Console" value="io.dcloud.feature.pdr.LoggerFeatureImpl"/> |
|
||||||
<feature name="Device" value="io.dcloud.feature.device.DeviceFeatureImpl"/> |
|
||||||
<feature name="File" value="io.dcloud.js.file.FileFeatureImpl"/> |
|
||||||
<feature name="Proximity" value="io.dcloud.feature.sensor.ProximityFeatureImpl"/> |
|
||||||
<feature name="Storage" value="io.dcloud.feature.pdr.NStorageFeatureImpl"/> |
|
||||||
<feature name="Cache" value="io.dcloud.feature.pdr.CoreCacheFeatureImpl"/> |
|
||||||
<feature name="Invocation" value="io.dcloud.invocation.Invocation"/> |
|
||||||
<feature name="Navigator" value="io.dcloud.feature.ui.navigator.NavigatorUIFeatureImpl"/> |
|
||||||
<feature name="NativeUI" value="io.dcloud.feature.ui.nativeui.NativeUIFeatureImpl"/> |
|
||||||
<feature name="UI" value="io.dcloud.feature.ui.UIFeatureImpl"> |
|
||||||
<module name="Navigator" value="io.dcloud.feature.ui.NavView"/> |
|
||||||
</feature> |
|
||||||
<feature name="Gallery" value="io.dcloud.js.gallery.GalleryFeatureImpl"/> |
|
||||||
<feature name="Downloader" value="io.dcloud.net.DownloaderFeatureImpl"/> |
|
||||||
<feature name="Uploader" value="io.dcloud.net.UploadFeature"/> |
|
||||||
<feature name="Push" value="io.dcloud.feature.aps.APSFeatureImpl"> |
|
||||||
<module name="igexin" value="io.dcloud.feature.apsGt.GTPushService"/> |
|
||||||
<!-- mkeypush --> |
|
||||||
</feature> |
|
||||||
<feature name="Zip" value="io.dcloud.feature.pdr.ZipFeature"/> |
|
||||||
<feature name="Audio" value="io.dcloud.feature.audio.AudioFeatureImpl"/> |
|
||||||
<feature name="Runtime" value="io.dcloud.feature.pdr.RuntimeFeatureImpl"/> |
|
||||||
<feature name="VideoPlayer" value="io.dcloud.media.MediaFeatureImpl"/> |
|
||||||
<feature name="LivePusher" value="io.dcloud.media.live.LiveMediaFeatureImpl"/> |
|
||||||
<feature name="XMLHttpRequest" value="io.dcloud.net.XMLHttpRequestFeature"/> |
|
||||||
<feature name="Statistic" value="io.dcloud.feature.statistics.StatisticsFeatureImpl"/> |
|
||||||
<feature name="Accelerometer" value="io.dcloud.feature.sensor.AccelerometerFeatureImpl"/> |
|
||||||
<feature name="Orientation" value="io.dcloud.feature.sensor.OrientationFeatureImpl"/> |
|
||||||
<feature name="NativeObj" value="io.dcloud.feature.nativeObj.FeatureImpl"/> |
|
||||||
<feature name="Geolocation" value="io.dcloud.js.geolocation.GeolocationFeatureImpl"/> |
|
||||||
<feature name="Payment" value="io.dcloud.feature.payment.PaymentFeatureImpl"> |
|
||||||
<module name="AliPay" value="io.dcloud.feature.payment.alipay.AliPay"/> |
|
||||||
<module name="Payment-Weixin" value="io.dcloud.feature.payment.weixin.WeiXinPay"/> |
|
||||||
<module name="Payment-Qihoo" value="io.dcloud.feature.payment.qihoopay.QihooPay"/> |
|
||||||
</feature> |
|
||||||
<feature name="Share" value="io.dcloud.share.ShareFeatureImpl"> |
|
||||||
<module name="Sina" value="io.dcloud.share.sina.SinaWeiboApiManager"/> |
|
||||||
<module name="Tencent" value="io.dcloud.share.tencent.TencentWeiboApiManager"/> |
|
||||||
<module name="Weixin" value="io.dcloud.share.mm.WeiXinApiManager"/> |
|
||||||
<module name="QQ" value="io.dcloud.share.qq.QQApiManager"/> |
|
||||||
</feature> |
|
||||||
<feature name="OAuth" value="io.dcloud.feature.oauth.OAuthFeatureImpl"> |
|
||||||
<module name="OAuth-Weixin" value="io.dcloud.feature.oauth.weixin.WeiXinOAuthService"/> |
|
||||||
<module name="OAuth-QQ" value="io.dcloud.feature.oauth.qq.QQOAuthService"/> |
|
||||||
<module name="OAuth-Sina" value="io.dcloud.feature.oauth.sina.SinaOAuthService"/> |
|
||||||
<module name="OAuth-Qihoo" value="io.dcloud.oauth.qihoo.QihooOAuthService"/> |
|
||||||
<module name="OAuth-MiUi" value="io.dcloud.feature.oauth.miui.MiUiOAuthService"/> |
|
||||||
</feature> |
|
||||||
<feature name="Stream" value="io.dcloud.appstream.js.StreamAppFeatureImpl"/> |
|
||||||
<feature name="Fingerprint" value="io.dcloud.feature.fingerprint.FingerPrintsImpl"/> |
|
||||||
<feature name="iBeacon" value="io.dcloud.feature.iBeacon.WxBluetoothFeatureImpl"/> |
|
||||||
<feature name="Bluetooth" value="io.dcloud.feature.bluetooth.BluetoothFeature"/> |
|
||||||
</features> |
|
||||||
|
|
||||||
<services> |
|
||||||
<service name="push" value="io.dcloud.feature.aps.APSFeatureImpl"/> |
|
||||||
<service name="Statistic" value="io.dcloud.feature.statistics.StatisticsBootImpl"/> |
|
||||||
<service name="Downloader" value="io.dcloud.net.DownloaderBootImpl"/> |
|
||||||
<service name="Maps" value="io.dcloud.js.map.MapInitImpl"/> |
|
||||||
</services> |
|
||||||
</properties> |
|
@ -1,55 +0,0 @@ |
|||||||
package com.zsw.huixiang |
|
||||||
|
|
||||||
import android.content.Context |
|
||||||
import android.content.Intent |
|
||||||
import android.net.Uri |
|
||||||
import android.text.TextUtils |
|
||||||
import android.util.Log |
|
||||||
import io.flutter.embedding.engine.plugins.FlutterPlugin |
|
||||||
import io.flutter.plugin.common.MethodCall |
|
||||||
import io.flutter.plugin.common.MethodChannel |
|
||||||
|
|
||||||
class BridgePlugin : FlutterPlugin, MethodChannel.MethodCallHandler { |
|
||||||
|
|
||||||
var intentAction : Uri? = null |
|
||||||
|
|
||||||
private lateinit var channel : MethodChannel |
|
||||||
private lateinit var context : Context; |
|
||||||
|
|
||||||
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { |
|
||||||
context = binding.applicationContext; |
|
||||||
channel = MethodChannel(binding.binaryMessenger, "bridge") |
|
||||||
channel.setMethodCallHandler(this) |
|
||||||
} |
|
||||||
|
|
||||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { |
|
||||||
channel.setMethodCallHandler(null) |
|
||||||
} |
|
||||||
|
|
||||||
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { |
|
||||||
if (call.method == "action") { |
|
||||||
if (intentAction != null) { |
|
||||||
val custom = intentAction?.getQueryParameter("custom") |
|
||||||
Log.e("bridge", "bridge:$custom") |
|
||||||
if (!TextUtils.isEmpty(custom)) { |
|
||||||
result.success(custom) |
|
||||||
intentAction = null |
|
||||||
return |
|
||||||
} |
|
||||||
} |
|
||||||
result.success("") |
|
||||||
} else if (call.method == "toAppStore") { |
|
||||||
try { |
|
||||||
val intent = Intent(Intent.ACTION_VIEW); |
|
||||||
intent.data = Uri.parse("market://search?q="+ context.packageName); |
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|
||||||
context.startActivity(intent); |
|
||||||
result.success("") |
|
||||||
} catch (e : Exception) { |
|
||||||
result.success("0") |
|
||||||
e.printStackTrace(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
package com.zsw.huixiang |
|
||||||
|
|
||||||
import android.app.Application |
|
||||||
import com.baidu.mapapi.base.BmfMapApplication |
|
||||||
|
|
||||||
class HxApplication : BmfMapApplication() { |
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate() { |
|
||||||
super.onCreate() |
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,42 +1,5 @@ |
|||||||
package com.zsw.huixiang |
package com.zsw.huixiang |
||||||
|
|
||||||
import android.content.Intent |
|
||||||
import android.os.Bundle |
|
||||||
import android.util.Log |
|
||||||
import io.dcloud.feature.sdk.DCUniMPSDK |
|
||||||
import io.flutter.embedding.android.FlutterActivity |
import io.flutter.embedding.android.FlutterActivity |
||||||
|
|
||||||
|
class MainActivity: FlutterActivity() |
||||||
class MainActivity: FlutterActivity() { |
|
||||||
|
|
||||||
|
|
||||||
lateinit var bridgePlugin : BridgePlugin |
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) { |
|
||||||
super.onCreate(savedInstanceState) |
|
||||||
|
|
||||||
Log.e("intentUrl:", "url: ${intent.data}" ) |
|
||||||
|
|
||||||
flutterEngine?.plugins?.add(MinPlugin()) |
|
||||||
|
|
||||||
bridgePlugin = BridgePlugin() |
|
||||||
if (intent.data != null) { |
|
||||||
bridgePlugin.intentAction = intent.data |
|
||||||
} |
|
||||||
flutterEngine?.plugins?.add(bridgePlugin) |
|
||||||
} |
|
||||||
|
|
||||||
override fun onNewIntent(intent: Intent) { |
|
||||||
super.onNewIntent(intent) |
|
||||||
Log.e("intentUrl:", "onNewIntent: ${intent.data}" ) |
|
||||||
if (bridgePlugin != null && intent.data != null) { |
|
||||||
bridgePlugin.intentAction = intent.data |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
override fun onDestroy() { |
|
||||||
super.onDestroy() |
|
||||||
DCUniMPSDK.getInstance().closeCurrentApp() |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
@ -1,129 +0,0 @@ |
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.zsw.huixiang |
|
||||||
|
|
||||||
import android.content.Context |
|
||||||
import androidx.annotation.NonNull |
|
||||||
import io.dcloud.common.adapter.util.Logger |
|
||||||
import io.dcloud.feature.sdk.DCSDKInitConfig |
|
||||||
import io.dcloud.feature.sdk.DCUniMPSDK |
|
||||||
import io.dcloud.feature.sdk.MenuActionSheetItem |
|
||||||
import io.flutter.embedding.engine.plugins.FlutterPlugin |
|
||||||
import io.flutter.plugin.common.MethodCall |
|
||||||
import io.flutter.plugin.common.MethodChannel |
|
||||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler |
|
||||||
import io.flutter.plugin.common.MethodChannel.Result |
|
||||||
import org.json.JSONObject |
|
||||||
|
|
||||||
|
|
||||||
/** MinPlugin */ |
|
||||||
class MinPlugin: FlutterPlugin, MethodCallHandler { |
|
||||||
/// The MethodChannel that will the communication between Flutter and native Android |
|
||||||
/// |
|
||||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it |
|
||||||
/// when the Flutter Engine is detached from the Activity |
|
||||||
private lateinit var channel : MethodChannel |
|
||||||
private lateinit var context : Context |
|
||||||
|
|
||||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { |
|
||||||
context = flutterPluginBinding.applicationContext; |
|
||||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "min") |
|
||||||
channel.setMethodCallHandler(this) |
|
||||||
} |
|
||||||
|
|
||||||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { |
|
||||||
if (call.method == "initialize") { |
|
||||||
if (!DCUniMPSDK.getInstance().isInitialize) { |
|
||||||
val item = MenuActionSheetItem("退出", "tc"); |
|
||||||
val sheetItems: MutableList<MenuActionSheetItem> = ArrayList() |
|
||||||
sheetItems.add(item) |
|
||||||
val config = DCSDKInitConfig.Builder() |
|
||||||
.setCapsule(true) |
|
||||||
.setMenuDefFontSize("16px") |
|
||||||
.setMenuDefFontColor("#000000") |
|
||||||
.setMenuDefFontWeight("normal") |
|
||||||
.setMenuActionSheetItems(sheetItems) |
|
||||||
.setEnableBackground(false) //后台运行 |
|
||||||
.build() |
|
||||||
DCUniMPSDK.getInstance().initialize(context, config) { |
|
||||||
result.success(it) |
|
||||||
} |
|
||||||
DCUniMPSDK.getInstance().setDefMenuButtonClickCallBack { p0, p1 -> |
|
||||||
Logger.e("p0: $p0 p1:$p1"); |
|
||||||
when (p1) { |
|
||||||
"tc" -> { |
|
||||||
Logger.e("用户点击了退出"); |
|
||||||
DCUniMPSDK.getInstance().closeCurrentApp() |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
DCUniMPSDK.getInstance().setUniMPOnCloseCallBack { |
|
||||||
Logger.e("用户点击了退出 it: $it") |
|
||||||
DCUniMPSDK.getInstance().closeCurrentApp() |
|
||||||
} |
|
||||||
} |
|
||||||
} else if (call.method == "isInitialize") { |
|
||||||
result.success(DCUniMPSDK.getInstance().isInitialize) |
|
||||||
} else if (call.method == "isExistsApp") { |
|
||||||
var appid = call.argument<String>("appid"); |
|
||||||
result.success(DCUniMPSDK.getInstance().isExistsApp(appid)) |
|
||||||
} else if (call.method == "getAppVersionInfo") { |
|
||||||
var appid = call.argument<String>("appid"); |
|
||||||
result.success(DCUniMPSDK.getInstance().getAppVersionInfo(appid)["name"]) |
|
||||||
} else if (call.method == "closeCurrentApp") { |
|
||||||
result.success(DCUniMPSDK.getInstance().closeCurrentApp()) |
|
||||||
} else if (call.method == "getAppBasePath") { |
|
||||||
result.success(DCUniMPSDK.getInstance().getAppBasePath(context)) |
|
||||||
} else if (call.method == "runingAppid") { |
|
||||||
result.success(DCUniMPSDK.getInstance().runingAppid) |
|
||||||
} else if (call.method == "currentPageUrl") { |
|
||||||
result.success(DCUniMPSDK.getInstance().currentPageUrl) |
|
||||||
} else if (call.method == "startMin") { |
|
||||||
try { |
|
||||||
var appid = call.argument<String>("appid") |
|
||||||
var hashMap = call.argument<HashMap<String, Object>>("json") |
|
||||||
Logger.e("startMin_json: ${JSONObject(hashMap as Map<*, *>)}") |
|
||||||
DCUniMPSDK.getInstance().startApp(context, appid, JSONObject(hashMap as Map<*, *>)) |
|
||||||
} catch (e: Exception) { |
|
||||||
e.printStackTrace() |
|
||||||
} |
|
||||||
result.success("") |
|
||||||
} else if (call.method == "clickListener") { |
|
||||||
DCUniMPSDK.getInstance().setDefMenuButtonClickCallBack { p0, p1 -> |
|
||||||
Logger.e("p0: $p0 p1:$p1"); |
|
||||||
when (p1) { |
|
||||||
"tc" -> { |
|
||||||
Logger.e("用户点击了退出"); |
|
||||||
DCUniMPSDK.getInstance().closeCurrentApp() |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
DCUniMPSDK.getInstance().setUniMPOnCloseCallBack { |
|
||||||
Logger.e("用户点击了退出 it: $it") |
|
||||||
} |
|
||||||
} else if (call.method == "reloadWgt") { |
|
||||||
try { |
|
||||||
var appid = call.argument<String>("appid"); |
|
||||||
var wgtPath = call.argument<String>("wgtPath"); |
|
||||||
DCUniMPSDK.getInstance().releaseWgtToRunPathFromePath(appid, wgtPath) { code, pArgs -> |
|
||||||
if (code == 1) { //释放wgt完成 |
|
||||||
result.success(true) |
|
||||||
} else { |
|
||||||
result.success(false) |
|
||||||
} |
|
||||||
null |
|
||||||
} |
|
||||||
} catch (e: Exception) { |
|
||||||
e.printStackTrace() |
|
||||||
} |
|
||||||
} else { |
|
||||||
result.notImplemented() |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { |
|
||||||
channel.setMethodCallHandler(null) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
@ -1,67 +0,0 @@ |
|||||||
package com.zsw.huixiang.wxapi |
|
||||||
|
|
||||||
import android.content.Intent |
|
||||||
import android.os.Bundle |
|
||||||
import cn.sharesdk.wechat.utils.WechatHandlerActivity |
|
||||||
import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity |
|
||||||
import io.flutter.Log |
|
||||||
|
|
||||||
class WXEntryActivity : WechatHandlerActivity() { |
|
||||||
|
|
||||||
|
|
||||||
// IWXAPI 是第三方app和微信通信的openapi接口 |
|
||||||
|
|
||||||
public override fun onCreate(savedInstanceState: Bundle?) { |
|
||||||
super.onCreate(savedInstanceState) |
|
||||||
Log.e("wx:", "onCreate:") |
|
||||||
|
|
||||||
// try { |
|
||||||
// if (!WXAPiHandler.wxApiRegistered) { |
|
||||||
// var appInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA) |
|
||||||
// val wechatAppId = appInfo.metaData.getString("weChatAppId") |
|
||||||
// if (wechatAppId != null ){ |
|
||||||
// WXAPiHandler.setupWxApi(wechatAppId,this) |
|
||||||
// WXAPiHandler.setCoolBool(true) |
|
||||||
// Log.d("fluwx","weChatAppId:" + wechatAppId) |
|
||||||
// }else { |
|
||||||
// Log.e("fluwx","can't load meta-data weChatAppId") |
|
||||||
// } |
|
||||||
// } |
|
||||||
// WXAPiHandler.wxApi?.handleIntent(intent, this) |
|
||||||
// } catch (e: Exception) { |
|
||||||
// e.printStackTrace() |
|
||||||
// startSpecifiedActivity(defaultFlutterActivityAction()) |
|
||||||
// finish() |
|
||||||
// } |
|
||||||
} |
|
||||||
|
|
||||||
// override fun onNewIntent(intent: Intent) { |
|
||||||
// super.onNewIntent(intent) |
|
||||||
// Log.e("wx:", "onNewIntent:") |
|
||||||
|
|
||||||
// setIntent(intent) |
|
||||||
|
|
||||||
// try { |
|
||||||
// WXAPiHandler.wxApi?.handleIntent(intent, this) |
|
||||||
// } catch (e: Exception) { |
|
||||||
// e.printStackTrace() |
|
||||||
// startSpecifiedActivity(defaultFlutterActivityAction()) |
|
||||||
// finish() |
|
||||||
// } |
|
||||||
// } |
|
||||||
|
|
||||||
|
|
||||||
// override fun onReq(baseReq: BaseReq) { |
|
||||||
// Log.e("wx:", "onReq: ${baseReq.toString()}") |
|
||||||
// FIXME: 可能是官方的Bug,从微信拉起APP的Intent类型不对,无法跳转回Flutter Activity |
|
||||||
// 稳定复现场景:微信版本为7.0.5,小程序SDK为2.7.7 |
|
||||||
// FluwxRequestHandler.onReq(baseReq,this) |
|
||||||
// } |
|
||||||
// 第三方应用发送到微信的请求处理后的响应结果,会回调到该方法 |
|
||||||
// override fun onResp(resp: BaseResp) { |
|
||||||
// Log.e("wx:", "onResp: ${resp.toString()}") |
|
||||||
// FluwxResponseHandler.handleResponse(resp) |
|
||||||
// finish() |
|
||||||
// } |
|
||||||
|
|
||||||
} |
|
@ -1,86 +0,0 @@ |
|||||||
package com.zsw.huixiang.wxapi |
|
||||||
|
|
||||||
import android.content.Intent |
|
||||||
import android.content.pm.PackageManager |
|
||||||
import android.os.Bundle |
|
||||||
import android.util.Log |
|
||||||
import com.jarvan.fluwx.handlers.FluwxRequestHandler |
|
||||||
import com.jarvan.fluwx.handlers.FluwxResponseHandler |
|
||||||
import com.jarvan.fluwx.handlers.WXAPiHandler |
|
||||||
import com.tencent.mm.opensdk.modelbase.BaseReq |
|
||||||
import com.tencent.mm.opensdk.modelbase.BaseResp |
|
||||||
import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity |
|
||||||
|
|
||||||
|
|
||||||
class WXPayEntryActivity : AbsWXPayCallbackActivity() { |
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) { |
|
||||||
super.onCreate(savedInstanceState) |
|
||||||
try { |
|
||||||
if (!WXAPiHandler.wxApiRegistered) { |
|
||||||
var appInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA) |
|
||||||
val wechatAppId = appInfo.metaData.getString("weChatAppId") |
|
||||||
if (wechatAppId != null ){ |
|
||||||
WXAPiHandler.setupWxApi(wechatAppId, this) |
|
||||||
WXAPiHandler.setCoolBool(true) |
|
||||||
io.flutter.Log.d("fluwx", "weChatAppId:$wechatAppId") |
|
||||||
}else { |
|
||||||
io.flutter.Log.e("fluwx", "can't load meta-data weChatAppId") |
|
||||||
} |
|
||||||
} |
|
||||||
WXAPiHandler.wxApi?.handleIntent(intent, this) |
|
||||||
} catch (e: Exception) { |
|
||||||
e.printStackTrace() |
|
||||||
startSpecifiedActivity(defaultFlutterActivityAction()) |
|
||||||
finish() |
|
||||||
} |
|
||||||
Log.e("WXPayEntryActivity", "onCreate") |
|
||||||
} |
|
||||||
|
|
||||||
override fun onNewIntent(intent: Intent) { |
|
||||||
super.onNewIntent(intent) |
|
||||||
|
|
||||||
setIntent(intent) |
|
||||||
|
|
||||||
try { |
|
||||||
WXAPiHandler.wxApi?.handleIntent(intent, this) |
|
||||||
} catch (e: Exception) { |
|
||||||
e.printStackTrace() |
|
||||||
startSpecifiedActivity(defaultFlutterActivityAction()) |
|
||||||
finish() |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
override fun onReq(req: BaseReq) { |
|
||||||
super.onReq(req) |
|
||||||
FluwxRequestHandler.onReq(req, this) |
|
||||||
Log.e("WXPayEntryActivity", "req: $req") |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
override fun onResp(resp: BaseResp) { |
|
||||||
FluwxResponseHandler.handleResponse(resp) |
|
||||||
super.onResp(resp) |
|
||||||
Log.e("WXPayEntryActivity", "resp: $resp") |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun startSpecifiedActivity(action: String, bundle: Bundle? = null, bundleKey: String? = null) { |
|
||||||
Intent(action).run { |
|
||||||
bundleKey?.let { |
|
||||||
putExtra(bundleKey, bundle) |
|
||||||
} |
|
||||||
addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT) |
|
||||||
packageManager?.let { |
|
||||||
resolveActivity(packageManager)?.also { |
|
||||||
startActivity(this) |
|
||||||
finish() |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
private fun defaultFlutterActivityAction(): String = "$packageName.FlutterActivity" |
|
||||||
|
|
||||||
} |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 192 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 830 B |
After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 482 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 972 B |
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 1003 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 718 B |
After Width: | Height: | Size: 876 B |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 840 B |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 890 B |
After Width: | Height: | Size: 572 B |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 662 B |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 880 B |
After Width: | Height: | Size: 768 B |
After Width: | Height: | Size: 834 B |
After Width: | Height: | Size: 858 B |
After Width: | Height: | Size: 794 B |