Compare commits

...

27 Commits

Author SHA1 Message Date
ZhanGSKen
a374d1aada <aes>APK 15.0.9 release Publish. 2025-03-29 08:53:46 +08:00
ZhanGSKen
b9d2778e11 开展新命名空间下的版本调试 2025-03-29 08:52:57 +08:00
ZhanGSKen
43a91575d5 <libaes>Library Release 15.0.8 2025-03-29 08:38:13 +08:00
ZhanGSKen
f60a57237c <aes>APK 15.0.8 release Publish. 2025-03-29 08:37:50 +08:00
ZhanGSKen
20b30c1337 移植来自APPUtils的模块,命名空间重构。 2025-03-29 08:35:58 +08:00
ZhanGSKen
ed1a1ac179 开始调试WinBollActivityManager... 2025-03-25 03:54:31 +08:00
ZhanGSKen
0a4727966a <libaes>Library Release 15.0.7 2025-03-25 01:19:55 +08:00
ZhanGSKen
7271b2b531 <aes>APK 15.0.7 release Publish. 2025-03-25 01:19:42 +08:00
ZhanGSKen
e9ed88b930 源码整理 2025-03-25 01:19:08 +08:00
ZhanGSKen
a0cf87fb83 <libaes>Library Release 15.0.6 2025-03-25 01:14:40 +08:00
ZhanGSKen
dae32ba6cb <aes>APK 15.0.6 release Publish. 2025-03-25 01:14:22 +08:00
ZhanGSKen
2818c0fd85 应用介绍页调试 2025-03-25 01:13:08 +08:00
ZhanGSKen
8fb9ef7992 应用介绍页重构... 2025-03-25 00:07:19 +08:00
ZhanGSKen
76c9ae469f 调试应用介绍页 Gitea 网页调用... 2025-03-24 20:52:41 +08:00
ZhanGSKen
f1dac0c395 <libaes>Library Release 15.0.5 2025-03-24 20:01:26 +08:00
ZhanGSKen
2750f0faf9 <aes>APK 15.0.5 release Publish. 2025-03-24 20:00:06 +08:00
ZhanGSKen
e96710e3f1 <libaes>Library Release 15.0.4 2025-03-24 19:53:54 +08:00
ZhanGSKen
b2ad623c9c <aes>APK 15.0.4 release Publish. 2025-03-24 19:53:34 +08:00
ZhanGSKen
78c038b56b 设置发布版应用介绍接口参数。 2025-03-24 19:52:10 +08:00
ZhanGSKen
a9bc345580 设置应用介绍页视图模块图标资源 2025-03-24 19:38:02 +08:00
ZhanGSKen
82b54551d0 添加APPUtils图标资源 2025-03-24 19:36:52 +08:00
ZhanGSKen
87d8c08b5f 处理应用介绍模块... 2025-03-24 17:21:48 +08:00
ZhanGSKen
5864b725eb <libaes>Library Release 15.0.3 2025-03-24 15:00:57 +08:00
ZhanGSKen
c70a43257c <aes>APK 15.0.3 release Publish. 2025-03-24 15:00:41 +08:00
ZhanGSKen
0794446d34 更新工具类版本。 2025-03-24 14:45:19 +08:00
ZhanGSKen
052c6881e5 <libaes>Library Release 15.0.2 2025-03-24 14:32:16 +08:00
ZhanGSKen
b0dbd1b339 <aes>APK 15.0.2 release Publish. 2025-03-24 14:31:58 +08:00
47 changed files with 2139 additions and 546 deletions

View File

@@ -23,7 +23,7 @@ android {
defaultConfig {
applicationId "cc.winboll.studio.aes"
minSdkVersion 26
minSdkVersion 24
targetSdkVersion 29
versionCode 1
// versionName 更新后需要手动设置

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Mar 24 14:31:46 HKT 2025
stageCount=2
#Sat Mar 29 08:53:46 HKT 2025
stageCount=10
libraryProject=libaes
baseVersion=15.0
publishVersion=15.0.1
publishVersion=15.0.9
buildCount=0
baseBetaVersion=15.0.2
baseBetaVersion=15.0.10

View File

@@ -30,6 +30,8 @@
android:name="android.max_aspect"
android:value="4.0"/>
<activity android:name=".AboutActivity"/>
</application>
</manifest>

View File

@@ -0,0 +1,75 @@
package cc.winboll.studio.aes;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 23:52:29
* @Describe AES应用介绍窗口
*/
import android.content.Context;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libaes.winboll.APPInfo;
import cc.winboll.studio.libaes.winboll.AboutView;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import android.app.Activity;
public class AboutActivity extends AppCompatActivity implements IWinBollActivity {
public static final String TAG = "AboutActivity";
Context mContext;
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
AboutView aboutView = CreateAboutView();
// 在 Activity 的 onCreate 或其他生命周期方法中调用
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
// 创建布局参数(宽度和高度)
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
);
addContentView(aboutView, params);
GlobalApplication.getWinBollActivityManager().add(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
GlobalApplication.getWinBollActivityManager().registeRemove(this);
}
public AboutView CreateAboutView() {
String szBranchName = "aes";
APPInfo appInfo = new APPInfo();
appInfo.setAppName("AES");
appInfo.setAppIcon(cc.winboll.studio.libaes.R.drawable.ic_winboll);
appInfo.setAppDescription("AES Description");
appInfo.setAppGitName("APP");
appInfo.setAppGitOwner("Studio");
appInfo.setAppGitAPPBranch(szBranchName);
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES");
appInfo.setAppAPKName("AES");
appInfo.setAppAPKFolderName("AES");
return new AboutView(mContext, appInfo);
}
}

View File

@@ -6,6 +6,8 @@ package cc.winboll.studio.aes;
* @Describe AES应用类
*/
import cc.winboll.studio.libappbase.GlobalApplication;
import com.hjq.toast.ToastUtils;
public class App extends GlobalApplication {
@@ -14,7 +16,8 @@ public class App extends GlobalApplication {
@Override
public void onCreate() {
super.onCreate();
//setIsDebug(BuildConfig.DEBUG);
ToastUtils.init(this);
ToastUtils.show("App onCreate");
}
}

View File

@@ -5,6 +5,7 @@ package cc.winboll.studio.aes;
* @Date 2024/06/13 19:05:52
* @Describe 应用主窗口
*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
@@ -12,8 +13,6 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;
import android.widget.Toolbar;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.aes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
@@ -25,37 +24,23 @@ import cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity;
import cc.winboll.studio.libaes.unittests.TestAToolbarActivity;
import cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity;
import cc.winboll.studio.libaes.unittests.TestViewPageFragment;
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libapputils.app.AboutActivityFactory;
import cc.winboll.studio.libapputils.bean.APPInfo;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import com.a4455jkjh.colorpicker.ColorPickerDialog;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
public class MainActivity extends DrawerFragmentActivity implements IWinBollActivity {
public static final String TAG = "MainActivity";
TestAButtonFragment mTestAButtonFragment;
TestViewPageFragment mTestViewPageFragment;
@Override
public APPInfo getAppInfo() {
String szBranchName = "aes";
APPInfo appInfo = AboutActivityFactory.buildDefaultAPPInfo();
appInfo.setAppName("AES");
appInfo.setAppIcon(cc.winboll.studio.libapputils.R.drawable.ic_winboll);
appInfo.setAppDescription("AES Description");
appInfo.setAppGitName("APP");
appInfo.setAppGitOwner("Studio");
appInfo.setAppGitAPPBranch(szBranchName);
appInfo.setAppGitAPPSubProjectFolder(szBranchName);
appInfo.setAppHomePage("https://www.winboll.cc/studio/details.php?app=AES");
appInfo.setAppAPKName("AES");
appInfo.setAppAPKFolderName("AES");
return appInfo;
//return null;
public Activity getActivity() {
return this;
}
@Override
@@ -63,21 +48,6 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBollActi
return TAG;
}
@Override
public Toolbar initToolBar() {
return null;
}
@Override
public boolean isAddWinBollToolBar() {
return false;
}
@Override
public boolean isEnableDisplayHomeAsUp() {
return false;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -87,6 +57,7 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBollActi
}
showFragment(mTestAButtonFragment);
//setSubtitle(TAG);
ToastUtils.show("onCreate");
}
@Override
@@ -214,10 +185,13 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBollActi
startActivity(intent);
}
else if (nItemId == R.id.item_about) {
AboutActivityFactory.showAboutActivity(this, getAppInfo());
Intent intent = new Intent(this, AboutActivity.class);
startActivity(intent);
return true;
}
return super.onOptionsItemSelected(item);
}
}

View File

