FirmInfFile.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package epson.maintain;
  2. import androidx.annotation.Nullable;
  3. import java.util.HashMap;
  4. public class FirmInfFile {
  5. private static final String INF_KEY_URL_ROM_EFU = "URLROMEFU";
  6. private int mInfFileVersion = 0;
  7. int mRomNum;
  8. final HashMap<String, String> mUpdateInf = new HashMap<>();
  9. public synchronized String getRomUrl(int i) {
  10. String str;
  11. if (i <= mRomNum) {
  12. str = mUpdateInf.get(String.format("URLROM%d", new Object[]{Integer.valueOf(i)}));
  13. } else {
  14. str = null;
  15. }
  16. return str;
  17. }
  18. public synchronized String getMainVersion() {
  19. return mUpdateInf.get("VERMAIN");
  20. }
  21. public synchronized String getNetVersion() {
  22. return mUpdateInf.get("VERNET");
  23. }
  24. public synchronized int getRomNum() {
  25. return mRomNum;
  26. }
  27. @Nullable
  28. public synchronized String getfuUrl() {
  29. return mUpdateInf.get(INF_KEY_URL_ROM_EFU);
  30. }
  31. public synchronized int getInfFileVersion() {
  32. return mInfFileVersion;
  33. }
  34. public synchronized boolean checkInfFileVersion(byte[] r4) {
  35. throw new UnsupportedOperationException("Method not decompiled: epson.maintain.FirmInfFile.checkInfFileVersion(byte[]):boolean");
  36. }
  37. @android.support.annotation.VisibleForTesting
  38. /* Code decompiled incorrectly, please refer to instructions dump. */
  39. public synchronized boolean parseInfFile(byte[] r10) {
  40. throw new UnsupportedOperationException("Method not decompiled: epson.maintain.FirmInfFile.parseInfFile(byte[]):boolean");
  41. }
  42. @VisibleForTesting
  43. static String getComparableVersion(@Nullable String str) {
  44. if (str == null || str.length() < 6) {
  45. throw new IllegalArgumentException();
  46. }
  47. return str.substring(4, 6) + str.substring(2, 4);
  48. }
  49. public int compareVersion(String str) {
  50. return getComparableVersion(str).compareTo(getComparableVersion(getMainVersion()));
  51. }
  52. }