FirmInfFile.java 2.0 KB

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