@@ -8,7 +8,7 @@ android {
buildToolsVersion "32.0.0"
defaultConfig {
minSdkVersion 26
minSdkVersion 24
targetSdkVersion 29
}
buildTypes {
@@ -22,6 +22,9 @@ android {
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
// 吐司类库
api 'com.github.getActivity:ToastUtils:10.5'
// 权限请求框架https://github.com/getActivity/XXPermissions
api 'com.github.getActivity:XXPermissions:18.63'
// 下拉控件
@@ -38,18 +41,16 @@ dependencies {
api 'com.journeyapps:zxing-android-embedded:3.6.0'
// 应用介绍页类库
api 'io.github.medyo:android-about-page:2.0.0'
// 吐司类库
api 'com.github.getActivity:ToastUtils:10.5'
// 网络连接类库
api 'com.squareup.okhttp3:okhttp:4.4.1'
// AndroidX 类库
api 'androidx.appcompat:appcompat:1.0.0'
api 'androidx.appcompat:appcompat:1.1.0'
api 'com.google.android.material:material:1.4.0'
//api 'androidx.viewpager:viewpager:1.0.0'
//api 'androidx.vectordrawable:vectordrawable:1.1.0'
//api 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
//api 'androidx.fragment:fragment:1.1.0'
api 'cc.winboll.studio:libappbase:15.0.9'
api 'cc.winboll.studio:libapputils:15.0.11'
api 'cc.winboll.studio:libappbase:15.2.0'
api 'cc.winboll.studio:libapputils:15.2.0'
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Mar 24 14:31:46 HKT 2025
stageCount=2
#Sat Mar 29 08:53:46 HKT 2025
stageCount=10
libraryProject=libaes
baseVersion=15.0
publishVersion=15.0.1
publishVersion=15.0.9
buildCount=0
baseBetaVersion=15.0.2
baseBetaVersion=15.0.10

View File

@@ -7,14 +7,18 @@
<activity android:name="cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity"/>
<activity android:name="cc.winboll.studio.libaes.activitys.AboutActivity"/>
<activity android:name="cc.winboll.studio.libaes.unittests.TestDrawerFragmentActivity"/>
<activity android:name="cc.winboll.studio.libaes.unittests.TestAToolbarActivity"/>
<activity android:name="cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity"/>
<service android:name="cc.winboll.studio.libaes.winboll.WinBollClientService"/>
<service android:name="cc.winboll.studio.libaes.winboll.AssistantService"/>
<service android:name="cc.winboll.studio.libaes.winboll.WinBollMail"/>
</application>
</manifest>

View File

@@ -16,6 +16,7 @@ import android.view.View;
import android.widget.AdapterView;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@@ -27,10 +28,9 @@ import cc.winboll.studio.libaes.beans.DrawerMenuBean;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libaes.views.ADrawerMenuListView;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import com.baoyz.widget.PullRefreshLayout;
import java.util.ArrayList;
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
import androidx.appcompat.widget.Toolbar;
public abstract class DrawerFragmentActivity extends AppCompatActivity implements IWinBollActivity,AdapterView.OnItemClickListener {

View File

@@ -1,15 +1,13 @@
package cc.winboll.studio.libaes.unittests;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libapputils.bean.APPInfo;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
/**
* @Author ZhanGSKen@QQ.COM
@@ -23,8 +21,8 @@ public class SecondaryLibraryActivity extends DrawerFragmentActivity implements
SecondaryLibraryFragment mSecondaryLibraryFragment;
@Override
public APPInfo getAppInfo() {
return null;
public Activity getActivity() {
return this;
}
@Override
@@ -32,21 +30,6 @@ public class SecondaryLibraryActivity extends DrawerFragmentActivity implements
return null;
}
@Override
public Toolbar initToolBar() {
return null;
}
@Override
public boolean isAddWinBollToolBar() {
return false;
}
@Override
public boolean isEnableDisplayHomeAsUp() {
return false;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View File

@@ -13,7 +13,7 @@ import androidx.fragment.app.Fragment;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.views.AButton;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.utils.ToastUtils;
import com.hjq.toast.ToastUtils;
public class TestAButtonFragment extends Fragment {

View File

@@ -5,19 +5,27 @@ package cc.winboll.studio.libaes.unittests;
* @Date 2024/07/16 01:14:00
* @Describe TestASupportToolbarActivity
*/
import android.content.Context;
import android.content.SharedPreferences;
import android.app.Activity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.beans.AESThemeBean;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
public class TestASupportToolbarActivity extends AppCompatActivity {
public class TestASupportToolbarActivity extends AppCompatActivity implements IWinBollActivity {
public static final String TAG = "TestASupportToolbarActivity";
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {

View File

@@ -10,11 +10,22 @@ import android.os.Bundle;
import android.widget.Toolbar;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
public class TestAToolbarActivity extends Activity {
public class TestAToolbarActivity extends Activity implements IWinBollActivity {
public static final String TAG = "TestAToolbarActivity";
@Override
public Activity getActivity() {
return this;
}
@Override
public String getTag() {
return TAG;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
AESThemeUtil.applyAppTheme(this);

View File

@@ -16,16 +16,15 @@ import androidx.fragment.app.Fragment;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity;
import cc.winboll.studio.libaes.beans.DrawerMenuBean;
import cc.winboll.studio.libaes.winboll.IWinBollActivity;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libapputils.bean.APPInfo;
import cc.winboll.studio.libappbase.winboll.IWinBollActivity;
import java.util.ArrayList;
public class TestDrawerFragmentActivity extends DrawerFragmentActivity implements IWinBollActivity {
@Override
public APPInfo getAppInfo() {
return null;
public Activity getActivity() {
return this;
}
@Override
@@ -33,22 +32,6 @@ public class TestDrawerFragmentActivity extends DrawerFragmentActivity implement
return null;
}
@Override
public Toolbar initToolBar() {
return null;
}
@Override
public boolean isAddWinBollToolBar() {
return false;
}
@Override
public boolean isEnableDisplayHomeAsUp() {
return false;
}
public static final String TAG = "TestDrawerFragmentActivity";
TestFragment1 mTestFragment1;

View File

@@ -19,7 +19,7 @@ import cc.winboll.studio.libaes.ImagePagerAdapter;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.views.AOHPCTCSeekBar;
import cc.winboll.studio.libappbase.LogView;
import cc.winboll.studio.libappbase.utils.ToastUtils;
import com.hjq.toast.ToastUtils;
import java.util.ArrayList;
import java.util.List;

View File

@@ -0,0 +1,162 @@
package cc.winboll.studio.libaes.utils;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2024/08/12 14:45:35
* @Describe 应用版本工具集
*/
import cc.winboll.studio.libappbase.LogUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class AppVersionUtils {
public static final String TAG = "AppVersionUtils";
//
// 检查新版本是否成立
// szCurrentCode : 当前版本应用包名
// szNextCode : 新版本应用包名
// 返回 情况1当前版本是发布版
// 返回 true (新版本 > 当前版本)
// 情况1当前版本是Beta版
// true 新版本 == 当前版本
//
public static boolean isHasNewVersion2(String szCurrentName, String szNextName) {
LogUtils.d(TAG, String.format("isHasNewVersion2\nszCurrentName : %s\nszNextName : %s", szCurrentName, szNextName));
//szCurrentName = "AES_6.2.0-beta0_3234.apk";
//szNextName = "AES_6.1.12.apk";
//szCurrentName = "AES_6.2.0-beta0_3234.apk";
//szNextName = "AES_6.2.0.apk";
//szCurrentName = "AES_6.2.0-beta0_3234.apk";
//szNextName = "AES_6.2.2.apk";
//szCurrentName = "AES_6.2.0-beta0_3234.apk";
//szNextName = "AES_6.2.0.apk";
//szCurrentName = "AES_6.1.0.apk";
//szNextName = "AES_6.2.0.apk";
//LogUtils.d(TAG, "szCurrentName : " + szCurrentName);
//LogUtils.d(TAG, "szNextName : " + szNextName);
//boolean isVersionNewer = false;
//if(szCurrentName.equals(szNextName)) {
// isVersionNewer = false;
//} else {
//ToastUtils.show("szCurrent : " + szCurrent + "\nszNext : " + szNext);
//int nApk = szNextName.lastIndexOf(".apk");
//ToastUtils.show("nApk : " + Integer.toString(nApk));
//String szNextNoApkName = szNextName.substring(0, nApk);
//ToastUtils.show("szNextNoApkName : " + szNextNoApkName);
//String szCurrentNoApkName = szCurrentName.substring(0, szNextNoApkName.length());
//ToastUtils.show("szCurrentNoApkName : " + szCurrentNoApkName);
//String str1 = "3.4.50";
//String str2 = "3.3.60";
//String str1 = getCodeInPackageName(szCurrentName);
//String str2 = getCodeInPackageName(szNextName);
//String str1 = getCodeInPackageName(szNextName);
//String str2 = getCodeInPackageName(szCurrentName);
//Boolean isVersionNewer2 = checkNewVersion(str1,str2);
//ToastUtils.show("isVersionNewer2 : " + Boolean.toString(isVersionNewer2));
//ToastUtils.show(checkNewVersion(getCodeInPackageName(szCurrentName), getCodeInPackageName(szNextName)));
//return checkNewVersion(getCodeInPackageName(szCurrentName), getCodeInPackageName(szNextName));
//}
//return isVersionNewer;
if (checkNewVersion(getCodeInPackageName(szCurrentName), getCodeInPackageName(szNextName))) {
// 比 AES_6.2.0.apk 版本大,如 AES_6.2.1.apk。
// 比 AES_6.2.0-beta0_3234.apk 大,如 AES_6.2.1.apk。
//LogUtils.d(TAG, "App newer stage version is released. Release name : " + szNextName);
return true;
}
if (szCurrentName.matches(".*_\\d+\\.\\d+\\.\\d+-beta.*\\.apk")) {
String szCurrentReleasePackageName = getReleasePackageName(szCurrentName);
//LogUtils.d(TAG, "szCurrentReleasePackageName : " + szCurrentReleasePackageName);
if (szCurrentReleasePackageName.equals(szNextName)) {
// 与 AES_6.2.0-beta0_3234.apk 版本相同,如 AES_6.2.0.apk。
//LogUtils.d(TAG, "App stage version is released. Release name : " + szNextName);
return true;
}
}
//LogUtils.d(TAG, "App version is the newest. ");
return false;
}
public static boolean isHasNewStageReleaseVersion(String szCurrentName, String szNextName) {
LogUtils.d(TAG, String.format("isHasNewStageReleaseVersion\nszCurrentName : %s\nszNextName : %s", szCurrentName, szNextName));
//szCurrentName = "AES_6.2.12.apk";
//szNextName = "AES_6.3.12.apk";
if (checkNewVersion(getCodeInPackageName(szCurrentName), getCodeInPackageName(szNextName))) {
// 比 AES_6.2.0.apk 版本大,如 AES_6.2.1.apk。
//LogUtils.d(TAG, "App newer stage version is released. Release name : " + szNextName);
return true;
}
return false;
}
//
// 检查新版本是否成立
// szCurrentCode : 当前版本
// szNextCode : 新版本
// 返回 true 新版本 > 当前版本
//
public static Boolean checkNewVersion(String szCurrentCode, String szNextCode) {
if (szCurrentCode == null || szCurrentCode.equals("") || szNextCode == null || szNextCode.equals("")) {
LogUtils.d(TAG, String.format("checkNewVersion unexpected parameters:\nszCurrentCode : %s\nszNextCode : %s", szCurrentCode, szNextCode));
return false;
}
boolean isNew = false;
String[] appVersionCurrent = szCurrentCode.split("\\.");
String[] appVersionNext = szNextCode.split("\\.");
//根据位数最短的判断
int lim = appVersionCurrent.length > appVersionNext.length ? appVersionNext.length : appVersionCurrent.length;
//根据位数循环判断各个版本
for (int i = 0; i < lim; i++) {
if (Integer.parseInt(appVersionNext[i]) > Integer.parseInt(appVersionCurrent[i])) {
isNew = true;
return isNew;
} else if (Integer.parseInt(appVersionNext[i]) == Integer.parseInt(appVersionCurrent[i])) {
continue ;
} else {
isNew = false;
return isNew;
}
}
return isNew;
}
//
// 截取应用包名称版本号信息
// 如 AppUtils_7.0.4-beta1_0120.apk 版本号为 7.0.4
// 如 AppUtils_7.0.4.apk 版本号为 7.0.4
//
public static String getCodeInPackageName(String apkName) {
LogUtils.d(TAG, String.format("getCodeInPackageName apkName : %s", apkName));
//String apkName = "AppUtils_7.0.0.apk";
Pattern pattern = Pattern.compile("\\d+\\.\\d+\\.\\d+");
Matcher matcher = pattern.matcher(apkName);
if (matcher.find()) {
String version = matcher.group();
LogUtils.d(TAG, String.format("version is %s", version));
return version;
//System.out.println("Version number: " + version); // 输出7.0.0
}
LogUtils.d(TAG, String.format("No result."));
return "";
}
//
// 根据Beta版名称生成发布版应用包名称
// 如 AppUtils_7.0.4-beta1_0120.apk
// 发布版名称就为AppUtils_7.0.4.apk
//
public static String getReleasePackageName(String szBetaPackageName) {
//String szBetaPackageName = "AppUtils_7.0.4-beta1_0120.apk";
Pattern pattern = Pattern.compile(".*\\d+\\.\\d+\\.\\d+");
Matcher matcher = pattern.matcher(szBetaPackageName);
if (matcher.find()) {
String szReleasePackageName = matcher.group();
return szReleasePackageName + ".apk";
//System.out.println("Version number: " + version); // 输出7.0.0
}
return "";
}
}

View File

@@ -0,0 +1,143 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/01/20 14:19:02
* @Describe 应用信息类
*/
import cc.winboll.studio.libaes.R;
import java.io.Serializable;
public class APPInfo implements Serializable {
public static final String TAG = "APPInfo";
// 应用名称
String appName;
// 应用图标
int appIcon;
// 应用描述
String appDescription;
// 应用Git仓库地址
String appGitName;
// 应用Git仓库拥有者
String appGitOwner;
// 应用Git仓库分支
String appGitAPPBranch;
// 应用Git仓库子项目文件夹
String appGitAPPSubProjectFolder;
// 应用主页
String appHomePage;
// 应用包名称
String appAPKName;
// 应用包存储文件夹名称
String appAPKFolderName;
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;
this.appDescription = appDescription;
this.appGitName = appGitName;
this.appGitOwner = appGitOwner;
this.appGitAPPBranch = appGitAPPBranch;
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
this.appHomePage = appHomePage;
this.appAPKName = appAPKName;
this.appAPKFolderName = appAPKFolderName;
}
public APPInfo() {
String szBranchName = "app";
this.appName = "APP";
this.appIcon = R.drawable.ic_launcher;
this.appDescription = "APP Description";
this.appGitName = "APP";
this.appGitOwner = "Studio";
this.appGitAPPBranch = szBranchName;
this.appGitAPPSubProjectFolder = szBranchName;
this.appHomePage = "https://www.winboll.cc/studio/details.php?app=APP";
this.appAPKName = "APP";
this.appAPKFolderName = "APP";
}
public void setAppGitOwner(String appGitOwner) {
this.appGitOwner = appGitOwner;
}
public String getAppGitOwner() {
return appGitOwner;
}
public void setAppGitAPPBranch(String appGitAPPBranch) {
this.appGitAPPBranch = appGitAPPBranch;
}
public String getAppGitAPPBranch() {
return appGitAPPBranch;
}
public void setAppGitAPPSubProjectFolder(String appGitAPPSubProjectFolder) {
this.appGitAPPSubProjectFolder = appGitAPPSubProjectFolder;
}
public String getAppGitAPPSubProjectFolder() {
return appGitAPPSubProjectFolder;
}
public void setAppIcon(int appIcon) {
this.appIcon = appIcon;
}
public int getAppIcon() {
return appIcon;
}
public void setAppDescription(String appDescription) {
this.appDescription = appDescription;
}
public String getAppDescription() {
return appDescription;
}
public void setAppAPKFolderName(String appAPKFolderName) {
this.appAPKFolderName = appAPKFolderName;
}
public String getAppAPKFolderName() {
return appAPKFolderName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getAppName() {
return appName;
}
public void setAppGitName(String appGitName) {
this.appGitName = appGitName;
}
public String getAppGitName() {
return appGitName;
}
public void setAppHomePage(String appHomePage) {
this.appHomePage = appHomePage;
}
public String getAppHomePage() {
return appHomePage;
}
public void setAppAPKName(String appAPKName) {
this.appAPKName = appAPKName;
}
public String getAppAPKName() {
return appAPKName;
}
}

View File

@@ -0,0 +1,392 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 15:08:52
* @Describe WinBoll应用介绍视图
*/
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.TypedArray;
import android.net.Uri;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import cc.winboll.studio.libaes.R;
import cc.winboll.studio.libaes.utils.AppVersionUtils;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libapputils.utils.PrefUtils;
import com.hjq.toast.ToastUtils;
import java.io.IOException;
import mehdi.sakout.aboutpage.AboutPage;
import mehdi.sakout.aboutpage.Element;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class AboutView extends LinearLayout {
public static final String TAG = "AboutView";
public static final int MSG_APPUPDATE_CHECKED = 0;
Context mContext;
APPInfo mAPPInfo;
WinBollServiceStatusView mWinBollServiceStatusView;
OnRequestDevUserInfoAutofillListener mOnRequestDevUserInfoAutofillListener;
String mszAppName = "";
String mszAppAPKFolderName = "";
String mszAppAPKName = "";
String mszAppGitName = "";
String mszAppVersionName = "";
String mszCurrentAppPackageName = "";
volatile String mszNewestAppPackageName = "";
String mszAppDescription = "";
String mszHomePage = "";
String mszGitea = "";
int mnAppIcon = 0;
String mszWinBollServerHost;
String mszReleaseAPKName;
EditText metDevUserName;
EditText metDevUserPassword;
public AboutView(Context context, APPInfo appInfo) {
super(context);
mContext = context;
setAPPInfo(appInfo);
initView(context);
}
public AboutView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
initView(context, attrs);
}
public void setAPPInfo(APPInfo appInfo) {
mAPPInfo = appInfo;
}
APPInfo createAppInfo(Context context, AttributeSet attrs) {
APPInfo appInfo = new APPInfo();
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.AboutView);
appInfo.setAppName(typedArray.getString(R.styleable.AboutView_app_name));
appInfo.setAppAPKFolderName(typedArray.getString(R.styleable.AboutView_app_apkfoldername));
appInfo.setAppAPKName(typedArray.getString(R.styleable.AboutView_app_apkname));
appInfo.setAppGitName(typedArray.getString(R.styleable.AboutView_app_gitname));
appInfo.setAppGitOwner(typedArray.getString(R.styleable.AboutView_app_gitowner));
appInfo.setAppGitAPPBranch(typedArray.getString(R.styleable.AboutView_app_gitappbranch));
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));
// 返回一个绑定资源结束的信号给资源
typedArray.recycle();
return appInfo;
}
void initView(Context context) {
mszAppName = mAPPInfo.getAppName();
mszAppAPKFolderName = mAPPInfo.getAppAPKFolderName();
mszAppAPKName = mAPPInfo.getAppAPKName();
mszAppGitName = mAPPInfo.getAppGitName();
mszAppDescription = mAPPInfo.getAppDescription();
mnAppIcon = mAPPInfo.getAppIcon();
mszWinBollServerHost = GlobalApplication.isDebuging() ? "https://dev.winboll.cc": "https://www.winboll.cc";
try {
mszAppVersionName = mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
mszCurrentAppPackageName = mszAppAPKName + "_" + mszAppVersionName + ".apk";
mszHomePage = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
if (mAPPInfo.getAppGitAPPBranch().equals("")) {
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName;
} else {
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName + "/src/branch/" + mAPPInfo.getAppGitAPPBranch() + "/" + mAPPInfo.getAppGitAPPSubProjectFolder();
}
if (GlobalApplication.isDebuging()) {
LayoutInflater inflater = LayoutInflater.from(mContext);
View addedView = inflater.inflate(R.layout.view_about_dev, this, false);
LinearLayout llMain = addedView.findViewById(R.id.viewaboutdevLinearLayout1);
metDevUserName = addedView.findViewById(R.id.viewaboutdevEditText1);
metDevUserPassword = addedView.findViewById(R.id.viewaboutdevEditText2);
metDevUserName.setText(PrefUtils.getString(mContext, "metDevUserName", ""));
metDevUserPassword.setText(PrefUtils.getString(mContext, "metDevUserPassword", ""));
//mDevelopHostConnectionStatusView = new DevelopHostConnectionStatusView(context);
mWinBollServiceStatusView = addedView.findViewById(R.id.viewaboutdevWinBollServiceStatusView1);
mWinBollServiceStatusView.setServerHost(mszWinBollServerHost);
mWinBollServiceStatusView.setAuthInfo(metDevUserName.getText().toString(), metDevUserPassword.getText().toString());
//llMain.addView(mDevelopHostConnectionStatusView);
llMain.addView(createAboutPage());
addView(addedView);
} else {
LayoutInflater inflater = LayoutInflater.from(mContext);
View addedView = inflater.inflate(R.layout.view_about_www, this, false);
LinearLayout llMain = addedView.findViewById(R.id.viewaboutwwwLinearLayout1);
//mDevelopHostConnectionStatusView = new DevelopHostConnectionStatusView(context);
mWinBollServiceStatusView = addedView.findViewById(R.id.viewaboutwwwWinBollServiceStatusView1);
mWinBollServiceStatusView.setServerHost(mszWinBollServerHost);
mWinBollServiceStatusView.setAuthInfo("", "");
//llMain.addView(mDevelopHostConnectionStatusView);
llMain.addView(createAboutPage());
addView(addedView);
}
// 初始化标题栏
//setSubtitle(getContext().getString(R.string.text_about));
// LinearLayout llMain = findViewById(R.id.viewaboutLinearLayout1);
// llMain.addView(createAboutPage());
// 就读取正式版应用包版本号,设置 Release 应用包文件名
String szReleaseAppVersionName = "";
try {
//LogUtils.d(TAG, String.format("mContext.getPackageName() %s", mContext.getPackageName()));
String szSubBetaSuffix = subBetaSuffix(mContext.getPackageName());
//LogUtils.d(TAG, String.format("szSubBetaSuffix : %s", szSubBetaSuffix));
szReleaseAppVersionName = mContext.getPackageManager().getPackageInfo(szSubBetaSuffix, 0).versionName;
} catch (PackageManager.NameNotFoundException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
mszReleaseAPKName = mszAppAPKName + "_" + szReleaseAppVersionName + ".apk";
}
void initView(Context context, AttributeSet attrs) {
mAPPInfo = createAppInfo(context, attrs);
initView(context);
}
public static String subBetaSuffix(String input) {
if (input.endsWith(".beta")) {
return input.substring(0, input.length() - ".beta".length());
}
return input;
}
android.os.Handler mHandler = new android.os.Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case MSG_APPUPDATE_CHECKED : {
/*//检查当前应用包文件名是否是测试版,如果是就忽略检查
if(mszCurrentAppPackageName.matches(".*_\\d+\\.\\d+\\.\\d+-beta.*\\.apk")) {
ToastUtils.show("APP is the beta Version. Version check ignore.");
return;
}*/
// if (!AppVersionUtils.isHasNewStageReleaseVersion(mszReleaseAPKName, mszNewestAppPackageName)) {
// ToastUtils.delayedShow("Current app is the newest.", 5000);
// }
if (!AppVersionUtils.isHasNewVersion2(mszCurrentAppPackageName, mszNewestAppPackageName)) {
ToastUtils.show("Current app is the newest.");
} else {
String szMsg = "Current app is :\n[ " + mszCurrentAppPackageName
+ " ]\nThe last app is :\n[ " + mszNewestAppPackageName
+ " ]\nIs download the last app?";
YesNoAlertDialog.show(mContext, "Application Update Prompt", szMsg, mIsDownlaodUpdateListener);
}
break;
}
}
}
};
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);
elementGitWeb.setOnClickListener(mGitWebOnClickListener);
// 定义检查更新按钮
//
Element elementAppUpdate = new Element(mContext.getString(R.string.app_update), R.drawable.ic_winboll);
elementAppUpdate.setOnClickListener(mAppUpdateOnClickListener);
String szAppInfo = "";
try {
szAppInfo = mszAppName + " "
+ mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).versionName
+ "\n" + mszAppDescription;
} catch (PackageManager.NameNotFoundException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
View aboutPage = new AboutPage(mContext)
.setDescription(szAppInfo)
//.isRTL(false)
//.setCustomFont(String) // or Typeface
.setImage(mnAppIcon)
//.addItem(versionElement)
//.addItem(adsElement)
//.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;
}
View.OnClickListener mAppDebugOnClickListener = new View.OnClickListener(){
@Override
public void onClick(View view) {
//ToastUtils.show("mAppDebugOnClickListener");
setApp2DebugMode(mContext);
}
};
View.OnClickListener mAppNormalOnClickListener = new View.OnClickListener(){
@Override
public void onClick(View view) {
//ToastUtils.show("mAppNormalOnClickListener");
setApp2NormalMode(mContext);
}
};
public static void setApp2DebugMode(Context context) {
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
if (intent != null) {
//intent.setAction(cc.winboll.studio.libapputils.intent.action.DEBUGVIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
GlobalApplication.setIsDebuging(true);
GlobalApplication.getWinBollActivityManager().finishAll();
context.startActivity(intent);
}
}
public static void setApp2NormalMode(Context context) {
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
if (intent != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
GlobalApplication.setIsDebuging(false);
GlobalApplication.getWinBollActivityManager().finishAll();
context.startActivity(intent);
}
}
View.OnClickListener mGitWebOnClickListener = new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(mszGitea));
mContext.startActivity(browserIntent);
}
};
View.OnClickListener mAppUpdateOnClickListener = new View.OnClickListener(){
@Override
public void onClick(View view) {
ToastUtils.show("Start app update checking.");
new Thread(new Runnable() {
@Override
public void run() {
String szUrl = mszWinBollServerHost + "/studio/details.php?app=" + mszAppAPKFolderName;
// 构建包含认证信息的请求
String credential = "";
if (GlobalApplication.isDebuging()) {
credential = Credentials.basic(metDevUserName.getText().toString(), metDevUserPassword.getText().toString());
PrefUtils.saveString(mContext, "metDevUserName", metDevUserName.getText().toString());
PrefUtils.saveString(mContext, "metDevUserPassword", metDevUserPassword.getText().toString());
} else {
credential = Credentials.basic("WinBoll", "WinBollPowerByZhanGSKen");
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(szUrl)
.header("Accept", "text/plain") // 设置正确的Content-Type头
.header("Authorization", credential)
.build();
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
// 处理网络请求失败
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
@Override
public void onResponse(Call call, Response response) throws IOException {
if (!response.isSuccessful()) {
LogUtils.d(TAG, "Unexpected code " + response, Thread.currentThread().getStackTrace());
return;
}
try {
// 读取响应体作为字符串,注意这里可能需要解码
String text = response.body().string();
org.jsoup.nodes.Document doc = org.jsoup.Jsoup.parse(text);
LogUtils.v(TAG, doc.text());
// 使用id选择器找到具有特定id的元素
org.jsoup.nodes.Element elementWithId = doc.select("#LastRelease").first(); // 获取第一个匹配的元素
// 提取并打印元素的文本内容
mszNewestAppPackageName = elementWithId.text();
//ToastUtils.delayedShow(text + "\n" + mszNewestAppPackageName, 5000);
mHandler.sendMessage(mHandler.obtainMessage(MSG_APPUPDATE_CHECKED));
} catch (Exception e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
}
});
}
}).start();
}
};
YesNoAlertDialog.OnDialogResultListener mIsDownlaodUpdateListener = new YesNoAlertDialog.OnDialogResultListener() {
@Override
public void onYes() {
String szUrl = mszWinBollServerHost + "/studio/download.php?appname=" + mszAppAPKFolderName + "&apkname=" + mszNewestAppPackageName;
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(szUrl));
mContext.startActivity(browserIntent);
}
@Override
public void onNo() {
}
};
public interface OnRequestDevUserInfoAutofillListener {
void requestAutofill(EditText etDevUserName, EditText etDevUserPassword);
}
public void setOnRequestDevUserInfoAutofillListener(OnRequestDevUserInfoAutofillListener l) {
mOnRequestDevUserInfoAutofillListener = l;
}
}

View File

@@ -0,0 +1,96 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 19:12:12
* @Describe 应用主要服务组件类守护进程服务组件类
*/
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import cc.winboll.studio.libaes.winboll.WinBollClientService;
import cc.winboll.studio.libappbase.utils.ServiceUtils;
public class AssistantService extends Service {
public final static String TAG = "AssistantService";
WinBollClientServiceBean mWinBollServiceBean;
MyServiceConnection mMyServiceConnection;
volatile boolean mIsServiceRunning;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
mWinBollServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
if (mMyServiceConnection == null) {
mMyServiceConnection = new MyServiceConnection();
}
// 设置运行参数
mIsServiceRunning = false;
run();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
run();
return START_STICKY;
}
@Override
public void onDestroy() {
mIsServiceRunning = false;
super.onDestroy();
}
//
// 运行服务内容
//
void run() {
mWinBollServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
if (mWinBollServiceBean.isEnable()) {
if (mIsServiceRunning == false) {
// 设置运行状态
mIsServiceRunning = true;
// 唤醒和绑定主进程
wakeupAndBindMain();
}
}
}
//
// 唤醒和绑定主进程
//
void wakeupAndBindMain() {
if (ServiceUtils.isServiceRunning(getApplicationContext(), WinBollClientService.class.getName()) == false) {
startForegroundService(new Intent(AssistantService.this, WinBollClientService.class));
}
bindService(new Intent(AssistantService.this, WinBollClientService.class), mMyServiceConnection, Context.BIND_IMPORTANT);
}
//
// 主进程与守护进程连接时需要用到此类
//
class MyServiceConnection implements ServiceConnection {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
}
@Override
public void onServiceDisconnected(ComponentName name) {
mWinBollServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(AssistantService.this);
if (mWinBollServiceBean.isEnable()) {
wakeupAndBindMain();
}
}
}
}

