精简模块,移除非必要模块到WinBoLL项目。
This commit is contained in:
		| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Sun Sep 28 20:11:56 HKT 2025 | ||||
| #Sun Sep 28 13:10:12 GMT 2025 | ||||
| stageCount=1 | ||||
| libraryProject=libaes | ||||
| baseVersion=15.10 | ||||
| publishVersion=15.10.0 | ||||
| buildCount=0 | ||||
| buildCount=5 | ||||
| baseBetaVersion=15.10.1 | ||||
|   | ||||
| @@ -33,6 +33,8 @@ | ||||
|  | ||||
|         <activity android:name=".AboutActivity"/> | ||||
|  | ||||
|         <activity android:name=".TestActivityManagerActivity"/> | ||||
|  | ||||
|     </application> | ||||
|  | ||||
| </manifest> | ||||
| @@ -12,11 +12,10 @@ import android.view.ViewGroup; | ||||
| import android.widget.LinearLayout; | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import androidx.appcompat.widget.Toolbar; | ||||
| import cc.winboll.studio.libaes.winboll.APPInfo; | ||||
| import cc.winboll.studio.libaes.winboll.AboutView; | ||||
| import cc.winboll.studio.libappbase.GlobalApplication; | ||||
| import cc.winboll.studio.libaes.winboll.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.winboll.WinBoLLActivityManager; | ||||
| import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.models.APPInfo; | ||||
| import cc.winboll.studio.libaes.utils.WinBoLLActivityManager; | ||||
| import cc.winboll.studio.libaes.views.AboutView; | ||||
|  | ||||
| public class AboutActivity extends AppCompatActivity implements IWinBoLLActivity { | ||||
|  | ||||
|   | ||||
| @@ -6,10 +6,10 @@ package cc.winboll.studio.aes; | ||||
|  * @Describe AES应用类 | ||||
|  */ | ||||
| import android.view.Gravity; | ||||
| import cc.winboll.studio.libaes.utils.WinBoLLActivityManager; | ||||
| import cc.winboll.studio.libappbase.GlobalApplication; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import com.hjq.toast.style.WhiteToastStyle; | ||||
| import cc.winboll.studio.libaes.winboll.WinBoLLActivityManager; | ||||
|  | ||||
|  | ||||
| public class App extends GlobalApplication { | ||||
|   | ||||
| @@ -15,9 +15,10 @@ import android.widget.AdapterView; | ||||
| import android.widget.Toast; | ||||
| import cc.winboll.studio.aes.R; | ||||
| import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity; | ||||
| import cc.winboll.studio.libaes.models.DrawerMenuBean; | ||||
| import cc.winboll.studio.libaes.dialogs.LocalFileSelectDialog; | ||||
| import cc.winboll.studio.libaes.dialogs.StoragePathDialog; | ||||
| import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.models.DrawerMenuBean; | ||||
| import cc.winboll.studio.libaes.unittests.SecondaryLibraryActivity; | ||||
| import cc.winboll.studio.libaes.unittests.TestAButtonFragment; | ||||
| import cc.winboll.studio.libaes.unittests.TestASupportToolbarActivity; | ||||
| @@ -25,10 +26,10 @@ 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.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libappbase.ToastUtils; | ||||
| import com.a4455jkjh.colorpicker.ColorPickerDialog; | ||||
| import com.hjq.toast.ToastUtils; | ||||
| import java.util.ArrayList; | ||||
| import cc.winboll.studio.libaes.winboll.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.utils.WinBoLLActivityManager; | ||||
|  | ||||
| public class MainActivity extends DrawerFragmentActivity implements IWinBoLLActivity { | ||||
|  | ||||
| @@ -122,9 +123,10 @@ public class MainActivity extends DrawerFragmentActivity implements IWinBoLLActi | ||||
|     @Override | ||||
|     public boolean onOptionsItemSelected(MenuItem item) { | ||||
|         int nItemId = item.getItemId(); | ||||
| //        if (item.getItemId() == R.id.item_log) { | ||||
| //            WinBoLLActivityManager.getInstance(this).startWinBoLLActivity(getApplicationContext(), LogActivity.class); | ||||
| //        } else  | ||||
|         if (item.getItemId() == R.id.item_testactivitymanager) { | ||||
|             WinBoLLActivityManager.getInstance().startWinBoLLActivity(this, TestActivityManagerActivity.class); | ||||
| 			//ToastUtils.show("item_testactivitymanager"); | ||||
|         } else  | ||||
|         if (nItemId == R.id.item_atoast) { | ||||
|             Toast.makeText(getApplication(), "item_testatoast", Toast.LENGTH_SHORT).show(); | ||||
|         } else if (nItemId == R.id.item_atoolbar) { | ||||
|   | ||||
| @@ -0,0 +1,33 @@ | ||||
| package cc.winboll.studio.aes; | ||||
|  | ||||
| import android.app.Activity; | ||||
| import android.os.Bundle; | ||||
| import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen&豆包大模型<zhangsken@qq.com> | ||||
|  * @Date 2025/09/28 21:07 | ||||
|  * @Describe 窗口管理类测试窗口 | ||||
|  */ | ||||
| public class TestActivityManagerActivity extends Activity implements IWinBoLLActivity { | ||||
|      | ||||
|     public static final String TAG = "TestActivityManagerActivity"; | ||||
|  | ||||
|     @Override | ||||
|     public Activity getActivity() { | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getTag() { | ||||
|         return TAG; | ||||
|     } | ||||
| 	 | ||||
|     @Override | ||||
|     protected void onCreate(Bundle savedInstanceState) { | ||||
|         super.onCreate(savedInstanceState); | ||||
|         setContentView(R.layout.activity_testactivitymanager); | ||||
|          | ||||
|     } | ||||
|      | ||||
| } | ||||
							
								
								
									
										15
									
								
								aes/src/main/res/layout/activity_testactivitymanager.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								aes/src/main/res/layout/activity_testactivitymanager.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| <?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"> | ||||
|  | ||||
| 	<TextView | ||||
| 		android:layout_width="wrap_content" | ||||
| 		android:layout_height="wrap_content" | ||||
| 		android:text="窗口管理类测试窗口"/> | ||||
|  | ||||
| </LinearLayout> | ||||
|  | ||||
| @@ -1,5 +1,8 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
| 	<item | ||||
| 		android:id="@+id/item_testactivitymanager" | ||||
| 		android:title="TestActivityManager"/> | ||||
|     <item | ||||
|         android:id="@+id/item_log" | ||||
|         android:title="LogActivity"/> | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| #Created by .winboll/winboll_app_build.gradle | ||||
| #Sun Sep 28 20:11:37 HKT 2025 | ||||
| #Sun Sep 28 13:10:12 GMT 2025 | ||||
| stageCount=1 | ||||
| libraryProject=libaes | ||||
| baseVersion=15.10 | ||||
| publishVersion=15.10.0 | ||||
| buildCount=0 | ||||
| buildCount=5 | ||||
| baseBetaVersion=15.10.1 | ||||
|   | ||||
| @@ -30,6 +30,7 @@ import cc.winboll.studio.libaes.views.ADrawerMenuListView; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import com.baoyz.widget.PullRefreshLayout; | ||||
| import java.util.ArrayList; | ||||
| import cc.winboll.studio.libaes.utils.WinBoLLActivityManager; | ||||
|  | ||||
| public abstract class DrawerFragmentActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { | ||||
|  | ||||
| @@ -174,8 +175,6 @@ public abstract class DrawerFragmentActivity extends AppCompatActivity implement | ||||
|             for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) { | ||||
|                 getString(i); | ||||
|             } | ||||
| //        } else if (R.id.item_log == item.getItemId()) { | ||||
| //            GlobalApplication.getWinBoLLActivityManager().startLogActivity(this); | ||||
|         } else if (R.id.item_about == item.getItemId()) { | ||||
|             LogUtils.d(TAG, "onAbout"); | ||||
|         } else if (android.R.id.home == item.getItemId()) { | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
| import android.app.Activity; | ||||
| package cc.winboll.studio.libaes.interfaces; | ||||
| 
 | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
|  * @Date 2025/05/10 09:34 | ||||
|  * @Describe WinBoLL 窗口操作接口 | ||||
|  */ | ||||
|  import android.app.Activity; | ||||
|   | ||||
| public abstract interface IWinBoLLActivity { | ||||
| 
 | ||||
|     public static final String TAG = "IWinBoLLActivity"; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
| package cc.winboll.studio.libaes.models; | ||||
| 
 | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
| @@ -1,92 +0,0 @@ | ||||
| package cc.winboll.studio.libaes.models; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
|  * @Date 2025/05/10 10:16 | ||||
|  * @Describe WinBoLLModel | ||||
|  */ | ||||
| import android.util.JsonReader; | ||||
| import android.util.JsonWriter; | ||||
| import cc.winboll.studio.libappbase.BaseBean; | ||||
| import java.io.IOException; | ||||
| import cc.winboll.studio.libappbase.APPModel; | ||||
|  | ||||
| public class WinBoLLModel extends BaseBean { | ||||
|      | ||||
|     public static final String TAG = "WinBoLLModel"; | ||||
|      | ||||
|     String appPackageName; | ||||
|     String appMainServiveName; | ||||
|  | ||||
|     public WinBoLLModel() { | ||||
|         this.appPackageName = ""; | ||||
|         this.appMainServiveName = ""; | ||||
|     } | ||||
|  | ||||
|     public WinBoLLModel(boolean isDebuging, String appPackageName, String appMainServiveName) { | ||||
|         this.appPackageName = appPackageName; | ||||
|         this.appMainServiveName = appMainServiveName; | ||||
|     } | ||||
|  | ||||
|     public WinBoLLModel(String appPackageName, String appMainServiveName) { | ||||
|         this.appPackageName = appPackageName; | ||||
|         this.appMainServiveName = appMainServiveName; | ||||
|     } | ||||
|  | ||||
|     public void setAppPackageName(String appPackageName) { | ||||
|         this.appPackageName = appPackageName; | ||||
|     } | ||||
|  | ||||
|     public String getAppPackageName() { | ||||
|         return appPackageName; | ||||
|     } | ||||
|  | ||||
|     public void setAppMainServiveName(String appMainServiveName) { | ||||
|         this.appMainServiveName = appMainServiveName; | ||||
|     } | ||||
|  | ||||
|     public String getAppMainServiveName() { | ||||
|         return appMainServiveName; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getName() { | ||||
|         return APPModel.class.getName(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void writeThisToJsonWriter(JsonWriter jsonWriter) throws IOException { | ||||
|         super.writeThisToJsonWriter(jsonWriter); | ||||
|         jsonWriter.name("appPackageName").value(getAppPackageName()); | ||||
|         jsonWriter.name("appMainServiveName").value(getAppMainServiveName()); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean initObjectsFromJsonReader(JsonReader jsonReader, String name) throws IOException { | ||||
|         if (super.initObjectsFromJsonReader(jsonReader, name)) { return true; } else { | ||||
|             if (name.equals("appPackageName")) { | ||||
|                 setAppPackageName(jsonReader.nextString()); | ||||
|             } else if (name.equals("appMainServiveName")) { | ||||
|                 setAppMainServiveName(jsonReader.nextString()); | ||||
|             } 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; | ||||
|     } | ||||
| } | ||||
|      | ||||
| @@ -7,7 +7,7 @@ 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.libaes.winboll.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
|   | ||||
| @@ -10,8 +10,8 @@ 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.interfaces.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.utils.AESThemeUtil; | ||||
| import cc.winboll.studio.libaes.winboll.IWinBoLLActivity; | ||||
|  | ||||
| public class TestASupportToolbarActivity extends AppCompatActivity implements IWinBoLLActivity  { | ||||
|  | ||||
|   | ||||
| @@ -14,10 +14,10 @@ import android.widget.Toast; | ||||
| import androidx.fragment.app.Fragment; | ||||
| import cc.winboll.studio.libaes.R; | ||||
| import cc.winboll.studio.libaes.activitys.DrawerFragmentActivity; | ||||
| import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libaes.models.DrawerMenuBean; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import java.util.ArrayList; | ||||
| import cc.winboll.studio.libaes.winboll.IWinBoLLActivity; | ||||
|  | ||||
| public class TestDrawerFragmentActivity extends DrawerFragmentActivity implements IWinBoLLActivity { | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
| package cc.winboll.studio.libaes.utils; | ||||
| 
 | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
| package cc.winboll.studio.libaes.utils; | ||||
| 
 | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
| @@ -10,16 +10,16 @@ package cc.winboll.studio.libaes.winboll; | ||||
|  */ | ||||
| import android.app.Activity; | ||||
| import android.app.ActivityManager; | ||||
| import android.app.TaskStackBuilder; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import cc.winboll.studio.libaes.interfaces.IWinBoLLActivity; | ||||
| import cc.winboll.studio.libappbase.GlobalApplication; | ||||
| import cc.winboll.studio.libappbase.LogActivity; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libappbase.ToastUtils; | ||||
| import java.util.HashMap; | ||||
| import java.util.Iterator; | ||||
| import java.util.Map; | ||||
| import cc.winboll.studio.libappbase.LogActivity; | ||||
| import cc.winboll.studio.libappbase.ToastUtils; | ||||
| 
 | ||||
| public class WinBoLLActivityManager { | ||||
| 
 | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
| package cc.winboll.studio.libaes.views; | ||||
| 
 | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
| @@ -17,7 +17,10 @@ import android.view.View; | ||||
| import android.widget.EditText; | ||||
| import android.widget.LinearLayout; | ||||
| import cc.winboll.studio.libaes.R; | ||||
| import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog; | ||||
| import cc.winboll.studio.libaes.models.APPInfo; | ||||
| import cc.winboll.studio.libaes.utils.AppVersionUtils; | ||||
| import cc.winboll.studio.libaes.utils.WinBoLLActivityManager; | ||||
| import cc.winboll.studio.libappbase.GlobalApplication; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libapputils.utils.PrefUtils; | ||||
| @@ -31,8 +34,6 @@ import okhttp3.Credentials; | ||||
| import okhttp3.OkHttpClient; | ||||
| import okhttp3.Request; | ||||
| import okhttp3.Response; | ||||
| import mehdi.sakout.aboutpage.BuildConfig; | ||||
| import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog; | ||||
| 
 | ||||
| public class AboutView extends LinearLayout { | ||||
| 
 | ||||
| @@ -43,7 +44,7 @@ public class AboutView extends LinearLayout { | ||||
|     static Context _mContext; | ||||
|     APPInfo mAPPInfo; | ||||
| 
 | ||||
|     WinBoLLServiceStatusView mWinBoLLServiceStatusView; | ||||
|     //WinBoLLServiceStatusView mWinBoLLServiceStatusView; | ||||
|     OnRequestDevUserInfoAutofillListener mOnRequestDevUserInfoAutofillListener; | ||||
|     String mszAppName = ""; | ||||
|     String mszAppAPKFolderName = ""; | ||||
| @@ -123,34 +124,7 @@ public class AboutView extends LinearLayout { | ||||
|             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); | ||||
|         } | ||||
| 		addView(createAboutPage()); | ||||
| 
 | ||||
|         // 初始化标题栏 | ||||
|         //setSubtitle(getContext().getString(R.string.text_about)); | ||||
| @@ -1,97 +0,0 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.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.models.WinBoLLClientServiceBean; | ||||
| import cc.winboll.studio.libaes.winboll.AssistantService; | ||||
| import cc.winboll.studio.libapputils.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.isServiceAlive(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(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,35 +0,0 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.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; | ||||
|     } | ||||
| } | ||||
| @@ -1,40 +0,0 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen<zhangsken@qq.com> | ||||
|  * @Date 2025/05/10 10:13 | ||||
|  * @Describe WinBoLL 系列应用通用管理类 | ||||
|  */ | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import cc.winboll.studio.libappbase.LogUtils; | ||||
| import cc.winboll.studio.libaes.models.WinBoLLModel; | ||||
|  | ||||
| public class WinBoLL { | ||||
|  | ||||
|     public static final String TAG = "WinBoLL"; | ||||
|  | ||||
|     public static final String ACTION_BIND = WinBoLL.class.getName() + ".ACTION_BIND"; | ||||
|     public static final String EXTRA_WINBOLLMODEL = "EXTRA_WINBOLLMODEL"; | ||||
|  | ||||
|     public static void bindToAPPBase(Context context, String appMainService) { | ||||
|         LogUtils.d(TAG, "bindToAPPBase(...)"); | ||||
|         String toPackage = "cc.winboll.studio.appbase"; | ||||
|         startBind(context, toPackage, appMainService); | ||||
|     } | ||||
|  | ||||
|     public static void bindToAPPBaseBeta(Context context, String appMainService) { | ||||
|         LogUtils.d(TAG, "bindToAPPBaseBeta(...)"); | ||||
|         String toPackage = "cc.winboll.studio.appbase.beta"; | ||||
|         startBind(context, toPackage, appMainService); | ||||
|     } | ||||
|  | ||||
|     static void startBind(Context context, String toPackage, String appMainService) { | ||||
|         Intent intent = new Intent(ACTION_BIND); | ||||
|         intent.putExtra(EXTRA_WINBOLLMODEL, (new WinBoLLModel(toPackage, appMainService)).toString()); | ||||
|         intent.setPackage(toPackage); | ||||
|         LogUtils.d(TAG, String.format("ACTION_BIND :\nTo Package : %s\nAPP Main Service : %s", toPackage, appMainService)); | ||||
|         context.sendBroadcast(intent); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1,21 +0,0 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
|  | ||||
| import android.app.Service; | ||||
| import android.content.Intent; | ||||
| import android.os.IBinder; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen | ||||
|  * @Date 2025/05/03 19:28 | ||||
|  */ | ||||
| public class WinBoLLClientService extends Service { | ||||
|      | ||||
|     public static final String TAG = "WinBoLLClientService"; | ||||
|      | ||||
|     @Override | ||||
|     public IBinder onBind(Intent intent) { | ||||
|          | ||||
|         return null; | ||||
|     } | ||||
|      | ||||
| } | ||||
| @@ -1,38 +0,0 @@ | ||||
| package cc.winboll.studio.libaes.winboll; | ||||
| import android.content.Context; | ||||
| import android.util.AttributeSet; | ||||
| import android.widget.LinearLayout; | ||||
|  | ||||
| /** | ||||
|  * @Author ZhanGSKen | ||||
|  * @Date 2025/05/03 19:14 | ||||
|  */ | ||||
| public class WinBoLLServiceStatusView extends LinearLayout { | ||||
|      | ||||
|     public static final String TAG = "WinBoLLServiceStatusView"; | ||||
|      | ||||
|     public WinBoLLServiceStatusView(Context context) { | ||||
|         super(context); | ||||
|     } | ||||
|  | ||||
|     public WinBoLLServiceStatusView(Context context, AttributeSet attrs) { | ||||
|         super(context, attrs); | ||||
|     } | ||||
|  | ||||
|     public WinBoLLServiceStatusView(Context context, AttributeSet attrs, int defStyleAttr) { | ||||
|         super(context, attrs, defStyleAttr); | ||||
|     } | ||||
|  | ||||
|     public WinBoLLServiceStatusView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { | ||||
|         super(context, attrs, defStyleAttr, defStyleRes); | ||||
|     } | ||||
|      | ||||
|      | ||||
|     void setServerHost(String szWinBoLLServerHost) { | ||||
|          | ||||
|     } | ||||
|      | ||||
|     void setAuthInfo(String szDevUserName, String szDevUserPassword) { | ||||
|          | ||||
|     } | ||||
| } | ||||
| @@ -1,64 +0,0 @@ | ||||
| <?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> | ||||
|  | ||||
| @@ -1,22 +0,0 @@ | ||||
| <?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> | ||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen