SoapRequestFactory.java 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package epson.epsonconnectregistration;
  2. import android.content.Context;
  3. import android.net.Uri;
  4. import epson.print.BuildConfig;
  5. import java.util.UUID;
  6. public class SoapRequestFactory {
  7. private static final String PRINER_KEY = "Y2OFL0wVYau52Rlrt7vNpt/8T4F4IjTMvqP1qn4Id0ToRYTlJLxG1CnD9C49Bl205RGyK23HeJzW+TX6HX7m6HwKuiJJKl+K5WQ6fLBY5JU";
  8. private static final String PRINER_KEY2 = "w4Wv3krd2XpBQbvkSX/ZvnbBvIPBW2Msq0E5VwlZX9SkiGHgynhJzOO+flksH6SEieMYlxNjeIBWdXCTu+QuXwO5zDZ89RjQmn7Qm/qYTNQ=";
  9. private static final String TAG_DESTINATION = "%DESTINATION%";
  10. private static final String TAG_GROUPID = "%GROUPID%";
  11. private static final String TAG_LANG = "%LANG%";
  12. private static final String TAG_PRINER_KEY = "%PRINER_KEY%";
  13. private static final String TAG_UUID = "%UUID%";
  14. private static final String XML_GETREQUEST = "soap/getrequest.xml";
  15. private static final String XML_GETREQUEST_WEBSETUP = "soap/getrequest_WEBSETUP.xml";
  16. private static final String XML_SETREQUEST_WEBSETUP = "soap/setrequest_WEBSETUP.xml";
  17. public static String createGetRequest(Context context, Uri uri) {
  18. return getXmlTemplate(context, XML_GETREQUEST).replace(TAG_DESTINATION, uri.toString()).replace(TAG_UUID, getUUID());
  19. }
  20. public static String createGetRequestWEBSETUP(Context context, Uri uri) {
  21. return getXmlTemplate(context, XML_GETREQUEST_WEBSETUP).replace(TAG_DESTINATION, uri.toString()).replace(TAG_UUID, getUUID());
  22. }
  23. public static String createSetRequestWEBSETUP(Context context, Uri uri, String str) {
  24. String replace = getXmlTemplate(context, XML_SETREQUEST_WEBSETUP).replace(TAG_DESTINATION, uri.toString()).replace(TAG_UUID, getUUID()).replace(TAG_LANG, str);
  25. if ("Beta".equals(BuildConfig.FLAVOR)) {
  26. return replace.replace(TAG_PRINER_KEY, PRINER_KEY2);
  27. }
  28. return replace.replace(TAG_PRINER_KEY, PRINER_KEY);
  29. }
  30. /* JADX WARNING: Removed duplicated region for block: B:20:0x0037 A[Catch:{ Exception -> 0x003b }] */
  31. /* JADX WARNING: Removed duplicated region for block: B:24:0x003f A[Catch:{ Exception -> 0x003b }] */
  32. /* Code decompiled incorrectly, please refer to instructions dump. */
  33. private static java.lang.String getXmlTemplate(android.content.Context r4, java.lang.String r5) {
  34. /*
  35. java.lang.StringBuffer r0 = new java.lang.StringBuffer
  36. r0.<init>()
  37. r1 = 0
  38. android.content.res.AssetManager r4 = r4.getAssets() // Catch:{ all -> 0x0032 }
  39. java.io.InputStream r4 = r4.open(r5) // Catch:{ all -> 0x0032 }
  40. java.io.BufferedReader r5 = new java.io.BufferedReader // Catch:{ all -> 0x0030 }
  41. java.io.InputStreamReader r2 = new java.io.InputStreamReader // Catch:{ all -> 0x0030 }
  42. r2.<init>(r4) // Catch:{ all -> 0x0030 }
  43. r5.<init>(r2) // Catch:{ all -> 0x0030 }
  44. L_0x0018:
  45. java.lang.String r1 = r5.readLine() // Catch:{ all -> 0x002b }
  46. if (r1 == 0) goto L_0x0022
  47. r0.append(r1) // Catch:{ all -> 0x002b }
  48. goto L_0x0018
  49. L_0x0022:
  50. if (r4 == 0) goto L_0x0027
  51. r4.close() // Catch:{ Exception -> 0x003b }
  52. L_0x0027:
  53. r5.close() // Catch:{ Exception -> 0x003b }
  54. goto L_0x0046
  55. L_0x002b:
  56. r1 = move-exception
  57. r3 = r1
  58. r1 = r5
  59. r5 = r3
  60. goto L_0x0035
  61. L_0x0030:
  62. r5 = move-exception
  63. goto L_0x0035
  64. L_0x0032:
  65. r4 = move-exception
  66. r5 = r4
  67. r4 = r1
  68. L_0x0035:
  69. if (r4 == 0) goto L_0x003d
  70. r4.close() // Catch:{ Exception -> 0x003b }
  71. goto L_0x003d
  72. L_0x003b:
  73. r4 = move-exception
  74. goto L_0x0043
  75. L_0x003d:
  76. if (r1 == 0) goto L_0x0042
  77. r1.close() // Catch:{ Exception -> 0x003b }
  78. L_0x0042:
  79. throw r5 // Catch:{ Exception -> 0x003b }
  80. L_0x0043:
  81. r4.printStackTrace()
  82. L_0x0046:
  83. java.lang.String r4 = r0.toString()
  84. return r4
  85. */
  86. throw new UnsupportedOperationException("Method not decompiled: epson.epsonconnectregistration.SoapRequestFactory.getXmlTemplate(android.content.Context, java.lang.String):java.lang.String");
  87. }
  88. private static String getUUID() {
  89. return UUID.randomUUID().toString();
  90. }
  91. }