View File

@@ -0,0 +1,35 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 19:11:27
* @Describe WinBoll UI 状态图标枚举
*/
import cc.winboll.studio.libaes.R;
public enum EWUIStatusIconDrawable {
NORMAL(0),
NEWS(1)
;
static final String TAG = "WUIStatusIconDrawable";
static String[] _mlistCNName = { "正常", "新的消息" };
private int value = 0;
private EWUIStatusIconDrawable(int value) { //必须是private的否则编译错误
this.value = value;
}
public static int getIconDrawableId(EWUIStatusIconDrawable drawableId) {
int res;
switch(drawableId){
case NEWS :
res = R.drawable.ic_winbollbeta;
break;
default :
res = R.drawable.ic_winboll;
}
return res;
}
}

View File

@@ -1,23 +0,0 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 08:23:40
* @Describe WinBoll 活动窗口通用接口
*/
import android.content.Context;
import android.widget.Toolbar;
import cc.winboll.studio.libapputils.bean.APPInfo;
public interface IWinBollActivity {
public static final String TAG = "IWinBollActivity";
// 获取应用资源上下文
abstract public Context getApplicationContext();
abstract public APPInfo getAppInfo();
abstract public String getTag();
abstract public Toolbar initToolBar();
abstract public boolean isEnableDisplayHomeAsUp();
abstract public boolean isAddWinBollToolBar();
}

