From 4b4daa42cfae16c75f312324f7f6368397bf1742 Mon Sep 17 00:00:00 2001 From: tongtongstudio Date: Tue, 21 Apr 2026 16:44:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=98=BE=E7=A4=BA=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E7=94=A8=E5=AE=89=E8=A3=85=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BA=94=E7=94=A8=E7=AE=A1=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- .../sn/network/NetInterfaceManager.java | 7 +++--- .../aoleyun/sn/receiver/NewAppReceiver.java | 3 +-- .../aoleyun/sn/service/main/MainService.java | 22 +++++++++---------- .../java/com/aoleyun/sn/utils/ApkUtils.java | 4 ---- .../java/com/aoleyun/sn/utils/JgyUtils.java | 7 +++++- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d4752a9..62b43f7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,8 +29,8 @@ android { defaultConfig { applicationId "com.aoleyun.sn" - versionCode 210 - versionName "1.6.0403" + versionCode 211 + versionName "1.6.04015" //There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature. minSdkVersion 24 diff --git a/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java b/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java index ffc4f5c..1ab0d37 100644 --- a/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/aoleyun/sn/network/NetInterfaceManager.java @@ -1772,6 +1772,7 @@ public class NetInterfaceManager { }); } + @Deprecated public void getDesktopIcon(boolean refresh, BehaviorSubject lifecycle, onCompleteCallback callback) { ConnectMode connectMode = ConnectMode.SIX_HOUR; if (refresh) { @@ -2717,15 +2718,15 @@ public class NetInterfaceManager { public void setPushTags(BehaviorSubject lifecycle, PushTagCallback callback) { getPushTagsObservable() .compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY)) - .subscribe(getgetPushTagsObserver(callback)); + .subscribe(getPushTagsObserver(callback)); } public void setPushTags() { getPushTagsObservable() - .subscribe(getgetPushTagsObserver(null)); + .subscribe(getPushTagsObserver(null)); } - private Observer> getgetPushTagsObserver(PushTagCallback callback) { + private Observer> getPushTagsObserver(PushTagCallback callback) { return new Observer>() { @Override public void onSubscribe(@NonNull Disposable d) { diff --git a/app/src/main/java/com/aoleyun/sn/receiver/NewAppReceiver.java b/app/src/main/java/com/aoleyun/sn/receiver/NewAppReceiver.java index 142902d..2808084 100644 --- a/app/src/main/java/com/aoleyun/sn/receiver/NewAppReceiver.java +++ b/app/src/main/java/com/aoleyun/sn/receiver/NewAppReceiver.java @@ -8,11 +8,9 @@ import android.os.Build; import android.text.TextUtils; import android.util.Log; -import com.aoleyun.sn.comm.CommonConfig; import com.aoleyun.sn.comm.PackageNames; import com.aoleyun.sn.network.NetInterfaceManager; import com.aoleyun.sn.utils.ApkUtils; -import com.aoleyun.sn.utils.CmdUtil; import com.aoleyun.sn.utils.JgyUtils; import java.util.concurrent.TimeUnit; @@ -122,6 +120,7 @@ public class NewAppReceiver extends BroadcastReceiver { NetInterfaceManager.getInstance().getAppLimit(); // NetInterfaceManager.getInstance().getDefaultDesktop(); NetInterfaceManager.getInstance().getNetAndLaunchSetting(); + NetInterfaceManager.getInstance().getDesktopIcon(); NetInterfaceManager.getInstance().sendInstalledAppInfo(new NetInterfaceManager.onCompleteCallback() { @Override public void onComplete() { diff --git a/app/src/main/java/com/aoleyun/sn/service/main/MainService.java b/app/src/main/java/com/aoleyun/sn/service/main/MainService.java index 8e65cab..51fcf11 100644 --- a/app/src/main/java/com/aoleyun/sn/service/main/MainService.java +++ b/app/src/main/java/com/aoleyun/sn/service/main/MainService.java @@ -599,13 +599,14 @@ public class MainService extends Service implements MainSContact.MainView, Netwo registerReceivers(); NetworkUtils.registerNetworkStatusChangedListener(this); - addShortcut(); timeChangedStart.onstar(System.currentTimeMillis()); setStatusbar(); setFloatingWindow(); JgyUtils.getInstance().writeAppPackageList(); -// notificationManager = NotificationManagerCompat.from(this); -// createNotificationChannel(); + notificationManager = NotificationManagerCompat.from(this); + createNotificationChannel(); + sendSimpleNotification(); + // aliyunPushInit(); IActivityManager activityManager = ActivityManagerNative.getDefault(); @@ -673,7 +674,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo channel.setDescription(CHANNEL_DESCRIPTION); // Register the channel with the system; you can't change the importance // or other notification behaviors after this - NotificationManager notificationManager = getSystemService(NotificationManager.class); notificationManager.createNotificationChannel(channel); } } @@ -691,11 +691,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo .setOngoing(true) .setPriority(NotificationCompat.PRIORITY_MAX); // notificationId is a unique int for each notification that you must define - notificationManager.notify(NotificationID, builder.build()); - } - - private void addShortcut() { - ApkUtils.addShortcut(this); +// notificationManager.notify(NotificationID, builder.build()); + startForeground(NotificationID, builder.build()); } private void setStatusbar() { @@ -923,7 +920,11 @@ public class MainService extends Service implements MainSContact.MainView, Netwo @Override public void onReceive(Context context, Intent intent) { Log.e("TimeChangedReceiver", "onReceive: " + intent.getAction()); - switch (intent.getAction()) { + String action = intent.getAction(); + if (TextUtils.isEmpty(action)) { + return; + } + switch (action) { case Intent.ACTION_DATE_CHANGED: case Intent.ACTION_TIME_CHANGED: case Intent.ACTION_TIMEZONE_CHANGED: @@ -1168,7 +1169,6 @@ public class MainService extends Service implements MainSContact.MainView, Netwo Log.e(TAG, "setLockedState: " + loocked); if (loocked) { Toaster.debugShow("设备已上锁"); -// sendSimpleNotification(); mPresenter.setPushTags(); ApkUtils.UninstallAPP(this, "com.joytv.live"); ApkUtils.UninstallAPP(this, "com.tencent.android.qqdownloader"); diff --git a/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java b/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java index 07e2f62..ef48352 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/ApkUtils.java @@ -1365,10 +1365,6 @@ public class ApkUtils { } } - public static void addShortcut(Context context) { - - } - private static final Set AoleyunOSApp = new HashSet() {{ this.add("com.aoleyun.info"); this.add("com.aoleyun.os"); diff --git a/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java b/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java index 9ec467a..50f0b92 100644 --- a/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java +++ b/app/src/main/java/com/aoleyun/sn/utils/JgyUtils.java @@ -245,7 +245,11 @@ public class JgyUtils { public static void init(Context context) { if (sInstance == null) { Log.e(TAG, "init: "); - sInstance = new JgyUtils(context); + synchronized (JgyUtils.class) { + if (sInstance == null) { + sInstance = new JgyUtils(context); + } + } } } @@ -3009,6 +3013,7 @@ public class JgyUtils { } } + @Deprecated public List getHidePackage() { String jsonString = cacheHelper.getAsString(UrlAddress.GET_HIDE_DESKTOPICON); //为 "" 是已经请求成功的