diff --git a/README.md b/README.md new file mode 100644 index 0000000..feb4290 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# uploadapkplugin + +Android. 上传测试服务器 并且自动发送飞书消息的gralde 插件 \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..ca0c944 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,57 @@ +plugins { + id 'groovy' + id 'maven-publish' + id 'java-gradle-plugin' +} + + +task comps { + afterEvaluate { + println("Components: " + components*.name) + } +} +// Because the components are created only during the afterEvaluate phase, you must +// configure your publications using the afterEvaluate() lifecycle method. +afterEvaluate { +publishing{ + + publications { + release(MavenPublication) { + groupId = 'center.uploadpgy.plugin' + artifactId = 'UploadApkPlugin' + version = '1.0.0' + from components.java + + + } + } + repositories { + maven { +// url = "$rootDir/repo" + url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } + } +} +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + + // gradle sdk + implementation gradleApi() + // groovy sdk + implementation localGroovy() + + implementation "com.android.tools.build:gradle:4.1.2" + implementation 'com.github.dcendents:android-maven-gradle-plugin:2.1' + implementation "com.google.code.gson:gson:2.8.8" + implementation "com.squareup.okhttp3:okhttp:3.12.12" +} \ No newline at end of file diff --git a/app/libs/UploadApkPlugin-1.0.0.jar b/app/libs/UploadApkPlugin-1.0.0.jar new file mode 100644 index 0000000..fa98215 Binary files /dev/null and b/app/libs/UploadApkPlugin-1.0.0.jar differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# 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 diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/PluginConstants.java b/app/src/main/java/com/trubitpro/uploadapkplugin/PluginConstants.java new file mode 100644 index 0000000..a8fc5e5 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/PluginConstants.java @@ -0,0 +1,17 @@ +package com.trubitpro.uploadapkplugin; + +public class PluginConstants { + + public static final String TASK_GROUP_NAME="publishToThirdPlatform"; + public static final String TASK_DES="tools of upload to third platform"; + + public static final String UPLOAD_PARAMS_NAME = "buildLarkParams"; + public static final String DING_PARAMS_NAME = "buildDingParams"; + public static final String WEIXIN_GROUP_PARAMS_NAME = "buildWeixinGroupParams"; + public static final String GIT_LOG_PARAMS_NAME = "buildGitLogParams"; + + public static final String ANDROID_EXTENSION_NAME = "android"; + public static final String TASK_EXTENSION_NAME = "ApkBuildUploadPlatform"; + public static final String TASK_EXTENSION_NAME_ONLY_UPLOAD = "OnlyUploadApkToPlatform"; + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/UploadApkPlugin.java b/app/src/main/java/com/trubitpro/uploadapkplugin/UploadApkPlugin.java new file mode 100644 index 0000000..2233c17 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/UploadApkPlugin.java @@ -0,0 +1,67 @@ +package com.trubitpro.uploadapkplugin; + +import com.android.build.gradle.AppExtension; +import com.android.build.gradle.api.ApplicationVariant; +import com.android.build.gradle.api.BaseVariant; +import com.trubitpro.uploadapkplugin.help.CmdHelper; +import com.trubitpro.uploadapkplugin.help.ProcessUtils; +import com.trubitpro.uploadapkplugin.pramars.GitLogParams; +import com.trubitpro.uploadapkplugin.pramars.SendLarkParams; +import com.trubitpro.uploadapkplugin.pramars.UploadPgyParams; +import com.trubitpro.uploadapkplugin.task.OnlyUploadTask; + +import org.gradle.api.Action; +import org.gradle.api.DomainObjectSet; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.jetbrains.annotations.NotNull; + +import java.util.Iterator; +import java.util.Locale; + +import kotlin.jvm.internal.Intrinsics; + +public class UploadApkPlugin implements Plugin { + @Override + public void apply(Project target) { + target.getExtensions().create(PluginConstants.GIT_LOG_PARAMS_NAME, GitLogParams.class); + + SendLarkParams uploadParams = (SendLarkParams)target.getExtensions().create(PluginConstants.UPLOAD_PARAMS_NAME, SendLarkParams.class, new Object[0]); + + target.afterEvaluate(project1 -> { + AppExtension appExtension = ((AppExtension) project1.getExtensions().findByName(PluginConstants.ANDROID_EXTENSION_NAME)); + if (appExtension == null) { + return; + } + DomainObjectSet appVariants = appExtension.getApplicationVariants(); + for (ApplicationVariant applicationVariant : appVariants) { + if (applicationVariant.getBuildType() != null) { + dependsOnTask(applicationVariant, true, project1); + } + } + }); + OnlyUploadTask uploadTask = target.getTasks() + .create(PluginConstants.TASK_EXTENSION_NAME_ONLY_UPLOAD, OnlyUploadTask.class); + uploadTask.init( null, target); + } + + + private void dependsOnTask(ApplicationVariant applicationVariant, boolean isInit, Project project1) { + String variantName = + applicationVariant.getName().substring(0, 1).toUpperCase() + applicationVariant.getName().substring(1); + if (variantName.isEmpty()) { + variantName ="Release" ; + } + //创建我们,上传到蒲公英的task任务 + OnlyUploadTask uploadTask = project1.getTasks() + .create(PluginConstants.TASK_EXTENSION_NAME + variantName, OnlyUploadTask.class); + uploadTask.init( isInit?applicationVariant:null, project1); + //依赖关系 。上传依赖打包,打包依赖clean。 + if (isInit){ + applicationVariant.getAssembleProvider().get().dependsOn(project1.getTasks().findByName("clean")); + uploadTask.dependsOn(applicationVariant.getAssembleProvider().get()); + } + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/entry/BaseResult.java b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/BaseResult.java new file mode 100644 index 0000000..e0bf544 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/BaseResult.java @@ -0,0 +1,29 @@ +package com.trubitpro.uploadapkplugin.entry; + +import com.google.gson.annotations.SerializedName; + + + public class BaseResult { + + @SerializedName("code") + private Integer code; + @SerializedName("message") + private String message; + + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/entry/LarkResult.java b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/LarkResult.java new file mode 100644 index 0000000..3067733 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/LarkResult.java @@ -0,0 +1,38 @@ +package com.trubitpro.uploadapkplugin.entry; + +import com.google.gson.annotations.SerializedName; + + +public class LarkResult { + + @SerializedName("code") + private Integer code; + @SerializedName("data") + private String data; + @SerializedName("msg") + private String msg; + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/entry/PgyCOSTokenResult.java b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/PgyCOSTokenResult.java new file mode 100644 index 0000000..8d95757 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/PgyCOSTokenResult.java @@ -0,0 +1,89 @@ +package com.trubitpro.uploadapkplugin.entry; + +import com.google.gson.annotations.SerializedName; + +/** + * Created by center + * 2021-09-03. + * + */ +public class PgyCOSTokenResult extends BaseResult { + + + @SerializedName("data") + private DataDTO data; + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + @SerializedName("params") + private ParamsDTO params; + @SerializedName("key") + private String key; + @SerializedName("endpoint") + private String endpoint; + + public ParamsDTO getParams() { + return params; + } + + public void setParams(ParamsDTO params) { + this.params = params; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public static class ParamsDTO { + @SerializedName("signature") + private String signature; + @SerializedName("x-cos-security-token") + private String xcossecuritytoken; + @SerializedName("key") + private String key; + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public String getXcossecuritytoken() { + return xcossecuritytoken; + } + + public void setXcossecuritytoken(String xcossecuritytoken) { + this.xcossecuritytoken = xcossecuritytoken; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/ElementsDTO.java b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/ElementsDTO.java new file mode 100644 index 0000000..fbacddc --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/ElementsDTO.java @@ -0,0 +1,60 @@ +package com.trubitpro.uploadapkplugin.entry.lark; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + + +public class ElementsDTO { + + @SerializedName("tag") + private String tag; + @SerializedName("text") + private TextDTO text; + @SerializedName("type") + private String type; + @SerializedName("url") + private String url; + @SerializedName("actions") + private List actions; + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public TextDTO getText() { + return text; + } + + public void setText(TextDTO text) { + this.text = text; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public List getActions() { + return actions; + } + + public void setActions(List actions) { + this.actions = actions; + } +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/LarkRequestBean.java b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/LarkRequestBean.java new file mode 100644 index 0000000..cc61606 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/LarkRequestBean.java @@ -0,0 +1,309 @@ +package com.trubitpro.uploadapkplugin.entry.lark; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public class LarkRequestBean { + + @SerializedName("msg_type") + private String msg_type; + @SerializedName("content") + private ContentDTO content; + @SerializedName("card") + private CardDTO card; + + public String getMsg_type() { + return msg_type; + } + + public void setMsg_type(String msg_type) { + this.msg_type = msg_type; + } + + public ContentDTO getContent() { + return content; + } + + public void setContent(ContentDTO content) { + this.content = content; + } + + public CardDTO getCard() { + return card; + } + + public void setCard(CardDTO card) { + this.card = card; + } + + public static class ContentDTO { + @SerializedName("post") + private PostDTO post; + + public PostDTO getPost() { + return post; + } + + public void setPost(PostDTO post) { + this.post = post; + } + + public static class PostDTO { + @SerializedName("zh_cn") + public ZhCnDTO zh_cn; + + public ZhCnDTO getZh_cn() { + return zh_cn; + } + + public void setZh_cn(ZhCnDTO zh_cn) { + this.zh_cn = zh_cn; + } + + public static class ZhCnDTO { + @SerializedName("title") + private String title; + @SerializedName("content") + private List> content; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public List> getContent() { + return content; + } + + public void setContent(List> content) { + this.content = content; + } + + public static class ContentBean { + @SerializedName("tag") + private String tag; + @SerializedName("text") + private String text; + @SerializedName("href") + private String href; + @SerializedName("user_id") + private String user_id; + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public String getUser_id() { + return user_id; + } + + public void setUser_id(String user_id) { + this.user_id = user_id; + } + } + } + } + + } + + public static class CardDTO { + @SerializedName("config") + private ConfigDTO config; + @SerializedName("header") + private HeaderDTO header; + @SerializedName("elements") + private List elements; + + public ConfigDTO getConfig() { + return config; + } + + public void setConfig(ConfigDTO config) { + this.config = config; + } + + public HeaderDTO getHeader() { + return header; + } + + public void setHeader(HeaderDTO header) { + this.header = header; + } + + public List getElements() { + return elements; + } + + public void setElements(List elements) { + this.elements = elements; + } + + public static class PostDTO { + @SerializedName("zh_cn") + public ZhCnDTO zh_cn; + + public ZhCnDTO getZh_cn() { + return zh_cn; + } + + public void setZh_cn(ZhCnDTO zh_cn) { + this.zh_cn = zh_cn; + } + + public static class ZhCnDTO { + @SerializedName("title") + private String title; + @SerializedName("content") + private List> content; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public List> getContent() { + return content; + } + + public void setContent(List> content) { + this.content = content; + } + + public static class ContentBean { + @SerializedName("tag") + private String tag; + @SerializedName("text") + private String text; + @SerializedName("href") + private String href; + @SerializedName("user_id") + private String user_id; + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public String getUser_id() { + return user_id; + } + + public void setUser_id(String user_id) { + this.user_id = user_id; + } + } + } + } + + public static class ConfigDTO { + @SerializedName("wide_screen_mode") + private boolean wide_screen_mode; + @SerializedName("enable_forward") + private boolean enable_forward; + + public boolean isWide_screen_mode() { + return wide_screen_mode; + } + + public void setWide_screen_mode(boolean wide_screen_mode) { + this.wide_screen_mode = wide_screen_mode; + } + + public boolean isEnable_forward() { + return enable_forward; + } + + public void setEnable_forward(boolean enable_forward) { + this.enable_forward = enable_forward; + } + } + + public static class HeaderDTO { + @SerializedName("title") + private TextDTO title; + /** + * 颜色值 + *