View File

@@ -0,0 +1,17 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 19:08:45
* @Describe WinBollService 服务 Binder。
*/
import android.graphics.drawable.Drawable;
public interface IWinBollClientServiceBinder {
public static final String TAG = "IWinBollClientServiceBinder";
public WinBollClientService getService();
public Drawable getCurrentStatusIconDrawable();
}

View File

@@ -1,97 +0,0 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 08:24:52
*/
import android.app.Activity;
import android.app.Application;
import android.content.Intent;
import android.os.Bundle;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.utils.ToastUtils;
public class MyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
public static final String TAG = "MyActivityLifecycleCallbacks";
public String mInfo = "";
public MyActivityLifecycleCallbacks() {
}
void createActivityeInfo(Activity activity) {
StringBuilder sb = new StringBuilder();
Intent receivedIntent = activity.getIntent();
sb.append("\nCallingActivity : \n");
if (activity.getCallingActivity() != null) {
sb.append(activity.getCallingActivity().getPackageName());
}
sb.append("\nReceived Intent Package : \n");
sb.append(receivedIntent.getPackage());
Bundle extras = receivedIntent.getExtras();
if (extras != null) {
for (String key : extras.keySet()) {
sb.append("\nIntentInfo");
sb.append("\n键: ");
sb.append(key);
sb.append(", 值: ");
sb.append(extras.get(key));
//Log.d("IntentInfo", "键: " + key + ", 值: " + extras.get(key));
}
}
mInfo = sb.toString();
//Log.d("IntentInfo", "发送Intent的应用包名: " + senderPackage);
}
public void showActivityeInfo() {
ToastUtils.show("ActivityeInfo : " + mInfo);
LogUtils.d(TAG, "ActivityeInfo : " + mInfo);
}
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
// 在这里可以做一些初始化相关的操作例如记录Activity的创建时间等
//System.out.println(activity.getLocalClassName() + " was created");
LogUtils.d(TAG, activity.getLocalClassName() + " was created");
createActivityeInfo(activity);
}
@Override
public void onActivityStarted(Activity activity) {
//System.out.println(activity.getLocalClassName() + " was started");
LogUtils.d(TAG, activity.getLocalClassName() + " was started");
//createActivityeInfo(activity);
}
@Override
public void onActivityResumed(Activity activity) {
//System.out.println(activity.getLocalClassName() + " was resumed");
LogUtils.d(TAG, activity.getLocalClassName() + " was resumed");
//createActivityeInfo(activity);
}
@Override
public void onActivityPaused(Activity activity) {
//System.out.println(activity.getLocalClassName() + " was paused");
LogUtils.d(TAG, activity.getLocalClassName() + " was paused");
}
@Override
public void onActivityStopped(Activity activity) {
//System.out.println(activity.getLocalClassName() + " was stopped");
LogUtils.d(TAG, activity.getLocalClassName() + " was stopped");
}
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
// 可以在这里添加保存状态的自定义逻辑
}
@Override
public void onActivityDestroyed(Activity activity) {
//System.out.println(activity.getLocalClassName() + " was destroyed");
LogUtils.d(TAG, activity.getLocalClassName() + " was destroyed");
}
}

