张波

提交代码

Showing 63 changed files with 3747 additions and 0 deletions
*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
... ...
/build
\ No newline at end of file
... ...
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
android {
compileSdkVersion var.compileSdkVersion
buildToolsVersion var.buildToolsVersion
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion var.minSdkVersion
targetSdkVersion var.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk {
// noinspection ChromeOsAbiSupport
abiFilters "armeabi-v7a", "arm64-v8a", "x86"
}
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
compileOptions {
// Java兼容性设置为Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
// implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "com.google.android.material:material:1.4.0"
// implementation project(path: ':wdstartup')
api(name: "wdstartup-debug-v1.0.0", ext: "aar")
}
\ No newline at end of file
... ...
No preview for this file type
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.myapplication">
<!-- 请求网络 -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
<activity
android:name="com.example.myapplication.MainActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
... ...
package com.example.myapplication;
import android.app.Activity;
import android.os.Bundle;
import androidx.annotation.Nullable;
/**
* @ProjectName: PeopleDailyVideo
* @Package: com.people.displayui.main
* @ClassName: WelcomeActivity
* @Description: 启动APP过渡页面
* @Author: wd
* @CreateDate: 2022/10/28 17:36
* @UpdateUser: wd
* @UpdateDate: 2022/10/28 17:36
* @UpdateRemark: 更新说明:
* @Version: 1.0
*/
public class MainActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 直接进入首页
}
}
... ...
package com.example.myapplication;
import android.app.Application;
import android.util.Log;
import com.example.myapplication.starttask.StartTaskConfig;
import com.example.myapplication.starttask.StartTaskTool;
/**
* @author devel
* @time 2024/8/28 星期三 16:23
*/
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Log.e("zzzz","MyApplication onCreate");
// test
StartTaskConfig taskConfig = new StartTaskConfig(this);
taskConfig.start();
StartTaskTool.startTaskInMain(this);
StartTaskTool.startPrivate(this);
StartTaskTool.startTaskInSplash(this);
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask;
import android.content.Context;
import android.util.Log;
import com.example.myapplication.starttask.task.MyTaskCreator;
import com.wd.base.starttask.AlphaManager;
import com.wd.base.starttask.Project;
/**
* 描述:启动初始化任务
* 默认放在子线程执行,如果子线程执行有问题,构造函数中使用super(name,isInUiThread)
*
* @author : lvjinhui
* @since: 2022/7/2
*/
public class StartTaskConfig {
private Context mContext;
public StartTaskConfig(Context mContext) {
this.mContext = mContext;
}
/**
* 开始全部的初始化,在application
*/
public void start() {
if (mContext == null) {
return;
}
Project.Builder builder = new Project.Builder().withTaskCreator(new MyTaskCreator(mContext));
// 日志
builder.add(MyTaskCreator.TASK_LOG);
// AppContext.init、CompComponent 组件服务注册,MyFileUtil.init,直播消息弹幕和打赏
builder.add(MyTaskCreator.TASK_LOCAL);
AlphaManager.getInstance(mContext).addProject(builder.create());
AlphaManager.getInstance(mContext).start();
Log.e("zzzz","start");
}
/**
* 适当的放一部分延时初始化
*/
public void startTaskDelay() {
if (mContext == null) {
return;
}
Project.Builder builder = new Project.Builder().withTaskCreator(new MyTaskCreator(mContext));
// 延时初始化,短视频SDK,辅助通道
builder.add(MyTaskCreator.TASK_DELAY);
builder.setProjectName("delayGroup");
AlphaManager.getInstance(mContext).addProject(builder.create());
AlphaManager.getInstance(mContext).start();
Log.e("zzzz","startTaskDelay");
}
/**
* 需要用户同意隐私政策才能初始化的SDK,放在PrivatePolicyTask
*/
public void startPrivate() {
if (mContext == null) {
return;
}
Project.Builder builder = new Project.Builder().withTaskCreator(new MyTaskCreator(mContext));
// umeng 正式init
builder.add(MyTaskCreator.TASK_PRIVATE);
builder.setProjectName("privateGroup");
AlphaManager.getInstance(mContext).addProject(builder.create());
AlphaManager.getInstance(mContext).start();
Log.e("zzzz","startPrivate");
}
/**
* 优先级最高(未同意隐私政策,等同意隐私政策完成后初始化;
* 已同意隐私政策,直接初始化)
* 进入主页在初始的,但是在隐私弹窗之前,不可以放涉及隐私的SDK
*/
public void startTaskInMain() {
if (mContext == null) {
return;
}
Project.Builder builder = new Project.Builder().withTaskCreator(new MyTaskCreator(mContext));
// 子线程 内容组件、comp组件、语音识别
builder.add(MyTaskCreator.TASK_WD);
builder.setProjectName("inMainGroup");
AlphaManager.getInstance(mContext).addProject(builder.create());
AlphaManager.getInstance(mContext).start();
Log.e("zzzz","startTaskInMain");
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask;
import android.content.Context;
/**
* 描述:
*
* @author : lvjinhui
* @since: 2022/7/7
*/
public class StartTaskTool {
public static void startTaskInMain(Context context) {
StartTaskConfig taskConfig = new StartTaskConfig(context);
taskConfig.startTaskInMain();
}
public static void startPrivate(Context context) {
StartTaskConfig taskConfig = new StartTaskConfig(context);
taskConfig.startPrivate();
}
public static void startTaskInSplash(Context context) {
StartTaskConfig taskConfig = new StartTaskConfig(context);
taskConfig.startTaskDelay();
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask.task;
import android.content.Context;
import com.wd.base.starttask.Task;
//import com.orhanobut.logger.Logger;
//import com.people.kittools.constant.CommonConstant;
//import com.people.kittools.sp.SpUtils;
//import com.people.umeng.UmSdkHelper;
/**
* 描述:在主页初始化,不着急使用,进入主页用户必然已经同意隐私政策
*
* @author : lvjinhui
* @since: 2022/7/2
*/
public class DelayTask extends Task {
public DelayTask(Context mContext) {
super("DelayTask");
setExecutePriority(9);
// if (SpUtils.isFirstAgreementFlag()){
// return;
// }
try {
//友盟分享
// UmSdkHelper.initUmThirdSDk(mContext, CommonConstant.FILE_PROVIDER);
// Logger.e("DelayTask 执行");
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void run() {
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask.task;
import java.lang.ref.WeakReference;
import android.content.Context;
import com.wd.base.starttask.Task;
//import com.people.kittools.file.MyFileUtils;
//import com.people.uiframework.CompComponent;
/**
* 描述:本地代码初始化context,都在子线程执行
* 无关用户信息,收集用户信息的SDK初始化不要放进这里
* @author : lvjinhui
* @since: 2022/7/2
*/
public class LocalThreadTask extends Task {
private WeakReference<Context> weakReference;
public LocalThreadTask(Context context) {
super("LocalThreadTask");
weakReference = new WeakReference<>(context);
setExecutePriority(1);
}
@Override
public void run() {
Context mContext = weakReference.get();
// 注册创建对象
// new CompComponent().registerServices();
// // 赋值context
// MyFileUtils.init(mContext);
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask.task;
import com.wd.base.starttask.Task;
//import com.people.logutil.LoggerInit;
/**
* 描述:com.orhanobut.logger 初始化,子线程初始化
*
* @author : lvjinhui
* @since: 2022/7/2
*/
public class LoggerTask extends Task {
public LoggerTask() {
super("LoggerTask");
}
@Override
public void run() {
// log 初始化
// LoggerInit.getInstance().init(true);// BuildConfig.DEBUG
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask.task;
import android.content.Context;
import android.util.Log;
import com.wd.base.starttask.ITaskCreator;
import com.wd.base.starttask.Task;
/**
* 描述:create task
*
* @author : lvjinhui
* @since: 2022/7/2
*/
public class MyTaskCreator implements ITaskCreator {
/**
* 定义的task 名字, 比如 LoggerTask 在 task 构造函数传入
*/
public static final String TASK_LOG = "LoggerTask";
public static final String TASK_LOCAL = "LocalThreadTask";
public static final String TASK_DELAY = "DelayTask";
public static final String TASK_PRIVATE = "PrivatePolicyTask";
public static final String TASK_WD = "WCompTask";
private final Context mContext;
public MyTaskCreator(Context context) {
this.mContext = context;
}
@Override
public Task createTask(String taskName) {
Log.d("==ALPHA==", taskName);
switch (taskName) {
case TASK_LOG:
return new LoggerTask();
case TASK_LOCAL:
return new LocalThreadTask(mContext);
case TASK_DELAY:
return new DelayTask(mContext);
case TASK_PRIVATE:
return new PrivatePolicyTask(mContext);
case TASK_WD:
return new WCompTask();
default:
break;
}
return null;
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask.task;
import android.content.Context;
import com.wd.base.starttask.Task;
//import com.orhanobut.logger.Logger;
//import com.people.kittools.sp.SpUtils;
//import com.people.umeng.UmSdkHelper;
/**
* 描述:需要用户同意隐私政策的SDK初始化
*
* @author : lvjinhui
* @since: 2022/7/2
*/
public class PrivatePolicyTask extends Task {
private Context instance;
public PrivatePolicyTask(Context context) {
super("PrivatePolicyTask");
this.instance = context;
// if (SpUtils.isFirstAgreementFlag()) {
// return;
// }
/**
* 友盟SDK正式初始化
*/
// UmSdkHelper.initUmSdk(instance);
// Logger.e("隐私SDK初始化");
}
@Override
public void run() {
}
}
... ...
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.example.myapplication.starttask.task;
//import com.wondertek.wheat.ability.scheduler.WComponent;
//import com.wondertek.wheat.ability.scheduler.listener.IComponentRegister;
//import com.wondertek.wheat.ability.scheduler.listener.InitListener;
import com.wd.base.starttask.Task;
/**
* 描述:组件注册,反射多了影响性能
*
* @author : lvjinhui
* @since: 2022/7/2
*/
public class WCompTask extends Task {
public WCompTask() {
super("WCompTask");
}
@Override
public void run() {
// 代码组件
initWComponent();
}
private void initWComponent() {
// WComponent.init(new InitListener() {
// @Override
// public void beforeInit() {
//
// }
//
// @Override
// public void registerComponent(IComponentRegister iComponentRegister) {
// // 内容获取组件
// iComponentRegister.registerComponent("ContentComponent",
// "com.people.component.content.ContentComponent");
// // comp组件
// iComponentRegister.registerComponent("CompComponent", "com.people.component.comp.CompComponent");
// // 语音识别
// iComponentRegister.registerComponent("SpeechComponent", "com.people.speech.SpeechComponent");
// }
//
// @Override
// public void initFinish() {
//
// }
// });
}
}
... ...
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
... ...
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" />
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
... ...
No preview for this file type
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
... ...
<resources>
<string name="app_name">My Application</string>
</resources>
\ No newline at end of file
... ...
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
\ No newline at end of file
... ...
apply plugin: 'maven'
buildscript {
ext.kotlin_version = "1.4.32"
repositories {
mavenLocal()
mavenCentral()
// 以下四行代码为阿里gradle源,需要的人自己放開使用
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' }
//阿里云 maven
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/releases' }
google()
maven { url "https://jitpack.io" }
//华为
maven { url 'https://developer.huawei.com/repo/' }
//阿里云QuickTracking
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/google/'
name 'aliyun-google'
}
// TingYun
maven { url "https://nexus2.tingyun.com/nexus/content/repositories/snapshots/" }
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.billy.android:autoregister:1.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
// 以下四行代码为阿里gradle源,需要的人自己放開使用
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' }
//阿里云 maven
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/releases' }
google()
maven { url "https://jitpack.io" }
//华为
maven { url 'https://developer.huawei.com/repo/' }
//阿里云QuickTracking
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/google/'
name 'aliyun-google'
}
flatDir { dirs 'src/main/libs' }
}
project.configurations.configureEach {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.android.support' && !details.requested.name.contains('multidex')) {
details.useVersion "28.0.0"
}
}
}
// 强制依赖
configurations.configureEach {
exclude group: 'com.alipay.android.phone.thirdparty', module: 'securityguard-build'
resolutionStrategy {
force 'androidx.activity:activity:1.2.1'
force 'androidx.annotation:annotation:1.1.0'
force 'androidx.appcompat:appcompat:1.2.0'
force 'androidx.arch.core:core-common:2.1.0'
force 'androidx.arch.core:core-runtime:2.1.0'
force 'androidx.core:core-ktx:1.6.0'
force 'androidx.core:core:1.5.0'
force 'androidx.collection:collection:1.1.0'
force 'androidx.constraintlayout:constraintlayout:2.0.4'
force 'androidx.constraintlayout:constraintlayout-solver:2.0.4'
force 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
force 'androidx.fragment:fragment:1.3.1'
force 'androidx.lifecycle:lifecycle-common:2.3.0'
force 'androidx.multidex:multidex:2.0.1'
force 'androidx.recyclerview:recyclerview:1.2.0'
force 'androidx.vectordrawable:vectordrawable:1.1.0'
force 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
force 'com.squareup.okhttp3:okhttp:4.9.1'
force 'com.squareup.okio:okio:2.7.0'
force 'org.jetbrains.kotlin:kotlin-stdlib:1.4.32'
force 'org.jetbrains.kotlin:kotilin-stdlib-jdk8:1.4.32'
force 'org.jetbrains:annotations:15.0'
force 'net.sf.proguard:proguard-base:6.1.0'
}
}
}
ext {
var = [
// SDK And Tools
applicationId : "com.wondertek.dss",
minSdkVersion : 25,
targetSdkVersion : 30,
compileSdkVersion: 30,
buildToolsVersion: "30.0.3",
// 版本号,正式版本 1.0.0 1000080 后两位,80即标识为发布版本
// 测试版本 1.0.0_TF1 1000001 后两位,01即为测试版本号,01-79
// 升级版本 1.0.0_RC1 1000081 后两位,81即为升级版本号,81-99
versionName : "1.0.0", // release正式
debugVnName : "", // debug开发模式 用于区分debug模式下上报的日志
versionCode : 100,
//此版本号是SDK版本,不能随便改
aar_version : "1.0.0",
]
}
... ...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="WonderTek_CodeFormatter_Convention_v1.0"
version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation"
value="common_lines" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true" />
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off" />
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="49" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
value="20" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations"
value="1" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column"
value="false" />
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120" />
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration"
value="end_of_line" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
value="0" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause"
value="common_lines" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
value="20" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
value="20" />
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error" />
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer"
value="20" />
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="20" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration"
value="0" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case"
value="end_of_line" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while"
value="insert" />
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16" />
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines"
value="2147483647" />
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="16" />
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation"
value="80" />
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column"
value="false" />
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer"
value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration"
value="common_lines" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16" />
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration"
value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch"
value="do not insert" />
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration"
value="common_lines" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration"
value="end_of_line" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header"
value="16" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
value="do not insert" />
<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
value="true" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
value="insert" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional"
value="insert" />
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description"
value="false" />
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space" />
<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1" />
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"
value="do not insert" />
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch"
value="insert" />
</profile>
</profiles>
\ No newline at end of file
... ...
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.jvmargs=-Xmx2048m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.enableResourceOptimizations=false
#建议您关闭 R8 后再进行混淆
android.enableR8=false
android.enableR8.libraries=false
# 如果使用最新稳定版本 Android Studio 3.5 或以上,那么您需要在 gradle.properties 里面新增
android.buildOnlyTargetAbi=false
#网络请求接口版本 202204151851
requestVersion=107
#设置组件是否作为app还是lib,true是lib ,false 是app
#分享
isShareModule=true
#播放器
isPlayerModule=true
#是否直播模块运行 false可以单独运行
isLiveModule=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
#android.nonTransitiveRClass=true
... ...
No preview for this file type
#Fri Oct 23 14:37:25 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.8-all.zip
... ...
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
... ...
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
... ...
rootProject.name = "wdstartup"
include ':app'
include ':wdstartup'
\ No newline at end of file
... ...
/build
\ No newline at end of file
... ...
plugins {
id 'com.android.library'
id 'kotlin-android'
}
android {
compileSdkVersion var.compileSdkVersion
defaultConfig {
minSdkVersion var.minSdkVersion
targetSdkVersion var.targetSdkVersion
versionCode var.versionCode
versionName var.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
buildConfigField "String", "API_VERSION", "\"${requestVersion}\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 自定义AAR包名
android.libraryVariants.all { variant ->
variant.outputs.all {
if (outputFileName != null && outputFileName.endsWith(".aar")) {
def fileName = "${project.name}-${buildType.name}-v${var.aar_version}.aar"
outputFileName = fileName
}
}
}
}
dependencies {
}
\ No newline at end of file
... ...
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
... ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wd.startup">
</manifest>
\ No newline at end of file
... ...
package com.wd.base.starttask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import android.content.Context;
public class AlphaConfig {
private static boolean sIsLoggable = true;
private static int sCoreThreadNum = Runtime.getRuntime().availableProcessors();
private static ThreadFactory sThreadFactory;
private static ExecutorService sExecutor;
private static int sWarningTime = 400;
private static boolean sShowToastToAlarm = false;
private static Context sContext;
public AlphaConfig() {
}
public static void setCoreThreadNum(int coreThreadNum) {
sCoreThreadNum = coreThreadNum;
}
public static void setThreadFactory(ThreadFactory threadFactory) {
sThreadFactory = threadFactory;
}
public static void setExecutorService(ExecutorService executorService) {
sExecutor = executorService;
}
public static void setLoggable(boolean isLoggable) {
sIsLoggable = isLoggable;
}
public static void setWarningTime(int warningTime) {
sWarningTime = warningTime;
}
public static void setShowToastToAlarm(Context context, boolean showToastToAlarm) {
sContext = context;
sShowToastToAlarm = showToastToAlarm;
}
static boolean isLoggable() {
return sIsLoggable;
}
static ThreadFactory getThreadFactory() {
if (sThreadFactory == null) {
sThreadFactory = getDefaultThreadFactory();
}
return sThreadFactory;
}
static ExecutorService getExecutor() {
if (sExecutor == null) {
sExecutor = getDefaultExecutor();
}
return sExecutor;
}
static int getWarmingTime() {
return sWarningTime;
}
static boolean shouldShowToastToAlarm() {
return sShowToastToAlarm;
}
static Context getContext() {
return sContext;
}
private static ThreadFactory getDefaultThreadFactory() {
ThreadFactory defaultFactory = new ThreadFactory() {
private final AtomicInteger mCount = new AtomicInteger(1);
public Thread newThread(Runnable r) {
return new Thread(r, "Alpha Thread #" + this.mCount.getAndIncrement());
}
};
return defaultFactory;
}
private static ExecutorService getDefaultExecutor() {
ThreadPoolExecutor executor = new ThreadPoolExecutor(sCoreThreadNum, sCoreThreadNum, 60L, TimeUnit.SECONDS,
new LinkedBlockingQueue(), getThreadFactory());
executor.allowCoreThreadTimeOut(true);
return executor;
}
}
... ...
package com.wd.base.starttask;
import android.util.Log;
public class AlphaLog {
public static final String GLOBAL_TAG = "==ALPHA==";
public AlphaLog() {
}
public static void d(String tag, Object obj) {
if (AlphaConfig.isLoggable()) {
Log.d(tag, obj.toString());
}
}
public static void d(String tag, String msg, Object... args) {
if (AlphaConfig.isLoggable()) {
String formattedMsg = String.format(msg, args);
Log.d(tag, formattedMsg);
}
}
public static void d(String msg, Object... args) {
d("==ALPHA==", msg, args);
}
public static void e(String tag, Object obj) {
if (AlphaConfig.isLoggable()) {
Log.e(tag, obj.toString());
}
}
public static void e(String tag, String msg, Object... args) {
if (AlphaConfig.isLoggable()) {
String formattedMsg = String.format(msg, args);
Log.e(tag, formattedMsg);
}
}
public static void i(String tag, Object obj) {
if (AlphaConfig.isLoggable()) {
Log.i(tag, obj.toString());
}
}
public static void w(Exception e) {
if (AlphaConfig.isLoggable()) {
e.printStackTrace();
}
}
public static void print(Object msg) {
d("==ALPHA==", msg);
}
public static void print(String msg, Object... args) {
d("==ALPHA==", msg, args);
}
}
... ...
package com.wd.base.starttask;
import android.content.Context;
import android.text.TextUtils;
import android.util.SparseArray;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class AlphaManager {
public static final int MAIN_PROCESS_MODE = 1;
public static final int SECONDARY_PROCESS_MODE = 2;
public static final int ALL_PROCESS_MODE = 3;
private Task mProjectForCurrentProcess;
private SparseArray<Task> mProjectArray = new SparseArray();
private Context mContext;
private static AlphaManager sInstance = null;
private volatile boolean mIsStartupFinished = false;
private OnProjectExecuteListener mProjectExecuteListener = new AlphaManager.ProjectExecuteListener();
private static byte[] sExtraTaskListLock = new byte[0];
private static byte[] sExtraTaskMapLock = new byte[0];
private List<String> mFinishedTask = new ArrayList();
private ListMultiMap<String, Task> mExtraTaskMap = new ListMultiMap();
private List<Task> mExtraTaskList = new ArrayList();
private static byte[] sWaitFinishLock = new byte[0];
private AlphaManager(Context context) {
if (context == null) {
throw new IllegalArgumentException("Context is null. ");
} else {
this.mContext = context;
}
}
public static synchronized AlphaManager getInstance(Context context) {
if (sInstance == null) {
sInstance = new AlphaManager(context);
}
return sInstance;
}
public void start() {
Project project = null;
if (this.mProjectForCurrentProcess != null) {
project = (Project)this.mProjectForCurrentProcess;
} else if (AlphaUtils.isInMainProcess(this.mContext) && this.mProjectArray.indexOfKey(1) >= 0) {
project = (Project)this.mProjectArray.get(1);
} else if (!AlphaUtils.isInMainProcess(this.mContext) && this.mProjectArray.indexOfKey(2) >= 0) {
project = (Project)this.mProjectArray.get(2);
} else if (this.mProjectArray.indexOfKey(3) >= 0) {
project = (Project)this.mProjectArray.get(3);
}
if (project != null) {
this.addListeners(project);
project.start();
} else {
AlphaLog.e("==ALPHA==", "No startup project for current process.");
}
}
public void addProject(Task project) {
this.addProject(project, 3);
}
public void addProject(Task project, String processName) {
if (AlphaUtils.isMatchProcess(this.mContext, processName)) {
this.mProjectForCurrentProcess = project;
}
}
public void addProject(Task project, int mode) {
if (project == null) {
throw new IllegalArgumentException("project is null");
} else if (mode >= 1 && mode <= 3) {
if (AlphaUtils.isMatchMode(this.mContext, mode)) {
this.mProjectArray.put(mode, project);
}
} else {
throw new IllegalArgumentException("No such mode: " + mode);
}
}
public void addProjectsViaFile(String path) {
File file = new File(path);
this.addProjectsViaFile(file);
}
public void addProjectsViaFile(File file) {
if (!file.exists()) {
throw new RuntimeException("Alpha config file " + file + " is not exist!");
} else {
InputStream in = null;
try {
in = new FileInputStream(file);
this.addProjectsViaFile((InputStream)in);
} catch (IOException var7) {
throw new RuntimeException(var7);
} finally {
AlphaUtils.closeSafely(in);
}
}
}
public void addProjectsViaFile(InputStream in) {
ConfigParser parser = new ConfigParser();
List<ConfigParser.ProjectInfo> projectInfoList = parser.parse(in);
if (projectInfoList == null) {
throw new RuntimeException("Parse alpha config file fail.");
} else {
Iterator var4 = projectInfoList.iterator();
while(var4.hasNext()) {
ConfigParser.ProjectInfo projectInfo = (ConfigParser.ProjectInfo)var4.next();
if (TextUtils.isEmpty(projectInfo.processName)) {
this.addProject(projectInfo.project, projectInfo.mode);
} else {
this.addProject(projectInfo.project, projectInfo.processName);
}
}
}
}
public boolean isStartupFinished() {
return this.mIsStartupFinished;
}
public void executeAfterStartup(Task task) {
this.executeAfterStartup(task, 3);
}
public void executeAfterStartup(Task task, int mode) {
this.executeAfterStartup(task, mode, 0);
}
public void executeAfterStartup(Task task, int mode, int executePriority) {
if (AlphaUtils.isMatchMode(this.mContext, mode)) {
if (this.isStartupFinished()) {
task.start();
} else {
task.setExecutePriority(executePriority);
this.addProjectBindTask(task);
}
}
}
public void executeAfterStartup(Task task, String processName, int executePriority) {
if (AlphaUtils.isMatchProcess(this.mContext, processName)) {
if (this.isStartupFinished()) {
task.start();
} else {
task.setExecutePriority(executePriority);
this.addProjectBindTask(task);
}
}
}
public void executeAfterStartup(Task task, String processName) {
this.executeAfterStartup(task, processName, 0);
}
public void executeAfterTask(Task task, String taskName) {
this.executeAfterTask(task, taskName, 3);
}
public void executeAfterTask(Task task, String taskName, int mode, int executePriority) {
if (AlphaUtils.isMatchMode(this.mContext, mode)) {
synchronized(sExtraTaskMapLock) {
if (!this.isStartupFinished() && !this.mFinishedTask.contains(taskName)) {
task.setExecutePriority(executePriority);
this.mExtraTaskMap.put(taskName, task);
} else {
task.start();
}
}
}
}
public void executeAfterTask(Task task, String taskName, int mode) {
this.executeAfterTask(task, taskName, mode, 0);
}
public void executeAfterTask(Task task, String taskName, String processName, int executePriority) {
if (AlphaUtils.isMatchProcess(this.mContext, processName)) {
synchronized(sExtraTaskMapLock) {
if (!this.isStartupFinished() && !this.mFinishedTask.contains(taskName)) {
task.setExecutePriority(executePriority);
this.mExtraTaskMap.put(taskName, task);
} else {
task.start();
}
}
}
}
public void executeAfterTask(Task task, String taskName, String processName) {
this.executeAfterTask(task, taskName, processName, 0);
}
public void waitUntilFinish() {
synchronized(sWaitFinishLock) {
while(!this.mIsStartupFinished) {
try {
sWaitFinishLock.wait();
} catch (InterruptedException var4) {
AlphaLog.w(var4);
}
}
}
}
public boolean waitUntilFinish(long timeout) {
long start = System.currentTimeMillis();
long waitTime = 0L;
synchronized(sWaitFinishLock) {
for(; !this.mIsStartupFinished && waitTime < timeout; waitTime = System.currentTimeMillis() - start) {
try {
sWaitFinishLock.wait(timeout);
} catch (InterruptedException var10) {
AlphaLog.w(var10);
}
}
}
return waitTime > timeout;
}
private void addListeners(Project project) {
project.addOnTaskFinishListener(new Task.OnTaskFinishListener() {
public void onTaskFinish(String taskName) {
AlphaManager.this.mIsStartupFinished = true;
AlphaManager.this.recycle();
AlphaManager.this.releaseWaitFinishLock();
}
});
project.addOnProjectExecuteListener(this.mProjectExecuteListener);
}
private void releaseWaitFinishLock() {
synchronized(sWaitFinishLock) {
sWaitFinishLock.notifyAll();
}
}
private void recycle() {
this.mProjectForCurrentProcess = null;
this.mProjectArray.clear();
}
private void executeTaskBindRunnable(String taskName) {
List<Task> list = this.mExtraTaskMap.get(taskName);
AlphaUtils.sort(list);
Iterator var3 = list.iterator();
while(var3.hasNext()) {
Task task = (Task)var3.next();
task.start();
}
this.mExtraTaskMap.remove(taskName);
}
private void executeProjectBindRunnables() {
AlphaUtils.sort(this.mExtraTaskList);
Iterator var1 = this.mExtraTaskList.iterator();
while(var1.hasNext()) {
Task task = (Task)var1.next();
task.start();
}
this.mExtraTaskList.clear();
}
private void addProjectBindTask(Task task) {
synchronized(sExtraTaskListLock) {
this.mExtraTaskList.add(task);
}
}
private class ProjectExecuteListener implements OnProjectExecuteListener {
private ProjectExecuteListener() {
}
public void onProjectStart() {
}
public void onTaskFinish(String taskName) {
synchronized(AlphaManager.sExtraTaskMapLock) {
AlphaManager.this.mFinishedTask.add(taskName);
if (AlphaManager.this.mExtraTaskMap.containsKey(taskName)) {
AlphaManager.this.executeTaskBindRunnable(taskName);
}
}
}
public void onProjectFinish() {
synchronized(AlphaManager.sExtraTaskListLock) {
if (!AlphaManager.this.mExtraTaskList.isEmpty()) {
AlphaManager.this.executeProjectBindRunnables();
}
}
synchronized(AlphaManager.sExtraTaskMapLock) {
AlphaManager.this.mFinishedTask.clear();
}
}
}
}
... ...
package com.wd.base.starttask;
import java.io.Closeable;
import java.io.FileInputStream;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import android.app.ActivityManager;
import android.content.Context;
import android.database.Cursor;
import android.os.Process;
import android.text.TextUtils;
public class AlphaUtils {
private static Comparator<Task> sTaskComparator = new Comparator<Task>() {
public int compare(Task lhs, Task rhs) {
return lhs.getExecutePriority() - rhs.getExecutePriority();
}
};
private static String sProcessName;
public AlphaUtils() {
}
public static void sort(List<Task> tasks) {
if (tasks.size() > 1) {
Collections.sort(tasks, sTaskComparator);
}
}
public static boolean closeSafely(Closeable closeable) {
if (closeable == null) {
return false;
} else {
boolean ret = false;
try {
closeable.close();
ret = true;
} catch (Exception var3) {
AlphaLog.w(var3);
}
return ret;
}
}
public static boolean closeSafely(Cursor cursor) {
if (cursor == null) {
return false;
} else {
boolean ret = false;
try {
cursor.close();
ret = true;
} catch (Exception var3) {
AlphaLog.w(var3);
}
return ret;
}
}
public static String getCurrProcessName(Context context) {
String name = getCurrentProcessNameViaLinuxFile();
if (TextUtils.isEmpty(name) && context != null) {
name = getCurrentProcessNameViaActivityManager(context);
}
return name;
}
public static boolean isInMainProcess(Context context) {
String mainProcessName = context.getPackageName();
String currentProcessName = getCurrProcessName(context);
return mainProcessName != null && mainProcessName.equalsIgnoreCase(currentProcessName);
}
private static String getCurrentProcessNameViaLinuxFile() {
int pid = Process.myPid();
String line = "/proc/" + pid + "/cmdline";
FileInputStream fis = null;
String processName = null;
byte[] bytes = new byte[1024];
int read = 0;
try {
fis = new FileInputStream(line);
read = fis.read(bytes);
} catch (Exception var10) {
AlphaLog.w(var10);
} finally {
closeSafely((Closeable) fis);
}
if (read > 0) {
processName = new String(bytes, 0, read);
processName = processName.trim();
}
return processName;
}
private static String getCurrentProcessNameViaActivityManager(Context context) {
if (context == null) {
return null;
} else if (sProcessName != null) {
return sProcessName;
} else {
int pid = Process.myPid();
ActivityManager mActivityManager = (ActivityManager) context.getSystemService("activity");
if (mActivityManager == null) {
return null;
} else {
List<ActivityManager.RunningAppProcessInfo> processes = mActivityManager.getRunningAppProcesses();
if (processes == null) {
return null;
} else {
Iterator var4 = processes.iterator();
while (var4.hasNext()) {
ActivityManager.RunningAppProcessInfo appProcess =
(ActivityManager.RunningAppProcessInfo) var4.next();
if (appProcess != null && appProcess.pid == pid) {
sProcessName = appProcess.processName;
break;
}
}
return sProcessName;
}
}
}
}
public static boolean isMatchProcess(Context context, String processName) {
String currentProcessName = getCurrProcessName(context);
return TextUtils.equals(processName, currentProcessName);
}
public static boolean isMatchMode(Context context, int mode) {
if (mode == 3) {
return true;
} else if (isInMainProcess(context) && mode == 1) {
return true;
} else {
return !isInMainProcess(context) && mode == 2;
}
}
}
... ...
package com.wd.base.starttask;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import android.text.TextUtils;
import android.util.Xml;
class ConfigParser {
private static final String TAG_PROJECTS = "projects";
private static final String TAG_PROJECT = "project";
private static final String TAG_TASK = "task";
private static final String ATTRIBUTE_TASK_NAME = "name";
private static final String ATTRIBUTE_TASK_CLASS = "class";
private static final String ATTRIBUTE_TASK_PREDECESSOR = "predecessor";
private static final String ATTRIBUTE_PROJECT_MODE = "mode";
private static final String ATTRIBUTE_PROCESS_NAME = "process";
private static final String ATTRIBUTE_THREAD_PRIORITY = "threadPriority";
private static final String ATTRIBUTE_EXECUTE_PRIORITY = "executePriority";
private static final String MODE_ALL_PROCESS = "allProcess";
private static final String MODE_MAIN_PROCESS = "mainProcess";
private static final String MODE_SECONDARY_PROCESS = "secondaryProcess";
private static final String PREDECESSOR_DIVIDER = ",";
ConfigParser() {
}
public List<ConfigParser.ProjectInfo> parse(InputStream in) {
try {
XmlPullParser parser = Xml.newPullParser();
parser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", false);
parser.setInput(in, (String) null);
parser.nextTag();
List<ConfigParser.TaskBundle> taskBundles = this.readProjects(parser);
List<ConfigParser.ProjectInfo> result = new ArrayList();
Iterator var5 = taskBundles.iterator();
while (var5.hasNext()) {
ConfigParser.TaskBundle info = (ConfigParser.TaskBundle) var5.next();
ConfigParser.ProjectInfo projectInfo = this.createProject(info);
result.add(projectInfo);
}
return result;
} catch (FileNotFoundException var8) {
AlphaLog.w(var8);
} catch (XmlPullParserException var9) {
AlphaLog.w(var9);
} catch (IOException var10) {
AlphaLog.w(var10);
}
return null;
}
private List<ConfigParser.TaskBundle> readProjects(XmlPullParser parser)
throws XmlPullParserException, IOException {
List<ConfigParser.TaskBundle> projects = new ArrayList();
parser.require(2, (String) null, "projects");
while (parser.next() != 3) {
if (parser.getEventType() == 2) {
String name = parser.getName();
if ("project".equals(name)) {
projects.add(this.readProject(parser));
} else {
this.skip(parser);
}
}
}
return projects;
}
private ConfigParser.TaskBundle readProject(XmlPullParser parser) throws IOException, XmlPullParserException {
parser.require(2, (String) null, "project");
List<ConfigParser.TaskInfo> taskList = new ArrayList();
int mode = this.readMode(parser);
String processName = parser.getAttributeValue((String) null, "process");
while (parser.next() != 3) {
if (parser.getEventType() == 2) {
String name = parser.getName();
if ("task".equals(name)) {
taskList.add(this.readTask(parser));
} else {
this.skip(parser);
}
}
}
ConfigParser.TaskBundle project = new ConfigParser.TaskBundle(mode, processName, taskList);
return project;
}
private ConfigParser.TaskInfo readTask(XmlPullParser parser) throws IOException, XmlPullParserException {
parser.require(2, (String) null, "task");
String name = parser.getAttributeValue((String) null, "name");
String path = parser.getAttributeValue((String) null, "class");
String predecessors = parser.getAttributeValue((String) null, "predecessor");
String threadPriorityStr = parser.getAttributeValue((String) null, "threadPriority");
String executePriorityStr = parser.getAttributeValue((String) null, "executePriority");
if (TextUtils.isEmpty(name)) {
throw new RuntimeException("Task name is not set.");
} else if (TextUtils.isEmpty(path)) {
throw new RuntimeException("The path of task : " + name + " is not set.");
} else {
ConfigParser.TaskInfo info = new ConfigParser.TaskInfo(name, path);
if (!TextUtils.isEmpty(predecessors)) {
List<String> predecessorList = this.parsePredecessorId(predecessors);
info.addPredecessors(predecessorList);
}
if (!TextUtils.isEmpty(threadPriorityStr)) {
info.threadPriority = Integer.parseInt(threadPriorityStr);
}
if (!TextUtils.isEmpty(executePriorityStr)) {
info.executePriority = Integer.parseInt(executePriorityStr);
}
parser.nextTag();
parser.require(3, (String) null, "task");
return info;
}
}
private List<String> parsePredecessorId(String predecessorIds) {
if (TextUtils.isEmpty(predecessorIds)) {
return null;
} else {
predecessorIds = predecessorIds.replace(" ", "");
String[] predecessorArray = TextUtils.split(predecessorIds, ",");
return Arrays.asList(predecessorArray);
}
}
private int readMode(XmlPullParser parser) {
String modeStr = parser.getAttributeValue((String) null, "mode");
if ("allProcess".equals(modeStr)) {
return 3;
} else if ("mainProcess".equals(modeStr)) {
return 1;
} else {
return "secondaryProcess".equals(modeStr) ? 2 : 3;
}
}
private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {
if (parser.getEventType() != 2) {
throw new IllegalStateException();
} else {
int depth = 1;
while (depth != 0) {
switch (parser.next()) {
case 2:
++depth;
break;
case 3:
--depth;
}
}
}
}
private ConfigParser.ProjectInfo createProject(ConfigParser.TaskBundle info) {
List<ConfigParser.TaskInfo> taskInfos = info.taskList;
HashMap<String, Task> taskMap = new HashMap();
Iterator var4 = taskInfos.iterator();
while (var4.hasNext()) {
ConfigParser.TaskInfo taskInfo = (ConfigParser.TaskInfo) var4.next();
Task task = null;
try {
Class<?> c = Class.forName(taskInfo.path);
task = (Task) c.newInstance();
task.setName(taskInfo.id);
if (taskInfo.threadPriority != 0) {
task.setThreadPriority(taskInfo.threadPriority);
}
if (taskInfo.executePriority != 0) {
task.setExecutePriority(taskInfo.executePriority);
}
} catch (ClassNotFoundException var12) {
AlphaLog.w(var12);
} catch (InstantiationException var13) {
AlphaLog.w(var13);
} catch (IllegalAccessException var14) {
AlphaLog.w(var14);
}
if (task == null) {
throw new RuntimeException("Can not reflect Task: " + taskInfo.path);
}
taskMap.put(taskInfo.id, task);
}
Project.Builder builder = new Project.Builder();
Iterator var16 = taskInfos.iterator();
while (true) {
List predecessorList;
do {
if (!var16.hasNext()) {
ConfigParser.ProjectInfo result =
new ConfigParser.ProjectInfo(builder.create(), info.mode, info.processName);
return result;
}
ConfigParser.TaskInfo taskInfo = (ConfigParser.TaskInfo) var16.next();
Task task = (Task) taskMap.get(taskInfo.id);
builder.add(task);
predecessorList = taskInfo.predecessorList;
} while (predecessorList.isEmpty());
Iterator var9 = predecessorList.iterator();
while (var9.hasNext()) {
String predecessorName = (String) var9.next();
Task t = (Task) taskMap.get(predecessorName);
if (t == null) {
throw new RuntimeException("No such task: " + predecessorName);
}
builder.after(t);
}
}
}
public static class ProjectInfo {
public Task project;
public int mode = 3;
public String processName;
public ProjectInfo(Task project, int mode, String processName) {
this.project = project;
this.mode = mode;
this.processName = processName;
}
}
private static class TaskInfo {
public String id;
public String path;
public List<String> predecessorList = new ArrayList();
public int threadPriority = 0;
public int executePriority = 0;
public TaskInfo(String id, String path) {
this.id = id;
this.path = path;
}
public void addPredecessors(List<String> predecessors) {
this.predecessorList.addAll(predecessors);
}
public boolean isFirst() {
return this.predecessorList.isEmpty();
}
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("TaskInfo ").append("id: ").append(this.id);
return builder.toString();
}
}
private static class TaskBundle {
public List<ConfigParser.TaskInfo> taskList = new ArrayList();
public int mode = 3;
public String processName = "";
public TaskBundle(int mode, String processName, List<ConfigParser.TaskInfo> tasks) {
this.mode = mode;
this.processName = processName;
this.taskList = tasks;
}
}
}
... ...
package com.wd.base.starttask;
import java.util.HashMap;
import java.util.Map;
import android.os.Handler;
import android.os.Looper;
import android.widget.Toast;
class ExecuteMonitor {
private Map<String, Long> mExecuteTimeMap = new HashMap();
private long mStartTime;
private long mProjectCostTime;
private Handler mHandler;
ExecuteMonitor() {
}
public synchronized void record(String taskName, long executeTime) {
AlphaLog.d("==ALPHA==", "AlphaTask-->Startup task %s cost time: %s ms, in thread: %s",
new Object[] {taskName, executeTime, Thread.currentThread().getName()});
if (executeTime >= (long) AlphaConfig.getWarmingTime()) {
this.toastToWarn("AlphaTask %s run too long, cost time: %s", taskName, executeTime);
}
this.mExecuteTimeMap.put(taskName, executeTime);
}
public synchronized Map<String, Long> getExecuteTimeMap() {
return this.mExecuteTimeMap;
}
public void recordProjectStart() {
this.mStartTime = System.currentTimeMillis();
}
public void recordProjectFinish() {
this.mProjectCostTime = System.currentTimeMillis() - this.mStartTime;
AlphaLog.d("==ALPHA==", "tm start up cost time: %s ms", new Object[] {this.mProjectCostTime});
}
public long getProjectCostTime() {
return this.mProjectCostTime;
}
private void toastToWarn(final String msg, final Object... args) {
if (AlphaConfig.shouldShowToastToAlarm()) {
this.getHandler().post(new Runnable() {
public void run() {
String formattedMsg;
if (args == null) {
formattedMsg = msg;
} else {
formattedMsg = String.format(msg, args);
}
Toast.makeText(AlphaConfig.getContext(), formattedMsg, Toast.LENGTH_SHORT).show();
}
});
}
}
private Handler getHandler() {
if (this.mHandler == null) {
this.mHandler = new Handler(Looper.getMainLooper());
}
return this.mHandler;
}
}
... ...
package com.wd.base.starttask;
public interface ITaskCreator {
Task createTask(String var1);
}
... ...
package com.wd.base.starttask;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class ListMultiMap<K, V> {
private HashMap<K, List<V>> mInnerMap = new HashMap();
private int mSize = 0;
public ListMultiMap() {
}
public void clear() {
this.mInnerMap.clear();
this.mSize = 0;
}
public boolean containsKey(K key) {
return this.mInnerMap.containsKey(key);
}
public boolean containsValue(V value) {
Iterator var2 = this.mInnerMap.entrySet().iterator();
List values;
do {
if (!var2.hasNext()) {
return false;
}
Map.Entry<K, List<V>> entry = (Map.Entry) var2.next();
values = (List) entry.getValue();
} while (values == null || !values.contains(value));
return true;
}
public boolean contains(K key, V value) {
if (!this.containsKey(key)) {
return false;
} else {
List<V> list = this.get(key);
return list != null && !list.isEmpty() ? list.contains(value) : false;
}
}
public List<V> get(K key) {
return (List) this.mInnerMap.get(key);
}
public boolean isEmpty() {
return this.mSize <= 0;
}
public void put(K key, V value) {
if (this.mInnerMap.containsKey(key)) {
List<V> list = (List) this.mInnerMap.get(key);
list.add(value);
} else {
List<V> list = new ArrayList();
list.add(value);
this.mInnerMap.put(key, list);
}
++this.mSize;
}
public List<V> remove(K key) {
List<V> list = (List) this.mInnerMap.remove(key);
if (list != null && !list.isEmpty()) {
this.mSize -= list.size();
}
return list;
}
public V remove(K key, V value) {
List<V> list = (List) this.mInnerMap.get(key);
V ret = null;
if (list != null && !list.isEmpty()) {
boolean isRemoved = list.remove(value);
if (isRemoved) {
--this.mSize;
ret = value;
}
}
return ret;
}
public V removeValue(V value) {
boolean contains = false;
Iterator var3 = this.mInnerMap.entrySet().iterator();
while (var3.hasNext()) {
Map.Entry<K, List<V>> entry = (Map.Entry) var3.next();
List<V> values = (List) entry.getValue();
if (values != null && values.contains(value)) {
values.remove(value);
contains = true;
--this.mSize;
}
}
return contains ? value : null;
}
public int size() {
return this.mSize;
}
public String toString() {
return this.mInnerMap.toString();
}
}
... ...
package com.wd.base.starttask;
import java.util.Map;
public interface OnGetMonitorRecordCallback {
void onGetTaskExecuteRecord(Map<String, Long> var1);
void onGetProjectExecuteTime(long var1);
}
... ...
package com.wd.base.starttask;
public interface OnProjectExecuteListener {
void onProjectStart();
void onTaskFinish(String var1);
void onProjectFinish();
}
... ...
package com.wd.base.starttask;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Project extends Task implements OnProjectExecuteListener {
private Task mStartTask;
private Project.AnchorTask mFinishTask;
private List<OnProjectExecuteListener> mExecuteListeners = new ArrayList();
private static final String DEFAULT_NAME = "AlphaProject";
private ExecuteMonitor mProjectExecuteMonitor;
private OnGetMonitorRecordCallback mOnGetMonitorRecordCallback;
public Project() {
super("AlphaProject");
}
public Project(String name) {
super(name);
}
public void run() {
}
public void start() {
this.mStartTask.start();
}
synchronized void addSuccessor(Task task) {
this.mFinishTask.addSuccessor(task);
}
public int getCurrentState() {
if (this.mStartTask.getCurrentState() == 0) {
return 0;
} else {
return this.mFinishTask.getCurrentState() == 2 ? 2 : 1;
}
}
public boolean isRunning() {
return this.getCurrentState() == 1;
}
public boolean isFinished() {
return this.getCurrentState() == 2;
}
public void addOnTaskFinishListener(final Task.OnTaskFinishListener listener) {
this.mFinishTask.addOnTaskFinishListener(new Task.OnTaskFinishListener() {
public void onTaskFinish(String taskName) {
listener.onTaskFinish(Project.this.mName);
}
});
}
public void onProjectStart() {
this.mProjectExecuteMonitor.recordProjectStart();
if (this.mExecuteListeners != null && !this.mExecuteListeners.isEmpty()) {
Iterator var1 = this.mExecuteListeners.iterator();
while(var1.hasNext()) {
OnProjectExecuteListener listener = (OnProjectExecuteListener)var1.next();
listener.onProjectStart();
}
}
}
public void onTaskFinish(String taskName) {
if (this.mExecuteListeners != null && !this.mExecuteListeners.isEmpty()) {
Iterator var2 = this.mExecuteListeners.iterator();
while(var2.hasNext()) {
OnProjectExecuteListener listener = (OnProjectExecuteListener)var2.next();
listener.onTaskFinish(taskName);
}
}
}
public void onProjectFinish() {
this.mProjectExecuteMonitor.recordProjectFinish();
this.recordTime(this.mProjectExecuteMonitor.getProjectCostTime());
if (this.mExecuteListeners != null && !this.mExecuteListeners.isEmpty()) {
Iterator var1 = this.mExecuteListeners.iterator();
while(var1.hasNext()) {
OnProjectExecuteListener listener = (OnProjectExecuteListener)var1.next();
listener.onProjectFinish();
}
}
if (this.mOnGetMonitorRecordCallback != null) {
this.mOnGetMonitorRecordCallback.onGetProjectExecuteTime(this.mProjectExecuteMonitor.getProjectCostTime());
this.mOnGetMonitorRecordCallback.onGetTaskExecuteRecord(this.mProjectExecuteMonitor.getExecuteTimeMap());
}
}
public void addOnProjectExecuteListener(OnProjectExecuteListener listener) {
this.mExecuteListeners.add(listener);
}
public void setOnGetMonitorRecordCallback(OnGetMonitorRecordCallback callback) {
this.mOnGetMonitorRecordCallback = callback;
}
void setStartTask(Task startTask) {
this.mStartTask = startTask;
}
void setFinishTask(Project.AnchorTask finishTask) {
this.mFinishTask = finishTask;
}
void setProjectExecuteMonitor(ExecuteMonitor monitor) {
this.mProjectExecuteMonitor = monitor;
}
void recycle() {
super.recycle();
this.mExecuteListeners.clear();
}
private static class AnchorTask extends Task {
private boolean mIsStartTask = true;
private OnProjectExecuteListener mExecuteListener;
public AnchorTask(boolean isStartTask, String name) {
super(name);
this.mIsStartTask = isStartTask;
}
public void setProjectLifecycleCallbacks(OnProjectExecuteListener callbacks) {
this.mExecuteListener = callbacks;
}
public void run() {
if (this.mExecuteListener != null) {
if (this.mIsStartTask) {
this.mExecuteListener.onProjectStart();
} else {
this.mExecuteListener.onProjectFinish();
}
}
}
}
private static class InnerOnTaskFinishListener implements Task.OnTaskFinishListener {
private Project mProject;
InnerOnTaskFinishListener(Project project) {
this.mProject = project;
}
public void onTaskFinish(String taskName) {
this.mProject.onTaskFinish(taskName);
}
}
public static class Builder {
private Task mCacheTask;
private boolean mIsSetPosition;
private Project.AnchorTask mFinishTask;
private Project.AnchorTask mStartTask;
private Project mProject;
private ExecuteMonitor mMonitor;
private TaskFactory mTaskFactory;
public Builder() {
this.init();
}
public Project create() {
this.addToRootIfNeed();
Project project = this.mProject;
this.init();
return project;
}
public Project.Builder withTaskCreator(ITaskCreator creator) {
this.mTaskFactory = new TaskFactory(creator);
return this;
}
public Project.Builder setOnProjectExecuteListener(OnProjectExecuteListener listener) {
this.mProject.addOnProjectExecuteListener(listener);
return this;
}
public Project.Builder setOnGetMonitorRecordCallback(OnGetMonitorRecordCallback callback) {
this.mProject.setOnGetMonitorRecordCallback(callback);
return this;
}
public Project.Builder setProjectName(String name) {
this.mProject.setName(name);
return this;
}
public Project.Builder add(String taskName) {
if (this.mTaskFactory == null) {
throw new IllegalAccessError("You should set a ITaskCreator with withTaskCreator(), and then you can call add() and after() with task name.");
} else {
Task task = this.mTaskFactory.getTask(taskName);
this.add(task);
return this;
}
}
public Project.Builder after(String taskName) {
if (this.mTaskFactory == null) {
throw new IllegalAccessError("You should set a ITaskCreator with withTaskCreator(), and then you can call add() and after() with task name.");
} else {
Task task = this.mTaskFactory.getTask(taskName);
this.after(task);
return this;
}
}
public Project.Builder after(String... taskNames) {
if (this.mTaskFactory == null) {
throw new IllegalAccessError("You should set a ITaskCreator with withTaskCreator(), and then you can call add() and after() with task name.");
} else {
Task[] tasks = new Task[taskNames.length];
int i = 0;
for(int len = taskNames.length; i < len; ++i) {
String taskName = taskNames[i];
Task task = this.mTaskFactory.getTask(taskName);
tasks[i] = task;
}
this.after(tasks);
return this;
}
}
public Project.Builder add(Task task) {
this.addToRootIfNeed();
this.mCacheTask = task;
this.mCacheTask.setExecuteMonitor(this.mMonitor);
this.mIsSetPosition = false;
this.mCacheTask.addOnTaskFinishListener(new Project.InnerOnTaskFinishListener(this.mProject));
this.mCacheTask.addSuccessor(this.mFinishTask);
return this;
}
public Project.Builder after(Task task) {
task.addSuccessor(this.mCacheTask);
this.mFinishTask.removePredecessor(task);
this.mIsSetPosition = true;
return this;
}
public Project.Builder after(Task... tasks) {
Task[] var2 = tasks;
int var3 = tasks.length;
for(int var4 = 0; var4 < var3; ++var4) {
Task task = var2[var4];
task.addSuccessor(this.mCacheTask);
this.mFinishTask.removePredecessor(task);
}
this.mIsSetPosition = true;
return this;
}
private void addToRootIfNeed() {
if (!this.mIsSetPosition && this.mCacheTask != null) {
this.mStartTask.addSuccessor(this.mCacheTask);
}
}
private void init() {
this.mCacheTask = null;
this.mIsSetPosition = true;
this.mProject = new Project();
this.mFinishTask = new Project.AnchorTask(false, "==AlphaDefaultFinishTask==");
this.mFinishTask.setProjectLifecycleCallbacks(this.mProject);
this.mStartTask = new Project.AnchorTask(true, "==AlphaDefaultStartTask==");
this.mStartTask.setProjectLifecycleCallbacks(this.mProject);
this.mProject.setStartTask(this.mStartTask);
this.mProject.setFinishTask(this.mFinishTask);
this.mMonitor = new ExecuteMonitor();
this.mProject.setProjectExecuteMonitor(this.mMonitor);
}
}
}
... ...
package com.wd.base.starttask;
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutorService;
public abstract class Task {
public static final int STATE_IDLE = 0;
public static final int STATE_RUNNING = 1;
public static final int STATE_FINISHED = 2;
public static final int STATE_WAIT = 3;
public static final int DEFAULT_EXECUTE_PRIORITY = 0;
private int mExecutePriority;
private int mThreadPriority;
private static ExecutorService sExecutor = AlphaConfig.getExecutor();
private static Handler sHandler = new Handler(Looper.getMainLooper());
private boolean mIsInUiThread;
private Runnable mInternalRunnable;
protected String mName;
private List<Task.OnTaskFinishListener> mTaskFinishListeners;
private volatile int mCurrentState;
private List<Task> mSuccessorList;
protected Set<Task> mPredecessorSet;
private ExecuteMonitor mTaskExecuteMonitor;
public Task(String name) {
this(name, 0);
}
public Task(String name, int threadPriority) {
this.mExecutePriority = 0;
this.mTaskFinishListeners = new ArrayList();
this.mCurrentState = 0;
this.mSuccessorList = new ArrayList();
this.mPredecessorSet = new HashSet();
this.mName = name;
this.mThreadPriority = threadPriority;
}
public Task(String name, boolean isInUiThread) {
this.mExecutePriority = 0;
this.mTaskFinishListeners = new ArrayList();
this.mCurrentState = 0;
this.mSuccessorList = new ArrayList();
this.mPredecessorSet = new HashSet();
this.mName = name;
this.mIsInUiThread = isInUiThread;
}
public synchronized void start() {
if (this.mCurrentState != 0) {
throw new RuntimeException("You try to run task " + this.mName + " twice, is there a circular dependency?");
} else {
this.switchState(3);
if (this.mInternalRunnable == null) {
this.mInternalRunnable = new Runnable() {
public void run() {
Process.setThreadPriority(Task.this.mThreadPriority);
long startTime = System.currentTimeMillis();
Task.this.switchState(1);
Task.this.run();
Task.this.switchState(2);
long finishTime = System.currentTimeMillis();
Task.this.recordTime(finishTime - startTime);
Task.this.notifyFinished();
Task.this.recycle();
}
};
}
if (this.mIsInUiThread) {
sHandler.post(this.mInternalRunnable);
} else {
sExecutor.execute(this.mInternalRunnable);
}
}
}
public void addOnTaskFinishListener(Task.OnTaskFinishListener listener) {
if (!this.mTaskFinishListeners.contains(listener)) {
this.mTaskFinishListeners.add(listener);
}
}
public abstract void run();
public int getCurrentState() {
return this.mCurrentState;
}
public boolean isRunning() {
return this.mCurrentState == 1;
}
public boolean isFinished() {
return this.mCurrentState == 2;
}
public void setExecutePriority(int executePriority) {
this.mExecutePriority = executePriority;
}
public int getExecutePriority() {
return this.mExecutePriority;
}
void addPredecessor(Task task) {
this.mPredecessorSet.add(task);
}
void removePredecessor(Task task) {
this.mPredecessorSet.remove(task);
}
void addSuccessor(Task task) {
if (task == this) {
throw new RuntimeException("A task should not after itself.");
} else {
task.addPredecessor(this);
this.mSuccessorList.add(task);
}
}
void notifyFinished() {
Iterator var1;
if (!this.mSuccessorList.isEmpty()) {
AlphaUtils.sort(this.mSuccessorList);
var1 = this.mSuccessorList.iterator();
while(var1.hasNext()) {
Task task = (Task)var1.next();
task.onPredecessorFinished(this);
}
}
if (!this.mTaskFinishListeners.isEmpty()) {
var1 = this.mTaskFinishListeners.iterator();
while(var1.hasNext()) {
Task.OnTaskFinishListener listener = (Task.OnTaskFinishListener)var1.next();
listener.onTaskFinish(this.mName);
}
this.mTaskFinishListeners.clear();
}
}
synchronized void onPredecessorFinished(Task beforeTask) {
if (!this.mPredecessorSet.isEmpty()) {
this.mPredecessorSet.remove(beforeTask);
if (this.mPredecessorSet.isEmpty()) {
this.start();
}
}
}
void setName(String name) {
this.mName = name;
}
void setThreadPriority(int threadPriority) {
this.mThreadPriority = threadPriority;
}
void setExecuteMonitor(ExecuteMonitor monitor) {
this.mTaskExecuteMonitor = monitor;
}
void recycle() {
this.mSuccessorList.clear();
this.mTaskFinishListeners.clear();
}
protected void recordTime(long costTime) {
if (this.mTaskExecuteMonitor != null) {
this.mTaskExecuteMonitor.record(this.mName, costTime);
}
}
private void switchState(int state) {
this.mCurrentState = state;
}
public interface OnTaskFinishListener {
void onTaskFinish(String var1);
}
}
... ...
package com.wd.base.starttask;
import java.util.HashMap;
import java.util.Map;
public final class TaskFactory {
private Map<String, Task> mTasks = new HashMap();
private ITaskCreator mTaskCreator;
public TaskFactory(ITaskCreator creator) {
this.mTaskCreator = creator;
}
public synchronized Task getTask(String taskName) {
Task task = (Task) this.mTasks.get(taskName);
if (task != null) {
return task;
} else {
task = this.mTaskCreator.createTask(taskName);
if (task == null) {
throw new IllegalArgumentException(
"Create task fail, there is no task corresponding to the task name. Make sure you have create a task instance in TaskCreator.");
} else {
this.mTasks.put(taskName, task);
return task;
}
}
}
}
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
\ No newline at end of file
... ...