From 0fd8faf8061369296b4a92b081d83c940dfc233e Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 06 一月 2026 18:24:36 +0800
Subject: [PATCH] 2026年01月06日18:24:23 暂隐藏前台服务
---
app/src/main/java/com/hdl/photovoltaic/uni/CSplashView.java | 48 +++++++++++++++++++-----------------------------
1 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/uni/CSplashView.java b/app/src/main/java/com/hdl/photovoltaic/uni/CSplashView.java
index 7b32dd0..91b7f55 100755
--- a/app/src/main/java/com/hdl/photovoltaic/uni/CSplashView.java
+++ b/app/src/main/java/com/hdl/photovoltaic/uni/CSplashView.java
@@ -6,6 +6,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
+import android.os.Build;
import android.os.IBinder;
import android.util.Log;
import android.view.LayoutInflater;
@@ -17,6 +18,7 @@
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.utils.ProcessManagerUtils;
+import com.hdl.photovoltaic.utils.ServiceUtils;
import java.lang.ref.WeakReference;
import java.util.List;
@@ -35,11 +37,21 @@
//璁剧疆瀵艰埅鏉¤儗鏅鑹�
Activity activity = (Activity) context;
activity.getWindow().setNavigationBarColor(HDLApp.getInstance().getColor(R.color.text_FF1C1C1E));
-// //鍙兘閫氳繃杩欑鏂瑰紡璋冪敤
-// Intent intent = new Intent();
-// intent.setPackage("com.hdl.photovoltaic");
-// intent.setAction("UniappService.ACTION");
-// context.bindService(intent, stringservice, Context.BIND_AUTO_CREATE);
+ // 2026骞�01鏈�06鏃�18:12:25 鍥犱笂鏋跺埌璋锋瓕琚嫆锛屽洜涓婃灦绱ф�ワ紝鏆傛椂鍏堝彇娑堝墠鍙版湇鍔★紝寰呬慨澶嶅悗鍐嶆仮澶嶏紱
+// try {
+//// if (!UserConfigManage.getInstance().isBAccount()) {
+// if (!ServiceUtils.isServiceRunning(context, MyForegroundService.class)) {
+// // 鍚姩鍓嶅彴鏈嶅姟
+// Intent serviceIntent = new Intent(context, MyForegroundService.class);
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+// context.startForegroundService(serviceIntent);
+// } else {
+// context.startService(serviceIntent);
+// }
+// }
+//// }
+// } catch (Exception e) {
+// }
return splashView;
}
@@ -62,33 +74,11 @@
}
}
- static ServiceConnection stringservice = new ServiceConnection() {
- private WeakReference<Context> contextWeakReference;
-
- @Override
- public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
- IUniappAidlInterface iUniappAidlInterface = IUniappAidlInterface.Stub.asInterface(iBinder);
- try {
- iUniappAidlInterface.sendMsg("寤虹珛杩炴帴");
- } catch (Exception e) {
- }
- }
-
- @Override
- public void onServiceDisconnected(ComponentName componentName) {
- Log.i("BSplashView", "杩炴帴宸叉柇寮�");
- Context context = contextWeakReference.get();
- ProcessManagerUtils.killAllProcess(contextWeakReference.get());
- }
-
- public void setContextWeakReference(WeakReference<Context> contextWeakReference) {
- this.contextWeakReference = contextWeakReference;
- }
- };
-
@Override
public void onCloseSplash(ViewGroup rootView) {
if (rootView != null)
rootView.removeView(splashView);
}
+
+
}
--
Gitblit v1.8.0