From 1d2b595859fc915e5e49202b5533e781cbb80222 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Thu, 3 Apr 2025 11:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8=E4=BB=8B?= =?UTF-8?q?=E7=BB=8D=E7=AA=97=E5=8F=A3=E8=B0=83=E8=AF=95=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aes/build.properties | 4 +- .../cc/winboll/studio/aes/AboutActivity.java | 2 + libaes/build.properties | 4 +- .../studio/libaes/winboll/APPInfo.java | 28 +++++++++- .../studio/libaes/winboll/AboutView.java | 53 +++++++++++-------- libaes/src/main/res/values/attrs.xml | 15 +++++- 6 files changed, 77 insertions(+), 29 deletions(-) diff --git a/aes/build.properties b/aes/build.properties index 3498711..3f24c35 100644 --- a/aes/build.properties +++ b/aes/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Wed Apr 02 20:09:04 HKT 2025 +#Thu Apr 03 03:02:56 GMT 2025 stageCount=6 libraryProject=libaes baseVersion=15.2 publishVersion=15.2.5 -buildCount=0 +buildCount=11 baseBetaVersion=15.2.6 diff --git a/aes/src/main/java/cc/winboll/studio/aes/AboutActivity.java b/aes/src/main/java/cc/winboll/studio/aes/AboutActivity.java index 208327c..bc1ff3b 100644 --- a/aes/src/main/java/cc/winboll/studio/aes/AboutActivity.java +++ b/aes/src/main/java/cc/winboll/studio/aes/AboutActivity.java @@ -86,6 +86,8 @@ public class AboutActivity extends WinBollActivity implements IWinBollActivity { appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES"); appInfo.setAppAPKName("AES"); appInfo.setAppAPKFolderName("AES"); + //appInfo.setIsAddDebugTools(false); + appInfo.setIsAddDebugTools(BuildConfig.DEBUG); return new AboutView(mContext, appInfo); } } diff --git a/libaes/build.properties b/libaes/build.properties index 2a919fc..3f24c35 100644 --- a/libaes/build.properties +++ b/libaes/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Wed Apr 02 20:08:50 HKT 2025 +#Thu Apr 03 03:02:56 GMT 2025 stageCount=6 libraryProject=libaes baseVersion=15.2 publishVersion=15.2.5 -buildCount=0 +buildCount=11 baseBetaVersion=15.2.6 diff --git a/libaes/src/main/java/cc/winboll/studio/libaes/winboll/APPInfo.java b/libaes/src/main/java/cc/winboll/studio/libaes/winboll/APPInfo.java index 66a53e6..9ee7030 100644 --- a/libaes/src/main/java/cc/winboll/studio/libaes/winboll/APPInfo.java +++ b/libaes/src/main/java/cc/winboll/studio/libaes/winboll/APPInfo.java @@ -32,7 +32,9 @@ public class APPInfo implements Serializable { String appAPKName; // 应用包存储文件夹名称 String appAPKFolderName; - + // 是否添加调试工具 + boolean isAddDebugTools; + public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitOwner, String appGitAPPBranch, String appGitAPPSubProjectFolder, String appHomePage, String appAPKName, String appAPKFolderName) { this.appName = appName; this.appIcon = appIcon; @@ -44,6 +46,21 @@ public class APPInfo implements Serializable { this.appHomePage = appHomePage; this.appAPKName = appAPKName; this.appAPKFolderName = appAPKFolderName; + this.isAddDebugTools = false; + } + + public APPInfo(String appName, int appIcon, String appDescription, String appGitName, String appGitOwner, String appGitAPPBranch, String appGitAPPSubProjectFolder, String appHomePage, String appAPKName, String appAPKFolderName, boolean isAddDebugTools) { + this.appName = appName; + this.appIcon = appIcon; + this.appDescription = appDescription; + this.appGitName = appGitName; + this.appGitOwner = appGitOwner; + this.appGitAPPBranch = appGitAPPBranch; + this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder; + this.appHomePage = appHomePage; + this.appAPKName = appAPKName; + this.appAPKFolderName = appAPKFolderName; + this.isAddDebugTools = isAddDebugTools; } public APPInfo() { @@ -58,6 +75,15 @@ public class APPInfo implements Serializable { this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP"; this.appAPKName = "APP"; this.appAPKFolderName = "APP"; + this.isAddDebugTools = false; + } + + public void setIsAddDebugTools(boolean isAddDebugTools) { + this.isAddDebugTools = isAddDebugTools; + } + + public boolean isAddDebugTools() { + return isAddDebugTools; } public void setAppGitOwner(String appGitOwner) { diff --git a/libaes/src/main/java/cc/winboll/studio/libaes/winboll/AboutView.java b/libaes/src/main/java/cc/winboll/studio/libaes/winboll/AboutView.java index 05d76dc..991b8ef 100644 --- a/libaes/src/main/java/cc/winboll/studio/libaes/winboll/AboutView.java +++ b/libaes/src/main/java/cc/winboll/studio/libaes/winboll/AboutView.java @@ -32,6 +32,7 @@ import okhttp3.Credentials; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; +import mehdi.sakout.aboutpage.BuildConfig; public class AboutView extends LinearLayout { @@ -50,6 +51,7 @@ public class AboutView extends LinearLayout { String mszAppGitName = ""; String mszAppVersionName = ""; String mszCurrentAppPackageName = ""; + boolean mIsAddDebugTools; volatile String mszNewestAppPackageName = ""; String mszAppDescription = ""; String mszHomePage = ""; @@ -91,6 +93,7 @@ public class AboutView extends LinearLayout { appInfo.setAppGitAPPSubProjectFolder(typedArray.getString(R.styleable.AboutView_app_gitappsubprojectfolder)); appInfo.setAppDescription(typedArray.getString(R.styleable.AboutView_appdescription)); appInfo.setAppIcon(typedArray.getResourceId(R.styleable.AboutView_appicon, R.drawable.ic_winboll)); + appInfo.setIsAddDebugTools(typedArray.getBoolean(R.styleable.AboutView_is_adddebugtools, false)); // 返回一个绑定资源结束的信号给资源 typedArray.recycle(); return appInfo; @@ -210,16 +213,6 @@ public class AboutView extends LinearLayout { }; protected View createAboutPage() { - // 定义应用调试按钮 - // - Element elementAppMode; - if (GlobalApplication.isDebuging()) { - elementAppMode = new Element(mContext.getString(R.string.app_normal), R.drawable.ic_winboll); - elementAppMode.setOnClickListener(mAppNormalOnClickListener); - } else { - elementAppMode = new Element(mContext.getString(R.string.app_debug), R.drawable.ic_winboll); - elementAppMode.setOnClickListener(mAppDebugOnClickListener); - } // 定义 GitWeb 按钮 // Element elementGitWeb = new Element(mContext.getString(R.string.gitea_home), R.drawable.ic_winboll); @@ -237,8 +230,8 @@ public class AboutView extends LinearLayout { } catch (PackageManager.NameNotFoundException e) { LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); } - View aboutPage = new AboutPage(mContext) - .setDescription(szAppInfo) + AboutPage aboutPage = new AboutPage(mContext); + aboutPage.setDescription(szAppInfo) //.isRTL(false) //.setCustomFont(String) // or Typeface .setImage(mnAppIcon) @@ -247,17 +240,31 @@ public class AboutView extends LinearLayout { //.addGroup("Connect with us") .addEmail("ZhanGSKen@AliYun.Com") .addWebsite(mszHomePage) - .addItem(elementAppMode) .addItem(elementGitWeb) - .addItem(elementAppUpdate) - //.addFacebook("the.medy") - //.addTwitter("medyo80") - //.addYoutube("UCdPQtdWIsg7_pi4mrRu46vA") - //.addPlayStore("com.ideashower.readitlater.pro") - //.addGitHub("medyo") - //.addInstagram("medyo80") - .create(); - return aboutPage; + .addItem(elementAppUpdate); + //.addFacebook("the.medy") + //.addTwitter("medyo80") + //.addYoutube("UCdPQtdWIsg7_pi4mrRu46vA") + //.addPlayStore("com.ideashower.readitlater.pro") + //.addGitHub("medyo") + //.addInstagram("medyo80") + //.create(); + + if (mAPPInfo.isAddDebugTools()) { + // 定义应用调试按钮 + // + Element elementAppMode; + if (GlobalApplication.isDebuging()) { + elementAppMode = new Element(mContext.getString(R.string.app_normal), R.drawable.ic_winboll); + elementAppMode.setOnClickListener(mAppNormalOnClickListener); + } else { + elementAppMode = new Element(mContext.getString(R.string.app_debug), R.drawable.ic_winboll); + elementAppMode.setOnClickListener(mAppDebugOnClickListener); + } + aboutPage.addItem(elementAppMode); + } + + return aboutPage.create(); } View.OnClickListener mAppDebugOnClickListener = new View.OnClickListener(){ @@ -328,7 +335,7 @@ public class AboutView extends LinearLayout { String password = "WinBollPowerByZhanGSKen"; credential = Credentials.basic(username, password); } - + Request request = new Request.Builder() .url(szUrl) .header("Accept", "text/plain") // 设置正确的Content-Type头 diff --git a/libaes/src/main/res/values/attrs.xml b/libaes/src/main/res/values/attrs.xml index c3a273d..e423414 100644 --- a/libaes/src/main/res/values/attrs.xml +++ b/libaes/src/main/res/values/attrs.xml @@ -11,7 +11,20 @@ - + + + + + + + + + + + + + +