View File

@@ -1,318 +0,0 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/24 08:25:43
* @Describe 应用活动窗口管理器
* 参考
* android 类似微信小程序多任务窗口 及 设置 TaskDescription 修改 icon 和 label
* https://blog.csdn.net/qq_29364417/article/details/109379915?app_version=6.4.2&code=app_1562916241&csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22109379915%22%2C%22source%22%3A%22weixin_38986226%22%7D&uLinkId=usr1mkqgl919blen&utm_source=app
*/
import android.app.ActivityManager;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import cc.winboll.studio.libappbase.LogUtils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class WinBollActivityManager {
// public static final String TAG = "WinBollActivityManager";
// public static final String EXTRA_TAG = "EXTRA_TAG";
//
// public static enum WinBollUI_TYPE {
// Aplication, // 退出应用后,保持最近任务栏任务记录主窗口
// Service // 退出应用后,清理所有最近任务栏任务记录窗口
// };
//
// // 应用类型标志
// volatile static WinBollUI_TYPE _mWinBollUI_TYPE = WinBollUI_TYPE.Service;
//
// Context mContext;
// MyActivityLifecycleCallbacks mMyActivityLifecycleCallbacks;
// static WinBollActivityManager _mWinBollActivityManager;
// static Map<String, IWinBollActivity> _mapIWinBollList;
// IWinBollActivity firstIWinBollActivity;
//
// public WinBollActivityManager(Context context) {
// mContext = context;
// LogUtils.d(TAG, "WinBollActivityManager()");
// _mapIWinBollList = new HashMap<String, IWinBollActivity>();
// }
//
// public static synchronized WinBollActivityManager getInstance(Context context) {
// LogUtils.d(TAG, "getInstance");
// if (_mWinBollActivityManager == null) {
// LogUtils.d(TAG, "_mWinBollActivityManager == null");
// _mWinBollActivityManager = new WinBollActivityManager(context);
// }
// return _mWinBollActivityManager;
// }
//
// //
// // 设置 WinBoll 应用 UI 类型
// //
// public synchronized static void setWinBollUI_TYPE(WinBollUI_TYPE mWinBollUI_TYPE) {
// _mWinBollUI_TYPE = mWinBollUI_TYPE;
// }
//
// //
// // 获取 WinBoll 应用 UI 类型
// //
// public synchronized static WinBollUI_TYPE getWinBollUI_TYPE() {
// return _mWinBollUI_TYPE;
// }
//
// //
// // 把Activity添加到管理中
// //
// public <T extends IWinBollActivity> void add(T iWinBoll) {
// if (isActive(iWinBoll.getTag())) {
// LogUtils.d(TAG, String.format("add(...) %s is active.", iWinBoll.getTag()));
// } else {
// // 设置起始活动窗口,以便最后退出时提问
// if (firstIWinBollActivity == null && _mapIWinBollList.size() == 0) {
// firstIWinBollActivity = iWinBoll;
// }
//
// // 添加到活动窗口列表
// _mapIWinBollList.put(iWinBoll.getTag(), iWinBoll);
// LogUtils.d(TAG, String.format("Add activity : %s\n_mapActivityList.size() : %d", iWinBoll.getTag(), _mapIWinBollList.size()));
// }
// }
//
//
// //
// // activity: 为 null 时,
// // intent.putExtra 函数 EXTRA_TAG 参数为 tag
// // activity: 不为 null 时,
// // intent.putExtra 函数 "tag" 参数为 activity.getTag()
// //
// public <T extends IWinBollActivity> void startWinBollActivity(Context context, Class<T> clazz) {
// try {
// // 如果窗口已存在就重启窗口
// String tag = clazz.newInstance().getTag();
// if (isActive(tag)) {
// resumeActivity(context, tag);
// return;
// }
//
// // 新建一个任务窗口
// Intent intent = new Intent(context, clazz);
// //打开多任务窗口 flags
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// intent.putExtra(EXTRA_TAG, tag);
// mContext.startActivity(intent);
// } catch (InstantiationException | IllegalAccessException e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
// }
//
// public <T extends IWinBollActivity> void startWinBollActivity(Context context, Intent intent, Class<T> clazz) {
// try {
// // 如果窗口已存在就重启窗口
// String tag = clazz.newInstance().getTag();
// if (isActive(tag)) {
// resumeActivity(context, tag);
// return;
// }
//
// // 新建一个任务窗口
// //Intent intent = new Intent(context, clazz);
// //打开多任务窗口 flags
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
// intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// intent.putExtra(EXTRA_TAG, tag);
// mContext.startActivity(intent);
// } catch (InstantiationException | IllegalAccessException e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
// }
//
// public boolean isFirstIWinBollActivity(IWinBollActivity iWinBollActivity) {
// return firstIWinBollActivity != null && firstIWinBollActivity == iWinBollActivity;
// }
//
// //
// // 判断 tag绑定的 MyActivity是否存在
// //
// public boolean isActive(String tag) {
// //printAvtivityListInfo();
// IWinBollActivity iWinBoll = getIWinBoll(tag);
// if (iWinBoll != null) {
// LogUtils.d(TAG, "isActive(...) activity != null tag " + tag);
// //ToastUtils.show("activity != null tag " + tag);
// //判断是否为 BaseActivity,如果已经销毁,则移除
// if (iWinBoll.getActivity().isFinishing() || iWinBoll.getActivity().isDestroyed()) {
// _mapIWinBollList.remove(iWinBoll.getTag());
// //_mWinBollActivityList.remove(activity);
// LogUtils.d(TAG, String.format("isActive(...) remove activity.\ntag : %s", tag));
// return false;
// } else {
// LogUtils.d(TAG, String.format("isActive(...) activity is exist.\ntag : %s", tag));
// return true;
// }
// } else {
// LogUtils.d(TAG, String.format("isActive(...) activity == null\ntag : %s", tag));
// return false;
// }
// }
//
// static IWinBollActivity getIWinBoll(String tag) {
// return _mapIWinBollList.get(tag);
// }
//
// //
// // 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
// //
// public <T extends IWinBollActivity> void resumeActivity(Context context, String tag) {
// LogUtils.d(TAG, "resumeActivty");
// T iWinBoll = (T)getIWinBoll(tag);
// //LogUtils.d(TAG, "activity " + activity.getTag());
// if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
// resumeActivity(context, iWinBoll);
// }
// }
//
// //
// // 找到tag 绑定的 BaseActivity ,通过 getTaskId() 移动到前台
// //
// public <T extends IWinBollActivity> void resumeActivity(Context context, T iWinBoll) {
// ActivityManager am = (ActivityManager) iWinBoll.getActivity().getSystemService(Context.ACTIVITY_SERVICE);
// //返回启动它的根任务home 或者 MainActivity
// Intent intent = new Intent(context, iWinBoll.getClass());
// TaskStackBuilder stackBuilder = TaskStackBuilder.create(context);
// stackBuilder.addNextIntentWithParentStack(intent);
// stackBuilder.startActivities();
// //moveTaskToFront(YourTaskId, 0);
// LogUtils.d(TAG, "am.moveTaskToFront");
// //ToastUtils.show("resumeActivity am.moveTaskToFront");
// am.moveTaskToFront(iWinBoll.getActivity().getTaskId(), ActivityManager.MOVE_TASK_NO_USER_ACTION);
// }
//
//
// //
// // 结束所有 Activity
// //
// public void finishAll() {
// try {
// for (String key : _mapIWinBollList.keySet()) {
// //System.out.println("Key: " + key + ", Value: " + _mapActivityList.get(key));
// IWinBollActivity iWinBoll = _mapIWinBollList.get(key);
// //ToastUtils.show("finishAll() activity");
// if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
// //ToastUtils.show("activity != null ...");
// if (getWinBollUI_TYPE() == WinBollUI_TYPE.Service) {
// // 结束窗口和最近任务栏, 建议前台服务类应用使用,可以方便用户再次调用 UI 操作。
// iWinBoll.getActivity().finishAndRemoveTask();
// //ToastUtils.show("finishAll() activity.finishAndRemoveTask();");
// } else if (getWinBollUI_TYPE() == WinBollUI_TYPE.Aplication) {
// // 结束窗口保留最近任务栏,建议前台服务类应用使用,可以保持应用的系统自觉性。
// iWinBoll.getActivity().finish();
// //ToastUtils.show("finishAll() activity.finish();");
// } else {
// LogUtils.d(TAG, "WinBollApplication.WinBollUI_TYPE error.");
// //ToastUtils.show("WinBollApplication.WinBollUI_TYPE error.");
// }
// }
// }
// } catch (Exception e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
// }
//
// //
// // 结束指定Activity
// //
// public <T extends IWinBollActivity> void finish(T iWinBoll) {
// try {
// if (iWinBoll != null && !iWinBoll.getActivity().isFinishing() && !iWinBoll.getActivity().isDestroyed()) {
// //根据tag 移除 MyActivity
// //String tag= activity.getTag();
// //_mWinBollActivityList.remove(tag);
// //ToastUtils.show("remove");
// //ToastUtils.show("_mWinBollActivityArrayMap.size() " + Integer.toString(_mWinBollActivityArrayMap.size()));
//
// // 窗口回调规则:
// // [] 当前窗口位置 >> 调度出的窗口位置
// // ★:[0] 1 2 3 4 >> 1
// // ★0 1 [2] 3 4 >> 1
// // ★0 1 2 [3] 4 >> 2
// // ★0 1 2 3 [4] >> 3
// // ★:[0] >> 直接关闭当前窗口
// LogUtils.d(TAG, "finish no yet.");
// IWinBollActivity preIWinBoll = getPreIWinBoll(iWinBoll);
// iWinBoll.getActivity().finish();
// if (preIWinBoll != null) {
// resumeActivity(mContext, preIWinBoll);
// }
// }
//
// } catch (Exception e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
// }
//
// //
// // 获取窗口队列中的前一个窗口
// //
// IWinBollActivity getPreIWinBoll(IWinBollActivity iWinBoll) {
// try {
// boolean bingo = false;
// IWinBollActivity preIWinBoll = null;
// for (Map.Entry<String, IWinBollActivity> entity : _mapIWinBollList.entrySet()) {
// if (entity.getKey().equals(iWinBoll.getTag())) {
// bingo = true;
// LogUtils.d(TAG, "bingo");
// break;
// }
// preIWinBoll = entity.getValue();
// }
//
// if (bingo) {
// return preIWinBoll;
// }
// } catch (Exception e) {
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
//
// return null;
// }
//
// //
// // 从管理列表中移除管理项
// //
// public <T extends IWinBollActivity> boolean registeRemove(T activity) {
// IWinBollActivity iWinBollTest = _mapIWinBollList.get(activity.getTag());
// if (iWinBollTest != null) {
// _mapIWinBollList.remove(activity.getTag());
// return true;
// }
// return false;
// }
//
// //
// // 打印管理列表项列表里的信息
// //
// public static void printIWinBollListInfo() {
// //LogUtils.d(TAG, "printAvtivityListInfo");
// if (!_mapIWinBollList.isEmpty()) {
// StringBuilder sb = new StringBuilder("Map entries : " + Integer.toString(_mapIWinBollList.size()));
// Iterator<Map.Entry<String, IWinBollActivity>> iterator = _mapIWinBollList.entrySet().iterator();
// while (iterator.hasNext()) {
// Map.Entry<String, IWinBollActivity> entry = iterator.next();
// sb.append("\nKey: " + entry.getKey() + ", \nValue: " + entry.getValue().getTag());
// //ToastUtils.show("\nKey: " + entry.getKey() + ", Value: " + entry.getValue().getTag());
// }
// sb.append("\nMap entries end.");
// LogUtils.d(TAG, sb.toString());
// } else {
// LogUtils.d(TAG, "The map is empty.");
// }
// }
}

