Commit 38181890 authored by wuchaowen's avatar wuchaowen

commit flutter jdsdk code

parents
.DS_Store
.dart_tool/
.packages
.pub/
build/
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Dart SDK">
<CLASSES>
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/html" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file:///Users/tanky/Documents/tools/flutter/bin/cache/dart-sdk/lib/typed_data" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
<CLASSES>
<root url="file://$PROJECT_DIR$" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Flutter for Android">
<CLASSES>
<root url="jar:///Users/tanky/Documents/tools/flutter/bin/cache/artifacts/engine/android-arm/flutter.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 19 Platform" project-jdk-type="Android SDK" />
<component name="ProjectType">
<option name="id" value="io.flutter" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/jdsdk.iml" filepath="$PROJECT_DIR$/jdsdk.iml" />
<module fileurl="file://$PROJECT_DIR$/android/jdsdk_android.iml" filepath="$PROJECT_DIR$/android/jdsdk_android.iml" />
<module fileurl="file://$PROJECT_DIR$/example/android/jdsdk_example_android.iml" filepath="$PROJECT_DIR$/example/android/jdsdk_example_android.iml" />
</modules>
</component>
</project>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="example/lib/main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/example/lib/main.dart" />
<method />
</configuration>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLogFilters">
<option name="TOOL_WINDOW_CUSTOM_FILTER" value="flutter-test" />
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
</component>
<component name="ChangeListManager">
<list default="true" id="e56a8e33-a4f7-4146-9ae8-6376df3c053c" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="Nexus_5X_API_28" />
<component name="ProjectId" id="1dG8Atmpf5XvmG8LhweJrquSiAO" />
<component name="PropertiesComponent">
<property name="dart.analysis.tool.window.force.activate" value="false" />
<property name="io.flutter.reload.alreadyRun" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/example/android/app" />
<property name="show.migrate.to.gradle.popup" value="false" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/android/app/src/main/res" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/android/app" />
<recent name="$PROJECT_DIR$/android/src/main/java/com/jd/jdsdk" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="e56a8e33-a4f7-4146-9ae8-6376df3c053c" name="Default Changelist" comment="" />
<created>1592039928861</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1592039928861</updated>
</task>
<servers />
</component>
</project>
\ No newline at end of file
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
channel: stable
project_type: plugin
## 0.0.1
* TODO: Describe initial release.
TODO: Add your license here.
# 京东sdk的唤醒
京东sdk在Flutter上的实现,通过它可以实现唤醒京东app打开京东任意的url,包括商品详情等功能。
## 使用需知
[京东官方接入文档](https://union.jd.com/helpcenter/13246-13248-46117),在android和ios分别加入安全图片。
### ios
在 Info.plist 文件中添加
```dart
<key>LSApplicationQueriesSchemes</key>
<array>
<string>openapp.jdmobile</string>
<string>jdlogin</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sdkback</string>
<string>此处填入appkey</string>
</array>
</dict>
</array>
```
## 初始化
```dart
import 'package:jdsdk/jdsdk.dart';
await Jdsdk.init(appKey: '', appSecret: '');
```
## 打开京东任意URL
```dart
import 'package:jdsdk/jdsdk.dart';
await Jdsdk.openUrl( url: 'https://item.m.jd.com/product/100009963992.html');
```
## 联系方式
QQ:`511644784`
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
group 'com.jd.jdsdk'
version '1.0'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
rootProject.allprojects {
repositories {
google()
jcenter()
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
sourceSets{
main{
jniLibs.srcDirs = ['src/libs']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
incremental true
}
}
dependencies{
//implementation files('src/libs/jdmasdk.jar')
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation files('src/libs/JDSDK_h.jar')
implementation files('src/libs/cps_1.0.0.jar')
}
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
rootProject.name = 'jdsdk'
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jd.jdsdk">
</manifest>
package com.jd.jdsdk;
import android.app.Activity;
import android.content.DialogInterface;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.jd.kepler.res.ApkResources;
import com.kepler.jd.Listener.AsyncInitListener;
import com.kepler.jd.Listener.OpenAppAction;
import com.kepler.jd.login.KeplerApiManager;
import com.kepler.jd.sdk.bean.KelperTask;
import com.kepler.jd.sdk.bean.KeplerAttachParameter;
import org.json.JSONException;
import java.util.Map;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.PluginRegistry;
public class JDHelper {
private static JDHelper jdHelper;
private PluginRegistry.Registrar register;
private ActivityPluginBinding binding;
Activity activity;
KelperTask mKelperTask;
Handler mHandler = new Handler();
KeplerAttachParameter mKeplerAttachParameter = new KeplerAttachParameter();//这个是即时性参数 可以设置
LoadingDialog dialog;
private Activity getActivity(){
if(null != register){
return register.activity();
}else if(null != binding){
return binding.getActivity();
}
return null;
}
OpenAppAction mOpenAppAction = new OpenAppAction() {
@Override
public void onStatus(final int status, final String url) {
mHandler.post(new Runnable() {
@Override
public void run() {
if (status == OpenAppAction.OpenAppAction_start) {//开始状态未必一定执行,
dialogShow();
}else {
mKelperTask = null;
dialogDiss();
}
if(status == OpenAppAction.OpenAppAction_result_NoJDAPP) {
// Toast.makeText(getActivity(), "您未安装京东app,你可以手动打开以下链接地址:"+url+" ,code="+status, Toast.LENGTH_SHORT).show();
}else if(status == OpenAppAction.OpenAppAction_result_BlackUrl){
// Toast.makeText(getActivity(), "url不在白名单,你可以手动打开以下链接地址:"+url+" ,code="+status, Toast.LENGTH_SHORT).show();
}else if(status == OpenAppAction.OpenAppAction_result_ErrorScheme){
// Toast.makeText(getActivity(), "呼起协议异常"+" ,code="+status, Toast.LENGTH_SHORT).show();
}else if(status == OpenAppAction.OpenAppAction_result_APP){
}else if(status == OpenAppAction.OpenAppAction_result_NetError){
// Toast.makeText(getActivity(), ApkResources.getSingleton().getString("kepler_check_net")+" ,code="+status+" ,url="+url,Toast.LENGTH_SHORT).show();
}
}
});
}
};
private void dialogShow() {
if (dialog == null) {
dialog = new LoadingDialog(getActivity());
dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
if (mKelperTask != null) {//取消
mKelperTask.setCancel(true);
}
}
});
}
dialog.show();
}
private void dialogDiss() {
if(dialog!=null)
dialog.dismiss();
}
//第一次调用getInstance register不能为空
public static JDHelper getInstance(PluginRegistry.Registrar register){
if (jdHelper == null){
synchronized (JDHelper.class){
jdHelper = new JDHelper();
if(null != register){
jdHelper.register = register;
}
}
}
return jdHelper;
}
//第一次调用getInstance register不能为空
public static JDHelper getInstance(ActivityPluginBinding binding){
if (jdHelper == null){
synchronized (JDHelper.class){
jdHelper = new JDHelper();
if(null != binding){
jdHelper.binding = binding;
}
}
}
return jdHelper;
}
/**
* 初始化开普勒
* @param call
* @param result
*/
public void initKepler(MethodCall call, MethodChannel.Result result){
String appKey = call.argument("appKey");
String appSecret = call.argument("appSecret");
Log.d("flutter-taoke","initKepler"+getActivity());
KeplerApiManager.asyncInitSdk(getActivity().getApplication(), appKey, appSecret, new AsyncInitListener() {
@Override
public void onSuccess() {
Toast.makeText(getActivity(),"success",Toast.LENGTH_SHORT).show();
result.success(PluginResponse.success(null).toMap());
}
@Override
public void onFailure() {
Toast.makeText(getActivity(),"fail",Toast.LENGTH_SHORT).show();
String errorCode = "-1";
String errorMsg = "初始化失败";
result.success(new PluginResponse(errorCode, errorMsg, null).toMap());
}
});
}
/**
* 通过URL方式打开
* @param call
* @param result
*/
public void openUrl(MethodCall call, MethodChannel.Result result){
String url = call.argument("url");
if(TextUtils.isEmpty(url)){
return;
}
mKelperTask = KeplerApiManager.getWebViewService().openAppWebViewPage(getActivity(),
url,
mKeplerAttachParameter,
mOpenAppAction);
Toast.makeText(getActivity(),"success",Toast.LENGTH_SHORT).show();
}
}
package com.jd.jdsdk;
import android.support.annotation.NonNull;
import android.util.Log;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
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 io.flutter.plugin.common.PluginRegistry.Registrar;
/** JdsdkPlugin */
public class JdsdkPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware {
public static JDHelper mJDHelper;
@Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
final MethodChannel channel = new MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "jdsdk");
channel.setMethodCallHandler(new JdsdkPlugin());
}
public static void registerWith(Registrar registrar) {
mJDHelper = JDHelper.getInstance(registrar);
final MethodChannel channel = new MethodChannel(registrar.messenger(), "jdsdk");
channel.setMethodCallHandler(new JdsdkPlugin());
}
@Override
public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
if (call.method.equals("getPlatformVersion")) {
result.success("Android " + android.os.Build.VERSION.RELEASE);
} else if (call.method.equals("init")) {
mJDHelper.initKepler(call,result);
}else if (call.method.equals("openUrl")) {
Log.d("flutter-test","openUrl");
mJDHelper.openUrl(call,result);
}else {
result.notImplemented();
}
}
@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
}
@Override
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
Log.d("flutter-taoke","onAttachedToActivity"+binding);
mJDHelper = JDHelper.getInstance(binding);
}
@Override
public void onDetachedFromActivityForConfigChanges() {
}
@Override
public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) {
}
@Override
public void onDetachedFromActivity() {
}
}
package com.jd.jdsdk;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;
public class LoadingDialog extends Dialog {
private TextView tv;
public LoadingDialog(Context context) {
super(context, R.style.loadingDialogStyle);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialogloading);
tv = (TextView)findViewById(R.id.tv);
tv.setText("加载");
LinearLayout linearLayout = (LinearLayout)this.findViewById(R.id.LinearLayout);
linearLayout.getBackground().setAlpha(210);
}
}
package com.jd.jdsdk;
public interface PluginConstants {
/**
* 超时时间设定
*/
int TIMEOUT = 15;
String ERROR_CODE_EXCEPTION = "-99999";
}
package com.jd.jdsdk;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import static com.jd.jdsdk.PluginConstants.ERROR_CODE_EXCEPTION;
public class PluginResponse implements Serializable {
private String errorCode;
private String errorMessage;
private Object data;
public static PluginResponse success(Object obj){
return new PluginResponse("0", "成功", obj);
}
public static PluginResponse failed(Exception e){
return new PluginResponse(ERROR_CODE_EXCEPTION, "异常中止: " + e.getMessage(), null);
}
public PluginResponse(String errorCode, String errorMessage, Object data) {
this.errorCode = errorCode;
this.errorMessage = errorMessage;
this.data = data;
}
public Map<String, Object> toMap(){
HashMap<String, Object> map = new HashMap<>();
map.put("errorCode", errorCode);
map.put("errorMessage", errorMessage);
map.put("data", data);
return map;
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 圆角 -->
<corners
android:radius="1dp"
android:topLeftRadius="1dp"
android:topRightRadius="1dp"
android:bottomLeftRadius="1dp"
android:bottomRightRadius="1dp"/><!-- 设置圆角半径 -->
<!-- 填充 -->
<solid
android:color="#F3F3F3"/>
<stroke android:color="#DDDDDD" android:width="1px"></stroke>
</shape><!-- From: file:/D:/gitProgects/jdmall-android-phone-lib-res/AndroidJD-Resource/src/main/res/drawable/button_b_01.xml -->
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/kepler_back_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/kepler_back_pressed" android:state_focused="true"/>
<item android:drawable="@drawable/kepler_back_normal"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/kepler_selcet_more_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/kepler_selcet_more_pressed" android:state_focused="true"/>
<item android:drawable="@drawable/kepler_selcet_more_normal"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff" />
<corners android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 外部 -->
<item>
<shape>
<solid android:color="#FF0000" />
<corners android:topLeftRadius="3dp" android:topRightRadius="3dp"
android:bottomRightRadius="3dp" android:bottomLeftRadius="3dp" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 外部 -->
<item>
<shape>
<solid android:color="#FFFFFF" />
<corners android:topLeftRadius="3dp" android:topRightRadius="3dp"
android:bottomRightRadius="3dp" android:bottomLeftRadius="3dp" />
<stroke android:width="1dp" android:color="#ffa8abad" />
</shape>
</item>
<!-- 内部 -->
<item android:top="1dp" android:bottom="1dp" android:left="1dp" android:right="1dp">
<shape>
<solid android:color="#FFFFFF" />
<corners android:topLeftRadius="3dp" android:topRightRadius="3dp"
android:bottomRightRadius="3dp" android:bottomLeftRadius="3dp" />
<stroke android:width="1dp" android:color="#ffffffff" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- http://www.cnblogs.com/cyanfei/archive/2012/07/27/2612023.html -->
<!-- 背景 gradient是渐变,corners定义的是圆角 -->
<item android:id="@android:id/background">
<shape>
<corners android:radius="0dp" />
<solid android:color="#ffffff" />
</shape>
</item>
<!-- 第二条进度条颜色 -->
<!-- shape是用来定义形状的,gradient定义该形状里面为渐变色填充, -->
<!-- startColor起始颜色,endColor结束颜色,angle表示方向角度。 -->
<!-- 当angle=0时,渐变色是从左向右。 然后逆时针方向转,当angle=90时为从下往上。 -->
<!-- gradient 对应颜色渐变。 startcolor、endcolor就不多说了。 android:angle 是指从哪个角度开始变。 -->
<!-- solid 填充 -->
<!-- stroke 描边 -->
<!-- corners 圆角 -->
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<corners android:radius="0dip" />
<gradient
android:angle="90.0"
android:centerColor="#ac6079"
android:centerY="0.45"
android:endColor="#6c213a"
android:startColor="#e71a5e" />
</shape>
</clip>
</item>
<!-- 进度条 -->
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="0dip" />
<solid android:color="#FF8080" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#000000"
android:endColor="#ffffff"
android:angle="270"
/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#86222222" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/LinearLayout"
android:layout_width="160dp"
android:layout_height="160dp"
android:background="@drawable/yuanjiao"
android:gravity="center"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@android:color/transparent" />
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="10dp"
android:textColor="#fff"
/>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<RelativeLayout
android:id="@+id/item_tab_1_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/item_tab_1_color_text"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp" />
<TextView
android:id="@+id/item_tab_1_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/item_tab_1_color_text"
android:gravity="center"
android:textColor="#333456"
android:textSize="15sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/item_tab_2_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/item_tab_2_color_text"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp" />
<TextView
android:id="@+id/item_tab_2_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/item_tab_2_color_text"
android:gravity="center"
android:textColor="#333456"
android:textSize="15sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/item_tab_3_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/item_tab_3_color_text"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
/>
<TextView
android:id="@+id/item_tab_3_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/item_tab_3_color_text"
android:gravity="center"
android:textColor="#333456"
android:textSize="15sp" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/mid_pro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/kepler_dialog_bk"
android:clickable="true"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
style="@style/text_18_red"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:gravity="center"
android:visibility="visible" />
<LinearLayout
android:id="@+id/kepler_dialog_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/kepler_dialog_message"
style="@style/text_16_666666"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|center"
android:lineSpacingMultiplier="1.5"
android:minHeight="120.0dip"
android:paddingBottom="15.0dip"
android:paddingLeft="20.0dip"
android:paddingRight="20.0dip" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1.0px"
android:background="#ffd0d0d0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:padding="10dp"
android:gravity="center"
android:orientation="horizontal" >
<Button
android:id="@+id/kepler_positiveButton"
style="@style/text_18_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@drawable/kepler_dialog_button_po"
android:gravity="center"
android:paddingBottom="10dp"
android:paddingTop="10dp" />
<Button
android:id="@+id/kepler_negativeButton"
style="@style/text_18_white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/kepler_dialog_button_ne"
android:gravity="center"
android:paddingBottom="10dp"
android:paddingTop="10dp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
>
<ImageView
android:layout_margin="8dp"
android:id="@+id/more_select_item_image"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
/>
<TextView
android:id="@+id/more_select_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="#ffffff"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/more_select_item_image" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/global_loading_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EFEFEF"
android:visibility="gone" >
<ImageView
android:id="@+id/global_loading_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/tvMiddle"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:src="@drawable/neterror" />
<TextView
android:id="@id/tvMiddle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="网络请求失败"
android:textColor="#333333"
android:textSize="20sp" />
<TextView
android:id="@+id/tvCheckNet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tvMiddle"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="请检查您的网络"
android:textColor="#6C6C6C" />
<TextView
android:id="@+id/tvReload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tvCheckNet"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="重新加载"
android:textColor="#6C6C6C" />
<Button
android:id="@+id/btnReload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tvReload"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@drawable/btn_reload"
android:padding="15dp"
android:text=" 重新加载 "
android:textColor="#333333" />
</RelativeLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sdk_title_id"
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@android:color/white" >
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@drawable/sdk_title_bg_with_shadow" />
<!-- 左侧 -->
<ImageButton
android:id="@+id/sdk_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@null"
android:minWidth="70dp"
android:src="@drawable/kepler_btn_back" />
<!-- 右侧 -->
<LinearLayout
android:id="@+id/sdk_more_select_lin"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/sdk_more_select"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:padding="10dp"
android:src="@drawable/kepler_btn_select_more" />
</LinearLayout>
<!-- 关闭栏 -->
<LinearLayout
android:id="@+id/title_close_lin"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:minWidth="40dp"
android:layout_toLeftOf="@id/sdk_more_select_lin"
android:orientation="horizontal" >
<TextView
android:id="@+id/sdk_closed"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:text="关闭"
android:textColor="#848689"
android:textSize="14sp" />
<TextView
android:id="@+id/sdk_xiangqing"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:layout_marginRight="10sp"
android:paddingLeft="5dp"
android:text="查看订单"
android:textColor="#848689"
android:textSize="14sp"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/sdk_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:maxLines="1"
android:textColor="#232326"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/sdk_title_tabs_layout"
android:layout_width="330dp"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/title_close_lin"
android:layout_toRightOf="@id/sdk_back"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<include layout="@layout/sdk_title_layout" />
<!--style="?android:attr/progressBarStyleHorizontal"-->
<ProgressBar
android:id="@+id/web_load_progressbar"
style="?android:attr/progressBarStyleHorizontal"
android:progressDrawable="@drawable/pressbar_color"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@id/sdk_title_id" />
<RelativeLayout
android:id="@+id/web_view_lin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/web_load_progressbar" />
<LinearLayout
android:id="@+id/sdk_more_select_lay_id"
android:layout_width="119dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/web_load_progressbar"
android:layout_marginRight="4dp"
android:layout_marginTop="1dp"
android:background="@drawable/select_bg"
android:orientation="horizontal"
android:visibility="gone" />
<include
android:layout_marginTop="40dp"
layout="@layout/neterror_layout" />
</RelativeLayout>
\ No newline at end of file
<resources>
<string name="app_name">sdk</string>
<string name="Illegal_info"> Illegal application ,check init !</string>
<string name="kepler_check_net">请检查您的网络环境</string>
<string name="order">订单中心</string>
<string name="history">最近浏览</string>
<string name="search">搜索</string>
<string name="message">消息</string>
<string name="loginout">退出登录</string>
<string name="give_up_message">"下单后24小时内未支付成功,订单将被取消,请尽快完成支付。"</string>
<string name="give_up_title">确定要离开收银台</string>
<string name="give_up_goon">继续支付</string>
<string name="give_up_affirm">确认离开</string>
<string name="loginout_success">注销成功</string>
<string name="not_login">未登录</string>
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
</resources>
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="text_18_black">
<item name="android:textSize">18sp</item>
<item name="android:textColor">#000000</item>
</style>
<style name="text_18_white">
<item name="android:textSize">18sp</item>
<item name="android:textColor">#ffffff</item>
</style>
<style name="text_18_red">
<item name="android:textSize">20sp</item>
<item name="android:textColor">#FF0000</item>
</style>
<style name="text_16_666666">
<item name="android:textSize">16sp</item>
<item name="android:textColor">#000000</item>
</style>
<style name="sdw_white">
<item name="android:shadowColor">#7fffffff</item>
<item name="android:shadowDx">0.0</item>
<item name="android:shadowDy">0.65</item>
<item name="android:shadowRadius">1.0</item>
</style>
<style name="sdw_79351b">
<item name="android:shadowColor">#ff79351b</item>
<item name="android:shadowDx">0.0</item>
<item name="android:shadowDy">1.0</item>
<item name="android:shadowRadius">1.0</item>
</style>
<style name="text_15_ffffff_sdw" parent="@style/sdw_79351b">
<item name="android:textSize">15.0dip</item>
<item name="android:textColor">#ffffffff</item>
</style>
<style name="text_15_666666_sdw" parent="@style/sdw_white">
<item name="android:textSize">15.0dip</item>
<item name="android:textColor">#ff666666</item>
</style>
<style name="KeplerDialog" parent="android:style/Theme.Dialog">
<item name="android:background">#00000000</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
</style>
<style name="loadingDialogStyle" parent="android:Theme.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">@null</item>
<!-- 对话框是否有遮盖 -->
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
\ No newline at end of file
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
channel: stable
project_type: app
# jdsdk_example
Demonstrates how to use the jdsdk plugin.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.youliapp"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
storeFile file("youli.jks")
storePassword "youli123456"
keyAlias "youli"
keyPassword "youli123456"
}
release {
storeFile file("youli.jks")
storePassword "youli123456"
keyAlias "youli"
keyPassword "youli123456"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
ndk{ // 必须加入这部分,否则可能导致编译成功的release包在真机中会闪退
abiFilters 'armeabi-v7a'
}
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jd.jdsdk_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jd.jdsdk_example">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<!-- 网络 状态变化等信息 -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- IMEI等基础信息 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.Manifest.permission.READ_PHONE_STATE" />
<!-- 授权 发现jd app -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<!-- 静态化资源 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="jdsdk_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package com.jd.jdsdk_example;
import android.support.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jd.jdsdk_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
PODS:
- Flutter (1.0.0)
- jdsdk (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
- jdsdk (from `.symlinks/plugins/jdsdk/ios`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
jdsdk:
:path: ".symlinks/plugins/jdsdk/ios"
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
jdsdk: 2ca38c7e3a2dfb0f3641425f8fd1e8d20357693f
PODFILE CHECKSUM: 5f3453128823cf0ac1f2bf98c4325c586526ba0b
COCOAPODS: 1.8.4
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : FlutterAppDelegate
@end
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment