EpsonService.java 126 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726
  1. package epson.print.service;
  2. import android.app.Service;
  3. import android.content.Context;
  4. import android.content.Intent;
  5. import android.os.Binder;
  6. import android.os.Handler;
  7. import android.os.IBinder;
  8. import android.os.Message;
  9. import android.os.RemoteCallbackList;
  10. import android.os.RemoteException;
  11. import com.epson.cameracopy.printlayout.ImageAndLayout;
  12. import com.epson.iprint.apf.ApfEpImageAdapter;
  13. import com.epson.iprint.storage.StorageSecureStore;
  14. import com.epson.mobilephone.common.PrintingLib.define.Constants;
  15. import com.epson.mobilephone.common.escpr.EscprError;
  16. import com.epson.mobilephone.common.escpr.EscprLib;
  17. import com.epson.mobilephone.common.wifidirect.WiFiDirectManager;
  18. import java.io.DataOutputStream;
  19. import java.io.File;
  20. import java.io.FileOutputStream;
  21. import java.io.IOException;
  22. import java.nio.ByteBuffer;
  23. import java.nio.ByteOrder;
  24. import java.util.ArrayList;
  25. import java.util.List;
  26. import epson.common.ExternalFileUtils;
  27. import epson.common.Info_paper;
  28. import epson.common.Utils;
  29. import epson.print.EPImageCreator;
  30. import epson.print.EPImageList;
  31. import epson.print.EPPrinterManager;
  32. import epson.print.MyPrinter;
  33. import epson.print.Util.EPLog;
  34. import epson.print.ecclient.EcClientLib;
  35. import epson.print.ecclient.EcClientLibUtil;
  36. import epson.print.ecclient.EpsJobAttrib;
  37. import epson.print.ecclient.EpsMediaSize;
  38. import epson.print.ecclient.EpsMediaType;
  39. import epson.print.ecclient.EpsSupportedMedia;
  40. import epson.print.screen.PrintSetting;
  41. import epson.provider.SharedPreferencesProvider;
  42. public class EpsonService extends Service implements ApfEpImageAdapter.ProgressCallback, PrintService {
  43. static final int DISABLE_SIMPLE_AP_TIMEOUT = 1800;
  44. public static final int EPS_ERR_MEMORY_ALLOCATION = -1001;
  45. public static final int EPS_ERR_NONE = 0;
  46. private static final int EPS_MLID_BORDERLESS = 1;
  47. static final int EPS_MSID_A3 = 62;
  48. static final int EPS_MSID_B4 = 63;
  49. static final int EPS_MSID_LEGAL = 2;
  50. public static final int MEDIA_INFO_MEMORY_ERROR = -5201;
  51. static final int NOT_SET_TIMEOUT = -1;
  52. public static final String PREFS_NAME = "PrintSetting";
  53. public static final int PROGRESS_NOTIFY_TYPE_APF = 2;
  54. public static final int PROGRESS_NOTIFY_TYPE_PRINTING = 1;
  55. private static volatile boolean bCancelPrinting = false;
  56. public static boolean bNotifyPrinter = false;
  57. private static boolean isInitDriver = false;
  58. static final RemoteCallbackList<IEpsonServiceCallback> mCallbacks = new RemoteCallbackList<>();
  59. private static final Object mCancelLock = new Object();
  60. private static final Object mConnect = new Object();
  61. private static final Object mLock = new Object();
  62. private static final Object mLockPrintingStatus = new Object();
  63. private static final Object mLockSearchingStatus = new Object();
  64. private static final Object mPrinting = new Object();
  65. private final int EPS_ERR_PRINTER_NOT_SET = EscprError.EPS_ERR_PRINTER_NOT_SET;
  66. private final int EPS_PRNERR_COMM = 102;
  67. private final int EPS_PRNERR_NOERROR = 0;
  68. private final int EPS_PRNST_BUSY = 2;
  69. private final int EPS_PRNST_ERROR = 4;
  70. private final String TAG = "EpsonService";
  71. private String accessKey = "";
  72. private boolean bEnd;
  73. private volatile boolean bPrinting = false;
  74. private volatile boolean bSearching = false;
  75. boolean bSetPrinter = false;
  76. private String clientId = null;
  77. public String debugString;
  78. private EpsJobAttrib epsJobattrib = new EpsJobAttrib();
  79. /* access modifiers changed from: private */
  80. /* renamed from: id */
  81. public String f406id;
  82. /* access modifiers changed from: private */
  83. /* renamed from: ip */
  84. public String f407ip;
  85. private final IEpsonService.Stub mBinder = new IEpsonService.Stub() {
  86. EcClientLib mEcClientLib = new EcClientLib();
  87. boolean mEpsonConnectlogin;
  88. int mRemotePrintMaxFileSize = 0;
  89. {
  90. mEcClientLib.Initialize();
  91. mEpsonConnectlogin = false;
  92. }
  93. public void unregisterCallback(IEpsonServiceCallback iEpsonServiceCallback) throws RemoteException {
  94. if (iEpsonServiceCallback != null) {
  95. EpsonService.mCallbacks.unregister(iEpsonServiceCallback);
  96. }
  97. }
  98. public void registerCallback(IEpsonServiceCallback iEpsonServiceCallback) throws RemoteException {
  99. if (iEpsonServiceCallback != null) {
  100. EpsonService.mCallbacks.register(iEpsonServiceCallback);
  101. }
  102. }
  103. public synchronized int searchPrinters(String str, String str2, int i) throws RemoteException {
  104. synchronized (EpsonService.mLockSearchingStatus) {
  105. EpsonService.bNotifyPrinter = false;
  106. }
  107. String unused = f406id = str;
  108. String unused2 = f407ip = str2;
  109. int unused3 = probeMethod = i;
  110. if (searchingPrinter != null) {
  111. EPLog.d("EpsonService", "searchPrinters() search intterrupt()");
  112. searchingPrinter.interrupt();
  113. try {
  114. searchingPrinter.join();
  115. } catch (InterruptedException e) {
  116. e.printStackTrace();
  117. }
  118. }
  119. EpsonService.access$504(EpsonService.this);
  120. if (mSearchCount > 1) {
  121. EPLog.e("EpsonService", "search count error! mSearchCount => " + mSearchCount);
  122. }
  123. if (!EpsonService.isInitDriver) {
  124. mEscprLib.release_driver();
  125. boolean unused4 = EpsonService.isInitDriver = true;
  126. mEscprLib.init_driver (getApplicationContext(), ExternalFileUtils.getInstance (getApplicationContext()).getSupportedMediaDir());
  127. }
  128. createSearchingThread();
  129. searchingPrinter.start();
  130. return 0;
  131. }
  132. public synchronized int cancelSearchPrinter() throws RemoteException {
  133. EPLog.e("Epson", "cancelSearchPrinter() call");
  134. if (searchingPrinter == null) {
  135. EPLog.e("Epson", "cancelSearchPrinter() finish1");
  136. return 0;
  137. }
  138. searchingPrinter.interrupt();
  139. try {
  140. EPLog.d("EpsonService", "searchingPrinter.join() enter");
  141. searchingPrinter.join(1000);
  142. int i = 0;
  143. while (true) {
  144. if (!Thread.State.RUNNABLE.equals(searchingPrinter.getState())) {
  145. break;
  146. }
  147. int i2 = i + 1;
  148. if (i > 60) {
  149. EPLog.w("EpsonService", "mSearchThread.join() timeout");
  150. break;
  151. }
  152. EPLog.d("EpsonService", "retry doCancelFindPrinter() " + i2);
  153. searchingPrinter.interrupt();
  154. searchingPrinter.join(1000);
  155. i = i2;
  156. }
  157. EPLog.d("EpsonService", "searchingPrinter.join() leave");
  158. } catch (InterruptedException e) {
  159. e.printStackTrace();
  160. }
  161. EPLog.e("Epson", "cancelSearchPrinter() finish");
  162. return 0;
  163. }
  164. public void setTimeOut(int i) throws RemoteException {
  165. EPLog.d("EpsonService", "timeout = " + i);
  166. int unused = timeout_sec = i;
  167. }
  168. public int setCurPrinter(int i) throws RemoteException {
  169. int i2;
  170. EPLog.d("EpsonService", "setCurPrinter(): " + i);
  171. cancelSearchPrinter();
  172. EPLog.e("Epson", "Finish cancelSearchPrinter()");
  173. synchronized (EpsonService.mLock) {
  174. EPLog.d("EpsonService", "Start set_printer()");
  175. i2 = mEscprLib.set_printer(i);
  176. EPLog.d("EpsonService", "setCurPrinter: result = " + i2);
  177. }
  178. return i2;
  179. }
  180. public int print(EPImageList ePImageList, String str, boolean z) throws RemoteException {
  181. EPLog.i();
  182. boolean z2 = SharedPreferencesProvider.getInstace(EpsonService.this).getInt(Constants.PRINTER_LOCATION, 0) == 2;
  183. EPLog.i("☆☆     isRemotePrinter " + z2);
  184. PrintSetting.Kind valueOf = PrintSetting.Kind.valueOf(str);
  185. if (z2) {
  186. int unused = createECPrintingThread(valueOf, ePImageList);
  187. if (printingThread != null) {
  188. printingThread.start();
  189. }
  190. return 0;
  191. }
  192. startLocalNonPdfPrintThread(valueOf, ePImageList, z);
  193. return 0;
  194. }
  195. public int printLocalPdf(String str, String str2, String str3, boolean z, int i, int i2, boolean z2) {
  196. startPdfPrintThread(str, str2, str3, z, i, i2, z2);
  197. return 0;
  198. }
  199. public int printWithImagesAndLayouts(List<ImageAndLayout> list, boolean z) {
  200. EpsonService epsonService = EpsonService.this;
  201. Thread unused = epsonService.printingThread = new PrintAndLayoutThread(epsonService, list, z);
  202. printingThread.start();
  203. return 0;
  204. }
  205. public int cancelPrint() throws RemoteException {
  206. return mEscprLib.cancel_print();
  207. }
  208. public int getLang() throws RemoteException {
  209. int i;
  210. synchronized (EpsonService.mLock) {
  211. i = mEscprLib.get_lang();
  212. }
  213. return i;
  214. }
  215. public int getSupportedMedia(boolean z, int i, String str, String str2) throws RemoteException {
  216. int i2;
  217. synchronized (EpsonService.mPrinting) {
  218. synchronized (EpsonService.mLock) {
  219. synchronized (EpsonService.mPrinting) {
  220. if (z) {
  221. i2 = EpsonConnectGetSupportedMedia(i, str, str2);
  222. } else {
  223. i2 = mEscprLib.get_supported_media2();
  224. }
  225. }
  226. }
  227. }
  228. return i2;
  229. }
  230. public int[] getPaperSize() throws RemoteException {
  231. int[] iArr;
  232. synchronized (EpsonService.mLock) {
  233. iArr = mEscprLib.get_paper_size();
  234. }
  235. return iArr;
  236. }
  237. public int[] getPaperType(int i) throws RemoteException {
  238. int[] iArr;
  239. synchronized (EpsonService.mLock) {
  240. iArr = mEscprLib.get_paper_type(i);
  241. }
  242. return iArr;
  243. }
  244. public int[] getLayout(int i, int i2) throws RemoteException {
  245. int[] iArr;
  246. synchronized (EpsonService.mLock) {
  247. iArr = mEscprLib.get_layout(i, i2);
  248. }
  249. return iArr;
  250. }
  251. public int[] getQuality(int i, int i2) throws RemoteException {
  252. int[] iArr;
  253. synchronized (EpsonService.mLock) {
  254. iArr = mEscprLib.get_quality(i, i2);
  255. }
  256. return iArr;
  257. }
  258. public int[] getPaperSource(int i, int i2, int i3) throws RemoteException {
  259. int[] iArr;
  260. synchronized (EpsonService.mLock) {
  261. iArr = mEscprLib.get_paper_source(i, i2);
  262. }
  263. return iArr;
  264. }
  265. public int[] getColor(boolean z, int i, int i2, int i3) throws RemoteException {
  266. int[] iArr;
  267. int i4;
  268. synchronized (EpsonService.mLock) {
  269. if (z) {
  270. ArrayList arrayList = new ArrayList();
  271. if (i == 1) {
  272. i4 = mEcClientLib.mColorModeAtRemote;
  273. } else {
  274. i4 = mEcClientLib.mColorModeAtLocal;
  275. }
  276. if ((i4 & 1) != 0) {
  277. arrayList.add(0);
  278. }
  279. if ((i4 & 2) != 0) {
  280. arrayList.add(1);
  281. }
  282. int size = arrayList.size();
  283. iArr = new int[arrayList.size()];
  284. for (int i5 = 0; i5 < size; i5++) {
  285. iArr[i5] = ((Integer) arrayList.get(i5)).intValue();
  286. }
  287. } else {
  288. iArr = mEscprLib.get_color(i2, i3);
  289. }
  290. }
  291. return iArr;
  292. }
  293. public int getDuplex(int i, int i2) throws RemoteException {
  294. int i3;
  295. synchronized (EpsonService.mLock) {
  296. i3 = mEscprLib.get_duplex(i, i2);
  297. }
  298. return i3;
  299. }
  300. public boolean isPrinting() {
  301. boolean access$1700;
  302. synchronized (EpsonService.mLockPrintingStatus) {
  303. access$1700 = bPrinting;
  304. }
  305. return access$1700;
  306. }
  307. public boolean isSearchingPrinter() {
  308. boolean access$1800;
  309. synchronized (EpsonService.mLockSearchingStatus) {
  310. access$1800 = bSearching;
  311. }
  312. return access$1800;
  313. }
  314. public int confirmCancel(boolean z) {
  315. EPLog.e("LAM DAI HIEP", "confirmCancel() call");
  316. EPLog.v("cancel ", "iscancel " + z);
  317. if (!z) {
  318. return 0;
  319. }
  320. synchronized (EpsonService.mLockPrintingStatus) {
  321. boolean unused = EpsonService.bCancelPrinting = true;
  322. synchronized (EpsonService.mCancelLock) {
  323. if (mEPImageCreator != null) {
  324. mEPImageCreator.requestStop();
  325. }
  326. }
  327. if (bPrinting) {
  328. if (mLocalPrintThread != null) {
  329. mLocalPrintThread.interrupt();
  330. }
  331. EPLog.e("lam dai hiep", "confirm_cancel: " + z);
  332. mEscprLib.confirm_cancel(z);
  333. } else if (isSearchingPrinter()) {
  334. try {
  335. cancelSearchPrinter();
  336. } catch (RemoteException e) {
  337. e.printStackTrace();
  338. }
  339. }
  340. }
  341. return 0;
  342. }
  343. public int confirmContinueable(boolean z) {
  344. EPLog.e("LAM DAI HIEP", "confirmContinueable() call: " + z);
  345. return mEscprLib.confirm_continue(z);
  346. }
  347. public int updatePrinterSettings(String str) {
  348. int i;
  349. int i2;
  350. int i3;
  351. int i4;
  352. int i5;
  353. int i6;
  354. int i7;
  355. EPLog.m83w("EpsonService", "call updatePrinterSettings() :: " + Binder.getCallingPid());
  356. PrintSetting printSetting = new PrintSetting(EpsonService.this, PrintSetting.Kind.valueOf(str));
  357. printSetting.loadSettings();
  358. int i8 = printSetting.paperSizeValue;
  359. int i9 = printSetting.paperTypeValue;
  360. int i10 = printSetting.layoutValue;
  361. int i11 = printSetting.qualityValue;
  362. int i12 = printSetting.paperSourceValue;
  363. int i13 = printSetting.duplexValue;
  364. int i14 = printSetting.colorValue;
  365. try {
  366. int[] paperSize = getPaperSize();
  367. if (paperSize != null) {
  368. if (paperSize.length != 0) {
  369. int i15 = 0;
  370. while (true) {
  371. if (i15 >= paperSize.length) {
  372. i = 0;
  373. break;
  374. } else if (i8 == paperSize[i15]) {
  375. i = i15;
  376. break;
  377. } else {
  378. i15++;
  379. }
  380. }
  381. if (i15 >= paperSize.length) {
  382. int defaultPaperSize = printSetting.getDefaultPaperSize();
  383. i2 = 0;
  384. while (true) {
  385. if (i2 >= paperSize.length) {
  386. break;
  387. } else if (defaultPaperSize == paperSize[i2]) {
  388. i8 = paperSize[i2];
  389. EPLog.w("EpsonService", "updatePrinterSettings paperSize = " + i8);
  390. i = i2;
  391. break;
  392. } else {
  393. i2++;
  394. }
  395. }
  396. } else {
  397. i2 = i15;
  398. }
  399. if (i2 >= paperSize.length) {
  400. i8 = paperSize[0];
  401. EPLog.w("EpsonService", "updatePrinterSettings paperSize = " + i8);
  402. i = 0;
  403. }
  404. int[] paperType = getPaperType(i);
  405. if (paperType != null) {
  406. if (paperType.length != 0) {
  407. int i16 = 0;
  408. while (true) {
  409. if (i16 >= paperType.length) {
  410. i3 = 0;
  411. break;
  412. } else if (i9 == paperType[i16]) {
  413. i3 = i16;
  414. break;
  415. } else {
  416. i16++;
  417. }
  418. }
  419. if (i16 >= paperType.length) {
  420. int defaultPaperType = printSetting.getDefaultPaperType();
  421. i4 = 0;
  422. while (true) {
  423. if (i4 >= paperType.length) {
  424. break;
  425. } else if (defaultPaperType == paperType[i4]) {
  426. i9 = paperType[i4];
  427. EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
  428. i3 = i4;
  429. break;
  430. } else {
  431. i4++;
  432. }
  433. }
  434. } else {
  435. i4 = i16;
  436. }
  437. if (i4 >= paperType.length) {
  438. if (PrintSetting.Kind.photo.compareTo(PrintSetting.Kind.valueOf(str)) == 0) {
  439. int code = Constants.MediaName.EPS_MTID_MATTE.getCode();
  440. int i17 = 0;
  441. while (true) {
  442. if (i4 >= paperType.length) {
  443. break;
  444. } else if (code == paperType[i4]) {
  445. i9 = paperType[i4];
  446. EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
  447. i3 = i4;
  448. break;
  449. } else {
  450. i17 = i4 + 1;
  451. }
  452. }
  453. } else {
  454. int code2 = Constants.MediaName.EPS_MTID_PLAIN1.getCode();
  455. int i18 = 0;
  456. while (true) {
  457. if (i4 >= paperType.length) {
  458. break;
  459. } else if (code2 == paperType[i4]) {
  460. i9 = paperType[i4];
  461. EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
  462. i3 = i4;
  463. break;
  464. } else {
  465. i18 = i4 + 1;
  466. }
  467. }
  468. if (i4 >= paperType.length) {
  469. int code3 = Constants.MediaName.EPS_MTID_AUTO_PLAIN.getCode();
  470. int i19 = 0;
  471. while (true) {
  472. if (i4 >= paperType.length) {
  473. break;
  474. } else if (code3 == paperType[i4]) {
  475. i9 = paperType[i4];
  476. EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
  477. i3 = i4;
  478. break;
  479. } else {
  480. i19 = i4 + 1;
  481. }
  482. }
  483. }
  484. }
  485. }
  486. if (i4 >= paperType.length) {
  487. i9 = paperType[0];
  488. EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
  489. i3 = 0;
  490. }
  491. int[] layout = getLayout(i, i3);
  492. if (layout != null) {
  493. int i20 = 0;
  494. while (true) {
  495. if (i20 >= layout.length) {
  496. break;
  497. } else if (i10 == layout[i20]) {
  498. i10 = layout[i20];
  499. break;
  500. } else {
  501. i20++;
  502. }
  503. }
  504. if (i20 >= layout.length) {
  505. EPLog.w("EpsonService", "updatePrinterSettings layout = EPS_MLID_BORDERS");
  506. i10 = 2;
  507. }
  508. } else {
  509. EPLog.w("EpsonService", "updatePrinterSettings layout = EPS_MLID_BORDERS");
  510. i10 = 2;
  511. }
  512. int[] quality = getQuality(i, i3);
  513. if (quality != null) {
  514. int i21 = 0;
  515. while (true) {
  516. if (i21 >= quality.length) {
  517. break;
  518. } else if (i11 == quality[i21]) {
  519. i11 = quality[i21];
  520. break;
  521. } else {
  522. i21++;
  523. }
  524. }
  525. if (i21 >= quality.length) {
  526. i5 = quality.length > 0 ? quality[0] : 2;
  527. EPLog.w("EpsonService", "updatePrinterSettings quality = " + i5);
  528. }
  529. } else {
  530. EPLog.w("EpsonService", "updatePrinterSettings quality = " + 2);
  531. i5 = 2;
  532. }
  533. int[] paperSource = getPaperSource(i, i3, 0);
  534. if (paperSource != null) {
  535. int i22 = 0;
  536. while (true) {
  537. if (i22 >= paperSource.length) {
  538. break;
  539. } else if (i12 == paperSource[i22]) {
  540. i12 = paperSource[i22];
  541. break;
  542. } else {
  543. i22++;
  544. }
  545. }
  546. if (i22 >= paperSource.length) {
  547. i6 = paperSource.length > 0 ? paperSource[0] : 0;
  548. EPLog.w("EpsonService", "updatePrinterSettings paperSource = " + i6);
  549. }
  550. } else {
  551. EPLog.w("EpsonService", "updatePrinterSettings paperSource = EPS_MPID_NOT_SPEC");
  552. i6 = 0;
  553. }
  554. int duplex = getDuplex(i, i3);
  555. if ((duplex == 0 || (i10 == 1 && (duplex & 2) != 0)) && i13 != 0) {
  556. EPLog.w("EpsonService", "updatePrinterSettings duplex = EPS_DUPLEX_NONE");
  557. i13 = 0;
  558. }
  559. int[] color = getColor(false, 0, i, i3);
  560. if (color != null) {
  561. int i23 = 0;
  562. while (true) {
  563. if (i23 >= color.length) {
  564. break;
  565. } else if (i14 == color[i23]) {
  566. i14 = color[i23];
  567. break;
  568. } else {
  569. i23++;
  570. }
  571. }
  572. if (i23 >= color.length) {
  573. i7 = color.length > 0 ? color[0] : 0;
  574. EPLog.w("EpsonService", "updatePrinterSettings color = " + i7);
  575. }
  576. } else {
  577. EPLog.w("EpsonService", "updatePrinterSettings color = " + 0);
  578. i7 = 0;
  579. }
  580. printSetting.paperSizeValue = i8;
  581. printSetting.paperTypeValue = i9;
  582. printSetting.layoutValue = i10;
  583. printSetting.qualityValue = i5;
  584. printSetting.paperSourceValue = i6;
  585. printSetting.duplexValue = i13;
  586. printSetting.colorValue = i7;
  587. printSetting.saveSettings();
  588. return 0;
  589. }
  590. }
  591. EPLog.w("EpsonService", "updatePrinterSettings Failed getPaperType");
  592. return -1;
  593. }
  594. }
  595. EPLog.w("EpsonService", "updatePrinterSettings Failed getPaperSize");
  596. return -1;
  597. } catch (RemoteException e) {
  598. e.printStackTrace();
  599. return -1;
  600. }
  601. }
  602. public int EpsonConnectUpdatePrinterSettings(String str) {
  603. int i;
  604. EpsSupportedMedia epsSupportedMedia;
  605. boolean z;
  606. boolean z2;
  607. int i2;
  608. int i3;
  609. EPLog.d("EpsonService", "EpsonConnectUpdatePrinterSettings() called.");
  610. PrintSetting instance = PrintSetting.getInstance(EpsonService.this, str);
  611. instance.loadSettings();
  612. int i4 = instance.paperSizeValue;
  613. int i5 = instance.paperTypeValue;
  614. int i6 = instance.layoutValue;
  615. int i7 = instance.qualityValue;
  616. int i8 = instance.paperSourceValue;
  617. int i9 = instance.duplexValue;
  618. int i10 = instance.colorValue;
  619. try {
  620. int i11 = 0;
  621. WiFiDirectManager.setPriorityToSimpleAP(EpsonService.this, false);
  622. int updateSettingsRemoteSourceType = instance.getUpdateSettingsRemoteSourceType();
  623. int supportedMedia = getSupportedMedia(true, updateSettingsRemoteSourceType, (String) null, (String) null);
  624. switch (updateSettingsRemoteSourceType) {
  625. case 1:
  626. epsSupportedMedia = mEcClientLib.mMediaAtRemote;
  627. i = mEcClientLib.mColorModeAtRemote;
  628. break;
  629. case 2:
  630. epsSupportedMedia = mEcClientLib.mMediaAtPhoto;
  631. i = mEcClientLib.mColorModeAtPhoto;
  632. break;
  633. case 3:
  634. epsSupportedMedia = mEcClientLib.mMediaAtLocal;
  635. i = mEcClientLib.mColorModeAtLocal;
  636. break;
  637. default:
  638. EPLog.e("EpsonService", "remoteSourceType is invalid.");
  639. return -1;
  640. }
  641. if (supportedMedia == 0) {
  642. int i12 = 0;
  643. while (true) {
  644. if (i12 >= epsSupportedMedia.mSizeList.length) {
  645. z = true;
  646. i12 = 0;
  647. } else if (i4 == epsSupportedMedia.mSizeList[i12].mMediaSizeID) {
  648. z = false;
  649. } else {
  650. i12++;
  651. }
  652. }
  653. if (z) {
  654. int defaultPaperSize = instance.getDefaultPaperSize();
  655. while (true) {
  656. if (i11 >= epsSupportedMedia.mSizeList.length) {
  657. i11 = i12;
  658. } else if (defaultPaperSize == epsSupportedMedia.mSizeList[i11].mMediaSizeID) {
  659. EPLog.w("EpsonService", "EpsonConnectUpdatePrinterSettings paperSize_index = " + i11);
  660. z = false;
  661. } else {
  662. i11++;
  663. }
  664. }
  665. if (z) {
  666. i11 = 0;
  667. }
  668. } else {
  669. i11 = i12;
  670. }
  671. int i13 = 0;
  672. while (true) {
  673. if (i13 >= epsSupportedMedia.mSizeList[i11].mTypeList.length) {
  674. z2 = true;
  675. i2 = 0;
  676. } else if (i5 == epsSupportedMedia.mSizeList[i11].mTypeList[i13].mMediaTypeId) {
  677. i2 = i13;
  678. z2 = false;
  679. } else {
  680. i13++;
  681. }
  682. }
  683. if (z2) {
  684. int defaultPaperType = instance.getDefaultPaperType();
  685. int i14 = 0;
  686. while (true) {
  687. if (i14 < epsSupportedMedia.mSizeList[i11].mTypeList.length) {
  688. if (defaultPaperType == epsSupportedMedia.mSizeList[i11].mTypeList[i14].mMediaTypeId) {
  689. EPLog.w("EpsonService", "EpsonConnectUpdatePrinterSettings paperType_index = " + i14);
  690. i2 = i14;
  691. z2 = false;
  692. } else {
  693. i14++;
  694. }
  695. }
  696. }
  697. if (z2) {
  698. i2 = 0;
  699. }
  700. }
  701. int i15 = epsSupportedMedia.mSizeList[i11].mMediaSizeID;
  702. int i16 = epsSupportedMedia.mSizeList[i11].mTypeList[i2].mMediaTypeId;
  703. EpsMediaType epsMediaType = epsSupportedMedia.mSizeList[i11].mTypeList[i2];
  704. int i17 = 8;
  705. if ((epsMediaType.mPaperSource & i8) == i8) {
  706. i3 = i8;
  707. } else if ((epsMediaType.mPaperSource & 1) == 1) {
  708. i3 = 1;
  709. } else if ((epsMediaType.mPaperSource & 2) == 2) {
  710. i3 = 2;
  711. } else if ((epsMediaType.mPaperSource & 4) == 4) {
  712. i3 = 4;
  713. } else if ((epsMediaType.mPaperSource & 8) == 8) {
  714. i3 = 8;
  715. } else if ((epsMediaType.mPaperSource & 16) == 16) {
  716. i3 = 16;
  717. } else {
  718. i3 = 128;
  719. if ((epsMediaType.mPaperSource & 128) != 128) {
  720. i3 = 32768;
  721. if ((epsMediaType.mPaperSource & 32768) != 32768) {
  722. if ((epsMediaType.mPaperSource & 32) == 32) {
  723. i3 = 32;
  724. } else {
  725. i3 = 64;
  726. if ((epsMediaType.mPaperSource & 64) != 64) {
  727. i3 = 2;
  728. }
  729. }
  730. }
  731. }
  732. }
  733. if ((epsMediaType.mLayout & i6) == i6) {
  734. i17 = i6 == 0 ? 2 : i6;
  735. } else if ((epsMediaType.mLayout & 1) == 1) {
  736. i17 = 1;
  737. } else if ((epsMediaType.mLayout & 2) == 2) {
  738. i17 = 2;
  739. } else if ((epsMediaType.mLayout & 4) == 4) {
  740. i17 = 4;
  741. } else if ((epsMediaType.mLayout & 8) != 8) {
  742. i17 = 2;
  743. }
  744. if ((epsMediaType.mQuality & i7) == i7) {
  745. if (i7 == 0) {
  746. i7 = 2;
  747. }
  748. } else if ((epsMediaType.mQuality & 1) == 1) {
  749. i7 = 1;
  750. } else if ((epsMediaType.mQuality & 2) == 2) {
  751. i7 = 2;
  752. } else {
  753. i7 = (epsMediaType.mQuality & 4) == 4 ? 4 : 2;
  754. }
  755. if (epsMediaType.mDuplex == 0 && i9 != 0) {
  756. i9 = 0;
  757. }
  758. if (((1 << i10) & i) == 0) {
  759. i10 = (i & 1) != 0 ? 0 : (2 & i) != 0 ? 1 : 0;
  760. }
  761. instance.paperSizeValue = i15;
  762. instance.paperTypeValue = i16;
  763. instance.layoutValue = i17;
  764. instance.layoutMultiPageValue = 0;
  765. instance.qualityValue = i7;
  766. instance.paperSourceValue = i3;
  767. instance.duplexValue = i9;
  768. instance.colorValue = i10;
  769. instance.printdate = 0;
  770. instance.saveSettings();
  771. return 0;
  772. }
  773. ExternalFileUtils instance2 = ExternalFileUtils.getInstance (getApplicationContext());
  774. instance2.getSupportedMedia().delete();
  775. instance2.getSavedSupportedMedia().delete();
  776. instance.paperSizeValue = instance.getDefaultPaperSize();
  777. instance.paperTypeValue = instance.getDefaultPaperType();
  778. instance.layoutValue = 2;
  779. instance.layoutMultiPageValue = 0;
  780. instance.qualityValue = 2;
  781. instance.paperSourceValue = 2;
  782. instance.duplexValue = 0;
  783. instance.printdate = 0;
  784. instance.saveSettings();
  785. return -1;
  786. } catch (RemoteException e) {
  787. e.printStackTrace();
  788. return -1;
  789. }
  790. }
  791. public int EpsonConnectCreateJob(int i, String str, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14) {
  792. int i15;
  793. int i16;
  794. int i17 = i;
  795. EPLog.d("EpsonService", "EpsonConnectCreateJob() called.");
  796. mEcClientLib.resetCancel();
  797. epsJobattrib.mMediaSizeIdx = i2;
  798. epsJobattrib.mMediaTypeIdx = i3;
  799. epsJobattrib.mPrintLayout = i4;
  800. epsJobattrib.mPrintQuality = i5;
  801. epsJobattrib.mPaperSource = i6;
  802. if (i7 == 1) {
  803. epsJobattrib.mColorMode = 2;
  804. } else {
  805. epsJobattrib.mColorMode = 1;
  806. }
  807. epsJobattrib.mBrightness = i8;
  808. epsJobattrib.mContrast = i9;
  809. epsJobattrib.mSaturation = i10;
  810. epsJobattrib.mPrintDirection = i11;
  811. epsJobattrib.mDuplex = i12;
  812. int i18 = 0;
  813. int ensureLogin = ensureLogin(false);
  814. if (ensureLogin != 0) {
  815. return ensureLogin;
  816. }
  817. if (i17 == 1) {
  818. String str2 = str;
  819. i18 = (int) new File(str).length();
  820. i16 = i13;
  821. i15 = i14;
  822. } else {
  823. String str3 = str;
  824. i16 = 0;
  825. i15 = 0;
  826. }
  827. try {
  828. String createJobFileName = EcClientLibUtil.getCreateJobFileName(i, str);
  829. try {
  830. ensureLogin = mEcClientLib.CreateJob(i, createJobFileName == null ? i17 != 2 ? "iPrint" : "iPrint Photo" : createJobFileName, i18, epsJobattrib, i16, i15);
  831. mRemotePrintMaxFileSize = mEcClientLib.mEccJobInfo.mMaxFileSize;
  832. return ensureLogin;
  833. } catch (NullPointerException e) {
  834. e.printStackTrace();
  835. return ensureLogin;
  836. }
  837. } catch (Exception e2) {
  838. e2.printStackTrace();
  839. return -1;
  840. }
  841. }
  842. public int EpsonConnectChangePrintSetting() {
  843. EPLog.d("EpsonService", "EpsonConnectChangePrintSetting() called.");
  844. return mEcClientLib.ChangePrintSetting (epsJobattrib, EcClientLibUtil.quoteForJsonString (mailAddress), EcClientLibUtil.quoteForJsonString (accessKey), false);
  845. }
  846. public int EpsonConnectUploadFile(String str, int i) {
  847. EPLog.d("EpsonService", "EpsonConnectUploadFile() called. - " + str);
  848. int ensureLogin = ensureLogin(false);
  849. if (ensureLogin != 0) {
  850. return ensureLogin;
  851. }
  852. return mEcClientLib.UploadFile(str, (int) new File(str).length(), i);
  853. }
  854. public int EpsonConnectStartPrint(int i, int i2) {
  855. EPLog.d("EpsonService", "EpsonConnectStartPrint() called.");
  856. return mEcClientLib.StartPrint(i, i2);
  857. }
  858. public int EpsonConnectEndJob() {
  859. EPLog.d("EpsonService", "EpsonConnectEndJob() called.");
  860. int EndJob = mEcClientLib.EndJob();
  861. mEcClientLib.resetCancel();
  862. return EndJob;
  863. }
  864. public int EpsonConnectCheckSupportedFileType(String str) {
  865. EPLog.d("EpsonService", "EpsonConnectCheckSupportedFileType() called.");
  866. return 0;
  867. }
  868. public int EpsonConnectGetRenderingStatus(int[] iArr) {
  869. int GetRenderingStatus;
  870. synchronized (EpsonService.mConnect) {
  871. iArr[0] = 1;
  872. iArr[1] = 0;
  873. GetRenderingStatus = mEcClientLib.GetRenderingStatus();
  874. if (GetRenderingStatus == 0) {
  875. iArr[0] = mEcClientLib.mRenderStatus;
  876. iArr[1] = mEcClientLib.mCompletePage;
  877. }
  878. }
  879. return GetRenderingStatus;
  880. }
  881. public int EpsonConnectGetPreview(int i, String str) {
  882. int DownloadPreview;
  883. synchronized (EpsonService.mConnect) {
  884. EPLog.d("EpsonService", "EpsonConnectGetPreview() called.");
  885. DownloadPreview = mEcClientLib.DownloadPreview(i, str);
  886. }
  887. return DownloadPreview;
  888. }
  889. public int EpsonConnectGetSupportedMedia(int i, String str, String str2) {
  890. EpsSupportedMedia epsSupportedMedia;
  891. int i2 = i;
  892. String path = ExternalFileUtils.getInstance (getApplicationContext()).getSupportedMedia().getPath();
  893. WiFiDirectManager.setPriorityToSimpleAP(EpsonService.this, false);
  894. if (str == null || str.length() <= 0) {
  895. int ensureLogin = ensureLogin(false);
  896. if (ensureLogin != 0) {
  897. return ensureLogin;
  898. }
  899. } else {
  900. mEpsonConnectlogin = false;
  901. int Login = mEcClientLib.Login(EcClientLibUtil.quoteForJsonString(str), EcClientLibUtil.quoteForJsonString(str2), clientId);
  902. if (Login != 0) {
  903. return Login;
  904. }
  905. }
  906. int GetCapability = mEcClientLib.GetCapability();
  907. if (GetCapability != 0) {
  908. return GetCapability;
  909. }
  910. switch (i2) {
  911. case 1:
  912. epsSupportedMedia = mEcClientLib.mMediaAtRemote;
  913. break;
  914. case 2:
  915. epsSupportedMedia = mEcClientLib.mMediaAtPhoto;
  916. break;
  917. case 3:
  918. epsSupportedMedia = mEcClientLib.mMediaAtLocal;
  919. break;
  920. default:
  921. EPLog.e("EpsonService", "sourceType is invalid.");
  922. return -1;
  923. }
  924. try {
  925. File file = new File(path);
  926. DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(file));
  927. byte[] bArr = new byte[32];
  928. ByteBuffer wrap = ByteBuffer.wrap(bArr);
  929. wrap.order(ByteOrder.LITTLE_ENDIAN);
  930. wrap.clear();
  931. wrap.putInt(epsSupportedMedia.mJpegSizeLimit);
  932. wrap.putInt(r10);
  933. dataOutputStream.write(bArr, 0, wrap.position());
  934. wrap.clear();
  935. for (EpsMediaSize epsMediaSize : epsSupportedMedia.mSizeList) {
  936. wrap.putInt(epsMediaSize.mMediaSizeID);
  937. wrap.putInt(r13);
  938. dataOutputStream.write(bArr, 0, wrap.position());
  939. wrap.clear();
  940. for (EpsMediaType epsMediaType : epsMediaSize.mTypeList) {
  941. wrap.putInt(epsMediaType.mMediaTypeId);
  942. wrap.putInt(epsMediaType.mLayout);
  943. wrap.putInt(epsMediaType.mQuality);
  944. wrap.putInt(epsMediaType.mPaperSource);
  945. wrap.putInt(epsMediaType.mDuplex);
  946. dataOutputStream.write(bArr, 0, wrap.position());
  947. wrap.clear();
  948. }
  949. }
  950. wrap.putInt(epsSupportedMedia.mResolution);
  951. wrap.putInt(1);
  952. dataOutputStream.write(bArr, 0, wrap.position());
  953. wrap.clear();
  954. dataOutputStream.close();
  955. EPLog.i("EpsonService", "finishu output SUPPORTED_MEDIA for EC. filename = " + path + " sourceType = " + i2 + " filesize = " + file.length());
  956. Utils.copyFile(file, new File (getApplicationContext()).getSavedSupportedMedia().getPath()));
  957. return 0;
  958. } catch (IOException e) {
  959. EPLog.e("EpsonService", "get_epsonconnect_supported_media(): IOExceptin.");
  960. e.printStackTrace();
  961. return -1;
  962. }
  963. }
  964. public int ensureLogin(boolean z) {
  965. updateLoginInfo();
  966. if (z) {
  967. mEpsonConnectlogin = false;
  968. }
  969. if (!mEpsonConnectlogin) {
  970. int Login = mEcClientLib.Login (mailAddress), EcClientLibUtil.quoteForJsonString (accessKey), clientId);
  971. if (Login != 0) {
  972. return Login;
  973. }
  974. mEpsonConnectlogin = true;
  975. }
  976. return 0;
  977. }
  978. public int EpsonConnectGetRemotePrintMaxFileSize() {
  979. return mRemotePrintMaxFileSize;
  980. }
  981. public void EpsonConnectCancel() {
  982. mEcClientLib.cancel();
  983. }
  984. public void refreshRemotePrinterLogin() {
  985. updateLoginInfo();
  986. }
  987. };
  988. private int mCreatetSheetIndex = 0;
  989. volatile EPImageCreator mEPImageCreator;
  990. private final EscprLib mEscprLib = EscprLib.getInstance();
  991. Handler mHandler = new Handler(new Handler.Callback() {
  992. public boolean handleMessage(Message message) {
  993. int i = message.what;
  994. if (i != 30) {
  995. switch (i) {
  996. case 0:
  997. epsNotifyDataChange((String) message.obj);
  998. return true;
  999. case 1:
  1000. epsNotifyContinueable(message.arg1);
  1001. return true;
  1002. case 2:
  1003. epsNotifyError(message.arg1, message.arg2, ((Boolean) message.obj).booleanValue());
  1004. return true;
  1005. default:
  1006. return true;
  1007. }
  1008. } else {
  1009. epsNotifyPage(message.arg1);
  1010. return true;
  1011. }
  1012. }
  1013. });
  1014. private LocalPrintThread mLocalPrintThread;
  1015. private volatile int mSearchCount = 0;
  1016. private String mailAddress = "";
  1017. private Thread printingThread = null;
  1018. private int probeMethod;
  1019. private SearchingThread searchingPrinter = null;
  1020. private int timeout_sec = -1;
  1021. static /* synthetic */ int access$504(EpsonService epsonService) {
  1022. int i = epsonService.mSearchCount + 1;
  1023. epsonService.mSearchCount = i;
  1024. return i;
  1025. }
  1026. static /* synthetic */ int access$506(EpsonService epsonService) {
  1027. int i = epsonService.mSearchCount - 1;
  1028. epsonService.mSearchCount = i;
  1029. return i;
  1030. }
  1031. public void javaDebugCB() {
  1032. System.out.println(debugString);
  1033. debugString = "";
  1034. }
  1035. public void epsNotifyPage(int i) {
  1036. EPLog.m304d(" Д percent = " + i);
  1037. synchronized (mLock) {
  1038. int beginBroadcast = mCallbacks.beginBroadcast();
  1039. for (int i2 = 0; i2 < beginBroadcast; i2++) {
  1040. try {
  1041. mCallbacks.getBroadcastItem(i2).onNotifyProgress(1, i);
  1042. } catch (RemoteException e) {
  1043. EPLog.e("Epson", e.toString());
  1044. }
  1045. }
  1046. mCallbacks.finishBroadcast();
  1047. }
  1048. }
  1049. public void epsNotifyDataChange(String str) {
  1050. String str2;
  1051. EPLog.d(" ***************** epsNotifyDataChange() call: " + str);
  1052. String str3 = "";
  1053. String str4 = "";
  1054. String[] split = str.split("\\|\\|");
  1055. synchronized (mLockSearchingStatus) {
  1056. if (!bNotifyPrinter) {
  1057. bNotifyPrinter = true;
  1058. }
  1059. }
  1060. synchronized (mLock) {
  1061. String str5 = "";
  1062. if (split.length >= 5) {
  1063. str = split[0];
  1064. str3 = split[1];
  1065. str4 = split[2];
  1066. if (split[3] != null) {
  1067. str5 = split[3];
  1068. }
  1069. str2 = split[4] != null ? split[4] : "";
  1070. } else if (split.length == 4) {
  1071. str = split[0];
  1072. str3 = split[1];
  1073. str4 = split[2];
  1074. if (split[3] != null) {
  1075. str5 = split[3];
  1076. str2 = "";
  1077. } else {
  1078. str2 = "";
  1079. }
  1080. } else if (split.length == 3) {
  1081. str = split[0];
  1082. str3 = split[1];
  1083. str4 = split[2];
  1084. str2 = "";
  1085. } else {
  1086. str2 = "";
  1087. }
  1088. int beginBroadcast = mCallbacks.beginBroadcast();
  1089. for (int i = 0; i < beginBroadcast; i++) {
  1090. try {
  1091. mCallbacks.getBroadcastItem(i).onFindPrinterResult(str, str3, str4, str5, str2);
  1092. } catch (RemoteException e) {
  1093. EPLog.e("Epson", e.toString());
  1094. }
  1095. }
  1096. mCallbacks.finishBroadcast();
  1097. }
  1098. }
  1099. private void updateLoginInfo() {
  1100. clearRemotePrinterInfo();
  1101. clientId = SharedPreferencesProvider.getInstace(this).getString(epson.common.Constants.PRINTER_CLIENT_ID, (String) null);
  1102. EPLog.d("▲clientId = " + clientId);
  1103. MyPrinter curPrinter = MyPrinter.getCurPrinter(this);
  1104. mailAddress = curPrinter.getEmailAddress();
  1105. accessKey = curPrinter.getRemotePrinterAccessKey(this);
  1106. }
  1107. private void clearRemotePrinterInfo() {
  1108. StorageSecureStore.invalidateCache();
  1109. new EPPrinterManager(getApplicationContext()).rollbackRemotePrinterInfo();
  1110. }
  1111. private synchronized void createSearchingThread() {
  1112. EPLog.e("Epson", "createSearchingThread() call");
  1113. searchingPrinter = new SearchingThread();
  1114. }
  1115. class SearchingThread extends Thread {
  1116. private volatile boolean mExecuting_search_printer = false;
  1117. SearchingThread() {
  1118. }
  1119. /* JADX WARNING: Code restructure failed: missing block: B:51:?, code lost:
  1120. sleep(1000);
  1121. epson.print.Util.EPLog.e("EpsonService", "sleep some second to waiting printing thread");
  1122. */
  1123. /* JADX WARNING: Code restructure failed: missing block: B:52:0x00fd, code lost:
  1124. r2 = move-exception;
  1125. */
  1126. /* JADX WARNING: Code restructure failed: missing block: B:53:0x00fe, code lost:
  1127. r2.printStackTrace();
  1128. r2 = true;
  1129. */
  1130. /* Code decompiled incorrectly, please refer to instructions dump. */
  1131. public void run() {
  1132. /*
  1133. r7 = this;
  1134. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this
  1135. r1 = 0
  1136. boolean unused = r0.bEnd = r1
  1137. r0 = 1
  1138. r2 = 0
  1139. L_0x0008:
  1140. boolean r3 = interrupted()
  1141. if (r3 == 0) goto L_0x0017
  1142. java.lang.String r2 = "EpsonService"
  1143. java.lang.String r3 = "user cancel searching printer"
  1144. epson.print.Util.EPLog.e((java.lang.String) r2, (java.lang.String) r3)
  1145. r2 = 1
  1146. goto L_0x0025
  1147. L_0x0017:
  1148. java.lang.Object r3 = epson.print.service.EpsonService.mLockPrintingStatus
  1149. monitor-enter(r3)
  1150. epson.print.service.EpsonService r4 = epson.print.service.EpsonService.this // Catch:{ all -> 0x0104 }
  1151. boolean r4 = r4.bPrinting // Catch:{ all -> 0x0104 }
  1152. if (r4 != 0) goto L_0x00ee
  1153. monitor-exit(r3) // Catch:{ all -> 0x0104 }
  1154. L_0x0025:
  1155. if (r2 == 0) goto L_0x0034
  1156. java.lang.String r0 = "EpsonService"
  1157. java.lang.String r1 = "bCancel = true"
  1158. epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
  1159. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this
  1160. epson.print.service.EpsonService.access$506(r0)
  1161. return
  1162. L_0x0034:
  1163. java.lang.Object r2 = epson.print.service.EpsonService.mLockSearchingStatus
  1164. monitor-enter(r2)
  1165. epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this // Catch:{ all -> 0x00eb }
  1166. boolean unused = r3.bSearching = r0 // Catch:{ all -> 0x00eb }
  1167. r7.mExecuting_search_printer = r0 // Catch:{ all -> 0x00eb }
  1168. monitor-exit(r2) // Catch:{ all -> 0x00eb }
  1169. java.lang.String r2 = "EpsonService"
  1170. java.lang.String r3 = "begin search printer"
  1171. epson.print.Util.EPLog.e((java.lang.String) r2, (java.lang.String) r3)
  1172. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1173. int r2 = r2.timeout_sec
  1174. r3 = -1
  1175. r4 = 60
  1176. if (r2 <= r3) goto L_0x005a
  1177. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1178. int r4 = r2.timeout_sec
  1179. goto L_0x0070
  1180. L_0x005a:
  1181. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1182. int r2 = r2.probeMethod
  1183. r3 = 2
  1184. if (r2 == r3) goto L_0x006a
  1185. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1186. java.lang.String r2 = r2.f406id
  1187. goto L_0x0070
  1188. L_0x006a:
  1189. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1190. java.lang.String r2 = r2.f407ip
  1191. L_0x0070:
  1192. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1193. com.epson.mobilephone.common.wifidirect.WiFiDirectManager.setPriorityToSimpleAP(r2, r0)
  1194. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1195. com.epson.mobilephone.common.escpr.EscprLib r2 = r2.mEscprLib
  1196. epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this
  1197. android.os.Handler r3 = r3.mHandler
  1198. r2.setHanlder(r3)
  1199. java.lang.StringBuilder r2 = new java.lang.StringBuilder
  1200. r2.<init>()
  1201. java.lang.String r3 = "SearchingThread : search_printer2 ☆☆ timeout = "
  1202. r2.append(r3)
  1203. r2.append(r4)
  1204. java.lang.String r2 = r2.toString()
  1205. com.epson.mobilephone.common.EPLog.d(r2)
  1206. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1207. com.epson.mobilephone.common.escpr.EscprLib r2 = r2.mEscprLib
  1208. epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this
  1209. java.lang.String r3 = r3.f406id
  1210. epson.print.service.EpsonService r5 = epson.print.service.EpsonService.this
  1211. java.lang.String r5 = r5.f407ip
  1212. epson.print.service.EpsonService r6 = epson.print.service.EpsonService.this
  1213. int r6 = r6.probeMethod
  1214. int r2 = r2.search_printer2(r3, r5, r6, r4)
  1215. if (r2 != 0) goto L_0x00cc
  1216. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1217. java.lang.String r2 = r2.f406id
  1218. if (r2 == 0) goto L_0x00cc
  1219. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1220. java.lang.String r2 = r2.f406id
  1221. int r2 = r2.length()
  1222. if (r2 <= 0) goto L_0x00cc
  1223. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
  1224. r2.bSetPrinter = r0
  1225. L_0x00cc:
  1226. java.lang.Object r0 = epson.print.service.EpsonService.mLockSearchingStatus
  1227. monitor-enter(r0)
  1228. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ all -> 0x00e8 }
  1229. boolean unused = r2.bSearching = r1 // Catch:{ all -> 0x00e8 }
  1230. epson.print.service.EpsonService.bNotifyPrinter = r1 // Catch:{ all -> 0x00e8 }
  1231. r7.mExecuting_search_printer = r1 // Catch:{ all -> 0x00e8 }
  1232. monitor-exit(r0) // Catch:{ all -> 0x00e8 }
  1233. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this
  1234. epson.print.service.EpsonService.access$506(r0)
  1235. java.lang.String r0 = "Epson"
  1236. java.lang.String r1 = "search printer finish"
  1237. epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
  1238. return
  1239. L_0x00e8:
  1240. r1 = move-exception
  1241. monitor-exit(r0) // Catch:{ all -> 0x00e8 }
  1242. throw r1
  1243. L_0x00eb:
  1244. r0 = move-exception
  1245. monitor-exit(r2) // Catch:{ all -> 0x00eb }
  1246. throw r0
  1247. L_0x00ee:
  1248. monitor-exit(r3) // Catch:{ all -> 0x0104 }
  1249. r3 = 1000(0x3e8, double:4.94E-321)
  1250. sleep(r3) // Catch:{ InterruptedException -> 0x00fd }
  1251. java.lang.String r3 = "EpsonService"
  1252. java.lang.String r4 = "sleep some second to waiting printing thread"
  1253. epson.print.Util.EPLog.e((java.lang.String) r3, (java.lang.String) r4) // Catch:{ InterruptedException -> 0x00fd }
  1254. goto L_0x0008
  1255. L_0x00fd:
  1256. r2 = move-exception
  1257. r2.printStackTrace()
  1258. r2 = 1
  1259. goto L_0x0008
  1260. L_0x0104:
  1261. r0 = move-exception
  1262. monitor-exit(r3) // Catch:{ all -> 0x0104 }
  1263. throw r0
  1264. */
  1265. throw new UnsupportedOperationException("Method not decompiled: epson.print.service.EpsonService.SearchingThread.run():void");
  1266. }
  1267. public void interrupt() {
  1268. if (mExecuting_search_printer && mEscprLib.cancel_search_printer() == -1305) {
  1269. mExecuting_search_printer = false;
  1270. boolean unused = bEnd = true;
  1271. }
  1272. super.interrupt();
  1273. synchronized (EpsonService.mLockSearchingStatus) {
  1274. boolean unused2 = bSearching = false;
  1275. }
  1276. }
  1277. }
  1278. public boolean updateApfProgress(int i) {
  1279. if (bCancelPrinting) {
  1280. return false;
  1281. }
  1282. notifyProgress(2, i);
  1283. return true;
  1284. }
  1285. private void stopSearchingThread() throws RemoteException {
  1286. if (searchingPrinter != null) {
  1287. mBinder.cancelSearchPrinter();
  1288. }
  1289. }
  1290. private void startLocalNonPdfPrintThread(PrintSetting.Kind kind, EPImageList ePImageList, boolean z) {
  1291. mLocalPrintThread = new LocalPrintThread(this, new LegacyRenderingController(this, ePImageList, kind), z);
  1292. mLocalPrintThread.start();
  1293. }
  1294. private void startPdfPrintThread(String str, String str2, String str3, boolean z, int i, int i2, boolean z2) {
  1295. mLocalPrintThread = new LocalPrintThread(this, new PdfRenderingController(this, str, str2, str3, z, new int[]{i, i2}), z2);
  1296. mLocalPrintThread.start();
  1297. }
  1298. private synchronized int createECPrintingThread(final PrintSetting.Kind kind, final EPImageList ePImageList) {
  1299. printingThread = new Thread() {
  1300. /* JADX ERROR: IndexOutOfBoundsException in pass: RegionMakerVisitor
  1301. java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  1302. at java.util.ArrayList.rangeCheck(ArrayList.java:657)
  1303. at java.util.ArrayList.get(ArrayList.java:433)
  1304. at jadx.core.dex.nodes.InsnNode.getArg(InsnNode.java:101)
  1305. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:611)
  1306. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1307. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1308. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1309. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1310. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1311. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1312. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  1313. at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:561)
  1314. at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133)
  1315. at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
  1316. at jadx.core.dex.visitors.regions.RegionMaker.processExcHandler(RegionMaker.java:1043)
  1317. at jadx.core.dex.visitors.regions.RegionMaker.processTryCatchBlocks(RegionMaker.java:975)
  1318. at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:52)
  1319. */
  1320. public void run() {
  1321. /*
  1322. r29 = this;
  1323. r7 = r29
  1324. java.lang.Object r8 = epson.print.service.EpsonService.mPrinting
  1325. monitor-enter(r8)
  1326. java.lang.String r0 = "EpsonService"
  1327. java.lang.String r1 = "createECPrintingThread() called."
  1328. com.epson.mobilephone.common.EPLog.d(r0, r1) // Catch:{ all -> 0x040b }
  1329. epson.print.screen.PrintSetting r0 = new epson.print.screen.PrintSetting // Catch:{ all -> 0x040b }
  1330. epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
  1331. epson.print.screen.PrintSetting$Kind r2 = r2 // Catch:{ all -> 0x040b }
  1332. r0.<init>(r1, r2) // Catch:{ all -> 0x040b }
  1333. r0.loadSettings() // Catch:{ all -> 0x040b }
  1334. int r6 = r0.paperSizeValue // Catch:{ all -> 0x040b }
  1335. int r13 = r0.paperTypeValue // Catch:{ all -> 0x040b }
  1336. int r5 = r0.layoutValue // Catch:{ all -> 0x040b }
  1337. int r4 = r0.qualityValue // Catch:{ all -> 0x040b }
  1338. int r1 = r0.paperSourceValue // Catch:{ all -> 0x040b }
  1339. int r3 = r0.colorValue // Catch:{ all -> 0x040b }
  1340. int r2 = r0.copiesValue // Catch:{ all -> 0x040b }
  1341. int r15 = r0.brightnessValue // Catch:{ all -> 0x040b }
  1342. int r14 = r0.contrastValue // Catch:{ all -> 0x040b }
  1343. int r12 = r0.saturationValue // Catch:{ all -> 0x040b }
  1344. int r11 = r0.duplexValue // Catch:{ all -> 0x040b }
  1345. int r10 = r0.feedDirectionValue // Catch:{ all -> 0x040b }
  1346. r25 = 0
  1347. epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
  1348. r26 = r3
  1349. r3 = 1
  1350. boolean unused = r9.bPrinting = r3 // Catch:{ all -> 0x040b }
  1351. r9 = 0
  1352. boolean unused = epson.print.service.EpsonService.bCancelPrinting = r9 // Catch:{ all -> 0x040b }
  1353. epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
  1354. epson.provider.SharedPreferencesProvider$SharedPreferencesMulti r3 = epson.provider.SharedPreferencesProvider.getInstace(r3) // Catch:{ all -> 0x040b }
  1355. java.lang.String r9 = "SOURCE_TYPE"
  1356. r17 = r10
  1357. r10 = 2
  1358. int r3 = r3.getInt(r9, r10) // Catch:{ all -> 0x040b }
  1359. epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1360. r10 = 0
  1361. com.epson.mobilephone.common.wifidirect.WiFiDirectManager.setPriorityToSimpleAP(r9, r10) // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1362. epson.print.EPImageList r9 = r3 // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1363. epson.print.EPImage r9 = r9.get(r10) // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1364. r10 = 3
  1365. r20 = r1
  1366. r1 = 2
  1367. if (r3 == r1) goto L_0x010b
  1368. if (r3 != r10) goto L_0x0065
  1369. goto L_0x010b
  1370. L_0x0065:
  1371. r1 = 1
  1372. if (r3 != r1) goto L_0x0103
  1373. epson.print.EPImageList r4 = r3 // Catch:{ Exception -> 0x0100, all -> 0x00fd }
  1374. r5 = 0
  1375. r4.get(r5) // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1376. epson.print.service.EpsonService r4 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1377. r4.epsNotifyPage(r5) // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1378. boolean r4 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1379. if (r4 == r1) goto L_0x00f7
  1380. epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1381. epson.print.ecclient.EpsJobAttrib r1 = r1.epsJobattrib // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1382. r1.mCopies = r2 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1383. epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1384. epson.print.service.IEpsonService$Stub r1 = r1.mBinder // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1385. int r9 = r1.EpsonConnectChangePrintSetting() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1386. if (r9 != 0) goto L_0x00f1
  1387. epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1388. r2 = 50
  1389. r1.epsNotifyPage(r2) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1390. boolean r1 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1391. r2 = 1
  1392. if (r1 == r2) goto L_0x00e2
  1393. int r1 = r0.startValue // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1394. int r2 = r0.endValue // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1395. epson.print.service.EpsonService r4 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1396. java.lang.String r6 = "PREFS_EPSON_CONNECT"
  1397. epson.provider.SharedPreferencesProvider$SharedPreferencesMulti r4 = epson.provider.SharedPreferencesProvider.getInstace(r4, r6) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1398. java.lang.String r6 = "ENABLE_SHOW_PREVIEW"
  1399. r10 = 1
  1400. boolean r4 = r4.getBoolean(r6, r10) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1401. boolean r0 = r0.printAll // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1402. if (r4 == 0) goto L_0x00b4
  1403. if (r0 != r10) goto L_0x00b6
  1404. L_0x00b4:
  1405. r1 = 0
  1406. r2 = 0
  1407. L_0x00b6:
  1408. boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1409. if (r0 == r10) goto L_0x00dc
  1410. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1411. epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1412. int r9 = r0.EpsonConnectStartPrint(r1, r2) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1413. if (r9 != 0) goto L_0x00d6
  1414. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1415. r1 = 100
  1416. r0.epsNotifyPage(r1) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1417. r28 = r3
  1418. r1 = r9
  1419. r9 = 1
  1420. r15 = 1
  1421. goto L_0x02be
  1422. L_0x00d6:
  1423. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1424. r0.<init>() // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1425. throw r0 // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1426. L_0x00dc:
  1427. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1428. r0.<init>() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1429. throw r0 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1430. L_0x00e2:
  1431. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1432. r0.<init>() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1433. throw r0 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1434. L_0x00e8:
  1435. r0 = move-exception
  1436. r1 = r0
  1437. r2 = r3
  1438. r3 = 1
  1439. goto L_0x011b
  1440. L_0x00ed:
  1441. r0 = move-exception
  1442. r2 = r3
  1443. r3 = 1
  1444. goto L_0x0122
  1445. L_0x00f1:
  1446. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1447. r0.<init>() // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1448. throw r0 // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
  1449. L_0x00f7:
  1450. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1451. r0.<init>() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1452. throw r0 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1453. L_0x00fd:
  1454. r0 = move-exception
  1455. r5 = 0
  1456. goto L_0x0117
  1457. L_0x0100:
  1458. r0 = move-exception
  1459. r5 = 0
  1460. goto L_0x011f
  1461. L_0x0103:
  1462. r5 = 0
  1463. r28 = r3
  1464. r1 = 0
  1465. r9 = 1
  1466. r15 = 1
  1467. goto L_0x02be
  1468. L_0x010b:
  1469. r1 = 100
  1470. r16 = 0
  1471. java.lang.String r0 = r9.loadImageFileName // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1472. if (r3 != r10) goto L_0x0125
  1473. java.lang.String r0 = r9.webUrl // Catch:{ Exception -> 0x011e, all -> 0x0116 }
  1474. goto L_0x0125
  1475. L_0x0116:
  1476. r0 = move-exception
  1477. L_0x0117:
  1478. r1 = r0
  1479. r2 = r3
  1480. r3 = 1
  1481. r9 = 0
  1482. L_0x011b:
  1483. r15 = 1
  1484. goto L_0x03da
  1485. L_0x011e:
  1486. r0 = move-exception
  1487. L_0x011f:
  1488. r2 = r3
  1489. r3 = 1
  1490. r9 = 0
  1491. L_0x0122:
  1492. r15 = 1
  1493. goto L_0x0373
  1494. L_0x0125:
  1495. epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1496. epson.print.service.IEpsonService$Stub r9 = r9.mBinder // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1497. r23 = 0
  1498. r24 = 0
  1499. r10 = 0
  1500. r27 = r2
  1501. r21 = r17
  1502. r2 = 0
  1503. r10 = r3
  1504. r22 = r11
  1505. r11 = r0
  1506. r0 = r12
  1507. r12 = r6
  1508. r19 = r14
  1509. r14 = r5
  1510. r18 = r15
  1511. r15 = r4
  1512. r16 = r20
  1513. r17 = r26
  1514. r20 = r0
  1515. int r19 = r9.EpsonConnectCreateJob(r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24) // Catch:{ Exception -> 0x036e, all -> 0x0366 }
  1516. if (r19 != 0) goto L_0x035a
  1517. boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0353, all -> 0x034a }
  1518. r9 = 1
  1519. if (r0 == r9) goto L_0x033e
  1520. epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0353, all -> 0x034a }
  1521. epson.print.EPImageList r10 = r3 // Catch:{ Exception -> 0x0353, all -> 0x034a }
  1522. r11 = 0
  1523. r14 = 0
  1524. r16 = 0
  1525. r18 = 0
  1526. r12 = r6
  1527. r13 = r26
  1528. r15 = r5
  1529. r17 = r4
  1530. r9.createPrintImage(r10, r11, r12, r13, r14, r15, r16, r17, r18) // Catch:{ Exception -> 0x0353, all -> 0x034a }
  1531. r9 = 0
  1532. L_0x0168:
  1533. epson.print.EPImageList r0 = r3 // Catch:{ Exception -> 0x0337, all -> 0x032e }
  1534. int r0 = r0.size() // Catch:{ Exception -> 0x0337, all -> 0x032e }
  1535. if (r9 >= r0) goto L_0x0292
  1536. epson.print.EPImageList r0 = r3 // Catch:{ Exception -> 0x028d, all -> 0x0287 }
  1537. epson.print.EPImage r0 = r0.get(r9) // Catch:{ Exception -> 0x028d, all -> 0x0287 }
  1538. epson.print.service.EpsonService r10 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0281, all -> 0x027a }
  1539. r10.epsNotifyPage(r2) // Catch:{ Exception -> 0x0281, all -> 0x027a }
  1540. boolean r10 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0281, all -> 0x027a }
  1541. r11 = 1
  1542. if (r10 == r11) goto L_0x0264
  1543. epson.print.service.EpsonService r10 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0281, all -> 0x027a }
  1544. int r12 = r9 + 1
  1545. int unused = r10.mCreatetSheetIndex = r12 // Catch:{ Exception -> 0x0281, all -> 0x027a }
  1546. epson.print.service.EpsonService$3$1 r10 = new epson.print.service.EpsonService$3$1 // Catch:{ Exception -> 0x0281, all -> 0x027a }
  1547. r13 = 100
  1548. r1 = r10
  1549. r14 = r27
  1550. r15 = 0
  1551. r2 = r29
  1552. r28 = r3
  1553. r11 = r26
  1554. r15 = 1
  1555. r3 = r6
  1556. r17 = r4
  1557. r4 = r11
  1558. r18 = r5
  1559. r19 = r6
  1560. r6 = r17
  1561. r1.<init>(r3, r4, r5, r6) // Catch:{ Exception -> 0x0274, all -> 0x026d }
  1562. epson.print.EPImageList r1 = r3 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1563. int r1 = r1.size() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1564. if (r12 >= r1) goto L_0x01b0
  1565. r10.start() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1566. L_0x01b0:
  1567. epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1568. r2 = 25
  1569. r1.epsNotifyPage(r2) // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1570. epson.print.EPImageCreator r1 = new epson.print.EPImageCreator // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1571. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1572. android.content.Context r2 = r2.getApplicationContext() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1573. r1.<init>(r2) // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1574. int r1 = r1.createJpegImage(r0, r13) // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1575. if (r1 != 0) goto L_0x023c
  1576. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1577. r3 = 50
  1578. r2.epsNotifyPage(r3) // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1579. boolean r2 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1580. if (r2 == r15) goto L_0x0226
  1581. epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1582. epson.print.service.IEpsonService$Stub r2 = r2.mBinder // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1583. java.lang.String r0 = r0.decodeImageFileName // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1584. int r1 = r2.EpsonConnectUploadFile(r0, r12) // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1585. if (r1 != 0) goto L_0x0220
  1586. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1587. r2 = 75
  1588. r0.epsNotifyPage(r2) // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1589. boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1590. if (r0 == r15) goto L_0x021a
  1591. r10.join() // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1592. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1593. r0.epsNotifyPage(r13) // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1594. boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1595. if (r0 == r15) goto L_0x0214
  1596. r25 = r10
  1597. r26 = r11
  1598. r9 = r12
  1599. r27 = r14
  1600. r4 = r17
  1601. r5 = r18
  1602. r6 = r19
  1603. r3 = r28
  1604. r2 = 0
  1605. r19 = r1
  1606. r1 = 100
  1607. goto L_0x0168
  1608. L_0x0214:
  1609. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1610. r0.<init>() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1611. throw r0 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1612. L_0x021a:
  1613. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1614. r0.<init>() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1615. throw r0 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1616. L_0x0220:
  1617. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1618. r0.<init>() // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1619. throw r0 // Catch:{ Exception -> 0x0234, all -> 0x022c }
  1620. L_0x0226:
  1621. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1622. r0.<init>() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1623. throw r0 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
  1624. L_0x022c:
  1625. r0 = move-exception
  1626. r3 = r9
  1627. r25 = r10
  1628. r2 = r28
  1629. goto L_0x0310
  1630. L_0x0234:
  1631. r0 = move-exception
  1632. r3 = r9
  1633. r25 = r10
  1634. r2 = r28
  1635. goto L_0x0317
  1636. L_0x023c:
  1637. r1 = -1200(0xfffffffffffffb50, float:NaN)
  1638. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x024f, all -> 0x0244 }
  1639. r0.<init>() // Catch:{ Exception -> 0x024f, all -> 0x0244 }
  1640. throw r0 // Catch:{ Exception -> 0x024f, all -> 0x0244 }
  1641. L_0x0244:
  1642. r0 = move-exception
  1643. r1 = r0
  1644. r3 = r9
  1645. r25 = r10
  1646. r2 = r28
  1647. r9 = -1200(0xfffffffffffffb50, float:NaN)
  1648. goto L_0x03da
  1649. L_0x024f:
  1650. r0 = move-exception
  1651. r3 = r9
  1652. r25 = r10
  1653. r2 = r28
  1654. r9 = -1200(0xfffffffffffffb50, float:NaN)
  1655. goto L_0x0373
  1656. L_0x0259:
  1657. r0 = move-exception
  1658. r1 = r0
  1659. r3 = r9
  1660. r25 = r10
  1661. goto L_0x0270
  1662. L_0x025f:
  1663. r0 = move-exception
  1664. r3 = r9
  1665. r25 = r10
  1666. goto L_0x0276
  1667. L_0x0264:
  1668. r28 = r3
  1669. r15 = 1
  1670. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0274, all -> 0x026d }
  1671. r0.<init>() // Catch:{ Exception -> 0x0274, all -> 0x026d }
  1672. throw r0 // Catch:{ Exception -> 0x0274, all -> 0x026d }
  1673. L_0x026d:
  1674. r0 = move-exception
  1675. r1 = r0
  1676. r3 = r9
  1677. L_0x0270:
  1678. r2 = r28
  1679. goto L_0x036b
  1680. L_0x0274:
  1681. r0 = move-exception
  1682. r3 = r9
  1683. L_0x0276:
  1684. r2 = r28
  1685. goto L_0x0372
  1686. L_0x027a:
  1687. r0 = move-exception
  1688. r15 = 1
  1689. r1 = r0
  1690. r2 = r3
  1691. L_0x027e:
  1692. r3 = r9
  1693. goto L_0x036b
  1694. L_0x0281:
  1695. r0 = move-exception
  1696. r15 = 1
  1697. r2 = r3
  1698. L_0x0284:
  1699. r3 = r9
  1700. goto L_0x0372
  1701. L_0x0287:
  1702. r0 = move-exception
  1703. r15 = 1
  1704. r1 = r0
  1705. r2 = r3
  1706. goto L_0x0332
  1707. L_0x028d:
  1708. r0 = move-exception
  1709. r15 = 1
  1710. r2 = r3
  1711. goto L_0x033a
  1712. L_0x0292:
  1713. r28 = r3
  1714. r14 = r27
  1715. r15 = 1
  1716. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x032a, all -> 0x0326 }
  1717. epson.print.ecclient.EpsJobAttrib r0 = r0.epsJobattrib // Catch:{ Exception -> 0x032a, all -> 0x0326 }
  1718. r0.mCopies = r14 // Catch:{ Exception -> 0x032a, all -> 0x0326 }
  1719. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x032a, all -> 0x0326 }
  1720. epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x032a, all -> 0x0326 }
  1721. int r1 = r0.EpsonConnectChangePrintSetting() // Catch:{ Exception -> 0x032a, all -> 0x0326 }
  1722. if (r1 != 0) goto L_0x031a
  1723. boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0313, all -> 0x030c }
  1724. if (r0 == r15) goto L_0x02fd
  1725. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0313, all -> 0x030c }
  1726. epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x0313, all -> 0x030c }
  1727. r2 = 0
  1728. int r1 = r0.EpsonConnectStartPrint(r2, r2) // Catch:{ Exception -> 0x0313, all -> 0x030c }
  1729. if (r1 != 0) goto L_0x02f5
  1730. L_0x02be:
  1731. if (r25 == 0) goto L_0x02c6
  1732. r25.join() // Catch:{ Exception -> 0x02d4 }
  1733. r2 = r28
  1734. goto L_0x02c8
  1735. L_0x02c6:
  1736. r2 = r28
  1737. L_0x02c8:
  1738. if (r2 == r15) goto L_0x02d6
  1739. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x02d4 }
  1740. epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x02d4 }
  1741. r0.EpsonConnectEndJob() // Catch:{ Exception -> 0x02d4 }
  1742. goto L_0x02d6
  1743. L_0x02d4:
  1744. r0 = move-exception
  1745. goto L_0x02e7
  1746. L_0x02d6:
  1747. if (r2 != r15) goto L_0x02de
  1748. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x02d4 }
  1749. com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r15) // Catch:{ Exception -> 0x02d4 }
  1750. goto L_0x02e3
  1751. L_0x02de:
  1752. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x02d4 }
  1753. com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r9) // Catch:{ Exception -> 0x02d4 }
  1754. L_0x02e3:
  1755. epson.print.service.EpsonService.onNotifyEndJob(r1) // Catch:{ Exception -> 0x02d4 }
  1756. goto L_0x02ea
  1757. L_0x02e7:
  1758. r0.printStackTrace() // Catch:{ all -> 0x040b }
  1759. L_0x02ea:
  1760. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
  1761. r1 = 0
  1762. boolean unused = r0.bPrinting = r1 // Catch:{ all -> 0x040b }
  1763. L_0x02f0:
  1764. boolean unused = epson.print.service.EpsonService.bCancelPrinting = r1 // Catch:{ all -> 0x040b }
  1765. goto L_0x03d3
  1766. L_0x02f5:
  1767. r2 = r28
  1768. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0324, all -> 0x0322 }
  1769. r0.<init>() // Catch:{ Exception -> 0x0324, all -> 0x0322 }
  1770. throw r0 // Catch:{ Exception -> 0x0324, all -> 0x0322 }
  1771. L_0x02fd:
  1772. r2 = r28
  1773. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0309, all -> 0x0305 }
  1774. r0.<init>() // Catch:{ Exception -> 0x0309, all -> 0x0305 }
  1775. throw r0 // Catch:{ Exception -> 0x0309, all -> 0x0305 }
  1776. L_0x0305:
  1777. r0 = move-exception
  1778. r1 = r0
  1779. goto L_0x027e
  1780. L_0x0309:
  1781. r0 = move-exception
  1782. goto L_0x0284
  1783. L_0x030c:
  1784. r0 = move-exception
  1785. r2 = r28
  1786. L_0x030f:
  1787. r3 = r9
  1788. L_0x0310:
  1789. r9 = r1
  1790. goto L_0x03d9
  1791. L_0x0313:
  1792. r0 = move-exception
  1793. r2 = r28
  1794. L_0x0316:
  1795. r3 = r9
  1796. L_0x0317:
  1797. r9 = r1
  1798. goto L_0x0373
  1799. L_0x031a:
  1800. r2 = r28
  1801. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0324, all -> 0x0322 }
  1802. r0.<init>() // Catch:{ Exception -> 0x0324, all -> 0x0322 }
  1803. throw r0 // Catch:{ Exception -> 0x0324, all -> 0x0322 }
  1804. L_0x0322:
  1805. r0 = move-exception
  1806. goto L_0x030f
  1807. L_0x0324:
  1808. r0 = move-exception
  1809. goto L_0x0316
  1810. L_0x0326:
  1811. r0 = move-exception
  1812. r2 = r28
  1813. goto L_0x0331
  1814. L_0x032a:
  1815. r0 = move-exception
  1816. r2 = r28
  1817. goto L_0x033a
  1818. L_0x032e:
  1819. r0 = move-exception
  1820. r2 = r3
  1821. r15 = 1
  1822. L_0x0331:
  1823. r1 = r0
  1824. L_0x0332:
  1825. r3 = r9
  1826. r9 = r19
  1827. goto L_0x03da
  1828. L_0x0337:
  1829. r0 = move-exception
  1830. r2 = r3
  1831. r15 = 1
  1832. L_0x033a:
  1833. r3 = r9
  1834. r9 = r19
  1835. goto L_0x0373
  1836. L_0x033e:
  1837. r2 = r3
  1838. r15 = 1
  1839. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0348, all -> 0x0346 }
  1840. r0.<init>() // Catch:{ Exception -> 0x0348, all -> 0x0346 }
  1841. throw r0 // Catch:{ Exception -> 0x0348, all -> 0x0346 }
  1842. L_0x0346:
  1843. r0 = move-exception
  1844. goto L_0x0369
  1845. L_0x0348:
  1846. r0 = move-exception
  1847. goto L_0x0371
  1848. L_0x034a:
  1849. r0 = move-exception
  1850. r2 = r3
  1851. r15 = 1
  1852. L_0x034d:
  1853. r1 = r0
  1854. r9 = r19
  1855. r3 = 1
  1856. goto L_0x03da
  1857. L_0x0353:
  1858. r0 = move-exception
  1859. r2 = r3
  1860. r15 = 1
  1861. L_0x0356:
  1862. r9 = r19
  1863. r3 = 1
  1864. goto L_0x0373
  1865. L_0x035a:
  1866. r2 = r3
  1867. r15 = 1
  1868. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0364, all -> 0x0362 }
  1869. r0.<init>() // Catch:{ Exception -> 0x0364, all -> 0x0362 }
  1870. throw r0 // Catch:{ Exception -> 0x0364, all -> 0x0362 }
  1871. L_0x0362:
  1872. r0 = move-exception
  1873. goto L_0x034d
  1874. L_0x0364:
  1875. r0 = move-exception
  1876. goto L_0x0356
  1877. L_0x0366:
  1878. r0 = move-exception
  1879. r2 = r3
  1880. r15 = 1
  1881. L_0x0369:
  1882. r1 = r0
  1883. r3 = 1
  1884. L_0x036b:
  1885. r9 = 0
  1886. goto L_0x03da
  1887. L_0x036e:
  1888. r0 = move-exception
  1889. r2 = r3
  1890. r15 = 1
  1891. L_0x0371:
  1892. r3 = 1
  1893. L_0x0372:
  1894. r9 = 0
  1895. L_0x0373:
  1896. r0.printStackTrace() // Catch:{ all -> 0x03d8 }
  1897. java.lang.Object r1 = epson.print.service.EpsonService.mLock // Catch:{ all -> 0x03d8 }
  1898. monitor-enter(r1) // Catch:{ all -> 0x03d8 }
  1899. android.os.RemoteCallbackList<epson.print.service.IEpsonServiceCallback> r0 = epson.print.service.EpsonService.mCallbacks // Catch:{ all -> 0x03d5 }
  1900. int r4 = r0.beginBroadcast() // Catch:{ all -> 0x03d5 }
  1901. r5 = 0
  1902. L_0x0382:
  1903. if (r5 >= r4) goto L_0x039e
  1904. android.os.RemoteCallbackList<epson.print.service.IEpsonServiceCallback> r0 = epson.print.service.EpsonService.mCallbacks // Catch:{ RemoteException -> 0x0391 }
  1905. android.os.IInterface r0 = r0.getBroadcastItem(r5) // Catch:{ RemoteException -> 0x0391 }
  1906. epson.print.service.IEpsonServiceCallback r0 = (epson.print.service.IEpsonServiceCallback) r0 // Catch:{ RemoteException -> 0x0391 }
  1907. r6 = 0
  1908. r0.onNotifyError(r6, r9, r6) // Catch:{ RemoteException -> 0x0391 }
  1909. goto L_0x039b
  1910. L_0x0391:
  1911. r0 = move-exception
  1912. java.lang.String r6 = "EpsonService"
  1913. java.lang.String r0 = r0.toString() // Catch:{ all -> 0x03d5 }
  1914. epson.print.Util.EPLog.e((java.lang.String) r6, (java.lang.String) r0) // Catch:{ all -> 0x03d5 }
  1915. L_0x039b:
  1916. int r5 = r5 + 1
  1917. goto L_0x0382
  1918. L_0x039e:
  1919. android.os.RemoteCallbackList<epson.print.service.IEpsonServiceCallback> r0 = epson.print.service.EpsonService.mCallbacks // Catch:{ all -> 0x03d5 }
  1920. r0.finishBroadcast() // Catch:{ all -> 0x03d5 }
  1921. monitor-exit(r1) // Catch:{ all -> 0x03d5 }
  1922. if (r25 == 0) goto L_0x03a9
  1923. r25.join() // Catch:{ Exception -> 0x03b5 }
  1924. L_0x03a9:
  1925. if (r2 == r15) goto L_0x03b7
  1926. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03b5 }
  1927. epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x03b5 }
  1928. r0.EpsonConnectEndJob() // Catch:{ Exception -> 0x03b5 }
  1929. goto L_0x03b7
  1930. L_0x03b5:
  1931. r0 = move-exception
  1932. goto L_0x03c8
  1933. L_0x03b7:
  1934. if (r2 != r15) goto L_0x03bf
  1935. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03b5 }
  1936. com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r15) // Catch:{ Exception -> 0x03b5 }
  1937. goto L_0x03c4
  1938. L_0x03bf:
  1939. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03b5 }
  1940. com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r3) // Catch:{ Exception -> 0x03b5 }
  1941. L_0x03c4:
  1942. epson.print.service.EpsonService.onNotifyEndJob(r9) // Catch:{ Exception -> 0x03b5 }
  1943. goto L_0x03cb
  1944. L_0x03c8:
  1945. r0.printStackTrace() // Catch:{ all -> 0x040b }
  1946. L_0x03cb:
  1947. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
  1948. r1 = 0
  1949. boolean unused = r0.bPrinting = r1 // Catch:{ all -> 0x040b }
  1950. goto L_0x02f0
  1951. L_0x03d3:
  1952. monitor-exit(r8) // Catch:{ all -> 0x040b }
  1953. return
  1954. L_0x03d5:
  1955. r0 = move-exception
  1956. monitor-exit(r1) // Catch:{ all -> 0x03d5 }
  1957. throw r0 // Catch:{ all -> 0x03d8 }
  1958. L_0x03d8:
  1959. r0 = move-exception
  1960. L_0x03d9:
  1961. r1 = r0
  1962. L_0x03da:
  1963. if (r25 == 0) goto L_0x03df
  1964. r25.join() // Catch:{ Exception -> 0x03eb }
  1965. L_0x03df:
  1966. if (r2 == r15) goto L_0x03ed
  1967. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03eb }
  1968. epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x03eb }
  1969. r0.EpsonConnectEndJob() // Catch:{ Exception -> 0x03eb }
  1970. goto L_0x03ed
  1971. L_0x03eb:
  1972. r0 = move-exception
  1973. goto L_0x03fe
  1974. L_0x03ed:
  1975. if (r2 != r15) goto L_0x03f5
  1976. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03eb }
  1977. com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r15) // Catch:{ Exception -> 0x03eb }
  1978. goto L_0x03fa
  1979. L_0x03f5:
  1980. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03eb }
  1981. com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r3) // Catch:{ Exception -> 0x03eb }
  1982. L_0x03fa:
  1983. epson.print.service.EpsonService.onNotifyEndJob(r9) // Catch:{ Exception -> 0x03eb }
  1984. goto L_0x0401
  1985. L_0x03fe:
  1986. r0.printStackTrace() // Catch:{ all -> 0x040b }
  1987. L_0x0401:
  1988. epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
  1989. r2 = 0
  1990. boolean unused = r0.bPrinting = r2 // Catch:{ all -> 0x040b }
  1991. boolean unused = epson.print.service.EpsonService.bCancelPrinting = r2 // Catch:{ all -> 0x040b }
  1992. throw r1 // Catch:{ all -> 0x040b }
  1993. L_0x040b:
  1994. r0 = move-exception
  1995. monitor-exit(r8) // Catch:{ all -> 0x040b }
  1996. throw r0
  1997. */
  1998. throw new UnsupportedOperationException("Method not decompiled: epson.print.service.EpsonService.C23713.run():void");
  1999. }
  2000. };
  2001. return 0;
  2002. }
  2003. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r14v1, resolved type: epson.print.EPImageCreator} */
  2004. /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r14v2, resolved type: java.lang.String} */
  2005. /* JADX WARNING: type inference failed for: r14v0 */
  2006. /* JADX WARNING: type inference failed for: r14v4 */
  2007. /* JADX WARNING: type inference failed for: r14v5 */
  2008. /* JADX WARNING: type inference failed for: r14v7 */
  2009. /* JADX WARNING: type inference failed for: r14v8 */
  2010. /* JADX ERROR: IndexOutOfBoundsException in pass: RegionMakerVisitor
  2011. java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  2012. at java.util.ArrayList.rangeCheck(ArrayList.java:657)
  2013. at java.util.ArrayList.get(ArrayList.java:433)
  2014. at jadx.core.dex.nodes.InsnNode.getArg(InsnNode.java:101)
  2015. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:611)
  2016. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  2017. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  2018. at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
  2019. at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:561)
  2020. at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133)
  2021. at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
  2022. at jadx.core.dex.visitors.regions.RegionMaker.processExcHandler(RegionMaker.java:1043)
  2023. at jadx.core.dex.visitors.regions.RegionMaker.processTryCatchBlocks(RegionMaker.java:975)
  2024. at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:52)
  2025. */
  2026. /* JADX WARNING: Can't fix incorrect switch cases order */
  2027. /* JADX WARNING: Multi-variable type inference failed */
  2028. public java.lang.String createPrintImage(epson.print.EPImageList r18, int r19, int r20, int r21, int r22, int r23, int r24, int r25, int r26) {
  2029. /*
  2030. r17 = this;
  2031. r1 = r17
  2032. r0 = r20
  2033. r2 = r22
  2034. r9 = r23
  2035. com.epson.mobilephone.common.EPLog.m68d()
  2036. epson.print.EPImage r15 = r18.get(r19)
  2037. epson.print.EPImageCreator r3 = new epson.print.EPImageCreator
  2038. android.content.Context r4 = r17.getApplicationContext()
  2039. r3.<init>(r4)
  2040. java.lang.Object r4 = mCancelLock
  2041. monitor-enter(r4)
  2042. r1.mEPImageCreator = r3 // Catch:{ all -> 0x023d }
  2043. monitor-exit(r4) // Catch:{ all -> 0x023d }
  2044. java.lang.System.gc()
  2045. r14 = 0
  2046. boolean r4 = bCancelPrinting // Catch:{ Exception -> 0x022f }
  2047. r5 = 1
  2048. if (r4 == r5) goto L_0x0229
  2049. com.epson.mobilephone.common.escpr.EscprLib r4 = r1.mEscprLib // Catch:{ Exception -> 0x022f }
  2050. int[] r4 = r4.get_printable_area() // Catch:{ Exception -> 0x022f }
  2051. epson.print.MyPrinter.getCurPrinter(r17) // Catch:{ Exception -> 0x022f }
  2052. boolean r13 = epson.print.MyPrinter.isRemotePrinter(r17) // Catch:{ Exception -> 0x022f }
  2053. java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ Exception -> 0x022f }
  2054. r6.<init>() // Catch:{ Exception -> 0x022f }
  2055. java.lang.String r7 = " ☆☆ isRemotePrinter "
  2056. r6.append(r7) // Catch:{ Exception -> 0x022f }
  2057. r6.append(r13) // Catch:{ Exception -> 0x022f }
  2058. java.lang.String r6 = r6.toString() // Catch:{ Exception -> 0x022f }
  2059. com.epson.mobilephone.common.EPLog.i(r6) // Catch:{ Exception -> 0x022f }
  2060. r6 = 2
  2061. r7 = 0
  2062. if (r13 != r5) goto L_0x00e2
  2063. android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
  2064. epson.common.Info_paper r4 = epson.common.Info_paper.getInfoPaper(r4, r0) // Catch:{ Exception -> 0x022f }
  2065. int[] r8 = new int[r6] // Catch:{ Exception -> 0x022f }
  2066. if (r9 != r6) goto L_0x0065
  2067. int r10 = r4.getPaper_width_boder() // Catch:{ Exception -> 0x022f }
  2068. r8[r7] = r10 // Catch:{ Exception -> 0x022f }
  2069. int r4 = r4.getPaper_height_boder() // Catch:{ Exception -> 0x022f }
  2070. r8[r5] = r4 // Catch:{ Exception -> 0x022f }
  2071. goto L_0x0073
  2072. L_0x0065:
  2073. if (r9 != r5) goto L_0x0073
  2074. int r10 = r4.getPaper_width_boderless() // Catch:{ Exception -> 0x022f }
  2075. r8[r7] = r10 // Catch:{ Exception -> 0x022f }
  2076. int r4 = r4.getPaper_height_boderless() // Catch:{ Exception -> 0x022f }
  2077. r8[r5] = r4 // Catch:{ Exception -> 0x022f }
  2078. L_0x0073:
  2079. int r4 = r15.srcWidth // Catch:{ Exception -> 0x022f }
  2080. r10 = r8[r7] // Catch:{ Exception -> 0x022f }
  2081. if (r4 <= r10) goto L_0x0080
  2082. int r4 = r15.srcHeight // Catch:{ Exception -> 0x022f }
  2083. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2084. if (r4 <= r10) goto L_0x0080
  2085. goto L_0x00e3
  2086. L_0x0080:
  2087. int r4 = r15.srcWidth // Catch:{ Exception -> 0x022f }
  2088. r10 = r8[r7] // Catch:{ Exception -> 0x022f }
  2089. if (r4 <= r10) goto L_0x009a
  2090. r4 = r8[r7] // Catch:{ Exception -> 0x022f }
  2091. float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
  2092. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2093. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2094. float r4 = r4 / r10
  2095. int r10 = r15.srcHeight // Catch:{ Exception -> 0x022f }
  2096. r8[r5] = r10 // Catch:{ Exception -> 0x022f }
  2097. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2098. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2099. float r10 = r10 * r4
  2100. int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
  2101. r8[r7] = r4 // Catch:{ Exception -> 0x022f }
  2102. goto L_0x00e3
  2103. L_0x009a:
  2104. int r4 = r15.srcHeight // Catch:{ Exception -> 0x022f }
  2105. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2106. if (r4 <= r10) goto L_0x00b4
  2107. r4 = r8[r5] // Catch:{ Exception -> 0x022f }
  2108. float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
  2109. r10 = r8[r7] // Catch:{ Exception -> 0x022f }
  2110. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2111. float r4 = r4 / r10
  2112. int r10 = r15.srcWidth // Catch:{ Exception -> 0x022f }
  2113. r8[r7] = r10 // Catch:{ Exception -> 0x022f }
  2114. r10 = r8[r7] // Catch:{ Exception -> 0x022f }
  2115. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2116. float r10 = r10 * r4
  2117. int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
  2118. r8[r5] = r4 // Catch:{ Exception -> 0x022f }
  2119. goto L_0x00e3
  2120. L_0x00b4:
  2121. int r4 = r15.srcWidth // Catch:{ Exception -> 0x022f }
  2122. int r10 = r15.srcHeight // Catch:{ Exception -> 0x022f }
  2123. if (r4 >= r10) goto L_0x00ce
  2124. r4 = r8[r5] // Catch:{ Exception -> 0x022f }
  2125. float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
  2126. r10 = r8[r7] // Catch:{ Exception -> 0x022f }
  2127. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2128. float r4 = r4 / r10
  2129. int r10 = r15.srcWidth // Catch:{ Exception -> 0x022f }
  2130. r8[r7] = r10 // Catch:{ Exception -> 0x022f }
  2131. r10 = r8[r7] // Catch:{ Exception -> 0x022f }
  2132. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2133. float r10 = r10 * r4
  2134. int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
  2135. r8[r5] = r4 // Catch:{ Exception -> 0x022f }
  2136. goto L_0x00e3
  2137. L_0x00ce:
  2138. r4 = r8[r7] // Catch:{ Exception -> 0x022f }
  2139. float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
  2140. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2141. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2142. float r4 = r4 / r10
  2143. int r10 = r15.srcHeight // Catch:{ Exception -> 0x022f }
  2144. r8[r5] = r10 // Catch:{ Exception -> 0x022f }
  2145. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2146. float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
  2147. float r10 = r10 * r4
  2148. int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
  2149. r8[r7] = r4 // Catch:{ Exception -> 0x022f }
  2150. goto L_0x00e3
  2151. L_0x00e2:
  2152. r8 = r4
  2153. L_0x00e3:
  2154. r15.rotate = r7 // Catch:{ Exception -> 0x022f }
  2155. epson.print.service.IEpsonService$Stub r4 = r1.mBinder // Catch:{ Exception -> 0x022f }
  2156. int r4 = r4.getLang() // Catch:{ Exception -> 0x022f }
  2157. switch(r4) {
  2158. case 1: goto L_0x0142;
  2159. case 2: goto L_0x0135;
  2160. case 3: goto L_0x0135;
  2161. case 4: goto L_0x00f0;
  2162. case 5: goto L_0x0135;
  2163. case 6: goto L_0x0135;
  2164. case 7: goto L_0x00f0;
  2165. default: goto L_0x00ee;
  2166. } // Catch:{ Exception -> 0x022f }
  2167. L_0x00ee:
  2168. goto L_0x017f
  2169. L_0x00f0:
  2170. com.epson.mobilephone.common.escpr.EscprLib r4 = r1.mEscprLib // Catch:{ Exception -> 0x022f }
  2171. boolean r4 = r4.pageS_needRotate2(r0) // Catch:{ Exception -> 0x022f }
  2172. if (r4 == 0) goto L_0x011c
  2173. r4 = r8[r7] // Catch:{ Exception -> 0x022f }
  2174. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2175. r8[r7] = r10 // Catch:{ Exception -> 0x022f }
  2176. r8[r5] = r4 // Catch:{ Exception -> 0x022f }
  2177. if (r24 != 0) goto L_0x010c
  2178. boolean r4 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
  2179. if (r4 != 0) goto L_0x010c
  2180. int r4 = r15.rotate // Catch:{ Exception -> 0x022f }
  2181. int r4 = r4 + 90
  2182. r15.rotate = r4 // Catch:{ Exception -> 0x022f }
  2183. L_0x010c:
  2184. if (r2 != r6) goto L_0x0118
  2185. int r2 = r19 % 2
  2186. if (r2 != r5) goto L_0x0118
  2187. int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
  2188. int r2 = r2 + 180
  2189. r15.rotate = r2 // Catch:{ Exception -> 0x022f }
  2190. L_0x0118:
  2191. r16 = 1
  2192. goto L_0x0181
  2193. L_0x011c:
  2194. if (r24 != 0) goto L_0x0128
  2195. boolean r4 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
  2196. if (r4 != r5) goto L_0x0128
  2197. int r4 = r15.rotate // Catch:{ Exception -> 0x022f }
  2198. int r4 = r4 + 90
  2199. r15.rotate = r4 // Catch:{ Exception -> 0x022f }
  2200. L_0x0128:
  2201. if (r2 != r5) goto L_0x017f
  2202. int r2 = r19 % 2
  2203. if (r2 != r5) goto L_0x017f
  2204. int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
  2205. int r2 = r2 + 180
  2206. r15.rotate = r2 // Catch:{ Exception -> 0x022f }
  2207. goto L_0x017f
  2208. L_0x0135:
  2209. if (r24 != 0) goto L_0x017f
  2210. boolean r2 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
  2211. if (r2 != r5) goto L_0x017f
  2212. int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
  2213. int r2 = r2 + 90
  2214. r15.rotate = r2 // Catch:{ Exception -> 0x022f }
  2215. goto L_0x017f
  2216. L_0x0142:
  2217. r4 = r8[r7] // Catch:{ Exception -> 0x022f }
  2218. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2219. if (r4 > r10) goto L_0x014a
  2220. r4 = 1
  2221. goto L_0x014b
  2222. L_0x014a:
  2223. r4 = 0
  2224. L_0x014b:
  2225. if (r24 != 0) goto L_0x0166
  2226. if (r4 != r5) goto L_0x015a
  2227. boolean r10 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
  2228. if (r10 != r5) goto L_0x015a
  2229. int r10 = r15.rotate // Catch:{ Exception -> 0x022f }
  2230. int r10 = r10 + 90
  2231. r15.rotate = r10 // Catch:{ Exception -> 0x022f }
  2232. goto L_0x0166
  2233. L_0x015a:
  2234. if (r4 != 0) goto L_0x0166
  2235. boolean r10 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
  2236. if (r10 != 0) goto L_0x0166
  2237. int r10 = r15.rotate // Catch:{ Exception -> 0x022f }
  2238. int r10 = r10 + 90
  2239. r15.rotate = r10 // Catch:{ Exception -> 0x022f }
  2240. L_0x0166:
  2241. int r10 = r19 % 2
  2242. if (r10 != r5) goto L_0x017f
  2243. if (r4 != r5) goto L_0x0175
  2244. if (r2 != r5) goto L_0x0175
  2245. int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
  2246. int r2 = r2 + 180
  2247. r15.rotate = r2 // Catch:{ Exception -> 0x022f }
  2248. goto L_0x017f
  2249. L_0x0175:
  2250. if (r4 != 0) goto L_0x017f
  2251. if (r2 != r6) goto L_0x017f
  2252. int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
  2253. int r2 = r2 + 180
  2254. r15.rotate = r2 // Catch:{ Exception -> 0x022f }
  2255. L_0x017f:
  2256. r16 = 0
  2257. L_0x0181:
  2258. int r2 = r17.getLang() // Catch:{ Exception -> 0x022f }
  2259. r4 = r25
  2260. int r6 = r1.getStartPageResolution(r13, r4, r2) // Catch:{ Exception -> 0x022f }
  2261. int r2 = r18.getRenderingMode() // Catch:{ Exception -> 0x022f }
  2262. if (r2 != r5) goto L_0x01e1
  2263. if (r24 != 0) goto L_0x01bb
  2264. android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
  2265. r7 = r8[r7] // Catch:{ Exception -> 0x022f }
  2266. r8 = r8[r5] // Catch:{ Exception -> 0x022f }
  2267. r2 = r3
  2268. r3 = r4
  2269. r4 = r15
  2270. r5 = r6
  2271. r6 = r7
  2272. r7 = r8
  2273. r8 = r20
  2274. r9 = r23
  2275. r10 = r24
  2276. r11 = r21
  2277. r12 = r26
  2278. r0 = r14
  2279. r14 = r16
  2280. r2.createPrintImage(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14) // Catch:{ Exception -> 0x01b8 }
  2281. java.lang.String r2 = r15.decodeImageFileName // Catch:{ Exception -> 0x01b8 }
  2282. r15.printImageFileName = r2 // Catch:{ Exception -> 0x01b8 }
  2283. r14 = r0
  2284. goto L_0x0231
  2285. L_0x01b8:
  2286. r14 = r0
  2287. goto L_0x022f
  2288. L_0x01bb:
  2289. android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
  2290. r9 = r8[r7] // Catch:{ Exception -> 0x022f }
  2291. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2292. int r13 = r15.rotate // Catch:{ Exception -> 0x022f }
  2293. r2 = r3
  2294. r3 = r4
  2295. r4 = r24
  2296. r5 = r6
  2297. r6 = r18
  2298. r7 = r19
  2299. r8 = r9
  2300. r9 = r10
  2301. r10 = r20
  2302. r11 = r21
  2303. r12 = r26
  2304. r0 = r14
  2305. r14 = r16
  2306. java.lang.String r2 = r2.createMultiPrintImage(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14) // Catch:{ Exception -> 0x01b8 }
  2307. r15.printImageFileName = r2 // Catch:{ Exception -> 0x01b8 }
  2308. r14 = r0
  2309. goto L_0x0231
  2310. L_0x01e1:
  2311. if (r24 == 0) goto L_0x020a
  2312. java.lang.String r2 = "割り付け画像を生成"
  2313. com.epson.mobilephone.common.EPLog.d(r2) // Catch:{ Exception -> 0x022f }
  2314. android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
  2315. r9 = r8[r7] // Catch:{ Exception -> 0x022f }
  2316. r10 = r8[r5] // Catch:{ Exception -> 0x022f }
  2317. int r13 = r15.rotate // Catch:{ Exception -> 0x022f }
  2318. r2 = r3
  2319. r3 = r4
  2320. r4 = r24
  2321. r5 = r6
  2322. r6 = r18
  2323. r7 = r19
  2324. r8 = r9
  2325. r9 = r10
  2326. r10 = r20
  2327. r11 = r21
  2328. r12 = r26
  2329. java.lang.String r0 = r2.createMultiPrintImage_org(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13) // Catch:{ Exception -> 0x022f }
  2330. r15.printImageFileName = r0 // Catch:{ Exception -> 0x022f }
  2331. goto L_0x0231
  2332. L_0x020a:
  2333. android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
  2334. r7 = r8[r7] // Catch:{ Exception -> 0x022f }
  2335. r8 = r8[r5] // Catch:{ Exception -> 0x022f }
  2336. r2 = r3
  2337. r3 = r4
  2338. r4 = r15
  2339. r5 = r6
  2340. r6 = r7
  2341. r7 = r8
  2342. r8 = r20
  2343. r9 = r23
  2344. r10 = r21
  2345. r11 = r26
  2346. r12 = r13
  2347. r2.createPrintImage_origi(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12) // Catch:{ Exception -> 0x022f }
  2348. java.lang.String r0 = r15.decodeImageFileName // Catch:{ Exception -> 0x022f }
  2349. r15.printImageFileName = r0 // Catch:{ Exception -> 0x022f }
  2350. goto L_0x0231
  2351. L_0x0229:
  2352. java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x022f }
  2353. r0.<init>() // Catch:{ Exception -> 0x022f }
  2354. throw r0 // Catch:{ Exception -> 0x022f }
  2355. L_0x022f:
  2356. r15.printImageFileName = r14
  2357. L_0x0231:
  2358. java.lang.Object r2 = mCancelLock
  2359. monitor-enter(r2)
  2360. r1.mEPImageCreator = r14 // Catch:{ all -> 0x023a }
  2361. monitor-exit(r2) // Catch:{ all -> 0x023a }
  2362. java.lang.String r0 = r15.printImageFileName
  2363. return r0
  2364. L_0x023a:
  2365. r0 = move-exception
  2366. monitor-exit(r2) // Catch:{ all -> 0x023a }
  2367. throw r0
  2368. L_0x023d:
  2369. r0 = move-exception
  2370. monitor-exit(r4) // Catch:{ all -> 0x023d }
  2371. throw r0
  2372. */
  2373. throw new UnsupportedOperationException("Method not decompiled: epson.print.service.EpsonService.createPrintImage(epson.print.EPImageList, int, int, int, int, int, int, int, int):java.lang.String");
  2374. }
  2375. private int getStartPageResolution(boolean z, int i, int i2) {
  2376. if (z) {
  2377. return EPImageCreator.getPrintAreaResolution(i2, i);
  2378. }
  2379. return mEscprLib.get_start_job_resolution2();
  2380. }
  2381. private int epsonConnectCreateJob(int i, String str, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14) throws RemoteException {
  2382. return mBinder.EpsonConnectCreateJob(i, str, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);
  2383. }
  2384. private int epsonConnectEndJob() throws RemoteException {
  2385. return mBinder.EpsonConnectEndJob();
  2386. }
  2387. private int epsonConnectUploadFile(String str, int i) throws RemoteException {
  2388. return mBinder.EpsonConnectUploadFile(str, i);
  2389. }
  2390. private int epsonConnectChangePrintSetting() throws RemoteException {
  2391. return mBinder.EpsonConnectChangePrintSetting();
  2392. }
  2393. private int epsonConnectStartPrint(int i, int i2) throws RemoteException {
  2394. return mBinder.EpsonConnectStartPrint(i, i2);
  2395. }
  2396. private void setEpsonConnectCopies(int i) {
  2397. epsJobattrib.mCopies = i;
  2398. }
  2399. public void waitIfSimpleAp() {
  2400. int[] printerStatus;
  2401. if (WiFiDirectManager.isSimpleAP(getApplicationContext())) {
  2402. try {
  2403. int[] iArr = new int[3];
  2404. Thread.sleep(5000);
  2405. int i = 0;
  2406. do {
  2407. printerStatus = getPrinterStatus();
  2408. Thread.sleep(1000);
  2409. i++;
  2410. if (i >= 1800) {
  2411. return;
  2412. }
  2413. } while (printerStatus[0] != 0);
  2414. } catch (InterruptedException e) {
  2415. e.printStackTrace();
  2416. }
  2417. }
  2418. }
  2419. public int startJob(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, boolean z) {
  2420. StringBuilder sb = new StringBuilder();
  2421. sb.append("service:: paperSize = ");
  2422. sb.append(i);
  2423. sb.append(" paperType = ");
  2424. int i12 = i2;
  2425. sb.append(i12);
  2426. sb.append(" layout = ");
  2427. int i13 = i3;
  2428. sb.append(i13);
  2429. EPLog.m304d(sb.toString());
  2430. return mEscprLib.start_job2(i, i12, i13, i4, i5, i6, i7, i8, i9, i10, i11, z);
  2431. }
  2432. public int getStartJobResolution() {
  2433. return mEscprLib.get_start_job_resolution2();
  2434. }
  2435. public int startPage() {
  2436. return mEscprLib.start_page();
  2437. }
  2438. public int endJob() {
  2439. return mEscprLib.end_job();
  2440. }
  2441. public int printPage() {
  2442. return mEscprLib.print_page();
  2443. }
  2444. public int getLang() {
  2445. return mEscprLib.get_lang();
  2446. }
  2447. public int endPage(boolean z) {
  2448. return mEscprLib.end_page(z);
  2449. }
  2450. public int initImage(String str) {
  2451. return mEscprLib.init_image(str);
  2452. }
  2453. public int releaseImage() {
  2454. return mEscprLib.release_image();
  2455. }
  2456. public int[] getPrintableArea() {
  2457. return mEscprLib.get_printable_area();
  2458. }
  2459. @NonNull
  2460. public int[] getLocalPrinterLayout1AreaSize(int i) {
  2461. int[] iArr = mEscprLib.get_printable_area();
  2462. if (i == 0) {
  2463. return iArr;
  2464. }
  2465. return Info_paper.getMultiLayoutArea(i, iArr[0], iArr[1], mEscprLib.get_start_job_resolution2());
  2466. }
  2467. public boolean pageSneedRotate(int i) {
  2468. return mEscprLib.pageS_needRotate2(i);
  2469. }
  2470. public int[] getPrinterStatus() {
  2471. return mEscprLib.get_printer_status();
  2472. }
  2473. public Object getPrintLockObject() {
  2474. return mPrinting;
  2475. }
  2476. public void setCancelPrinting(boolean z) {
  2477. bCancelPrinting = z;
  2478. }
  2479. public boolean getCancelPrinting() {
  2480. return bCancelPrinting;
  2481. }
  2482. public void setPrinting(boolean z) {
  2483. bPrinting = z;
  2484. }
  2485. public void notifyEndJob(int i) {
  2486. onNotifyEndJob(i);
  2487. }
  2488. public Context getLocalApplicationContext() {
  2489. return getApplicationContext();
  2490. }
  2491. public void onCreate() {
  2492. EPLog.i();
  2493. super.onCreate();
  2494. }
  2495. public IBinder onBind(Intent intent) {
  2496. EPLog.i();
  2497. try {
  2498. if (!isInitDriver) {
  2499. mEscprLib.init_driver(getApplicationContext(), ExternalFileUtils.getInstance(getApplicationContext()).getSupportedMediaDir());
  2500. isInitDriver = true;
  2501. }
  2502. updateLoginInfo();
  2503. } catch (Exception e) {
  2504. e.printStackTrace();
  2505. }
  2506. return mBinder;
  2507. }
  2508. public void onRebind(Intent intent) {
  2509. EPLog.i();
  2510. mEscprLib.release_driver();
  2511. isInitDriver = false;
  2512. mEscprLib.init_driver(getApplicationContext(), ExternalFileUtils.getInstance(getApplicationContext()).getSupportedMediaDir());
  2513. isInitDriver = true;
  2514. clientId = SharedPreferencesProvider.getInstace(this).getString(epson.common.Constants.PRINTER_CLIENT_ID, (String) null);
  2515. EPLog.d("▲clientId = " + clientId);
  2516. MyPrinter curPrinter = MyPrinter.getCurPrinter(this);
  2517. mailAddress = curPrinter.getEmailAddress();
  2518. accessKey = curPrinter.getRemotePrinterAccessKey(this);
  2519. super.onRebind(intent);
  2520. }
  2521. public boolean onUnbind(Intent intent) {
  2522. EPLog.i();
  2523. mEscprLib.setHanlder((Handler) null);
  2524. mEscprLib.release_driver();
  2525. isInitDriver = false;
  2526. return super.onUnbind(intent);
  2527. }
  2528. public void onDestroy() {
  2529. EPLog.i();
  2530. super.onDestroy();
  2531. }
  2532. public static void onNotifyProgress(int i) {
  2533. synchronized (mLock) {
  2534. int beginBroadcast = mCallbacks.beginBroadcast();
  2535. for (int i2 = 0; i2 < beginBroadcast; i2++) {
  2536. try {
  2537. mCallbacks.getBroadcastItem(i2).onNotifyProgress(1, i);
  2538. } catch (RemoteException e) {
  2539. EPLog.e("NotificationService", e.toString());
  2540. }
  2541. }
  2542. mCallbacks.finishBroadcast();
  2543. }
  2544. }
  2545. public static void notifyProgress(int i, int i2) {
  2546. synchronized (mLock) {
  2547. int beginBroadcast = mCallbacks.beginBroadcast();
  2548. for (int i3 = 0; i3 < beginBroadcast; i3++) {
  2549. try {
  2550. mCallbacks.getBroadcastItem(i3).onNotifyProgress(i, i2);
  2551. } catch (RemoteException e) {
  2552. EPLog.e("NotificationService", e.toString());
  2553. }
  2554. }
  2555. mCallbacks.finishBroadcast();
  2556. }
  2557. }
  2558. public static void onNotifyContinueable(int i) {
  2559. synchronized (mLock) {
  2560. int beginBroadcast = mCallbacks.beginBroadcast();
  2561. for (int i2 = 0; i2 < beginBroadcast; i2++) {
  2562. try {
  2563. mCallbacks.getBroadcastItem(i2).onNotifyContinueable(i);
  2564. } catch (RemoteException e) {
  2565. EPLog.e("NotificationService", e.toString());
  2566. }
  2567. }
  2568. mCallbacks.finishBroadcast();
  2569. }
  2570. }
  2571. public void epsNotifyContinueable(int i) {
  2572. synchronized (mLock) {
  2573. int beginBroadcast = mCallbacks.beginBroadcast();
  2574. for (int i2 = 0; i2 < beginBroadcast; i2++) {
  2575. try {
  2576. mCallbacks.getBroadcastItem(i2).onNotifyContinueable(i);
  2577. } catch (RemoteException e) {
  2578. EPLog.e("NotificationService", e.toString());
  2579. }
  2580. }
  2581. mCallbacks.finishBroadcast();
  2582. }
  2583. }
  2584. public static void onNotifyEndJob(int i) {
  2585. synchronized (mLock) {
  2586. int beginBroadcast = mCallbacks.beginBroadcast();
  2587. for (int i2 = 0; i2 < beginBroadcast; i2++) {
  2588. try {
  2589. mCallbacks.getBroadcastItem(i2).onNotifyEndJob(i);
  2590. } catch (RemoteException e) {
  2591. EPLog.e("NotificationService", e.toString());
  2592. }
  2593. }
  2594. mCallbacks.finishBroadcast();
  2595. }
  2596. }
  2597. public static void onNotifyError(int i, int i2, boolean z) {
  2598. synchronized (mLock) {
  2599. int beginBroadcast = mCallbacks.beginBroadcast();
  2600. for (int i3 = 0; i3 < beginBroadcast; i3++) {
  2601. try {
  2602. mCallbacks.getBroadcastItem(i3).onNotifyError(i, i2, z);
  2603. } catch (RemoteException e) {
  2604. EPLog.e("NotificationService", e.toString());
  2605. }
  2606. }
  2607. mCallbacks.finishBroadcast();
  2608. }
  2609. }
  2610. public void epsNotifyError(int i, int i2, boolean z) {
  2611. synchronized (mLock) {
  2612. int beginBroadcast = mCallbacks.beginBroadcast();
  2613. for (int i3 = 0; i3 < beginBroadcast; i3++) {
  2614. try {
  2615. mCallbacks.getBroadcastItem(i3).onNotifyError(i, i2, z);
  2616. } catch (RemoteException e) {
  2617. EPLog.e("NotificationService", e.toString());
  2618. }
  2619. }
  2620. mCallbacks.finishBroadcast();
  2621. }
  2622. }
  2623. }