Exploit databaseDownload repository ZIP
GH-14fb583d3d1bd2da10251bb1a37b93d6
gitchw/ghostlock-cve-2026-43499
Sources for CVE-2026-43499
168 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files16
gitchw/ghostlock-cve-2026-43499Revision 96acd93156f6
- ↑..Parent directory
- AesEncryptUtils.java
- AlarmTimeUtils.java
- BspathUtils.java
- Condition.java
- FileUtils.java
- IdentifierManager.java
- NetworkUtils.java
- OppoLog.java
- PackageUtils.java
- PatchUtils.java
- PreUtils.java
- Preconditions.java
- PropertiesUtils.java
- RusNearmeUtils.java
- Strings.java
- UrlUtils.java
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
workspace/decomp/HeyRomUpdate/sources/com/heytap/wearable/romupdate/utils/AlarmTimeUtils.java
Java · 5,870 bytespackage com.heytap.wearable.romupdate.utils;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.support.v4.app.NotificationCompat;
import com.heytap.wearable.romupdate.RUSConstants;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
/* loaded from: classes.dex */
public class AlarmTimeUtils {
private static final long ALARM_SECTION_HOUR_AUTO_UPDATE = 86400000;
private static final int HOUR_PER_DAY = 24;
private static final long TIME_ONE_HOUR_IN_MILLS = 3600000;
private Context mContext;
private final SimpleDateFormat mSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
private static final String TAG = AlarmTimeUtils.class.getSimpleName();
private static volatile AlarmTimeUtils instance = null;
public static AlarmTimeUtils getInstance(Context context) {
if (instance == null) {
synchronized (AlarmTimeUtils.class) {
if (instance == null) {
instance = new AlarmTimeUtils(context);
}
}
}
return instance;
}
public AlarmTimeUtils(Context context) {
this.mContext = context;
}
public void setRomUpdateFilterCheckAlarm() {
long lastAlarmTime = PreUtils.getInstance(this.mContext).getLastAlarmTime();
long nextTriggerTime = getNextTriggerTime();
if (lastAlarmTime <= System.currentTimeMillis() || lastAlarmTime > nextTriggerTime) {
OppoLog.d(TAG, "the nextTriggerTime is " + nextTriggerTime + ", " + changeEpoch2Date(this.mSdf, nextTriggerTime));
setRomUpdateFilterCheckAlarm(nextTriggerTime);
return;
}
OppoLog.d(TAG, "reset alarm based on lastSetTime : " + changeEpoch2Date(this.mSdf, lastAlarmTime));
setRomUpdateFilterCheckAlarm(lastAlarmTime);
}
public void setRomUpdateFilterCheckAlarm(long j) {
Intent intent = new Intent(RUSConstants.BROADCAST_ROM_UPDATE_FILTER_CHECK);
intent.setPackage(this.mContext.getPackageName());
PendingIntent broadcast = PendingIntent.getBroadcast(this.mContext, 0, intent, 0);
AlarmManager alarmManager = (AlarmManager) this.mContext.getSystemService(NotificationCompat.CATEGORY_ALARM);
if (alarmManager != null) {
alarmManager.cancel(broadcast);
PreUtils.getInstance(this.mContext).setLastAlarmTime(j);
alarmManager.setExact(1, j, broadcast);
}
}
public void setRightTime(String str) {
boolean isAutoTimeConfig = getIsAutoTimeConfig();
long firstRightTime = PreUtils.getInstance(this.mContext).getFirstRightTime();
OppoLog.i(TAG, "autoTimeEnabled=" + isAutoTimeConfig + ", firstRightTime=" + firstRightTime + ", type=" + str);
if (isAutoTimeConfig && firstRightTime == 0 && NetworkUtils.getInstance(this.mContext).isNetworkEnable()) {
PreUtils.getInstance(this.mContext).setFirstRightTime(System.currentTimeMillis());
OppoLog.i(TAG, "setFirstRightTime " + System.currentTimeMillis());
}
}
private boolean getIsAutoTimeConfig() {
String string = Settings.Global.getString(this.mContext.getContentResolver(), "auto_time");
if (string != null && string.equals("1")) {
return true;
}
return false;
}
private long getNextTriggerTime() {
return getNextTriggerTime(changeEpoch2Date(this.mSdf, System.currentTimeMillis()), PreUtils.getInstance(this.mContext).getFrequency());
}
private long getNextTriggerTime(String str, int i) {
if (str == null || str.length() < 11) {
return getTime();
}
if (i < 2 || i > 24) {
return getTime();
}
String substring = str.substring(11, 13);
OppoLog.d(TAG, "currentHourString is " + substring);
int currentHour = getCurrentHour(substring);
OppoLog.d(TAG, "currentHour is " + currentHour);
if (currentHour == -1) {
return getTime();
}
int i2 = 24 / i;
int i3 = ((currentHour / i2) * i2) + i2;
OppoLog.d(TAG, "baseHour is " + i3);
long epochBeginOfDay = getEpochBeginOfDay(str);
if (epochBeginOfDay == -1) {
return getTime();
}
OppoLog.d(TAG, "baseDay is " + epochBeginOfDay + ", " + changeEpoch2Date(this.mSdf, epochBeginOfDay));
long j = epochBeginOfDay + (((long) i3) * TIME_ONE_HOUR_IN_MILLS);
OppoLog.d(TAG, "baseTime is " + j + ", " + changeEpoch2Date(this.mSdf, j));
return j + getRandTime(i2);
}
private long getRandTime(int i) {
return (long) (Math.random() * i * 3600000.0d);
}
private long getTime() {
return System.currentTimeMillis() + ((long) (((Math.random() * 0.5d) + 0.5d) * 8.64E7d));
}
private int getCurrentHour(String str) {
try {
return Integer.parseInt(str);
} catch (Exception e) {
e.printStackTrace();
return -1;
}
}
private long getEpochBeginOfDay(String str) {
return changeDate2Epoch(this.mSdf, str.substring(0, 10) + " 00:00:00");
}
private long changeDate2Epoch(SimpleDateFormat simpleDateFormat, String str) {
try {
return simpleDateFormat.parse(str).getTime();
} catch (ParseException e) {
e.printStackTrace();
return -1L;
}
}
private String changeEpoch2Date(SimpleDateFormat simpleDateFormat, long j) {
try {
return simpleDateFormat.format(Long.valueOf(j));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}