+ * blue + * wathet + * turquoise + * green + * yellow + * orange + * red + * carmine + * violet + * purple + * indigo + * grey + */ + @SerializedName("template") + private String template; + + public TextDTO getTitle() { + return title; + } + + public void setTitle(TextDTO title) { + this.title = title; + } + + public String getTemplate() { + return template; + } + + public void setTemplate(String template) { + this.template = template; + } + } + + + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/TextDTO.java b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/TextDTO.java new file mode 100644 index 0000000..9d908b4 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/entry/lark/TextDTO.java @@ -0,0 +1,28 @@ +package com.trubitpro.uploadapkplugin.entry.lark; + +import com.google.gson.annotations.SerializedName; + + +public class TextDTO { + + @SerializedName("content") + private String content; + @SerializedName("tag") + private String tag; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/help/CmdHelper.java b/app/src/main/java/com/trubitpro/uploadapkplugin/help/CmdHelper.java new file mode 100644 index 0000000..06be807 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/help/CmdHelper.java @@ -0,0 +1,163 @@ +package com.trubitpro.uploadapkplugin.help; + +import com.trubitpro.uploadapkplugin.pramars.GitLogParams; + + +import org.gradle.api.Project; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + + +public class CmdHelper { + private static final int LOG_MAX_COUNT = 50; + private static final int LOG_MIN_COUNT = 10; + private static final String GIT_LOG_BASIC_CMD = "git log --oneline --pretty=format:\"%an—>%s\" --no-merges"; + public static final String gitLogCmd = GIT_LOG_BASIC_CMD + " --since=\"2022-8-30\" --until=\"2022-9-1\""; + /** + * %ai 是时间,格式:2022-08-31 23:18:48 +0800 + */ + public static final String gitLogCmd2 = "git log --oneline --pretty=format:\"%ai,%an:%s\" --no-merges --since=2days"; + public static final String gitLogCmd3 = GIT_LOG_BASIC_CMD + " --max-count=10"; + + public static String checkGetGitParamsWithLog(Project project) { + GitLogParams gitLogParams = GitLogParams.getGitParamsConfig(project); + if (gitLogParams == null) { + return ""; + } + return getGitLogByTimeAndCount(gitLogParams.gitLogHistoryDayTime, gitLogParams.gitLogMaxCount); + } + + public static String getGitLogByTimeAndCount(int logDayTime, int logMaxCount) { + StringBuilder logBuilder = new StringBuilder(GIT_LOG_BASIC_CMD); + if (logDayTime >= 1) { + logBuilder.append(" --since=").append(logDayTime).append("days"); + logMaxCount = LOG_MAX_COUNT; + } else { + if (logMaxCount <= 0) { + logMaxCount = LOG_MIN_COUNT; + } else if (logMaxCount > LOG_MAX_COUNT) { + logMaxCount = LOG_MAX_COUNT; + } + } + logBuilder.append(" --max-count=").append(logMaxCount); + System.out.println("获取Git log 外部命令:\n" + logBuilder.toString()); + return exeCmd(logBuilder.toString()); + } + + + public static boolean exeBuildFlutterAar(){ + + BufferedReader bufferedReader = null; + Process p = null; + String cdFir="cd ../mexo_flutter_module&&pwd&&flutter clear&&flutter build aar"; + try { + p = Runtime.getRuntime().exec(cdFir ); + System.out.println("cdFir Start"); + Print(p,cdFir); + int exitVal = p.waitFor(); + System.out.println("cdFir End==="+exitVal); + if (exitVal==0){ + return true; + } + + } catch (Exception e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + } finally { + if (bufferedReader != null) { + try { + bufferedReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (p != null) { + try { + p.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + return false; + + + } + + + private static void Print(Process p, String s){ + BufferedReader bufferedReader=null; + try { + bufferedReader = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8)); + StringBuilder stringBuilder = new StringBuilder(); + String line; + int count = 0; + while ((line = bufferedReader.readLine()) != null) { + ++count; + stringBuilder.append(count).append(". ").append(line).append("\n "); + } + System.out.println( s+" result:\n" + stringBuilder); + } catch (Exception e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + } finally { + if (bufferedReader != null) { + try { + bufferedReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (p != null) { + try { + p.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } + + public static String exeCmd(String commandStr) { + BufferedReader bufferedReader = null; + Process p = null; + try { + //java 调用外部命令 + p = Runtime.getRuntime().exec(commandStr); + //Charset.forName("UTF-8") + bufferedReader = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8)); + StringBuilder stringBuilder = new StringBuilder(); + String line; + int count = 0; + while ((line = bufferedReader.readLine()) != null) { + ++count; + stringBuilder.append(count).append(". ").append(line).append("\n "); + } + System.out.println("ExeCmd result:\n" + stringBuilder); + return stringBuilder.toString(); + } catch (Exception e) { + e.printStackTrace(); + System.out.println(e.getMessage()); + } finally { + if (bufferedReader != null) { + try { + bufferedReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (p != null) { + try { + p.waitFor(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + return ""; + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/help/HttpHelper.java b/app/src/main/java/com/trubitpro/uploadapkplugin/help/HttpHelper.java new file mode 100644 index 0000000..fe63430 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/help/HttpHelper.java @@ -0,0 +1,17 @@ +package com.trubitpro.uploadapkplugin.help; + +import java.util.concurrent.TimeUnit; + +import okhttp3.OkHttpClient; + +public class HttpHelper { + + + public static OkHttpClient getOkHttpClient() { + return new OkHttpClient.Builder() + .readTimeout(60, TimeUnit.SECONDS) + .connectTimeout(60, TimeUnit.SECONDS) + .writeTimeout(60, TimeUnit.SECONDS).build(); + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/help/ProcessUtils.java b/app/src/main/java/com/trubitpro/uploadapkplugin/help/ProcessUtils.java new file mode 100644 index 0000000..7fcb16e --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/help/ProcessUtils.java @@ -0,0 +1,108 @@ +package com.trubitpro.uploadapkplugin.help; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeoutException; + +public class ProcessUtils { + /** + * @param timeout 超时时长 + * @param fileDir 所运行程序路径 + * @param command 程序所要执行的命令 + * 运行一个外部命令,返回状态.若超过指定的超时时间,抛出TimeoutException + */ + public static int executeProcess(final long timeout, File fileDir, final String command) + throws IOException, InterruptedException, TimeoutException { + Process process = Runtime.getRuntime().exec(command, null, fileDir); + Worker worker = new Worker(process); + worker.start(); + try { + worker.join(timeout); + if (worker.exit != null){ + return worker.exit; + } else{ + throw new TimeoutException(); + } + } catch (InterruptedException ex) { + worker.interrupt(); + Thread.currentThread().interrupt(); + throw ex; + } + finally { + process.destroy(); + } + } + +private static class Worker extends Thread { + private final Process process; + private Integer exit; + + private Worker(Process process) { + this.process = process; + } + + @Override + public void run() { + InputStream errorStream = null; + InputStream inputStream = null; + try { + errorStream = process.getErrorStream(); + inputStream = process.getInputStream(); + readStreamInfo(errorStream, inputStream); + exit = process.waitFor(); + process.destroy(); + if (exit == 0) { + System.out.println("子进程正常完成"); + } else { + System.out.println("子进程异常结束"); + } + } catch (InterruptedException ignore) { + return; + } + } +} + + /** + * 读取RunTime.exec运行子进程的输入流 和 异常流 + * @param inputStreams 输入流 + */ + public static void readStreamInfo(InputStream... inputStreams){ + ExecutorService executorService = Executors.newFixedThreadPool(inputStreams.length); + for (InputStream in : inputStreams) { + executorService.execute(new MyThread(in)); + } + executorService.shutdown(); + } + public static class MyThread implements Runnable { + + private InputStream in; + public MyThread(InputStream in){ + this.in = in; + } + + @Override + public void run() { + try{ + BufferedReader br = new BufferedReader(new InputStreamReader(in, "GBK")); + String line = null; + while((line = br.readLine())!=null){ + System.out.println(" inputStream: " + line); + } + }catch (IOException e){ + e.printStackTrace(); + }finally { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/help/SendMsgHelper.java b/app/src/main/java/com/trubitpro/uploadapkplugin/help/SendMsgHelper.java new file mode 100644 index 0000000..86c75e9 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/help/SendMsgHelper.java @@ -0,0 +1,203 @@ +package com.trubitpro.uploadapkplugin.help; + +import com.android.build.gradle.api.BaseVariant; +import com.trubitpro.uploadapkplugin.entry.lark.ElementsDTO; +import com.trubitpro.uploadapkplugin.entry.lark.LarkRequestBean; +import com.trubitpro.uploadapkplugin.entry.lark.TextDTO; +import com.trubitpro.uploadapkplugin.pramars.SendLarkParams; +import org.gradle.api.Project; +import java.util.ArrayList; +import java.util.List; +import groovy.json.JsonOutput; +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +public final class SendMsgHelper { + public static void sendMsgToLark(BaseVariant variant, Project project, String dataDTO, String gitLog) { + String defaultTitle = "测试包"; + String defaultText = "最新开发测试包已上传 "; + String defaultClickText = "点我进行下载"; + String defaultLogTitle = "最近Git更新内容:\n "; + SendLarkParams feishuParams = SendLarkParams.getLarkParamsConfig(project); + String webHookHostUrl = feishuParams.webHookHostUrl; + if ( isEmpty(webHookHostUrl)) { + System.out.println("send to lark failure:webHookHostUrl is empty"); + return; + } + String flavorStr = getFlavorInfo(variant); + String title = feishuParams.contentTitle; + if (isEmpty(title)) { + title = defaultTitle; + } + String titleStr = flavorStr ; + String text = feishuParams.contentText; + if ( isEmpty(text)) { + text = defaultText; + } + StringBuilder textStr = new StringBuilder("**").append(title).append( "\n").append(text).append("** ").append(dataDTO).append(" \n"); + LarkRequestBean larkRequestBean = new LarkRequestBean(); + if ("interactive".equals(feishuParams.msgtype)) { + LarkRequestBean.CardDTO cardDTO = new LarkRequestBean.CardDTO(); + + larkRequestBean.setMsg_type("interactive"); + LarkRequestBean.CardDTO.ConfigDTO cardConfigBean = new LarkRequestBean.CardDTO.ConfigDTO(); + cardConfigBean.setWide_screen_mode(true); + cardConfigBean.setEnable_forward(true); + cardDTO.setConfig(cardConfigBean); + LarkRequestBean.CardDTO.HeaderDTO cardHeaderBean = new LarkRequestBean.CardDTO.HeaderDTO(); + cardHeaderBean.setTemplate("green"); + TextDTO cardHeaderTitleBean = new TextDTO(); + cardHeaderTitleBean.setTag("plain_text"); + String rocket="\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80\uD83D\uDE80 "; + cardHeaderTitleBean.setContent(rocket +"\n"+ titleStr); + cardHeaderBean.setTitle(cardHeaderTitleBean); + cardDTO.setHeader(cardHeaderBean); + List elementsDTOList = new ArrayList<>(); + ElementsDTO elements1 = new ElementsDTO(); + elements1.setTag("div"); + TextDTO elements1TextBean = new TextDTO(); + elements1TextBean.setTag("lark_md"); + + String QRCode="https://cli.im/api/qrcode/code?text="+dataDTO+"&mhid=skKRBVu8y54hMHYoI9dQMKo"; + + textStr.append("![").append( isEmpty(feishuParams.clickTxt) ? defaultClickText : feishuParams.clickTxt) + .append("]").append("(").append(dataDTO).append(")").append(""); +// textStr.append("![").append( "").append("(").append(dataDTO).append(")"); + +// textStr.append("[查看下载二维码]").append("(").append(QRCode).append(")"); + if (feishuParams.isAtAll) { + textStr.append(" \n").append(""); + } + elements1TextBean.setContent(textStr.toString()); + elements1.setText(elements1TextBean); + elementsDTOList.add(elements1); + ElementsDTO elements2 = new ElementsDTO(); + + elements2.setTag("hr"); + elementsDTOList.add(elements2); + if (! isEmpty(gitLog) && feishuParams.isSupportGitLog) { + ElementsDTO elements3 = new ElementsDTO(); + elements3.setTag("div"); + TextDTO elements3TextBean = new TextDTO(); + elements3TextBean.setTag("lark_md"); + StringBuilder logStrBuilder = new StringBuilder("**").append(defaultLogTitle).append("**").append(gitLog); + elements3TextBean.setContent(logStrBuilder.toString()); + elements3.setText(elements3TextBean); + elementsDTOList.add(elements3); + ElementsDTO elements4 = new ElementsDTO(); + elements4.setTag("hr"); + elementsDTOList.add(elements4); + } + ElementsDTO elements5 = new ElementsDTO(); + elements5.setTag("action"); + List actionsList = new ArrayList<>(); + ElementsDTO actionBtnDownBtn = new ElementsDTO(); + actionBtnDownBtn.setTag("button"); + actionBtnDownBtn.setType("primary"); + actionBtnDownBtn.setUrl( dataDTO); + TextDTO actionDownBtnText = new TextDTO(); + actionDownBtnText.setTag("plain_text"); + actionDownBtnText.setContent( isEmpty(feishuParams.clickTxt) ? defaultClickText : feishuParams.clickTxt); + actionBtnDownBtn.setText(actionDownBtnText); + actionsList.add(actionBtnDownBtn); + + ElementsDTO actionBtnQRCodeBtn = new ElementsDTO(); + actionBtnQRCodeBtn.setTag("button"); + actionBtnQRCodeBtn.setType("primary"); + actionBtnQRCodeBtn.setUrl(QRCode); + TextDTO actionQRCodeBtnText = new TextDTO(); + actionQRCodeBtnText.setTag("plain_text"); + actionQRCodeBtnText.setContent("查看下载二维码"); + actionBtnQRCodeBtn.setText(actionQRCodeBtnText); + actionsList.add(actionBtnQRCodeBtn); + elements5.setActions(actionsList); + elementsDTOList.add(elements5); + cardDTO.setElements(elementsDTOList); + larkRequestBean.setCard(cardDTO); + } else { + LarkRequestBean.ContentDTO contentDTO = new LarkRequestBean.ContentDTO(); + + larkRequestBean.setMsg_type("post"); + LarkRequestBean.ContentDTO.PostDTO postDTO = new LarkRequestBean.ContentDTO.PostDTO(); + + LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean contentBeanText = new LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean(); + contentBeanText.setTag("text"); + contentBeanText.setText(textStr.toString()); + LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean contentBeanA = new LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean(); + contentBeanA.setTag("a"); + contentBeanA.setText( isEmpty(feishuParams.clickTxt) ? defaultClickText : feishuParams.clickTxt); + contentBeanA.setHref( dataDTO); + List< LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean> contentBeans = new ArrayList<>(); + contentBeans.add(contentBeanText); + contentBeans.add(contentBeanA); + if (feishuParams.isAtAll) { + LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean contentBeanAt = new LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean(); + contentBeanAt.setTag("at"); + contentBeanAt.setUser_id("all"); + contentBeans.add(contentBeanAt); + } + List> zhCnContentList = new ArrayList<>(); + zhCnContentList.add(contentBeans); + if (! isEmpty(gitLog) && feishuParams.isSupportGitLog) { + List< LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean> contentGitLogBeans = new ArrayList<>(); + LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean contentGitLogBeanText = new LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO.ContentBean(); + contentGitLogBeanText.setTag("text"); + contentGitLogBeanText.setText("** " + defaultLogTitle + gitLog); + contentGitLogBeans.add(contentGitLogBeanText); + zhCnContentList.add(contentGitLogBeans); + } + + LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO zhCnDTO = new LarkRequestBean.ContentDTO.PostDTO.ZhCnDTO(); + zhCnDTO.setTitle(titleStr.toString()); + zhCnDTO.setContent(zhCnContentList); + postDTO.setZh_cn(zhCnDTO); + contentDTO.setPost(postDTO); + larkRequestBean.setContent(contentDTO); + } + + + /** + * text 文本 + * post 富文本 发送富文本消息 + * image 图片 上传图片 + * share_chat 分享群名片 群名片 + * interactive 消息卡片 消息卡片消息 + */ + String json = JsonOutput.toJson(larkRequestBean); + System.out.println("send to lark request json:" + json); + RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;charset=UTF-8"), json); + Request request = new Request.Builder() + .addHeader("Connection", "Keep-Alive") + .addHeader("Charset", "UTF-8") + .url(webHookHostUrl) + .post(requestBody) + .build(); + try { + Response response = HttpHelper.getOkHttpClient().newCall(request).execute(); + if (response.isSuccessful() && response.body() != null) { + String result = response.body().string(); + System.out.println("send to lark result:" + result); + } else { + System.out.println("send to lark failure"); + } + System.out.println("*************** sendMsgToLark finish ***************"); + } catch (Exception e) { + System.out.println("send to lark failure " + e); + } + } + + private static String getFlavorInfo(BaseVariant variant) { + String flavor = isEmpty(variant.getName()) ? variant.getFlavorName() : variant.getName(); + return isEmpty(flavor) ? "" : "(FlavorName:" + flavor + ")"; + } + public static boolean isEmpty(CharSequence s) { + if (s == null) { + return true; + } else { + return s.length() == 0; + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/GitLogParams.java b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/GitLogParams.java new file mode 100644 index 0000000..b5d6ae6 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/GitLogParams.java @@ -0,0 +1,25 @@ +package com.trubitpro.uploadapkplugin.pramars; + +import org.gradle.api.Project; + +/** + * 设置获取Git日志的参数 + */ +public class GitLogParams { + + /** + * 获取以当前时间为准的,多少天之前的Git记录,默认-1为全部,会结合数量进行获取 + */ + public int gitLogHistoryDayTime = -1; + + /** + * Git记录的最大数量 + */ + public int gitLogMaxCount = 10; + + public static GitLogParams getGitParamsConfig(Project project) { + GitLogParams extension = project.getExtensions().findByType(GitLogParams.class); + return extension; + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/SendLarkParams.java b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/SendLarkParams.java new file mode 100644 index 0000000..d312440 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/SendLarkParams.java @@ -0,0 +1,44 @@ +package com.trubitpro.uploadapkplugin.pramars; + + +import org.gradle.api.Project; + +/** + * 发送到飞书的消息参数 + */ +public class SendLarkParams { + + public String webHookHostUrl; + public String contentTitle; + public String contentText; + public String msgtype = "post"; + public boolean isAtAll = false; + public String clickTxt = "点我进行下载"; + /** + * 是否支持发送git记录 + */ + public boolean isSupportGitLog = true; + + public SendLarkParams() { + + } + + public SendLarkParams(String webHookHostUrl, String contentTitle, String contentText, String msgtype, boolean isAtAll, String clickTxt) { + this.webHookHostUrl = webHookHostUrl; + this.contentText = contentText; + this.contentTitle = contentTitle; + this.msgtype = msgtype; + this.isAtAll = isAtAll; + this.clickTxt = clickTxt; + } + + public static SendLarkParams getLarkParamsConfig(Project project) { + + SendLarkParams extension = project.getExtensions().findByType(SendLarkParams.class); + if (extension == null) { + extension = new SendLarkParams(); + } + return extension; + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/TrubitProParams.java b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/TrubitProParams.java new file mode 100644 index 0000000..f560b69 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/TrubitProParams.java @@ -0,0 +1,6 @@ +package com.trubitpro.uploadapkplugin.pramars; + +public class TrubitProParams { + + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/UploadPgyParams.java b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/UploadPgyParams.java new file mode 100644 index 0000000..ca1ec93 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/pramars/UploadPgyParams.java @@ -0,0 +1,66 @@ +package com.trubitpro.uploadapkplugin.pramars; + +import org.gradle.api.Project; + + +//插件外部传入的参数 + +public class UploadPgyParams { + + //(必填) API Key 点击获取_api_key + public String apiKey; + public String appName; + public String buildTypeName;//非蒲公英参数,用于控制打包release还是debug,默认1是release,2是debug + //(选填)应用安装方式,值为(1,2,3,默认为1 公开安装)。1:公开安装,2:密码安装,3:邀请安装 + public int buildInstallType = 1; + //(选填) 设置App安装密码,密码为空时默认公开安装 + public String buildPassword; + //(选填) 版本更新描述,请传空字符串,或不传。 + public String buildUpdateDescription; + //(选填)是否设置安装有效期,值为:1 设置有效时间, 2 长期有效,如果不填写不修改上一次的设置 + public int buildInstallDate = 2; + //(选填)所需更新的指定渠道的下载短链接,只可指定一个渠道,字符串型,如:abcd + public String buildChannelShortcut; + + public String uploadApkFilePath; + + public UploadPgyParams() { + + } + + public UploadPgyParams(String apiKey) { + this(apiKey, "Release"); + } + + public UploadPgyParams(String apiKey, String buildTypeName) { + this(apiKey, "", buildTypeName, 1, ""); + } + + public UploadPgyParams(String apiKey, String appName, String buildTypeName, int buildInstallType, String buildPassword) { + this(apiKey, appName, buildTypeName, buildInstallType, buildPassword, ""); + } + + public UploadPgyParams(String apiKey, String appName, String buildTypeName, int buildInstallType, String buildPassword, String buildUpdateDescription) { + this(apiKey, appName, buildTypeName, buildInstallType, buildPassword, buildUpdateDescription, 2, ""); + } + + public UploadPgyParams(String apiKey, String appName, String buildTypeName, int buildInstallType, String buildPassword, String buildUpdateDescription, int buildInstallDate, String buildChannelShortcut) { + this.apiKey = apiKey; + this.appName = appName; + this.buildTypeName = buildTypeName; + this.buildInstallType = buildInstallType; + this.buildPassword = buildPassword; + this.buildUpdateDescription = buildUpdateDescription; + this.buildInstallDate = buildInstallDate; + this.buildChannelShortcut = buildChannelShortcut; + } + + public static UploadPgyParams getConfig(Project project) { + UploadPgyParams extension = project.getExtensions().findByType(UploadPgyParams.class); + if (extension == null) { + extension = new UploadPgyParams(); + } + return extension; + } + +} diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/task/BaseTask.java b/app/src/main/java/com/trubitpro/uploadapkplugin/task/BaseTask.java new file mode 100644 index 0000000..2180ad0 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/task/BaseTask.java @@ -0,0 +1,107 @@ +package com.trubitpro.uploadapkplugin.task; + + + +import com.android.build.gradle.api.BaseVariant; +import com.google.gson.Gson; +import com.trubitpro.uploadapkplugin.PluginConstants; +import com.trubitpro.uploadapkplugin.entry.LarkResult; +import com.trubitpro.uploadapkplugin.entry.PgyCOSTokenResult; +import com.trubitpro.uploadapkplugin.help.CmdHelper; +import com.trubitpro.uploadapkplugin.help.HttpHelper; +import com.trubitpro.uploadapkplugin.help.SendMsgHelper; + + +import org.gradle.api.DefaultTask; +import org.gradle.api.Project; + +import java.io.File; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import okhttp3.FormBody; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +/** + * Created by Android-ZX + * 2021/9/3. + */ +public class BaseTask extends DefaultTask { + + protected BaseVariant mVariant; + protected Project mTargetProject; + + public void init(BaseVariant variant, Project project) { + this.mVariant = variant; + this.mTargetProject = project; + setDescription(PluginConstants.TASK_DES); + setGroup(PluginConstants.TASK_GROUP_NAME); + } + + + /** + * 快速上传方式 获取上传的 token + * @param apkFile + */ + public void uploadPgyQuickWay(File apkFile) { + //builder + + RequestBody fileBody = RequestBody.create(MediaType.parse("*/*"), apkFile); + String name = apkFile.getName(); //文件名称 + try { + name = URLEncoder.encode(name, "UTF-8"); //文件名称编码,防止出现中文乱码 + } catch (UnsupportedEncodingException e1) { + //TODO + } + MultipartBody mBody = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart("file" , name , fileBody) + .build(); + Request request = new Request.Builder() + .url("https://test-api.trubit.com/member-api/api/v1/uploadApp") + .post(mBody) + .build(); + + + try { + Response response = HttpHelper.getOkHttpClient().newCall(request).execute(); + if (response.isSuccessful()) { + String result = response.body().string(); + System.out.println("TrubitPro --- result: " + result); + if (!result.isEmpty()) { + LarkResult larkResult = new Gson().fromJson(result, LarkResult.class); + if (larkResult.getCode() != 0 ) { + System.out.println("TrubitPro --- upload error : " + larkResult.getMsg()); + return; + } + if (larkResult.getData() != null) { + String apkDownUrl = larkResult.getData(); + System.out.println("上传成功,应用链接: " + apkDownUrl); + String gitLog = CmdHelper.checkGetGitParamsWithLog(mTargetProject); + SendMsgHelper.sendMsgToLark(mVariant, mTargetProject, larkResult.getData(), gitLog); + } else { + System.out.println("TrubitPro --- buildInfo: upload pgy result error : data is empty"); + } + } + } else { + System.out.println(response.toString()); + System.out.println("TrubitPro ---- request 上传 call failed"); + } + System.out.println("******************* TrubitPro: finish *******************"); + } catch (Exception e) { + System.out.println("TrubitPro ---- request 上传 call failed " + e); + } + } + + + + + +} \ No newline at end of file diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/task/OnlyUploadTask.java b/app/src/main/java/com/trubitpro/uploadapkplugin/task/OnlyUploadTask.java new file mode 100644 index 0000000..5a1b44c --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/task/OnlyUploadTask.java @@ -0,0 +1,51 @@ +package com.trubitpro.uploadapkplugin.task; + + +import com.android.build.gradle.api.BaseVariantOutput; +import com.trubitpro.uploadapkplugin.pramars.UploadPgyParams; + + +import org.gradle.api.GradleException; +import org.gradle.api.tasks.TaskAction; + +import java.io.File; +import java.util.Objects; + +/** + * Created by Android-ZX + * 2021/9/3. + */ +public class OnlyUploadTask extends BaseTask { + + @TaskAction + public void uploadToPGY() { + + for (BaseVariantOutput output : mVariant.getOutputs()) { + File apkDir = output.getOutputFile(); + if (apkDir == null || !apkDir.exists()) { + throw new GradleException("The compiled APK file to upload does not exist!"); + } + System.out.println("ApkDir path: " + apkDir.getAbsolutePath()); + File apk = null; + if (apkDir.getName().endsWith(".apk")) { + apk = apkDir; + } else { + if (apkDir.listFiles() != null) { + for (int i = Objects.requireNonNull(apkDir.listFiles()).length - 1; i >= 0; i--) { + File apkFile = Objects.requireNonNull(apkDir.listFiles())[i]; + if (apkFile != null && apkFile.exists() && apkFile.getName().endsWith(".apk")) { + apk = apkFile; + break; + } + } + } + } + if (apk == null || !apk.exists()) { + throw new GradleException("The compiled APK file to upload does not exist!"); + } + System.out.println("Final upload apk path: " + apk.getAbsolutePath()); + uploadPgyQuickWay( apk); + } + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/trubitpro/uploadapkplugin/test.java b/app/src/main/java/com/trubitpro/uploadapkplugin/test.java new file mode 100644 index 0000000..285fd66 --- /dev/null +++ b/app/src/main/java/com/trubitpro/uploadapkplugin/test.java @@ -0,0 +1,15 @@ +package com.trubitpro.uploadapkplugin; + +import com.trubitpro.uploadapkplugin.task.BaseTask; + +import java.io.File; + +public class test { + + + public static void main(String[] args) { + BaseTask baseTask=new BaseTask(); + File baseFile=new File("/Users/wuao/AndroidStudioProjects/MyApplication3/app/build/outputs/apk/Facebook/debug/app-Facebook-debug.apk"); + baseTask .uploadPgyQuickWay(baseFile); + } +} diff --git a/app/src/main/resources/META-INF/gradle-plugins/center.uploadpgy.plugin.properties b/app/src/main/resources/META-INF/gradle-plugins/center.uploadpgy.plugin.properties new file mode 100644 index 0000000..91d279e --- /dev/null +++ b/app/src/main/resources/META-INF/gradle-plugins/center.uploadpgy.plugin.properties @@ -0,0 +1 @@ +implementation-class=com.trubitpro.uploadapkplugin.UploadApkPlugin \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..c48c27d --- /dev/null +++ b/build.gradle @@ -0,0 +1,22 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url 'https://jitpack.io' } + jcenter() // Warning: this repository is going to shut down soon + } + + dependencies { + classpath "com.android.tools.build:gradle:4.1.2" + classpath "com.github.dcendents:android-maven-gradle-plugin:2.1" + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + plugins { + id 'org.jetbrains.kotlin.android' version '1.8.0' apply false +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..61ba924 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,24 @@ +# 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 -Dfile.encoding=UTF-8 +# 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 +# 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 +android.disableAutomaticComponentCreation=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..01c7580 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Sep 04 10:39:02 CST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## 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='"-Xmx64m" "-Xms64m"' + +# 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 or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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=`expr $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" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@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 Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@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="-Xmx64m" "-Xms64m" + +@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 execute + +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 execute + +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 + +: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 %* + +: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 diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar new file mode 100644 index 0000000..fa98215 Binary files /dev/null and b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar differ diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.md5 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.md5 new file mode 100644 index 0000000..7970c62 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.md5 @@ -0,0 +1 @@ +cccaa0dcafa9b64122828864c05bf8fd \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha1 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha1 new file mode 100644 index 0000000..f8fcac6 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha1 @@ -0,0 +1 @@ +6e5fbd734581f465167256ac5e69ce58072e1961 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha256 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha256 new file mode 100644 index 0000000..d875342 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha256 @@ -0,0 +1 @@ +7a2446ca584281d76a1dd539d7d412f7075279f47991955e7165c61831214786 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha512 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha512 new file mode 100644 index 0000000..0990beb --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.jar.sha512 @@ -0,0 +1 @@ +a77055aa6ecbd7d28fba76ebe89eb8e1cbae4266e489b3dc482778cb69169fa253dbe0091f55672b9b5afd5ae235834d5eee63dfffcdaafc2c20db3c5494b8b7 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module new file mode 100644 index 0000000..11768fa --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module @@ -0,0 +1,90 @@ +{ + "formatVersion": "1.1", + "component": { + "group": "center.uploadpgy.plugin", + "module": "UploadApkPlugin", + "version": "1.0.0", + "attributes": { + "org.gradle.status": "release" + } + }, + "createdBy": { + "gradle": { + "version": "8.0" + } + }, + "variants": [ + { + "name": "apiElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-api" + }, + "files": [ + { + "name": "UploadApkPlugin-1.0.0.jar", + "url": "UploadApkPlugin-1.0.0.jar", + "size": 36367, + "sha512": "a77055aa6ecbd7d28fba76ebe89eb8e1cbae4266e489b3dc482778cb69169fa253dbe0091f55672b9b5afd5ae235834d5eee63dfffcdaafc2c20db3c5494b8b7", + "sha256": "7a2446ca584281d76a1dd539d7d412f7075279f47991955e7165c61831214786", + "sha1": "6e5fbd734581f465167256ac5e69ce58072e1961", + "md5": "cccaa0dcafa9b64122828864c05bf8fd" + } + ] + }, + { + "name": "runtimeElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-runtime" + }, + "dependencies": [ + { + "group": "com.android.tools.build", + "module": "gradle", + "version": { + "requires": "3.6.4" + } + }, + { + "group": "com.github.dcendents", + "module": "android-maven-gradle-plugin", + "version": { + "requires": "2.1" + } + }, + { + "group": "com.google.code.gson", + "module": "gson", + "version": { + "requires": "2.8.8" + } + }, + { + "group": "com.squareup.okhttp3", + "module": "okhttp", + "version": { + "requires": "3.12.12" + } + } + ], + "files": [ + { + "name": "UploadApkPlugin-1.0.0.jar", + "url": "UploadApkPlugin-1.0.0.jar", + "size": 36367, + "sha512": "a77055aa6ecbd7d28fba76ebe89eb8e1cbae4266e489b3dc482778cb69169fa253dbe0091f55672b9b5afd5ae235834d5eee63dfffcdaafc2c20db3c5494b8b7", + "sha256": "7a2446ca584281d76a1dd539d7d412f7075279f47991955e7165c61831214786", + "sha1": "6e5fbd734581f465167256ac5e69ce58072e1961", + "md5": "cccaa0dcafa9b64122828864c05bf8fd" + } + ] + } + ] +} diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.md5 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.md5 new file mode 100644 index 0000000..34e1031 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.md5 @@ -0,0 +1 @@ +6c22a6af684f05524677f0ff0837b12f \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha1 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha1 new file mode 100644 index 0000000..7650efc --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha1 @@ -0,0 +1 @@ +8b1c1d59e1ebf31461710b67ed3659fb1f02cbe4 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha256 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha256 new file mode 100644 index 0000000..0bee9c0 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha256 @@ -0,0 +1 @@ +2f41bf1c5ea34f25cc38112cce092e9d601cdbe2f9c5d1ce9551da28daf58b26 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha512 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha512 new file mode 100644 index 0000000..9f62d12 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.module.sha512 @@ -0,0 +1 @@ +69b302ae7f0f079939cb0cf4fa3f9ed4ff2fecea1a34396396acb4c2638425eecf6d355dcc01b8eab7d12a46f9c5683e5b601bcbd9e359d07af7c4da1f77b8e9 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom new file mode 100644 index 0000000..e5220e7 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom @@ -0,0 +1,39 @@ + + + + + + + + 4.0.0 + center.uploadpgy.plugin + UploadApkPlugin + 1.0.0 + + + com.android.tools.build + gradle + 3.6.4 + runtime + + + com.github.dcendents + android-maven-gradle-plugin + 2.1 + runtime + + + com.google.code.gson + gson + 2.8.8 + runtime + + + com.squareup.okhttp3 + okhttp + 3.12.12 + runtime + + + diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.md5 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.md5 new file mode 100644 index 0000000..162a2bf --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.md5 @@ -0,0 +1 @@ +ffa263d116cefbdd53b480c708cab652 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha1 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha1 new file mode 100644 index 0000000..750be1d --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha1 @@ -0,0 +1 @@ +b5e576f3a6f91dd8c8ea0b4396c4ffc9f57dcb4d \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha256 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha256 new file mode 100644 index 0000000..f6fe1a8 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha256 @@ -0,0 +1 @@ +8e5b5cb69d7ae33e856469f3e442c3e0a88f1594ffbf1b71c5ecd5f11522878f \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha512 b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha512 new file mode 100644 index 0000000..c44a7c2 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/1.0.0/UploadApkPlugin-1.0.0.pom.sha512 @@ -0,0 +1 @@ +5d138065f8486e59b47b14855df06841654afbed1578848fa9fd64e98e0b9e077b631f9d14e57688fbb3c839a9619376dfb2f987b46ecaf6b831519dccd17c25 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml new file mode 100644 index 0000000..16e17d5 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml @@ -0,0 +1,13 @@ + + + center.uploadpgy.plugin + UploadApkPlugin + + 1.0.0 + 1.0.0 + + 1.0.0 + + 20230904095305 + + diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.md5 b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.md5 new file mode 100644 index 0000000..fb6ba91 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.md5 @@ -0,0 +1 @@ +4e2865e77607500864620c3bdc5b4bda \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha1 b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha1 new file mode 100644 index 0000000..00f2021 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +69490d899ede062a9e8e232866898c353cf62f17 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha256 b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha256 new file mode 100644 index 0000000..da7ed74 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha256 @@ -0,0 +1 @@ +221cf4bacab8de71d3ec007add01e346c33b4ab12a1a21843feea8342b038079 \ No newline at end of file diff --git a/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha512 b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha512 new file mode 100644 index 0000000..8542586 --- /dev/null +++ b/repo/center/uploadpgy/plugin/UploadApkPlugin/maven-metadata.xml.sha512 @@ -0,0 +1 @@ +47f1b5ba4377eddfcf99bf1ef2b37fd06d1568fe2df190c99faa74f719060ffb868c2bf43fa2ba35875e652b936d8bd8351978271ab51fef68c04e355e5e9781 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/maven-metadata.xml b/repo/uploadapkplugin/app/maven-metadata.xml new file mode 100644 index 0000000..310f5c5 --- /dev/null +++ b/repo/uploadapkplugin/app/maven-metadata.xml @@ -0,0 +1,13 @@ + + + uploadapkplugin + app + + unspecified + unspecified + + unspecified + + 20230904095305 + + diff --git a/repo/uploadapkplugin/app/maven-metadata.xml.md5 b/repo/uploadapkplugin/app/maven-metadata.xml.md5 new file mode 100644 index 0000000..eaf7706 --- /dev/null +++ b/repo/uploadapkplugin/app/maven-metadata.xml.md5 @@ -0,0 +1 @@ +444dfb6c25acf10e41043c5cffe8b6e3 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/maven-metadata.xml.sha1 b/repo/uploadapkplugin/app/maven-metadata.xml.sha1 new file mode 100644 index 0000000..c123be4 --- /dev/null +++ b/repo/uploadapkplugin/app/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +e85b3fa10e5f197a197382ad8fdcac42c1a8623a \ No newline at end of file diff --git a/repo/uploadapkplugin/app/maven-metadata.xml.sha256 b/repo/uploadapkplugin/app/maven-metadata.xml.sha256 new file mode 100644 index 0000000..5ad81a3 --- /dev/null +++ b/repo/uploadapkplugin/app/maven-metadata.xml.sha256 @@ -0,0 +1 @@ +bcc123f1ee35601a10a3456e5c8c3e60235ce5b35639c589182d4437c1c56e87 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/maven-metadata.xml.sha512 b/repo/uploadapkplugin/app/maven-metadata.xml.sha512 new file mode 100644 index 0000000..b2b1c52 --- /dev/null +++ b/repo/uploadapkplugin/app/maven-metadata.xml.sha512 @@ -0,0 +1 @@ +aacd68d959149111a6c4c3b9dcbe9236de1097ac174e81f41783b7e4928a122cb2c9546b398314dbd7a7ffe2debb16b9937a14bbff4dd3f0e0dde9743b67a3c4 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.jar b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar new file mode 100644 index 0000000..fa98215 Binary files /dev/null and b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar differ diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.md5 b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.md5 new file mode 100644 index 0000000..7970c62 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.md5 @@ -0,0 +1 @@ +cccaa0dcafa9b64122828864c05bf8fd \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha1 b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha1 new file mode 100644 index 0000000..f8fcac6 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha1 @@ -0,0 +1 @@ +6e5fbd734581f465167256ac5e69ce58072e1961 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha256 b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha256 new file mode 100644 index 0000000..d875342 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha256 @@ -0,0 +1 @@ +7a2446ca584281d76a1dd539d7d412f7075279f47991955e7165c61831214786 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha512 b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha512 new file mode 100644 index 0000000..0990beb --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.jar.sha512 @@ -0,0 +1 @@ +a77055aa6ecbd7d28fba76ebe89eb8e1cbae4266e489b3dc482778cb69169fa253dbe0091f55672b9b5afd5ae235834d5eee63dfffcdaafc2c20db3c5494b8b7 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.module b/repo/uploadapkplugin/app/unspecified/app-unspecified.module new file mode 100644 index 0000000..78295d0 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.module @@ -0,0 +1,90 @@ +{ + "formatVersion": "1.1", + "component": { + "group": "uploadapkplugin", + "module": "app", + "version": "unspecified", + "attributes": { + "org.gradle.status": "release" + } + }, + "createdBy": { + "gradle": { + "version": "8.0" + } + }, + "variants": [ + { + "name": "apiElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-api" + }, + "files": [ + { + "name": "app-unspecified.jar", + "url": "app-unspecified.jar", + "size": 36367, + "sha512": "a77055aa6ecbd7d28fba76ebe89eb8e1cbae4266e489b3dc482778cb69169fa253dbe0091f55672b9b5afd5ae235834d5eee63dfffcdaafc2c20db3c5494b8b7", + "sha256": "7a2446ca584281d76a1dd539d7d412f7075279f47991955e7165c61831214786", + "sha1": "6e5fbd734581f465167256ac5e69ce58072e1961", + "md5": "cccaa0dcafa9b64122828864c05bf8fd" + } + ] + }, + { + "name": "runtimeElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-runtime" + }, + "dependencies": [ + { + "group": "com.android.tools.build", + "module": "gradle", + "version": { + "requires": "3.6.4" + } + }, + { + "group": "com.github.dcendents", + "module": "android-maven-gradle-plugin", + "version": { + "requires": "2.1" + } + }, + { + "group": "com.google.code.gson", + "module": "gson", + "version": { + "requires": "2.8.8" + } + }, + { + "group": "com.squareup.okhttp3", + "module": "okhttp", + "version": { + "requires": "3.12.12" + } + } + ], + "files": [ + { + "name": "app-unspecified.jar", + "url": "app-unspecified.jar", + "size": 36367, + "sha512": "a77055aa6ecbd7d28fba76ebe89eb8e1cbae4266e489b3dc482778cb69169fa253dbe0091f55672b9b5afd5ae235834d5eee63dfffcdaafc2c20db3c5494b8b7", + "sha256": "7a2446ca584281d76a1dd539d7d412f7075279f47991955e7165c61831214786", + "sha1": "6e5fbd734581f465167256ac5e69ce58072e1961", + "md5": "cccaa0dcafa9b64122828864c05bf8fd" + } + ] + } + ] +} diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.module.md5 b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.md5 new file mode 100644 index 0000000..d6d18fc --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.md5 @@ -0,0 +1 @@ +7bab39f11a42ba442118e18f359dd0a4 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha1 b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha1 new file mode 100644 index 0000000..3ea94e9 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha1 @@ -0,0 +1 @@ +3c648d9216e4bec5f10916ac454182514a4995e0 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha256 b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha256 new file mode 100644 index 0000000..0a24345 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha256 @@ -0,0 +1 @@ +6280baa9aa78321d7821ebc0a81a84e0381dca776fab6932de46f84163f9164d \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha512 b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha512 new file mode 100644 index 0000000..d26b85c --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.module.sha512 @@ -0,0 +1 @@ +eff87dae4bc9fb7cf1e4a1cfa8fb841362bbcfef03b9f5bc7c87c2edeebbafa425665cbf237ba2c74565bae03d1b9e2541c1ecb03771c19d3cc0b8a89450bf93 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.pom b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom new file mode 100644 index 0000000..6ddc9ec --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom @@ -0,0 +1,39 @@ + + + + + + + + 4.0.0 + uploadapkplugin + app + unspecified + + + com.android.tools.build + gradle + 3.6.4 + runtime + + + com.github.dcendents + android-maven-gradle-plugin + 2.1 + runtime + + + com.google.code.gson + gson + 2.8.8 + runtime + + + com.squareup.okhttp3 + okhttp + 3.12.12 + runtime + + + diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.md5 b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.md5 new file mode 100644 index 0000000..75270b2 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.md5 @@ -0,0 +1 @@ +580e21640c16ce9c641e849833f2025a \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha1 b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha1 new file mode 100644 index 0000000..ba4f532 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha1 @@ -0,0 +1 @@ +50c90881f534abfde4d2c81f8c827f52c211b245 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha256 b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha256 new file mode 100644 index 0000000..efdc3f3 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha256 @@ -0,0 +1 @@ +2d9cefa4b8586b9fc260537f4eba7fa570c7c03b42ac766a1088d0e510952a88 \ No newline at end of file diff --git a/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha512 b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha512 new file mode 100644 index 0000000..52c2997 --- /dev/null +++ b/repo/uploadapkplugin/app/unspecified/app-unspecified.pom.sha512 @@ -0,0 +1 @@ +43ca1ef1ee8240f1c3f67df87febc4690c4f4e20d2bc04225d3d5e690ff7af08a5cb90d549b8fd3ad15bf179b6304b5be7bd2de913c8bc21cc569c13f976d1c1 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..71aec1b --- /dev/null +++ b/settings.gradle @@ -0,0 +1,17 @@ +import org.gradle.api.initialization.resolve.RepositoriesMode + + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.PREFER_PROJECT) + repositories { + google() + mavenCentral() + google() + jcenter() + maven { url 'https://jitpack.io' } + mavenCentral() + } +} + +//rootProject.name = "uploadapkplugin" +include ':app'