View File

@@ -0,0 +1,190 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 19:06:54
* @Describe WinBoll 客户端服务
*/
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.os.IBinder;
import cc.winboll.studio.libaes.winboll.AssistantService;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.utils.ServiceUtils;
import com.hjq.toast.ToastUtils;
public class WinBollClientService extends Service implements IWinBollClientServiceBinder {
public static final String TAG = "WinBollClientService";
WinBollClientServiceBean mWinBollClientServiceBean;
MyServiceConnection mMyServiceConnection;
volatile boolean mIsWinBollClientThreadRunning;
volatile boolean mIsEnableService;
WinBollClientThread mWinBollClientThread;
public boolean isWinBollClientThreadRunning() {
return mIsWinBollClientThreadRunning;
}
@Override
public WinBollClientService getService() {
return WinBollClientService.this;
}
@Override
public Drawable getCurrentStatusIconDrawable() {
return mIsWinBollClientThreadRunning ?
getDrawable(EWUIStatusIconDrawable.getIconDrawableId(EWUIStatusIconDrawable.NORMAL))
: getDrawable(EWUIStatusIconDrawable.getIconDrawableId(EWUIStatusIconDrawable.NEWS));
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
ToastUtils.show("onCreate");
super.onCreate();
mWinBollClientThread = null;
mWinBollClientServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
mIsEnableService = mWinBollClientServiceBean.isEnable();
if (mMyServiceConnection == null) {
mMyServiceConnection = new MyServiceConnection();
}
// 由系统启动时,应用可以通过下面函数实例化实际服务进程。
runMainThread();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
ToastUtils.show("onStartCommand");
// 由应用 Intent 启动时,应用可以通过下面函数实例化实际服务进程。
runMainThread();
// 返回运行参数持久化存储后,服务状态控制参数
// 无论 Intent 传入如何,服务状态一直以持久化存储后的参数控制,
// PS: 另外当然可以通过 Intent 传入的指标来修改 mWinBollServiceBean
// 不过本服务的应用方向会变得繁琐,
// 现阶段只要满足手机端启动与停止本服务WinBoll 客户端实例运行在手机端就可以了。
return mIsEnableService ? Service.START_STICKY: super.onStartCommand(intent, flags, startId);
}
void runMainThread() {
if (mWinBollClientThread == null) {
ToastUtils.show("runMainThread()");
mWinBollClientThread = new WinBollClientThread();
mWinBollClientThread.start();
}
}
void syncWinBollClientThreadStatus() {
mWinBollClientServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
mIsEnableService = mWinBollClientServiceBean.isEnable();
}
// 唤醒和绑定守护进程
//
void wakeupAndBindAssistant() {
if (ServiceUtils.isServiceRunning(getApplicationContext(), AssistantService.class.getName()) == false) {
startService(new Intent(WinBollClientService.this, AssistantService.class));
//LogUtils.d(TAG, "call wakeupAndBindAssistant() : Binding... AssistantService");
bindService(new Intent(WinBollClientService.this, AssistantService.class), mMyServiceConnection, Context.BIND_IMPORTANT);
}
}
// 主进程与守护进程连接时需要用到此类
//
private class MyServiceConnection implements ServiceConnection {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
}
@Override
public void onServiceDisconnected(ComponentName name) {
mWinBollClientServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(WinBollClientService.this);
if (mWinBollClientServiceBean.isEnable()) {
// 唤醒守护进程
wakeupAndBindAssistant();
}
}
}
@Override
public void onDestroy() {
super.onDestroy();
ToastUtils.show("onDestroy");
}
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
}
void setWinBollServiceEnableStatus(boolean isEnable) {
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(this);
bean.setIsEnable(isEnable);
WinBollClientServiceBean.saveWinBollServiceBean(this, bean);
}
boolean getWinBollServiceEnableStatus(Context context) {
mWinBollClientServiceBean = WinBollClientServiceBean.loadWinBollClientServiceBean(context);
return mWinBollClientServiceBean.isEnable();
}
/*public interface OnServiceStatusChangeListener {
void onServerStatusChange(boolean isServiceAlive);
}
public void setOnServerStatusChangeListener(OnServiceStatusChangeListener l) {
mOnServerStatusChangeListener = l;
}*/
class WinBollClientThread extends Thread {
@Override
public void run() {
//ToastUtils.show("WinBollClientThread");
super.run();
syncWinBollClientThreadStatus();
if (mIsEnableService) {
if (mIsWinBollClientThreadRunning == false) {
// 设置运行状态
mIsWinBollClientThreadRunning = true;
//ToastUtils.show("run()");
// 唤醒守护进程
//wakeupAndBindAssistant();
while (mIsEnableService) {
// 显示运行状态
ToastUtils.show(TAG + " is running.");
try {
Thread.sleep(2 * 1000);
} catch (InterruptedException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
syncWinBollClientThreadStatus();
//ToastUtils.show("syncServiceThreadStatus OK.");
//ToastUtils.show("mIsExist : " + Boolean.toString(!mIsEnableService));
//break;
}
// 服务进程退出, 重置进程运行状态
mIsWinBollClientThreadRunning = false;
mWinBollClientThread = null;
}
}
}
}
}

View File

@@ -0,0 +1,78 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 19:05:15
* @Describe WinBollService 运行参数配置
*/
import android.content.Context;
import android.util.JsonReader;
import android.util.JsonWriter;
import cc.winboll.studio.libappbase.BaseBean;
import java.io.IOException;
public class WinBollClientServiceBean extends BaseBean {
public static final String TAG = "WinBollClientServiceBean";
volatile boolean isEnable;
public WinBollClientServiceBean() {
isEnable = false;
}
public void setIsEnable(boolean isEnable) {
this.isEnable = isEnable;
}
public boolean isEnable() {
return isEnable;
}
@Override
public String getName() {
return WinBollClientServiceBean.class.getName();
}
@Override
public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException {
super.writeThisToJsonWriter(jsonWriter);
WinBollClientServiceBean bean = this;
jsonWriter.name("isEnable").value(bean.isEnable());
}
@Override
public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException {
if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else {
if (name.equals("isEnable")) {
setIsEnable(jsonReader.nextBoolean());
} else {
return false;
}
}
return true;
}
@Override
public BaseBean readBeanFromJsonReader(JsonReader jsonReader) throws IOException {
jsonReader.beginObject();
while (jsonReader.hasNext()) {
String name = jsonReader.nextName();
if (!initObjectsFromJsonReader(jsonReader, name)) {
jsonReader.skipValue();
}
}
// 结束 JSON 对象
jsonReader.endObject();
return this;
}
public static WinBollClientServiceBean loadWinBollClientServiceBean(Context context) {
WinBollClientServiceBean bean = WinBollClientServiceBean.loadBean(context, WinBollClientServiceBean.class);
return bean == null ? new WinBollClientServiceBean() : bean;
}
public static boolean saveWinBollServiceBean(WinBollClientService service, WinBollClientServiceBean bean) {
return WinBollClientServiceBean.saveBean(service, bean);
}
}

