mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2026-01-19 02:02:37 +01:00
Modify extension bytecode to fix SimpleDateFormat cannot parse errors
This commit is contained in:
@@ -26,5 +26,8 @@ class AndroidCompatInitializer {
|
||||
ApplicationInfoConfigModule.register(GlobalConfigManager.config),
|
||||
SystemConfigModule.register(GlobalConfigManager.config)
|
||||
)
|
||||
|
||||
// Set some properties extensions use
|
||||
System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
package xyz.nulldev.androidcompat.replace;
|
||||
|
||||
import com.ibm.icu.text.DateFormat;
|
||||
import com.ibm.icu.util.TimeZone;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class CalendarDelegate extends Calendar {
|
||||
private com.ibm.icu.util.Calendar delegate;
|
||||
|
||||
public CalendarDelegate(com.ibm.icu.util.Calendar delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public static java.util.Calendar getInstance() {
|
||||
return new CalendarDelegate(com.ibm.icu.util.Calendar.getInstance());
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.Calendar getInstance(TimeZone zone) {
|
||||
return com.ibm.icu.util.Calendar.getInstance(zone);
|
||||
}
|
||||
|
||||
public static java.util.Calendar getInstance(Locale aLocale) {
|
||||
return new CalendarDelegate(com.ibm.icu.util.Calendar.getInstance(aLocale));
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.Calendar getInstance(ULocale locale) {
|
||||
return com.ibm.icu.util.Calendar.getInstance(locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.Calendar getInstance(TimeZone zone, Locale aLocale) {
|
||||
return com.ibm.icu.util.Calendar.getInstance(zone, aLocale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.Calendar getInstance(TimeZone zone, ULocale locale) {
|
||||
return com.ibm.icu.util.Calendar.getInstance(zone, locale);
|
||||
}
|
||||
|
||||
public static Locale[] getAvailableLocales() {
|
||||
return com.ibm.icu.util.Calendar.getAvailableLocales();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void computeTime() {}
|
||||
|
||||
@Override
|
||||
protected void computeFields() {}
|
||||
|
||||
public static ULocale[] getAvailableULocales() {
|
||||
return com.ibm.icu.util.Calendar.getAvailableULocales();
|
||||
}
|
||||
|
||||
public static String[] getKeywordValuesForLocale(String key, ULocale locale, boolean commonlyUsed) {
|
||||
return com.ibm.icu.util.Calendar.getKeywordValuesForLocale(key, locale, commonlyUsed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimeInMillis() {
|
||||
return delegate.getTimeInMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTimeInMillis(long millis) {
|
||||
delegate.setTimeInMillis(millis);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int getRelatedYear() {
|
||||
return delegate.getRelatedYear();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setRelatedYear(int year) {
|
||||
delegate.setRelatedYear(year);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return delegate.equals(obj);
|
||||
}
|
||||
|
||||
public boolean isEquivalentTo(com.ibm.icu.util.Calendar other) {
|
||||
return delegate.isEquivalentTo(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return delegate.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean before(Object when) {
|
||||
return delegate.before(when);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean after(Object when) {
|
||||
return delegate.after(when);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActualMaximum(int field) {
|
||||
return delegate.getActualMaximum(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActualMinimum(int field) {
|
||||
return delegate.getActualMinimum(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roll(int field, int amount) {
|
||||
delegate.roll(field, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(int field, int amount) {
|
||||
delegate.add(field, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roll(int field, boolean up) {
|
||||
roll(field, up ? 1 : -1);
|
||||
}
|
||||
|
||||
public String getDisplayName(Locale loc) {
|
||||
return delegate.getDisplayName(loc);
|
||||
}
|
||||
|
||||
public String getDisplayName(ULocale loc) {
|
||||
return delegate.getDisplayName(loc);
|
||||
}
|
||||
|
||||
public int compareTo(com.ibm.icu.util.Calendar that) {
|
||||
return delegate.compareTo(that);
|
||||
}
|
||||
|
||||
public DateFormat getDateTimeFormat(int dateStyle, int timeStyle, Locale loc) {
|
||||
return delegate.getDateTimeFormat(dateStyle, timeStyle, loc);
|
||||
}
|
||||
|
||||
public DateFormat getDateTimeFormat(int dateStyle, int timeStyle, ULocale loc) {
|
||||
return delegate.getDateTimeFormat(dateStyle, timeStyle, loc);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getDateTimePattern(com.ibm.icu.util.Calendar cal, ULocale uLocale, int dateStyle) {
|
||||
return com.ibm.icu.util.Calendar.getDateTimePattern(cal, uLocale, dateStyle);
|
||||
}
|
||||
|
||||
public int fieldDifference(Date when, int field) {
|
||||
return delegate.fieldDifference(when, field);
|
||||
}
|
||||
|
||||
public void setTimeZone(TimeZone value) {
|
||||
delegate.setTimeZone(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.TimeZone getTimeZone() {
|
||||
return new TimeZoneDelegate(delegate.getTimeZone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLenient(boolean lenient) {
|
||||
delegate.setLenient(lenient);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLenient() {
|
||||
return delegate.isLenient();
|
||||
}
|
||||
|
||||
public void setRepeatedWallTimeOption(int option) {
|
||||
delegate.setRepeatedWallTimeOption(option);
|
||||
}
|
||||
|
||||
public int getRepeatedWallTimeOption() {
|
||||
return delegate.getRepeatedWallTimeOption();
|
||||
}
|
||||
|
||||
public void setSkippedWallTimeOption(int option) {
|
||||
delegate.setSkippedWallTimeOption(option);
|
||||
}
|
||||
|
||||
public int getSkippedWallTimeOption() {
|
||||
return delegate.getSkippedWallTimeOption();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFirstDayOfWeek(int value) {
|
||||
delegate.setFirstDayOfWeek(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFirstDayOfWeek() {
|
||||
return delegate.getFirstDayOfWeek();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMinimalDaysInFirstWeek(int value) {
|
||||
delegate.setMinimalDaysInFirstWeek(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimalDaysInFirstWeek() {
|
||||
return delegate.getMinimalDaysInFirstWeek();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimum(int field) {
|
||||
return delegate.getMinimum(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximum(int field) {
|
||||
return delegate.getMaximum(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGreatestMinimum(int field) {
|
||||
return delegate.getGreatestMinimum(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLeastMaximum(int field) {
|
||||
return delegate.getLeastMaximum(field);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int getDayOfWeekType(int dayOfWeek) {
|
||||
return delegate.getDayOfWeekType(dayOfWeek);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int getWeekendTransition(int dayOfWeek) {
|
||||
return delegate.getWeekendTransition(dayOfWeek);
|
||||
}
|
||||
|
||||
public boolean isWeekend(Date date) {
|
||||
return delegate.isWeekend(date);
|
||||
}
|
||||
|
||||
public boolean isWeekend() {
|
||||
return delegate.isWeekend();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return delegate.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return delegate.toString();
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.Calendar.WeekData getWeekDataForRegion(String region) {
|
||||
return com.ibm.icu.util.Calendar.getWeekDataForRegion(region);
|
||||
}
|
||||
|
||||
public com.ibm.icu.util.Calendar.WeekData getWeekData() {
|
||||
return delegate.getWeekData();
|
||||
}
|
||||
|
||||
public com.ibm.icu.util.Calendar setWeekData(com.ibm.icu.util.Calendar.WeekData wdata) {
|
||||
return delegate.setWeekData(wdata);
|
||||
}
|
||||
|
||||
public int getFieldCount() {
|
||||
return delegate.getFieldCount();
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return delegate.getType();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean haveDefaultCentury() {
|
||||
return delegate.haveDefaultCentury();
|
||||
}
|
||||
|
||||
public ULocale getLocale(ULocale.Type type) {
|
||||
return delegate.getLocale(type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
package xyz.nulldev.androidcompat.replace;
|
||||
|
||||
import com.ibm.icu.text.DisplayContext;
|
||||
import com.ibm.icu.text.NumberFormat;
|
||||
import com.ibm.icu.util.Currency;
|
||||
import com.ibm.icu.util.CurrencyAmount;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
import java.text.FieldPosition;
|
||||
import java.text.ParseException;
|
||||
import java.text.ParsePosition;
|
||||
import java.util.Locale;
|
||||
|
||||
public class NumberFormatDelegate extends java.text.NumberFormat {
|
||||
private com.ibm.icu.text.NumberFormat delegate;
|
||||
|
||||
public NumberFormatDelegate(com.ibm.icu.text.NumberFormat delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public StringBuffer format(Object number, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(number, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public String format(BigInteger number) {
|
||||
return delegate.format(number);
|
||||
}
|
||||
|
||||
public String format(BigDecimal number) {
|
||||
return delegate.format(number);
|
||||
}
|
||||
|
||||
public String format(com.ibm.icu.math.BigDecimal number) {
|
||||
return delegate.format(number);
|
||||
}
|
||||
|
||||
public String format(CurrencyAmount currAmt) {
|
||||
return delegate.format(currAmt);
|
||||
}
|
||||
|
||||
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(number, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(number, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(number, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(number, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public StringBuffer format(com.ibm.icu.math.BigDecimal number, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(number, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public StringBuffer format(CurrencyAmount currAmt, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(currAmt, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public Number parse(String text, ParsePosition parsePosition) {
|
||||
return delegate.parse(text, parsePosition);
|
||||
}
|
||||
|
||||
public Number parse(String text) throws ParseException {
|
||||
return delegate.parse(text);
|
||||
}
|
||||
|
||||
public CurrencyAmount parseCurrency(CharSequence text, ParsePosition pos) {
|
||||
return delegate.parseCurrency(text, pos);
|
||||
}
|
||||
|
||||
public boolean isParseIntegerOnly() {
|
||||
return delegate.isParseIntegerOnly();
|
||||
}
|
||||
|
||||
public void setParseIntegerOnly(boolean value) {
|
||||
delegate.setParseIntegerOnly(value);
|
||||
}
|
||||
|
||||
public void setParseStrict(boolean value) {
|
||||
delegate.setParseStrict(value);
|
||||
}
|
||||
|
||||
public boolean isParseStrict() {
|
||||
return delegate.isParseStrict();
|
||||
}
|
||||
|
||||
public void setContext(DisplayContext context) {
|
||||
delegate.setContext(context);
|
||||
}
|
||||
|
||||
public DisplayContext getContext(DisplayContext.Type type) {
|
||||
return delegate.getContext(type);
|
||||
}
|
||||
|
||||
public static java.text.NumberFormat getInstance(Locale inLocale) {
|
||||
return new NumberFormatDelegate(NumberFormat.getInstance(inLocale));
|
||||
}
|
||||
|
||||
public static NumberFormat getInstance(ULocale inLocale) {
|
||||
return NumberFormat.getInstance(inLocale);
|
||||
}
|
||||
|
||||
public static NumberFormat getInstance(int style) {
|
||||
return NumberFormat.getInstance(style);
|
||||
}
|
||||
|
||||
public static NumberFormat getInstance(Locale inLocale, int style) {
|
||||
return NumberFormat.getInstance(inLocale, style);
|
||||
}
|
||||
|
||||
public static NumberFormat getNumberInstance(ULocale inLocale) {
|
||||
return NumberFormat.getNumberInstance(inLocale);
|
||||
}
|
||||
|
||||
public static NumberFormat getIntegerInstance(ULocale inLocale) {
|
||||
return NumberFormat.getIntegerInstance(inLocale);
|
||||
}
|
||||
|
||||
public static NumberFormat getCurrencyInstance(ULocale inLocale) {
|
||||
return NumberFormat.getCurrencyInstance(inLocale);
|
||||
}
|
||||
|
||||
public static NumberFormat getPercentInstance(ULocale inLocale) {
|
||||
return NumberFormat.getPercentInstance(inLocale);
|
||||
}
|
||||
|
||||
public static NumberFormat getScientificInstance(ULocale inLocale) {
|
||||
return NumberFormat.getScientificInstance(inLocale);
|
||||
}
|
||||
|
||||
public static Locale[] getAvailableLocales() {
|
||||
return NumberFormat.getAvailableLocales();
|
||||
}
|
||||
|
||||
public static ULocale[] getAvailableULocales() {
|
||||
return NumberFormat.getAvailableULocales();
|
||||
}
|
||||
|
||||
public static Object registerFactory(NumberFormat.NumberFormatFactory factory) {
|
||||
return NumberFormat.registerFactory(factory);
|
||||
}
|
||||
|
||||
public static boolean unregister(Object registryKey) {
|
||||
return NumberFormat.unregister(registryKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return delegate.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return delegate.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return delegate.clone();
|
||||
}
|
||||
|
||||
public boolean isGroupingUsed() {
|
||||
return delegate.isGroupingUsed();
|
||||
}
|
||||
|
||||
public void setGroupingUsed(boolean newValue) {
|
||||
delegate.setGroupingUsed(newValue);
|
||||
}
|
||||
|
||||
public int getMaximumIntegerDigits() {
|
||||
return delegate.getMaximumIntegerDigits();
|
||||
}
|
||||
|
||||
public void setMaximumIntegerDigits(int newValue) {
|
||||
delegate.setMaximumIntegerDigits(newValue);
|
||||
}
|
||||
|
||||
public int getMinimumIntegerDigits() {
|
||||
return delegate.getMinimumIntegerDigits();
|
||||
}
|
||||
|
||||
public void setMinimumIntegerDigits(int newValue) {
|
||||
delegate.setMinimumIntegerDigits(newValue);
|
||||
}
|
||||
|
||||
public int getMaximumFractionDigits() {
|
||||
return delegate.getMaximumFractionDigits();
|
||||
}
|
||||
|
||||
public void setMaximumFractionDigits(int newValue) {
|
||||
delegate.setMaximumFractionDigits(newValue);
|
||||
}
|
||||
|
||||
public int getMinimumFractionDigits() {
|
||||
return delegate.getMinimumFractionDigits();
|
||||
}
|
||||
|
||||
public void setMinimumFractionDigits(int newValue) {
|
||||
delegate.setMinimumFractionDigits(newValue);
|
||||
}
|
||||
|
||||
public void setCurrency(Currency theCurrency) {
|
||||
delegate.setCurrency(theCurrency);
|
||||
}
|
||||
|
||||
public java.util.Currency getCurrency() {
|
||||
return java.util.Currency.getInstance(delegate.getCurrency().getCurrencyCode());
|
||||
}
|
||||
|
||||
public void setRoundingMode(int roundingMode) {
|
||||
delegate.setRoundingMode(roundingMode);
|
||||
}
|
||||
|
||||
public static NumberFormat getInstance(ULocale desiredLocale, int choice) {
|
||||
return NumberFormat.getInstance(desiredLocale, choice);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getPatternForStyle(ULocale forLocale, int choice) {
|
||||
return NumberFormat.getPatternForStyle(forLocale, choice);
|
||||
}
|
||||
|
||||
public ULocale getLocale(ULocale.Type type) {
|
||||
return delegate.getLocale(type);
|
||||
}
|
||||
|
||||
public AttributedCharacterIterator formatToCharacterIterator(Object obj) {
|
||||
return delegate.formatToCharacterIterator(obj);
|
||||
}
|
||||
|
||||
public Object parseObject(String source) throws ParseException {
|
||||
return delegate.parseObject(source);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
package xyz.nulldev.androidcompat.replace;
|
||||
|
||||
import com.ibm.icu.text.DateFormatSymbols;
|
||||
import com.ibm.icu.text.DisplayContext;
|
||||
import com.ibm.icu.text.NumberFormat;
|
||||
import com.ibm.icu.text.TimeZoneFormat;
|
||||
import com.ibm.icu.util.Calendar;
|
||||
import com.ibm.icu.util.TimeZone;
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
||||
import java.text.*;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Overridden to switch to Android implementation
|
||||
*/
|
||||
public class SimpleDateFormat extends DateFormat {
|
||||
private com.ibm.icu.text.SimpleDateFormat delegate;
|
||||
|
||||
public SimpleDateFormat() {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat();
|
||||
}
|
||||
|
||||
private SimpleDateFormat(com.ibm.icu.text.SimpleDateFormat delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public SimpleDateFormat(String pattern) {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat(pattern);
|
||||
}
|
||||
|
||||
public SimpleDateFormat(String pattern, Locale loc) {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat(pattern, loc);
|
||||
}
|
||||
|
||||
public SimpleDateFormat(String pattern, ULocale loc) {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat(pattern, loc);
|
||||
}
|
||||
|
||||
public SimpleDateFormat(String pattern, String override, ULocale loc) {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat(pattern, override, loc);
|
||||
}
|
||||
|
||||
public SimpleDateFormat(String pattern, DateFormatSymbols formatData) {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat(pattern, formatData);
|
||||
}
|
||||
|
||||
public SimpleDateFormat(String pattern, DateFormatSymbols formatData, ULocale loc) {
|
||||
delegate = new com.ibm.icu.text.SimpleDateFormat(pattern, formatData, loc);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static SimpleDateFormat getInstance(Calendar.FormatConfiguration formatConfig) {
|
||||
return new SimpleDateFormat(com.ibm.icu.text.SimpleDateFormat.getInstance(formatConfig));
|
||||
}
|
||||
|
||||
public void set2DigitYearStart(Date startDate) {
|
||||
delegate.set2DigitYearStart(startDate);
|
||||
}
|
||||
|
||||
public Date get2DigitYearStart() {
|
||||
return delegate.get2DigitYearStart();
|
||||
}
|
||||
|
||||
public void setContext(DisplayContext context) {
|
||||
delegate.setContext(context);
|
||||
}
|
||||
|
||||
public StringBuffer format(Calendar cal, StringBuffer toAppendTo, FieldPosition pos) {
|
||||
return delegate.format(cal, toAppendTo, pos);
|
||||
}
|
||||
|
||||
public void setNumberFormat(NumberFormat newNumberFormat) {
|
||||
delegate.setNumberFormat(newNumberFormat);
|
||||
}
|
||||
|
||||
public void parse(String text, Calendar cal, ParsePosition parsePos) {
|
||||
delegate.parse(text, cal, parsePos);
|
||||
}
|
||||
|
||||
public String toPattern() {
|
||||
return delegate.toPattern();
|
||||
}
|
||||
|
||||
public String toLocalizedPattern() {
|
||||
return delegate.toLocalizedPattern();
|
||||
}
|
||||
|
||||
public void applyPattern(String pat) {
|
||||
delegate.applyPattern(pat);
|
||||
}
|
||||
|
||||
public void applyLocalizedPattern(String pat) {
|
||||
delegate.applyLocalizedPattern(pat);
|
||||
}
|
||||
|
||||
public DateFormatSymbols getDateFormatSymbols() {
|
||||
return delegate.getDateFormatSymbols();
|
||||
}
|
||||
|
||||
public void setDateFormatSymbols(DateFormatSymbols newFormatSymbols) {
|
||||
delegate.setDateFormatSymbols(newFormatSymbols);
|
||||
}
|
||||
|
||||
public TimeZoneFormat getTimeZoneFormat() {
|
||||
return delegate.getTimeZoneFormat();
|
||||
}
|
||||
|
||||
public void setTimeZoneFormat(TimeZoneFormat tzfmt) {
|
||||
delegate.setTimeZoneFormat(tzfmt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return delegate.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return delegate.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return delegate.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributedCharacterIterator formatToCharacterIterator(Object obj) {
|
||||
return delegate.formatToCharacterIterator(obj);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public StringBuffer intervalFormatByAlgorithm(Calendar fromCalendar, Calendar toCalendar, StringBuffer appendTo, FieldPosition pos) throws IllegalArgumentException {
|
||||
return delegate.intervalFormatByAlgorithm(fromCalendar, toCalendar, appendTo, pos);
|
||||
}
|
||||
|
||||
public void setNumberFormat(String fields, NumberFormat overrideNF) {
|
||||
delegate.setNumberFormat(fields, overrideNF);
|
||||
}
|
||||
|
||||
public NumberFormat getNumberFormat(char field) {
|
||||
return delegate.getNumberFormat(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||
return delegate.format(date, toAppendTo, fieldPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String text) throws ParseException {
|
||||
return delegate.parse(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String text, ParsePosition pos) {
|
||||
return delegate.parse(text, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object parseObject(String source, ParsePosition pos) {
|
||||
return delegate.parseObject(source, pos);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getTimeInstance(int style, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getTimeInstance(style, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateInstance(int style, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getDateInstance(style, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateTimeInstance(int dateStyle, int timeStyle, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getDateTimeInstance(dateStyle, timeStyle, locale);
|
||||
}
|
||||
|
||||
public static Locale[] getAvailableLocales() {
|
||||
return com.ibm.icu.text.DateFormat.getAvailableLocales();
|
||||
}
|
||||
|
||||
public static ULocale[] getAvailableULocales() {
|
||||
return com.ibm.icu.text.DateFormat.getAvailableULocales();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalendar(java.util.Calendar newCalendar) {
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(newCalendar.getTimeZone().getID()));
|
||||
cal.setTimeInMillis(newCalendar.getTimeInMillis());
|
||||
delegate.setCalendar(cal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.Calendar getCalendar() {
|
||||
return new CalendarDelegate(delegate.getCalendar());
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.text.NumberFormat getNumberFormat() {
|
||||
return new NumberFormatDelegate(delegate.getNumberFormat());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTimeZone(java.util.TimeZone zone) {
|
||||
delegate.setTimeZone(TimeZone.getTimeZone(zone.getID()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.TimeZone getTimeZone() {
|
||||
return new TimeZoneDelegate(delegate.getTimeZone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLenient(boolean lenient) {
|
||||
delegate.setLenient(lenient);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLenient() {
|
||||
return delegate.isLenient();
|
||||
}
|
||||
|
||||
public void setCalendarLenient(boolean lenient) {
|
||||
delegate.setCalendarLenient(lenient);
|
||||
}
|
||||
|
||||
public boolean isCalendarLenient() {
|
||||
return delegate.isCalendarLenient();
|
||||
}
|
||||
|
||||
public com.ibm.icu.text.DateFormat setBooleanAttribute(com.ibm.icu.text.DateFormat.BooleanAttribute key, boolean value) {
|
||||
return delegate.setBooleanAttribute(key, value);
|
||||
}
|
||||
|
||||
public boolean getBooleanAttribute(com.ibm.icu.text.DateFormat.BooleanAttribute key) {
|
||||
return delegate.getBooleanAttribute(key);
|
||||
}
|
||||
|
||||
public DisplayContext getContext(DisplayContext.Type type) {
|
||||
return delegate.getContext(type);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateInstance(Calendar cal, int dateStyle, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getDateInstance(cal, dateStyle, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateInstance(Calendar cal, int dateStyle, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getDateInstance(cal, dateStyle, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getTimeInstance(Calendar cal, int timeStyle, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getTimeInstance(cal, timeStyle, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getTimeInstance(Calendar cal, int timeStyle, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getTimeInstance(cal, timeStyle, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getDateTimeInstance(cal, dateStyle, timeStyle, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getDateTimeInstance(cal, dateStyle, timeStyle, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstance(Calendar cal, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getInstance(cal, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstance(Calendar cal, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getInstance(cal, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstance(Calendar cal) {
|
||||
return com.ibm.icu.text.DateFormat.getInstance(cal);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateInstance(Calendar cal, int dateStyle) {
|
||||
return com.ibm.icu.text.DateFormat.getDateInstance(cal, dateStyle);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getTimeInstance(Calendar cal, int timeStyle) {
|
||||
return com.ibm.icu.text.DateFormat.getTimeInstance(cal, timeStyle);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle) {
|
||||
return com.ibm.icu.text.DateFormat.getDateTimeInstance(cal, dateStyle, timeStyle);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstanceForSkeleton(String skeleton) {
|
||||
return com.ibm.icu.text.DateFormat.getInstanceForSkeleton(skeleton);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstanceForSkeleton(String skeleton, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getInstanceForSkeleton(skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstanceForSkeleton(String skeleton, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getInstanceForSkeleton(skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstanceForSkeleton(Calendar cal, String skeleton, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getInstanceForSkeleton(cal, skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getInstanceForSkeleton(Calendar cal, String skeleton, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getInstanceForSkeleton(cal, skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getPatternInstance(String skeleton) {
|
||||
return com.ibm.icu.text.DateFormat.getPatternInstance(skeleton);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getPatternInstance(String skeleton, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getPatternInstance(skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getPatternInstance(String skeleton, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getPatternInstance(skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getPatternInstance(Calendar cal, String skeleton, Locale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getPatternInstance(cal, skeleton, locale);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.text.DateFormat getPatternInstance(Calendar cal, String skeleton, ULocale locale) {
|
||||
return com.ibm.icu.text.DateFormat.getPatternInstance(cal, skeleton, locale);
|
||||
}
|
||||
|
||||
public ULocale getLocale(ULocale.Type type) {
|
||||
return delegate.getLocale(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object parseObject(String source) throws ParseException {
|
||||
return delegate.parseObject(source);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package xyz.nulldev.androidcompat.replace;
|
||||
|
||||
import com.ibm.icu.util.ULocale;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class TimeZoneDelegate extends TimeZone {
|
||||
private com.ibm.icu.util.TimeZone delegate;
|
||||
|
||||
public TimeZoneDelegate(com.ibm.icu.util.TimeZone delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) {
|
||||
return delegate.getOffset(era, year, month, day, dayOfWeek, milliseconds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset(long date) {
|
||||
return delegate.getOffset(date);
|
||||
}
|
||||
|
||||
public void getOffset(long date, boolean local, int[] offsets) {
|
||||
delegate.getOffset(date, local, offsets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRawOffset(int offsetMillis) {
|
||||
delegate.setRawOffset(offsetMillis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRawOffset() {
|
||||
return delegate.getRawOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return delegate.getID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setID(String ID) {
|
||||
delegate.setID(ID);
|
||||
}
|
||||
|
||||
public String getDisplayName(ULocale locale) {
|
||||
return delegate.getDisplayName(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName(boolean daylight, int style, Locale locale) {
|
||||
return delegate.getDisplayName(daylight, style, locale);
|
||||
}
|
||||
|
||||
public String getDisplayName(boolean daylight, int style, ULocale locale) {
|
||||
return delegate.getDisplayName(daylight, style, locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDSTSavings() {
|
||||
return delegate.getDSTSavings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useDaylightTime() {
|
||||
return delegate.useDaylightTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean observesDaylightTime() {
|
||||
return delegate.observesDaylightTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inDaylightTime(Date date) {
|
||||
return delegate.inDaylightTime(date);
|
||||
}
|
||||
|
||||
public static TimeZone getTimeZone(String ID) {
|
||||
return new TimeZoneDelegate(com.ibm.icu.util.TimeZone.getTimeZone(ID));
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.TimeZone getFrozenTimeZone(String ID) {
|
||||
return com.ibm.icu.util.TimeZone.getFrozenTimeZone(ID);
|
||||
}
|
||||
|
||||
public static com.ibm.icu.util.TimeZone getTimeZone(String ID, int type) {
|
||||
return com.ibm.icu.util.TimeZone.getTimeZone(ID, type);
|
||||
}
|
||||
|
||||
public static void setDefaultTimeZoneType(int type) {
|
||||
com.ibm.icu.util.TimeZone.setDefaultTimeZoneType(type);
|
||||
}
|
||||
|
||||
public static int getDefaultTimeZoneType() {
|
||||
return com.ibm.icu.util.TimeZone.getDefaultTimeZoneType();
|
||||
}
|
||||
|
||||
public static Set<String> getAvailableIDs(com.ibm.icu.util.TimeZone.SystemTimeZoneType zoneType, String region, Integer rawOffset) {
|
||||
return com.ibm.icu.util.TimeZone.getAvailableIDs(zoneType, region, rawOffset);
|
||||
}
|
||||
|
||||
public static String[] getAvailableIDs(int rawOffset) {
|
||||
return com.ibm.icu.util.TimeZone.getAvailableIDs(rawOffset);
|
||||
}
|
||||
|
||||
public static String[] getAvailableIDs(String country) {
|
||||
return com.ibm.icu.util.TimeZone.getAvailableIDs(country);
|
||||
}
|
||||
|
||||
public static String[] getAvailableIDs() {
|
||||
return com.ibm.icu.util.TimeZone.getAvailableIDs();
|
||||
}
|
||||
|
||||
public static int countEquivalentIDs(String id) {
|
||||
return com.ibm.icu.util.TimeZone.countEquivalentIDs(id);
|
||||
}
|
||||
|
||||
public static String getEquivalentID(String id, int index) {
|
||||
return com.ibm.icu.util.TimeZone.getEquivalentID(id, index);
|
||||
}
|
||||
|
||||
public static TimeZone getDefault() {
|
||||
return new TimeZoneDelegate(com.ibm.icu.util.TimeZone.getDefault());
|
||||
}
|
||||
|
||||
public static void setDefault(com.ibm.icu.util.TimeZone tz) {
|
||||
com.ibm.icu.util.TimeZone.setDefault(tz);
|
||||
}
|
||||
|
||||
public boolean hasSameRules(com.ibm.icu.util.TimeZone other) {
|
||||
return delegate.hasSameRules(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return delegate.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return delegate.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return delegate.hashCode();
|
||||
}
|
||||
|
||||
public static String getTZDataVersion() {
|
||||
return com.ibm.icu.util.TimeZone.getTZDataVersion();
|
||||
}
|
||||
|
||||
public static String getCanonicalID(String id) {
|
||||
return com.ibm.icu.util.TimeZone.getCanonicalID(id);
|
||||
}
|
||||
|
||||
public static String getCanonicalID(String id, boolean[] isSystemID) {
|
||||
return com.ibm.icu.util.TimeZone.getCanonicalID(id, isSystemID);
|
||||
}
|
||||
|
||||
public static String getRegion(String id) {
|
||||
return com.ibm.icu.util.TimeZone.getRegion(id);
|
||||
}
|
||||
|
||||
public static String getWindowsID(String id) {
|
||||
return com.ibm.icu.util.TimeZone.getWindowsID(id);
|
||||
}
|
||||
|
||||
public static String getIDForWindowsID(String winid, String region) {
|
||||
return com.ibm.icu.util.TimeZone.getIDForWindowsID(winid, region);
|
||||
}
|
||||
|
||||
public boolean isFrozen() {
|
||||
return delegate.isFrozen();
|
||||
}
|
||||
|
||||
public com.ibm.icu.util.TimeZone freeze() {
|
||||
return delegate.freeze();
|
||||
}
|
||||
|
||||
public com.ibm.icu.util.TimeZone cloneAsThawed() {
|
||||
return delegate.cloneAsThawed();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user