From 42a38cc6d99a60efd546a2e100e1d793713f25ac Mon Sep 17 00:00:00 2001 From: tongtongstudio Date: Mon, 29 Sep 2025 18:30:31 +0800 Subject: [PATCH] =?UTF-8?q?version:3.4.5=20fix:=20update:=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=85=A8=E5=B1=80=E7=BD=91=E7=BB=9C=E9=BB=91=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E5=92=8C=E7=AC=AC=E4=BA=8C=E5=A4=A9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=95=B4=E6=9C=BA=E6=97=B6=E9=97=B4=E5=B7=B2=E7=94=A8=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 +- .../com/fuying/sn/config/CommonConfig.java | 6 ++ .../fuying/sn/desktop/RunningAppManager.java | 72 ++++++++++++++++--- .../sn/network/NetInterfaceManager.java | 57 +++++++++------ .../sn/receiver/APKinstallReceiver.java | 5 +- .../sn/service/main/MainSPresenter.java | 6 +- .../fuying/sn/service/main/MainService.java | 18 ++++- .../java/com/fuying/sn/utils/JGYUtils.java | 23 +++++- .../java/com/fuying/sn/utils/TimeUtils.java | 32 ++++++--- 9 files changed, 170 insertions(+), 53 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 91323fa..09b43d3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -74,8 +74,8 @@ android { official { flavorDimensions "default" - versionCode 80 - versionName "3.4.0" + versionCode 85 + versionName "3.4.5" } } diff --git a/app/src/main/java/com/fuying/sn/config/CommonConfig.java b/app/src/main/java/com/fuying/sn/config/CommonConfig.java index 2d39659..9af76a0 100644 --- a/app/src/main/java/com/fuying/sn/config/CommonConfig.java +++ b/app/src/main/java/com/fuying/sn/config/CommonConfig.java @@ -31,6 +31,8 @@ public class CommonConfig { public static final String KEY_IS_CONTROL = "is_control_key"; public static final String DEVICES_IS_BIND_KEY = "is_bind_state"; + /*内置应用名单*/ + public static final String BUILT_IN_APPS = "built_in_apps_key"; /** * 设备重启标志 重启后请求接口,Service重启不请求 @@ -113,4 +115,8 @@ public class CommonConfig { /*WiFi白名单*/ public static final String AOLE_ACTION_AOLE_SSID_WHITE_LIST = "aole_ssid_whiteList"; + /*应用动态权限*/ + public static final String AOLE_APP_PRIVILEGE = "aole_app_privilege"; + + } diff --git a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java index 380d37f..0efeba8 100644 --- a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java +++ b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java @@ -56,6 +56,7 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Random; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.function.Predicate; @@ -63,6 +64,8 @@ import java.util.stream.Collectors; import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Observer; +import io.reactivex.rxjava3.disposables.Disposable; import io.reactivex.rxjava3.functions.Consumer; import io.reactivex.rxjava3.schedulers.Schedulers; @@ -332,18 +335,52 @@ public class RunningAppManager { Log.i(TAG, "TimeChangedReceiver:" + action); long time = System.currentTimeMillis(); String finaWayDate = sdf.format(time); + Log.e(TAG, "onReceive: finaWayDate = " + finaWayDate); if ("00:00:00".equals(finaWayDate)) { - //清除数据保证及时性 - mMMKV.encode(RemainingTimeMap, ""); - mMMKV.encode(GlobalUsageTimeMap, ""); - mMMKV.encode(AllApplUsageTimeMap, ""); - mRemainingTimeMap.clear(); - mGlobalUsageTime.clear(); - mAllAppUsageTime.clear(); + getConfig(); } } } + private void getConfig() { + int min = 300; + int max = 1800; + Random random = new Random(); + int randomNumber = random.nextInt(max - min + 1) + min; // 公式:nextInt(范围跨度) + 最小值 + Observable.timer(randomNumber, TimeUnit.SECONDS) + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new Observer() { + @Override + public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) { + + } + + @Override + public void onNext(@io.reactivex.rxjava3.annotations.NonNull Long aLong) { + //清除数据保证及时性 + mMMKV.encode(RemainingTimeMap, ""); + mMMKV.encode(GlobalUsageTimeMap, ""); + mMMKV.encode(AllApplUsageTimeMap, ""); + mRemainingTimeMap.clear(); + mGlobalUsageTime.clear(); + mAllAppUsageTime.clear(); + NetInterfaceManager.getInstance().getAppTimeControl(); + NetInterfaceManager.getInstance().getSnTimeControl(); + } + + @Override + public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) { + + } + + @Override + public void onComplete() { + + } + }); + } + public void killBackgroundProcesses(String processName) { // gotoLauncher(); // mIsScanning = true; @@ -730,6 +767,7 @@ public class RunningAppManager { * @param pkg * @return */ + @Deprecated public boolean inControlTime2(String pkg) { Log.i(TAG, "inControlTime: pkg = " + pkg); if (allowPackage.contains(pkg)) { @@ -975,6 +1013,11 @@ public class RunningAppManager { } } } else {//app额度打开 app使用时段关闭 + if (globalRemainingTime <= 0) { + Log.e(TAG, "inControlTime: appTimeControl globalRemainingTime = 0"); + ToastUtil.show("整机可用时间已用完"); + return true; + } Log.e(TAG, "inControlTime: appTimeControl is_quota = 1 is_part = 0"); if (appTimeControl.getRest_time() == 0 && appTimeControl.getWork_time() == 0) {//自由配置且没有设置额度 return false; @@ -1009,6 +1052,11 @@ public class RunningAppManager { } else { Log.e(TAG, "inControlTime: appTimeControl " + "不在管控时间内"); if (appTimeControl.getRest_time() == 0 && appTimeControl.getWork_time() == 0) {//自由配置且没有设置额度 + if (globalRemainingTime <= 0) { + Log.e(TAG, "inControlTime: appTimeControl globalRemainingTime = 0"); + ToastUtil.show("整机可用时间已用完"); + return true; + } Log.e(TAG, "inControlTime: appTimeControl " + "自由配置且没有设置额度"); return false; } else { @@ -1126,11 +1174,13 @@ public class RunningAppManager { private int getTodayTime(AppTimeControl appTimeControl) { if (inWeekDay()) { - Log.e(TAG, "getTodayTime: Work"); - return (int) appTimeControl.getWork_time(); + int workTime = (int) appTimeControl.getWork_time(); + Log.e(TAG, "getTodayTime: Work = " + workTime); + return workTime; } else { - Log.e(TAG, "getTodayTime: Rest"); - return (int) appTimeControl.getRest_time(); + int restTime = (int) appTimeControl.getRest_time(); + Log.e(TAG, "getTodayTime: Rest = " + restTime); + return restTime; } } diff --git a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java index d0cfcfe..3fd229a 100644 --- a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java @@ -2070,6 +2070,7 @@ public class NetInterfaceManager { } } + @Deprecated public void getSystemSettings(boolean refresh, BehaviorSubject lifecycle, CompleteCallback callback) { ConnectMode connectMode = ConnectMode.ONE_MINUTE; if (refresh) { @@ -2117,20 +2118,23 @@ public class NetInterfaceManager { public void onNext(BaseResponse systemSettingsBaseResponse) { Log.e("getSystemSettings", "onNext: " + systemSettingsBaseResponse); SPUtils.put(mContext, "is_first_connection", 0); - //imei是否绑定 - int is_bind = mMMKV.decodeInt(CommonConfig.DEVICES_IS_BIND_KEY, 0); + int code = systemSettingsBaseResponse.code; - if (is_bind == 1) { - if (code == 200) { - String data = new Gson().toJson(systemSettingsBaseResponse.data.getUser()); - ControlManager.getInstance().setSystemSetting(data); - } else { - Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0); - ControlManager.getInstance().setDisableSetting(); - } + if (code == 200) { + String data = new Gson().toJson(systemSettingsBaseResponse.data.getUser()); + ControlManager.getInstance().setSystemSetting(data); } else { + Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0); ControlManager.getInstance().setDisableSetting(); } + + //imei是否绑定 +// int is_bind = mMMKV.decodeInt(CommonConfig.DEVICES_IS_BIND_KEY, 0); +// if (is_bind == 1) { +// +// } else { +// ControlManager.getInstance().setDisableSetting(); +// } } @Override @@ -2783,28 +2787,31 @@ public class NetInterfaceManager { // .compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY)) // .subscribe(getAppJumpObserver(callback)); - Observable.zip(getAppJumpObservable(), getBlacklistObservable(), getBlacklistBiFunction()).subscribeOn(Schedulers.io()) + Observable.zip(getAppJumpObservable(), getBlacklistObservable(), getBlacklistBiFunction()) + .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY)) - .subscribe(getBlacklistObserver()); + .subscribe(getBlacklistObserver(callback)); } public void getAppJump(CompleteCallback callback) { // getAppJumpObservable() // .subscribe(getAppJumpObserver(callback)); - Observable.zip(getAppJumpObservable(), getBlacklistObservable(), getBlacklistBiFunction()).subscribeOn(Schedulers.io()) + Observable.zip(getAppJumpObservable(), getBlacklistObservable(), getBlacklistBiFunction()) + .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(getBlacklistObserver()); + .subscribe(getBlacklistObserver(callback)); } public void getAppJump() { // getAppJumpObservable() // .subscribe(getAppJumpObserver(null)); - Observable.zip(getAppJumpObservable(), getBlacklistObservable(), getBlacklistBiFunction()).subscribeOn(Schedulers.io()) + Observable.zip(getAppJumpObservable(), getBlacklistObservable(), getBlacklistBiFunction()) + .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(getBlacklistObserver()); + .subscribe(getBlacklistObserver(null)); } private BiFunction>, BaseResponse, List> getBlacklistBiFunction() { @@ -2813,7 +2820,7 @@ public class NetInterfaceManager { public List apply(BaseResponse> listBaseResponse, BaseResponse blacklistBeanBaseResponse) throws Throwable { Log.e("getBlacklistBiFunction", "apply: listBaseResponse = " + listBaseResponse); Log.e("getBlacklistBiFunction", "apply: blacklistBeanBaseResponse = " + blacklistBeanBaseResponse); - List blackListUrls = new ArrayList<>(); + Set blackListUrls = new HashSet<>(); if (listBaseResponse.code == 200) { List appJumpList = listBaseResponse.data; if (appJumpList != null && !appJumpList.isEmpty()) { @@ -2833,12 +2840,17 @@ public class NetInterfaceManager { blackListUrls.addAll(stringList); } } - return blackListUrls; +// if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G12NLPlatform) { + blackListUrls.add("com.tencent.wemeet.app.com.tencent.wemeet.sdk.view.OnlyPrivacyBrowserActivity"); + blackListUrls.add("com.tencent.wemeet.app.com.tencent.wemeet.components.webcore.activity.GestureBrowserActivity"); + blackListUrls.add("com.tencent.wemeet.components.webcore.activity.GestureBrowserActivity"); +// } + return new ArrayList<>(blackListUrls); } }; } - private Observer> getBlacklistObserver() { + private Observer> getBlacklistObserver(CompleteCallback callback) { return new Observer>() { @Override public void onSubscribe(@NonNull Disposable d) { @@ -2865,6 +2877,7 @@ public class NetInterfaceManager { @Override public void onComplete() { Log.e("getBlacklistObserver", "onComplete: "); + if (callback != null) callback.onComplete(); } }; } @@ -3086,6 +3099,7 @@ public class NetInterfaceManager { }; } + @Deprecated public void getAppAndWhite(boolean refresh, BehaviorSubject lifecycle, CompleteCallback callback) { ConnectMode connectMode = ConnectMode.ONE_MINUTE; if (refresh) { @@ -3140,9 +3154,11 @@ public class NetInterfaceManager { if (appAndWhiteList != null) { List pkgList = appAndWhiteList.stream().map(AppAndWhiteBean::getApp_package).collect(Collectors.toList()); String pkgString = StringUtils.join(",", pkgList); - mMMKV.encode(UrlAddress.GET_APP_AND_WHITE, pkgString); + mMMKV.encode(CommonConfig.BUILT_IN_APPS, pkgString); Log.e("getAppAndWhite", "onNext: " + pkgString); } + } else { + mMMKV.remove(CommonConfig.BUILT_IN_APPS); } } @@ -3155,6 +3171,7 @@ public class NetInterfaceManager { @Override public void onComplete() { Log.e("getAppAndWhite", "onComplete: "); + JGYUtils.getInstance().putBuiltInApps(); if (callback != null) { callback.onComplete(); } diff --git a/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java b/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java index 98b0b4b..35776b8 100644 --- a/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java +++ b/app/src/main/java/com/fuying/sn/receiver/APKinstallReceiver.java @@ -10,8 +10,6 @@ import android.util.Log; import com.fuying.sn.config.CommonConfig; import com.fuying.sn.manager.ControlManager; import com.fuying.sn.network.NetInterfaceManager; -import com.fuying.sn.service.main.MainService; -import com.fuying.sn.utils.ApkUtils; import com.fuying.sn.utils.CacheUtils; import com.fuying.sn.utils.JGYUtils; import com.fuying.sn.utils.SPUtils; @@ -53,6 +51,7 @@ public class APKinstallReceiver extends BroadcastReceiver { case Intent.ACTION_PACKAGE_ADDED: state = "安装了:"; JGYUtils.RemoveTask(context, packageName); + JGYUtils.getInstance().putBuiltInApps(); break; case Intent.ACTION_PACKAGE_REPLACED: cleanLauncher3Cache(); @@ -91,7 +90,7 @@ public class APKinstallReceiver extends BroadcastReceiver { private static void sendAppInfo() { Observable.create((ObservableEmitter emitter) -> newAppListener = emitter::onNext) - .throttleLast(5, TimeUnit.MINUTES) + .throttleLast(1, TimeUnit.MINUTES) .subscribe(new Observer() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java b/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java index ef4f9f3..b37582b 100644 --- a/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java +++ b/app/src/main/java/com/fuying/sn/service/main/MainSPresenter.java @@ -71,7 +71,7 @@ public class MainSPresenter implements MainSContact.Presenter { @Override public void getAppAndWhite() { - NetInterfaceManager.getInstance().getAppAndWhite(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() { + NetInterfaceManager.getInstance().getAppAndWhite(getLifecycle(), new NetInterfaceManager.CompleteCallback() { @Override public void onComplete() { mView.getAppAndWhiteFinish(); @@ -249,7 +249,7 @@ public class MainSPresenter implements MainSContact.Presenter { @Override public void getSystemSettings() { NetInterfaceManager.getInstance() - .getSystemSettings(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() { + .getSystemSettings(getLifecycle(), new NetInterfaceManager.CompleteCallback() { @Override public void onComplete() { mView.setSystemSettings(); @@ -319,7 +319,7 @@ public class MainSPresenter implements MainSContact.Presenter { @Override public void getAppTimeControl() { - NetInterfaceManager.getInstance().getAppTimeControl(true, getLifecycle(), new NetInterfaceManager.CompleteCallback() { + NetInterfaceManager.getInstance().getAppTimeControl(getLifecycle(), new NetInterfaceManager.CompleteCallback() { @Override public void onComplete() { mView.setAppTimeControl(); diff --git a/app/src/main/java/com/fuying/sn/service/main/MainService.java b/app/src/main/java/com/fuying/sn/service/main/MainService.java index b037f4c..20de4bf 100644 --- a/app/src/main/java/com/fuying/sn/service/main/MainService.java +++ b/app/src/main/java/com/fuying/sn/service/main/MainService.java @@ -31,6 +31,7 @@ import com.fuying.sn.config.CommonConfig; import com.fuying.sn.manager.AmapManager; import com.fuying.sn.manager.ControlManager; import com.fuying.sn.network.NetInterfaceManager; +import com.fuying.sn.network.UrlAddress; import com.fuying.sn.rlog.LogDBManager; import com.fuying.sn.service.DownloadService; import com.fuying.sn.service.GuardService; @@ -201,6 +202,8 @@ public class MainService extends BaseRxService implements MainSContact.MainView, registerReceivers(); startService(); Settings.System.putString(getContentResolver(), CommonConfig.APP_SOURCE_WHITE_LIST, DEFAULT_SOURCE); + + JGYUtils.getInstance().putBuiltInApps(); } private static final String DEFAULT_SOURCE = "com.fuying.sn,com.fuying.appstore,com.fuying.fuxiaoying"; @@ -466,7 +469,7 @@ public class MainService extends BaseRxService implements MainSContact.MainView, // mPresenter.getAppTimeControl(); break; case Intent.ACTION_SCREEN_ON: - + getAppControl(); break; case Intent.ACTION_SCREEN_OFF: @@ -480,6 +483,19 @@ public class MainService extends BaseRxService implements MainSContact.MainView, } } + private void getAppControl() { + Log.e(TAG, "getAppControl: "); + long lastTime = mMMKV.decodeLong(UrlAddress.GET_APP_TIME_CONTROL + "_time", System.currentTimeMillis()); + Log.e(TAG, "getAppControl: lastTime = " + lastTime); + Log.e(TAG, "getAppControl: lastTime = " + TimeUtils.getDate(lastTime)); + if (TimeUtils.isTodayWithJavaTime(lastTime)) { + Log.e(TAG, "getAppControl: requests have been made today"); + } else { + Log.e(TAG, "getAppControl: getAppTimeControl"); + mPresenter.getAppTimeControl(); + } + } + @Override public void getAppAndWhiteFinish() { mPresenter.checkUpdate(); diff --git a/app/src/main/java/com/fuying/sn/utils/JGYUtils.java b/app/src/main/java/com/fuying/sn/utils/JGYUtils.java index ad2034e..da79b8b 100644 --- a/app/src/main/java/com/fuying/sn/utils/JGYUtils.java +++ b/app/src/main/java/com/fuying/sn/utils/JGYUtils.java @@ -47,7 +47,6 @@ import com.fuying.sn.R; import com.fuying.sn.config.CommonConfig; import com.fuying.sn.gson.GsonUtils; import com.fuying.sn.network.NetInterfaceManager; -import com.fuying.sn.network.UrlAddress; import com.fuying.sn.receiver.BootReceiver; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -113,7 +112,7 @@ public class JGYUtils { public static final String iPlay50SETag = "ipaly50SE"; public static final String G6Tag = "G6"; public static final String G11JTag = "G10J"; - public static final String G12NLTag = " G12NL"; + public static final String G12NLTag = "G12NL"; private HashSet ownApp = new HashSet() {{ @@ -207,7 +206,7 @@ public class JGYUtils { } public HashSet getAppAndWhite() { - String pkgString = mMMKV.decodeString(UrlAddress.GET_APP_AND_WHITE, ""); + String pkgString = mMMKV.decodeString(CommonConfig.BUILT_IN_APPS, ""); if (TextUtils.isEmpty(pkgString)) { return new HashSet<>(); } else { @@ -215,6 +214,24 @@ public class JGYUtils { } } + public void putBuiltInApps() { + String pkgString = mMMKV.decodeString(CommonConfig.BUILT_IN_APPS, ""); + Set stringSet = new HashSet<>(Arrays.asList(pkgString.split(","))); + Set filter = stringSet.stream().filter(new Predicate() { + @Override + public boolean test(String s) { + return ApkUtils.isAvailable(mContext, s); + } + }).collect(Collectors.toSet()); + if (filter.size() != 0) { + String pkg = String.join(",", filter); + Log.e(TAG, "putBuiltInApps: pkg = " + pkg); + Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_APP_PRIVILEGE, pkg); + } else { + Log.e(TAG, "putBuiltInApps: filter is empty"); + } + } + private JGYUtils(Context context) { if (context == null) { throw new RuntimeException("Context is NULL"); diff --git a/app/src/main/java/com/fuying/sn/utils/TimeUtils.java b/app/src/main/java/com/fuying/sn/utils/TimeUtils.java index cfb0266..68a4e4a 100644 --- a/app/src/main/java/com/fuying/sn/utils/TimeUtils.java +++ b/app/src/main/java/com/fuying/sn/utils/TimeUtils.java @@ -18,8 +18,10 @@ import java.net.InetAddress; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.Calendar; @@ -275,11 +277,7 @@ public class TimeUtils { */ public static boolean inWeekDay(long time) { int weekDay = getWeekDay(time); - if (weekDay > 5) { - return true; - } else { - return false; - } + return weekDay > 5; } public static void setSystemTime(long time) { @@ -356,11 +354,7 @@ public class TimeUtils { } Log.e(TAG, "inControlTime: " + (startDate.getTime() - minuteTime)); assert nowDate != null; - if (nowDate.getTime() <= startDate.getTime() - minuteTime || nowDate.getTime() >= endDate.getTime()) { - return true; - } else { - return false; - } + return nowDate.getTime() <= startDate.getTime() - minuteTime || nowDate.getTime() >= endDate.getTime(); } catch (ParseException e) { e.printStackTrace(); } @@ -589,4 +583,22 @@ public class TimeUtils { buffer[offset++] = (byte) (Math.random() * 255.0); } } + + /** + * 使用 Java 8 现代API判断时间戳是否为今天 + * + * @param timestamp 毫秒级时间戳 + * @return 如果是今天返回 true,否则返回 false + */ + public static boolean isTodayWithJavaTime(long timestamp) { + // 1. 获取系统默认时区下的当前日期 + LocalDate today = LocalDate.now(); + // 2. 将时间戳转换为Instant对象,然后结合时区转换为LocalDateTime,再提取日期部分 + LocalDate dateToCheck = LocalDateTime.ofInstant( + Instant.ofEpochMilli(timestamp), ZoneId.systemDefault() + ).toLocalDate(); + // 3. 比较两个日期是否相等 + return today.equals(dateToCheck); + } + }