Use ISO date-time formatter (#954)
This commit is contained in:
parent
5af017dc32
commit
7ef5da6867
|
|
@ -36,8 +36,7 @@ import org.lsposed.manager.BuildConfig;
|
|||
import org.lsposed.manager.R;
|
||||
import org.lsposed.manager.databinding.ActivityCrashReportBinding;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class CrashReportActivity extends AppCompatActivity {
|
||||
ActivityCrashReportBinding binding;
|
||||
|
|
@ -60,11 +59,10 @@ public class CrashReportActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
public String getAllErrorDetailsFromIntent(@NonNull Intent intent) {
|
||||
var dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
String versionName = String.format("%s (%s)", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE);
|
||||
|
||||
return "Build version: " + versionName + " \n" +
|
||||
"Current date: " + dateFormat.format(Instant.now()) + " \n" +
|
||||
"Current date: " + LocalDateTime.now() + " \n" +
|
||||
"Device: " + getDeviceModelName() + " \n" +
|
||||
"Fingerprint: " + getFingerprint() + " \n \n" +
|
||||
"SDK: " + Build.VERSION.SDK_INT + " \n \n" +
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import java.io.IOException;
|
|||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ModuleLogger {
|
||||
private static DateTimeFormatter logDateFormat;
|
||||
|
|
@ -39,9 +38,8 @@ public class ModuleLogger {
|
|||
public static void initLogger(ParcelFileDescriptor fileDescriptor) {
|
||||
if (fd == null && fileDescriptor != null) {
|
||||
fd = fileDescriptor;
|
||||
var zone = ZoneId.of(SystemProperties.get("persist.sys.timezone"));
|
||||
var pattern = "yyyy-MM-dd HH:mm:ss.SSS";
|
||||
logDateFormat = DateTimeFormatter.ofPattern(pattern, Locale.ROOT).withZone(zone);
|
||||
var zone = ZoneId.of(SystemProperties.get("persist.sys.timezone", "GMT"));
|
||||
logDateFormat = DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(zone);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,18 @@
|
|||
package android.os;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
|
||||
public class SystemProperties {
|
||||
public static String get(String key) {
|
||||
public static String get(@NonNull String key) {
|
||||
throw new UnsupportedOperationException("Stub");
|
||||
}
|
||||
|
||||
public static void set(String key, String val) {
|
||||
public static String get(@NonNull String key, @Nullable String def) {
|
||||
throw new UnsupportedOperationException("Stub");
|
||||
}
|
||||
|
||||
public static void set(@NonNull String key, @Nullable String val) {
|
||||
throw new UnsupportedOperationException("Stub");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue