EpsonService.java 129 KB

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