EpsonService.java 127 KB

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