View File

@@ -0,0 +1,22 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 19:13:20
* @Describe WinBoll 邮件服务
*/
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class WinBollMail extends Service {
public static final String TAG = "WinBollMail";
@Override
public IBinder onBind(Intent intent) {
return null;
}
}

View File

@@ -0,0 +1,340 @@
package cc.winboll.studio.libaes.winboll;
/**
* @Author ZhanGSKen@AliYun.Com
* @Date 2025/03/28 17:41:55
* @Describe WinBoll 服务主机连接状态视图
*/
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import cc.winboll.studio.libappbase.LogUtils;
import com.hjq.toast.ToastUtils;
import cc.winboll.studio.libapputils.R;
//import okhttp3.Authenticator;
//import okhttp3.Credentials;
//import okhttp3.OkHttpClient;
//import okhttp3.Request;
//import okhttp3.Response;
//import okhttp3.Route;
public class WinBollServiceStatusView extends LinearLayout {
public static final String TAG = "WinBollServiceStatusView";
public static final int MSG_CONNECTION_INFO = 0;
public static final int MSG_UPDATE_CONNECTION_STATUS = 1;
Context mContext;
//boolean mIsConnected;
ConnectionThread mConnectionThread;
String mszServerHost;
WinBollClientService mWinBollService;
ImageView mImageView;
TextView mTextView;
WinBollServiceViewHandler mWinBollServiceViewHandler;
//WebView mWebView;
static volatile ConnectionStatus mConnectionStatus;
View.OnClickListener mViewOnClickListener;
static String _mUserName;
static String _mPassword;
static enum ConnectionStatus {
DISCONNECTED,
START_CONNECT,
CONNECTING,
CONNECTED;
};
boolean isBound = false;
ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
IWinBollClientServiceBinder binder = (IWinBollClientServiceBinder) service;
mWinBollService = binder.getService();
isBound = true;
// 可以在这里调用Service的方法进行通信比如获取数据
mImageView.setBackgroundDrawable(mWinBollService.getCurrentStatusIconDrawable());
}
@Override
public void onServiceDisconnected(ComponentName name) {
isBound = false;
}
};
public WinBollServiceStatusView(Context context) {
super(context);
mContext = context;
initView();
}
public WinBollServiceStatusView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
initView();
}
public WinBollServiceStatusView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
initView();
}
public WinBollServiceStatusView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
mContext = context;
initView();
}
ConnectionStatus getConnectionStatus() {
return false ?
ConnectionStatus.CONNECTED
: ConnectionStatus.DISCONNECTED;
}
void initView() {
mImageView = new ImageView(mContext);
setImageViewByConnection(mImageView, false);
mConnectionStatus = getConnectionStatus();
//mIsConnected = false;
//mWinBollServerHostConnectionStatus = WinBollServerHostConnectionStatus.DISCONNECTED;
//ToastUtils.show("initView()");
mViewOnClickListener = new View.OnClickListener(){
@Override
public void onClick(View v) {
//ToastUtils.show("onClick()");
//ToastUtils.show("mWinBollServerHostConnectionStatus : " + mWinBollServerHostConnectionStatus);
//isConnected = !isConnected;
if (mConnectionStatus == ConnectionStatus.CONNECTED) {
ToastUtils.show("Click to stop service.");
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(mContext);
bean.setIsEnable(false);
WinBollClientServiceBean.saveBean(mContext, bean);
Intent intent = new Intent(mContext, WinBollClientService.class);
mContext.stopService(intent);
mConnectionStatus = ConnectionStatus.DISCONNECTED;
//
/*//ToastUtils.show("CONNECTED");
setConnectionStatusView(false);
mWinBollServerHostConnectionStatusViewHandler.postMessageText("");
if (mConnectionThread != null) {
mConnectionThread.mIsExist = true;
mConnectionThread = null;
mWinBollServerHostConnectionStatus = WinBollServerHostConnectionStatus.DISCONNECTED;
ToastUtils.show("WinBoll Server Disconnected.");
}*/
} else if (mConnectionStatus == ConnectionStatus.DISCONNECTED) {
ToastUtils.show("Click to start service.");
WinBollClientServiceBean bean = WinBollClientServiceBean.loadWinBollClientServiceBean(mContext);
bean.setIsEnable(true);
WinBollClientServiceBean.saveBean(mContext, bean);
Intent intent = new Intent(mContext, WinBollClientService.class);
mContext.startService(intent);
mConnectionStatus = ConnectionStatus.CONNECTED;
ToastUtils.show("startService");
/*//ToastUtils.show("DISCONNECTED");
setConnectionStatusView(true);
if (mConnectionThread == null) {
ToastUtils.show("mConnectionThread == null");
mConnectionThread = new ConnectionThread();
mWinBollServerHostConnectionStatus = WinBollServerHostConnectionStatus.START_CONNECT;
mConnectionThread.start();
}*/
} else {
ToastUtils.show("Other Click condition.");
}
/*if (isConnected) {
mWebView.loadUrl("https://dev.winboll.cc");
} else {
mWebView.stopLoading();
}*/
//ToastUtils.show(mDevelopHostConnectionStatus);
//LogUtils.d(TAG, "mDevelopHostConnectionStatus : " + mWinBollServerHostConnectionStatus);
}
};
setOnClickListener(mViewOnClickListener);
addView(mImageView);
mTextView = new TextView(mContext);
mWinBollServiceViewHandler = new WinBollServiceViewHandler(this);
addView(mTextView);
/*mWebView = new WebView(mContext);
mWebView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
// 弹出系统基本HTTP验证窗口
handler.proceed("username", "password");
}
});
addView(mWebView);*/
}
void checkWinBollServerStatusAndUpdateCurrentView() {
LogUtils.d(TAG, "checkWinBollServerStatusAndUpdateCurrentView()");
/*if (getConnectionStatus() == ConnectionStatus.CONNECTED) {
mConnectionStatus = ConnectionStatus.CONNECTED;
} else {
mConnectionStatus = ConnectionStatus.DISCONNECTED;
}*/
}
public void setServerHost(String szWinBollServerHost) {
mszServerHost = szWinBollServerHost;
}
public void setAuthInfo(String username, String password) {
_mUserName = username;
_mPassword = password;
}
void setImageViewByConnection(ImageView imageView, boolean isConnected) {
//mIsConnected = isConnected;
// 获取vector drawable
Drawable drawable = mContext.getDrawable(isConnected ? R.drawable.ic_dev_connected : R.drawable.ic_dev_disconnected);
if (drawable != null) {
imageView.setImageDrawable(drawable);
}
}
void requestWithBasicAuth(WinBollServiceViewHandler textViewHandler, String targetUrl, final String username, final String password) {
// 用户名和密码,替换为实际的认证信息
//String username = "your_username";
//String password = "your_password";
// OkHttpClient client = new OkHttpClient.Builder()
// .authenticator(new Authenticator() {
// @Override
// public Request authenticate(Route route, Response response) throws IOException {
// String credential = Credentials.basic(username, password);
// return response.request().newBuilder()
// .header("Authorization", credential)
// .build();
// }
// })
// .build();
//
// Request request = new Request.Builder()
// .url(targetUrl) // 替换为实际要请求的网页地址
// .build();
//
// try {
// Response response = client.newCall(request).execute();
// if (response.isSuccessful()) {
// //System.out.println(response.body().string());
// //ToastUtils.show("Develop Host Connection IP is : " + response.body().string());
// // 获取当前时间
// LocalDateTime now = LocalDateTime.now();
//
// // 定义时间格式
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
// // 按照指定格式格式化时间并输出
// String formattedDateTime = now.format(formatter);
// //System.out.println(formattedDateTime);
// textViewHandler.postMessageText("ClientIP<" + formattedDateTime + ">: " + response.body().string());
// textViewHandler.postMessageConnectionStatus(true);
// } else {
// String sz = "请求失败,状态码: " + response.code();
// setImageViewByConnection(mImageView, false);
// textViewHandler.postMessageText(sz);
// textViewHandler.postMessageConnectionStatus(false);
// LogUtils.d(TAG, sz);
// }
// } catch (IOException e) {
// textViewHandler.postMessageText(e.getMessage());
// textViewHandler.postMessageConnectionStatus(false);
// LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
// }
}
class WinBollServiceViewHandler extends Handler {
WinBollServiceStatusView mDevelopHostConnectionStatusView;
public WinBollServiceViewHandler(WinBollServiceStatusView view) {
mDevelopHostConnectionStatusView = view;
}
@Override
public void handleMessage(Message msg) {
if (msg.what == MSG_CONNECTION_INFO) {
mDevelopHostConnectionStatusView.mTextView.setText((String)msg.obj);
} else if (msg.what == MSG_UPDATE_CONNECTION_STATUS) {
mDevelopHostConnectionStatusView.setImageViewByConnection(mImageView, (boolean)msg.obj);
mDevelopHostConnectionStatusView.mConnectionStatus = ((boolean)msg.obj) ? ConnectionStatus.CONNECTED : ConnectionStatus.DISCONNECTED;
}
super.handleMessage(msg);
}
void postMessageText(String szMSG) {
Message msg = new Message();
msg.what = MSG_CONNECTION_INFO;
msg.obj = szMSG;
sendMessage(msg);
}
void postMessageConnectionStatus(boolean isConnected) {
Message msg = new Message();
msg.what = MSG_UPDATE_CONNECTION_STATUS;
msg.obj = isConnected;
sendMessage(msg);
}
}
class ConnectionThread extends Thread {
public volatile boolean mIsExist;
//DevelopHostConnectionStatusViewHandler mDevelopHostConnectionStatusViewHandler;
//public ConnectionThread(DevelopHostConnectionStatusViewHandler developHostConnectionStatusViewHandler) {
//mDevelopHostConnectionStatusViewHandler = developHostConnectionStatusViewHandler;
//}
public ConnectionThread() {
mIsExist = false;
}
@Override
public void run() {
super.run();
while (mIsExist == false) {
if (mConnectionStatus == ConnectionStatus.START_CONNECT) {
mConnectionStatus = ConnectionStatus.CONNECTING;
ToastUtils.show("WinBoll Server Connection Start.");
//LogUtils.d(TAG, "Develop Host Connection Start.");
String targetUrl = "https://" + mszServerHost + "/cip/?simple=true"; // 这里替换成你实际要访问的网址
requestWithBasicAuth(mWinBollServiceViewHandler, targetUrl, _mUserName, _mPassword);
} else if (mConnectionStatus == ConnectionStatus.CONNECTED
&& mConnectionStatus == ConnectionStatus.DISCONNECTED) {
ToastUtils.show("mWinBollServerHostConnectionStatus " + mConnectionStatus);
}
try {
Thread.sleep(5 * 1000);
} catch (InterruptedException e) {
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
}
}
//ToastUtils.show("ConnectionThread exit.");
LogUtils.d(TAG, "ConnectionThread exit.");
}
}
/*WinBollService.OnServiceStatusChangeListener mOnServerStatusChangeListener = new WinBollService.OnServiceStatusChangeListener(){
@Override
public void onServerStatusChange(boolean isServiceAlive) {
}
};*/
}

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 阴影部分 -->
<!-- 个人觉得更形象的表达top代表下边的阴影高度left代表右边的阴影宽度。其实也就是相对应的offsetsolid中的颜色是阴影的颜色也可以设置角度等等 -->
<item
android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="2dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:endColor="#0F000000"
android:startColor="#0F000000" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
<!-- 背景部分 -->
<!-- 形象的表达bottom代表背景部分在上边缘超出阴影的高度right代表背景部分在左边超出阴影的宽度相对应的offset -->
<item
android:left="3dp"
android:top="3dp"
android:right="3dp"
android:bottom="5dp">
<shape android:shape="rectangle" >
<gradient
android:angle="270"
android:endColor="@color/colorAccent"
android:startColor="@color/colorAccent" />
<corners
android:bottomLeftRadius="6dip"
android:bottomRightRadius="6dip"
android:topLeftRadius="6dip"
android:topRightRadius="6dip" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,12V14H5V12H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3,15V17H5V15H3M14,15H20V19H14V15M3,18V20H5V18H3M6,18V20H8V18H6M9,18V20H11V18H9Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M22,6C22,4.9 21.1,4 20,4H4C2.9,4 2,4.9 2,6V18C2,19.1 2.9,20 4,20H20C21.1,20 22,19.1 22,18V6M20,6L12,11L4,6H20M20,18H4V8L12,13L20,8V18Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#ff000000"
android:pathData="M24,7H22V13H24V7M24,15H22V17H24V15M20,6C20,4.9 19.1,4 18,4H2C0.9,4 0,4.9 0,6V18C0,19.1 0.9,20 2,20H18C19.1,20 20,19.1 20,18V6M18,6L10,11L2,6H18M18,18H2V8L10,13L18,8V18Z"/>
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true">
<item
android:width="256dp"
android:height="256dp"
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
android:drawable="@drawable/winboll_logo">
</item>
</layer-list>

View File

@@ -0,0 +1,170 @@
<?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="@color/colorPrimary"
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>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M16.61,15.15C16.15,15.15 15.77,14.78 15.77,14.32S16.15,13.5 16.61,13.5H16.61C17.07,13.5 17.45,13.86 17.45,14.32C17.45,14.78 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,14.78 6.57,14.32C6.57,13.86 6.95,13.5 7.41,13.5H7.41C7.87,13.5 8.24,13.86 8.24,14.32C8.24,14.78 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14H16.91Z"/>
</vector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true">
<item
android:width="256dp"
android:height="256dp"
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
android:drawable="@drawable/winboll_logo">
</item>
</layer-list>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true">
<item android:drawable="@drawable/ic_launcher_background"/>
<item
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
android:drawable="@drawable/winboll_logo"/>
</layer-list>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FFFFFFFF"
android:startColor="#FFFFFFFF"
android:type="linear" />
<corners android:radius="10dp" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#000000" /> <!-- 这里可调整边框宽度和颜色 -->
<solid android:color="@android:color/transparent" />
</shape>

View File

@@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:fillColor="#FF1E9B54"
android:strokeColor="#FFF8E733"
android:strokeWidth="20.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M254.63 35.45C374.95 35.45 473.38 133.89 473.38 254.2 473.38 374.51 374.95 472.95 254.63 472.95 134.32 472.95 35.88 374.51 35.88 254.2 35.88 133.89 134.32 35.45 254.63 35.45"/>
<path
android:fillColor="#FF000000"
android:strokeColor="#FF000000"
android:strokeWidth="1.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M257.28 361.25C266.56 361.25 274.14 368.84 274.14 378.11 274.14 387.39 266.56 394.98 257.28 394.98 248.01 394.98 240.42 387.39 240.42 378.11 240.42 368.84 248.01 361.25 257.28 361.25"/>
<path
android:fillColor="#00000000"
android:strokeColor="#FF000000"
android:strokeWidth="30.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M182.16 214.09C181.42 199.71 182.42 177.87 207.64 155.49 213.64 150.16 220.13 146.12 226.28 143.08 238.64 136.97 249.62 134.91 252.55 134.56 252.7 134.54 252.83 134.53 252.94 134.52 253.05 134.51 253.14 134.5 253.2 134.5 255.01 134.48 294.9 136.66 313.05 160.43 332.29 185.63 344.82 221.3 300.07 263.56 263.08 298.49 258.36 318 258.54 317.72"/>
</vector>

View File

@@ -0,0 +1,48 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:fillColor="#FF1E9B54"
android:strokeColor="#FFF8E733"
android:strokeWidth="20.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M254.63 35.45C374.95 35.45 473.38 133.89 473.38 254.2 473.38 374.51 374.95 472.95 254.63 472.95 134.32 472.95 35.88 374.51 35.88 254.2 35.88 133.89 134.32 35.45 254.63 35.45"/>
<path
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="1.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M257.28 361.25C266.56 361.25 274.14 368.84 274.14 378.11 274.14 387.39 266.56 394.98 257.28 394.98 248.01 394.98 240.42 387.39 240.42 378.11 240.42 368.84 248.01 361.25 257.28 361.25"/>
<path
android:fillColor="#00000000"
android:strokeColor="#FF000000"
android:strokeWidth="30.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M182.16 214.09C181.42 199.71 182.42 177.87 207.64 155.49 213.64 150.16 220.13 146.12 226.28 143.08 238.64 136.97 249.62 134.91 252.55 134.56 252.7 134.54 252.83 134.53 252.94 134.52 253.05 134.51 253.14 134.5 253.2 134.5 255.01 134.48 294.9 136.66 313.05 160.43 332.29 185.63 344.82 221.3 300.07 263.56 263.08 298.49 258.36 318 258.54 317.72"/>
<path
android:fillColor="#00000000"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="30.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M103.77 307.45C103.02 293.07 104.03 271.24 129.24 248.85 135.25 243.52 141.74 239.48 147.89 236.44 160.24 230.34 171.23 228.28 174.15 227.92 174.31 227.9 174.44 227.89 174.55 227.88 174.66 227.87 174.75 227.86 174.81 227.86 176.62 227.85 216.5 230.02 234.65 253.79 253.9 278.99 266.43 314.66 221.67 356.93 184.69 391.85 179.97 411.36 180.15 411.08"/>
<path
android:fillColor="#00000000"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="30.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M248.17 309.83C247.43 295.45 248.43 273.62 273.64 251.23 279.65 245.9 286.14 241.86 292.29 238.82 304.65 232.72 315.63 230.65 318.55 230.3 318.71 230.28 318.84 230.27 318.95 230.26 319.06 230.25 319.15 230.24 319.21 230.24 321.02 230.22 360.9 232.4 379.06 256.17 398.3 281.37 410.83 317.04 366.08 359.31 329.09 394.23 324.37 413.74 324.55 413.46"/>
<path
android:fillColor="#00000000"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="30.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M182.16 214.09C181.42 199.71 182.42 177.87 207.64 155.49 213.64 150.16 220.13 146.12 226.28 143.08 238.64 136.97 249.62 134.91 252.55 134.56 252.7 134.54 252.83 134.53 252.94 134.52 253.05 134.51 253.14 134.5 253.2 134.5 255.01 134.48 294.9 136.66 313.05 160.43 332.29 185.63 344.82 221.3 300.07 263.56 263.08 298.49 258.36 318 258.54 317.72"/>
</vector>

View File

@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="512dp"
android:height="512dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path
android:fillColor="#FF1E9B54"
android:strokeColor="#FFF8E733"
android:strokeWidth="20.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M254.63 35.45C374.95 35.45 473.38 133.89 473.38 254.2 473.38 374.51 374.95 472.95 254.63 472.95 134.32 472.95 35.88 374.51 35.88 254.2 35.88 133.89 134.32 35.45 254.63 35.45"/>
<path
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="1.0"
android:strokeLineCap="round"
android:strokeMiterLimit="10"
android:pathData="M257.28 361.25C266.56 361.25 274.14 368.84 274.14 378.11 274.14 387.39 266.56 394.98 257.28 394.98 248.01 394.98 240.42 387.39 240.42 378.11 240.42 368.84 248.01 361.25 257.28 361.25"/>
</vector>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/aboutroot_ll">
</LinearLayout>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewaboutdevLinearLayout1">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<TextView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="DevelopUserName :"/>
<EditText
android:layout_width="0dp"
android:ems="10"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:id="@+id/viewaboutdevEditText1"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<TextView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="DevelopUserPassword :"/>
<EditText
android:layout_width="0dp"
android:inputType="textPassword"
android:layout_height="wrap_content"
android:ems="10"
android:layout_weight="1.0"
android:id="@+id/viewaboutdevEditText2"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<cc.winboll.studio.libaes.winboll.WinBollServiceStatusView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/viewaboutdevWinBollServiceStatusView1"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/viewaboutwwwLinearLayout1">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<cc.winboll.studio.libaes.winboll.WinBollServiceStatusView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/viewaboutwwwWinBollServiceStatusView1"/>
</LinearLayout>
</LinearLayout>