12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726 |
- package epson.print.service;
- import android.app.Service;
- import android.content.Context;
- import android.content.Intent;
- import android.os.Binder;
- import android.os.Handler;
- import android.os.IBinder;
- import android.os.Message;
- import android.os.RemoteCallbackList;
- import android.os.RemoteException;
- import com.epson.cameracopy.printlayout.ImageAndLayout;
- import com.epson.iprint.apf.ApfEpImageAdapter;
- import com.epson.iprint.storage.StorageSecureStore;
- import com.epson.mobilephone.common.PrintingLib.define.Constants;
- import com.epson.mobilephone.common.escpr.EscprError;
- import com.epson.mobilephone.common.escpr.EscprLib;
- import com.epson.mobilephone.common.wifidirect.WiFiDirectManager;
- import java.io.DataOutputStream;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.nio.ByteBuffer;
- import java.nio.ByteOrder;
- import java.util.ArrayList;
- import java.util.List;
- import epson.common.ExternalFileUtils;
- import epson.common.Info_paper;
- import epson.common.Utils;
- import epson.print.EPImageCreator;
- import epson.print.EPImageList;
- import epson.print.EPPrinterManager;
- import epson.print.MyPrinter;
- import epson.print.Util.EPLog;
- import epson.print.ecclient.EcClientLib;
- import epson.print.ecclient.EcClientLibUtil;
- import epson.print.ecclient.EpsJobAttrib;
- import epson.print.ecclient.EpsMediaSize;
- import epson.print.ecclient.EpsMediaType;
- import epson.print.ecclient.EpsSupportedMedia;
- import epson.print.screen.PrintSetting;
- import epson.provider.SharedPreferencesProvider;
- public class EpsonService extends Service implements ApfEpImageAdapter.ProgressCallback, PrintService {
- static final int DISABLE_SIMPLE_AP_TIMEOUT = 1800;
- public static final int EPS_ERR_MEMORY_ALLOCATION = -1001;
- public static final int EPS_ERR_NONE = 0;
- private static final int EPS_MLID_BORDERLESS = 1;
- static final int EPS_MSID_A3 = 62;
- static final int EPS_MSID_B4 = 63;
- static final int EPS_MSID_LEGAL = 2;
- public static final int MEDIA_INFO_MEMORY_ERROR = -5201;
- static final int NOT_SET_TIMEOUT = -1;
- public static final String PREFS_NAME = "PrintSetting";
- public static final int PROGRESS_NOTIFY_TYPE_APF = 2;
- public static final int PROGRESS_NOTIFY_TYPE_PRINTING = 1;
- private static volatile boolean bCancelPrinting = false;
- public static boolean bNotifyPrinter = false;
- private static boolean isInitDriver = false;
- static final RemoteCallbackList<IEpsonServiceCallback> mCallbacks = new RemoteCallbackList<>();
- private static final Object mCancelLock = new Object();
- private static final Object mConnect = new Object();
- private static final Object mLock = new Object();
- private static final Object mLockPrintingStatus = new Object();
- private static final Object mLockSearchingStatus = new Object();
- private static final Object mPrinting = new Object();
- private final int EPS_ERR_PRINTER_NOT_SET = EscprError.EPS_ERR_PRINTER_NOT_SET;
- private final int EPS_PRNERR_COMM = 102;
- private final int EPS_PRNERR_NOERROR = 0;
- private final int EPS_PRNST_BUSY = 2;
- private final int EPS_PRNST_ERROR = 4;
- private final String TAG = "EpsonService";
- private String accessKey = "";
- private boolean bEnd;
- private volatile boolean bPrinting = false;
- private volatile boolean bSearching = false;
- boolean bSetPrinter = false;
- private String clientId = null;
- public String debugString;
- private EpsJobAttrib epsJobattrib = new EpsJobAttrib();
- /* access modifiers changed from: private */
- /* renamed from: id */
- public String f406id;
- /* access modifiers changed from: private */
- /* renamed from: ip */
- public String f407ip;
- private final IEpsonService.Stub mBinder = new IEpsonService.Stub() {
- EcClientLib mEcClientLib = new EcClientLib();
- boolean mEpsonConnectlogin;
- int mRemotePrintMaxFileSize = 0;
- {
- mEcClientLib.Initialize();
- mEpsonConnectlogin = false;
- }
- public void unregisterCallback(IEpsonServiceCallback iEpsonServiceCallback) throws RemoteException {
- if (iEpsonServiceCallback != null) {
- EpsonService.mCallbacks.unregister(iEpsonServiceCallback);
- }
- }
- public void registerCallback(IEpsonServiceCallback iEpsonServiceCallback) throws RemoteException {
- if (iEpsonServiceCallback != null) {
- EpsonService.mCallbacks.register(iEpsonServiceCallback);
- }
- }
- public synchronized int searchPrinters(String str, String str2, int i) throws RemoteException {
- synchronized (EpsonService.mLockSearchingStatus) {
- EpsonService.bNotifyPrinter = false;
- }
- String unused = f406id = str;
- String unused2 = f407ip = str2;
- int unused3 = probeMethod = i;
- if (searchingPrinter != null) {
- EPLog.d("EpsonService", "searchPrinters() search intterrupt()");
- searchingPrinter.interrupt();
- try {
- searchingPrinter.join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- EpsonService.access$504(EpsonService.this);
- if (mSearchCount > 1) {
- EPLog.e("EpsonService", "search count error! mSearchCount => " + mSearchCount);
- }
- if (!EpsonService.isInitDriver) {
- mEscprLib.release_driver();
- boolean unused4 = EpsonService.isInitDriver = true;
- mEscprLib.init_driver (getApplicationContext(), ExternalFileUtils.getInstance (getApplicationContext()).getSupportedMediaDir());
- }
- createSearchingThread();
- searchingPrinter.start();
- return 0;
- }
- public synchronized int cancelSearchPrinter() throws RemoteException {
- EPLog.e("Epson", "cancelSearchPrinter() call");
- if (searchingPrinter == null) {
- EPLog.e("Epson", "cancelSearchPrinter() finish1");
- return 0;
- }
- searchingPrinter.interrupt();
- try {
- EPLog.d("EpsonService", "searchingPrinter.join() enter");
- searchingPrinter.join(1000);
- int i = 0;
- while (true) {
- if (!Thread.State.RUNNABLE.equals(searchingPrinter.getState())) {
- break;
- }
- int i2 = i + 1;
- if (i > 60) {
- EPLog.w("EpsonService", "mSearchThread.join() timeout");
- break;
- }
- EPLog.d("EpsonService", "retry doCancelFindPrinter() " + i2);
- searchingPrinter.interrupt();
- searchingPrinter.join(1000);
- i = i2;
- }
- EPLog.d("EpsonService", "searchingPrinter.join() leave");
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- EPLog.e("Epson", "cancelSearchPrinter() finish");
- return 0;
- }
- public void setTimeOut(int i) throws RemoteException {
- EPLog.d("EpsonService", "timeout = " + i);
- int unused = timeout_sec = i;
- }
- public int setCurPrinter(int i) throws RemoteException {
- int i2;
- EPLog.d("EpsonService", "setCurPrinter(): " + i);
- cancelSearchPrinter();
- EPLog.e("Epson", "Finish cancelSearchPrinter()");
- synchronized (EpsonService.mLock) {
- EPLog.d("EpsonService", "Start set_printer()");
- i2 = mEscprLib.set_printer(i);
- EPLog.d("EpsonService", "setCurPrinter: result = " + i2);
- }
- return i2;
- }
- public int print(EPImageList ePImageList, String str, boolean z) throws RemoteException {
- EPLog.i();
- boolean z2 = SharedPreferencesProvider.getInstace(EpsonService.this).getInt(Constants.PRINTER_LOCATION, 0) == 2;
- EPLog.i("☆☆ isRemotePrinter " + z2);
- PrintSetting.Kind valueOf = PrintSetting.Kind.valueOf(str);
- if (z2) {
- int unused = createECPrintingThread(valueOf, ePImageList);
- if (printingThread != null) {
- printingThread.start();
- }
- return 0;
- }
- startLocalNonPdfPrintThread(valueOf, ePImageList, z);
- return 0;
- }
- public int printLocalPdf(String str, String str2, String str3, boolean z, int i, int i2, boolean z2) {
- startPdfPrintThread(str, str2, str3, z, i, i2, z2);
- return 0;
- }
- public int printWithImagesAndLayouts(List<ImageAndLayout> list, boolean z) {
- EpsonService epsonService = EpsonService.this;
- Thread unused = epsonService.printingThread = new PrintAndLayoutThread(epsonService, list, z);
- printingThread.start();
- return 0;
- }
- public int cancelPrint() throws RemoteException {
- return mEscprLib.cancel_print();
- }
- public int getLang() throws RemoteException {
- int i;
- synchronized (EpsonService.mLock) {
- i = mEscprLib.get_lang();
- }
- return i;
- }
- public int getSupportedMedia(boolean z, int i, String str, String str2) throws RemoteException {
- int i2;
- synchronized (EpsonService.mPrinting) {
- synchronized (EpsonService.mLock) {
- synchronized (EpsonService.mPrinting) {
- if (z) {
- i2 = EpsonConnectGetSupportedMedia(i, str, str2);
- } else {
- i2 = mEscprLib.get_supported_media2();
- }
- }
- }
- }
- return i2;
- }
- public int[] getPaperSize() throws RemoteException {
- int[] iArr;
- synchronized (EpsonService.mLock) {
- iArr = mEscprLib.get_paper_size();
- }
- return iArr;
- }
- public int[] getPaperType(int i) throws RemoteException {
- int[] iArr;
- synchronized (EpsonService.mLock) {
- iArr = mEscprLib.get_paper_type(i);
- }
- return iArr;
- }
- public int[] getLayout(int i, int i2) throws RemoteException {
- int[] iArr;
- synchronized (EpsonService.mLock) {
- iArr = mEscprLib.get_layout(i, i2);
- }
- return iArr;
- }
- public int[] getQuality(int i, int i2) throws RemoteException {
- int[] iArr;
- synchronized (EpsonService.mLock) {
- iArr = mEscprLib.get_quality(i, i2);
- }
- return iArr;
- }
- public int[] getPaperSource(int i, int i2, int i3) throws RemoteException {
- int[] iArr;
- synchronized (EpsonService.mLock) {
- iArr = mEscprLib.get_paper_source(i, i2);
- }
- return iArr;
- }
- public int[] getColor(boolean z, int i, int i2, int i3) throws RemoteException {
- int[] iArr;
- int i4;
- synchronized (EpsonService.mLock) {
- if (z) {
- ArrayList arrayList = new ArrayList();
- if (i == 1) {
- i4 = mEcClientLib.mColorModeAtRemote;
- } else {
- i4 = mEcClientLib.mColorModeAtLocal;
- }
- if ((i4 & 1) != 0) {
- arrayList.add(0);
- }
- if ((i4 & 2) != 0) {
- arrayList.add(1);
- }
- int size = arrayList.size();
- iArr = new int[arrayList.size()];
- for (int i5 = 0; i5 < size; i5++) {
- iArr[i5] = ((Integer) arrayList.get(i5)).intValue();
- }
- } else {
- iArr = mEscprLib.get_color(i2, i3);
- }
- }
- return iArr;
- }
- public int getDuplex(int i, int i2) throws RemoteException {
- int i3;
- synchronized (EpsonService.mLock) {
- i3 = mEscprLib.get_duplex(i, i2);
- }
- return i3;
- }
- public boolean isPrinting() {
- boolean access$1700;
- synchronized (EpsonService.mLockPrintingStatus) {
- access$1700 = bPrinting;
- }
- return access$1700;
- }
- public boolean isSearchingPrinter() {
- boolean access$1800;
- synchronized (EpsonService.mLockSearchingStatus) {
- access$1800 = bSearching;
- }
- return access$1800;
- }
- public int confirmCancel(boolean z) {
- EPLog.e("LAM DAI HIEP", "confirmCancel() call");
- EPLog.v("cancel ", "iscancel " + z);
- if (!z) {
- return 0;
- }
- synchronized (EpsonService.mLockPrintingStatus) {
- boolean unused = EpsonService.bCancelPrinting = true;
- synchronized (EpsonService.mCancelLock) {
- if (mEPImageCreator != null) {
- mEPImageCreator.requestStop();
- }
- }
- if (bPrinting) {
- if (mLocalPrintThread != null) {
- mLocalPrintThread.interrupt();
- }
- EPLog.e("lam dai hiep", "confirm_cancel: " + z);
- mEscprLib.confirm_cancel(z);
- } else if (isSearchingPrinter()) {
- try {
- cancelSearchPrinter();
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- }
- return 0;
- }
- public int confirmContinueable(boolean z) {
- EPLog.e("LAM DAI HIEP", "confirmContinueable() call: " + z);
- return mEscprLib.confirm_continue(z);
- }
- public int updatePrinterSettings(String str) {
- int i;
- int i2;
- int i3;
- int i4;
- int i5;
- int i6;
- int i7;
- EPLog.m83w("EpsonService", "call updatePrinterSettings() :: " + Binder.getCallingPid());
- PrintSetting printSetting = new PrintSetting(EpsonService.this, PrintSetting.Kind.valueOf(str));
- printSetting.loadSettings();
- int i8 = printSetting.paperSizeValue;
- int i9 = printSetting.paperTypeValue;
- int i10 = printSetting.layoutValue;
- int i11 = printSetting.qualityValue;
- int i12 = printSetting.paperSourceValue;
- int i13 = printSetting.duplexValue;
- int i14 = printSetting.colorValue;
- try {
- int[] paperSize = getPaperSize();
- if (paperSize != null) {
- if (paperSize.length != 0) {
- int i15 = 0;
- while (true) {
- if (i15 >= paperSize.length) {
- i = 0;
- break;
- } else if (i8 == paperSize[i15]) {
- i = i15;
- break;
- } else {
- i15++;
- }
- }
- if (i15 >= paperSize.length) {
- int defaultPaperSize = printSetting.getDefaultPaperSize();
- i2 = 0;
- while (true) {
- if (i2 >= paperSize.length) {
- break;
- } else if (defaultPaperSize == paperSize[i2]) {
- i8 = paperSize[i2];
- EPLog.w("EpsonService", "updatePrinterSettings paperSize = " + i8);
- i = i2;
- break;
- } else {
- i2++;
- }
- }
- } else {
- i2 = i15;
- }
- if (i2 >= paperSize.length) {
- i8 = paperSize[0];
- EPLog.w("EpsonService", "updatePrinterSettings paperSize = " + i8);
- i = 0;
- }
- int[] paperType = getPaperType(i);
- if (paperType != null) {
- if (paperType.length != 0) {
- int i16 = 0;
- while (true) {
- if (i16 >= paperType.length) {
- i3 = 0;
- break;
- } else if (i9 == paperType[i16]) {
- i3 = i16;
- break;
- } else {
- i16++;
- }
- }
- if (i16 >= paperType.length) {
- int defaultPaperType = printSetting.getDefaultPaperType();
- i4 = 0;
- while (true) {
- if (i4 >= paperType.length) {
- break;
- } else if (defaultPaperType == paperType[i4]) {
- i9 = paperType[i4];
- EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
- i3 = i4;
- break;
- } else {
- i4++;
- }
- }
- } else {
- i4 = i16;
- }
- if (i4 >= paperType.length) {
- if (PrintSetting.Kind.photo.compareTo(PrintSetting.Kind.valueOf(str)) == 0) {
- int code = Constants.MediaName.EPS_MTID_MATTE.getCode();
- int i17 = 0;
- while (true) {
- if (i4 >= paperType.length) {
- break;
- } else if (code == paperType[i4]) {
- i9 = paperType[i4];
- EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
- i3 = i4;
- break;
- } else {
- i17 = i4 + 1;
- }
- }
- } else {
- int code2 = Constants.MediaName.EPS_MTID_PLAIN1.getCode();
- int i18 = 0;
- while (true) {
- if (i4 >= paperType.length) {
- break;
- } else if (code2 == paperType[i4]) {
- i9 = paperType[i4];
- EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
- i3 = i4;
- break;
- } else {
- i18 = i4 + 1;
- }
- }
- if (i4 >= paperType.length) {
- int code3 = Constants.MediaName.EPS_MTID_AUTO_PLAIN.getCode();
- int i19 = 0;
- while (true) {
- if (i4 >= paperType.length) {
- break;
- } else if (code3 == paperType[i4]) {
- i9 = paperType[i4];
- EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
- i3 = i4;
- break;
- } else {
- i19 = i4 + 1;
- }
- }
- }
- }
- }
- if (i4 >= paperType.length) {
- i9 = paperType[0];
- EPLog.w("EpsonService", "updatePrinterSettings paperType = " + i9);
- i3 = 0;
- }
- int[] layout = getLayout(i, i3);
- if (layout != null) {
- int i20 = 0;
- while (true) {
- if (i20 >= layout.length) {
- break;
- } else if (i10 == layout[i20]) {
- i10 = layout[i20];
- break;
- } else {
- i20++;
- }
- }
- if (i20 >= layout.length) {
- EPLog.w("EpsonService", "updatePrinterSettings layout = EPS_MLID_BORDERS");
- i10 = 2;
- }
- } else {
- EPLog.w("EpsonService", "updatePrinterSettings layout = EPS_MLID_BORDERS");
- i10 = 2;
- }
- int[] quality = getQuality(i, i3);
- if (quality != null) {
- int i21 = 0;
- while (true) {
- if (i21 >= quality.length) {
- break;
- } else if (i11 == quality[i21]) {
- i11 = quality[i21];
- break;
- } else {
- i21++;
- }
- }
- if (i21 >= quality.length) {
- i5 = quality.length > 0 ? quality[0] : 2;
- EPLog.w("EpsonService", "updatePrinterSettings quality = " + i5);
- }
- } else {
- EPLog.w("EpsonService", "updatePrinterSettings quality = " + 2);
- i5 = 2;
- }
- int[] paperSource = getPaperSource(i, i3, 0);
- if (paperSource != null) {
- int i22 = 0;
- while (true) {
- if (i22 >= paperSource.length) {
- break;
- } else if (i12 == paperSource[i22]) {
- i12 = paperSource[i22];
- break;
- } else {
- i22++;
- }
- }
- if (i22 >= paperSource.length) {
- i6 = paperSource.length > 0 ? paperSource[0] : 0;
- EPLog.w("EpsonService", "updatePrinterSettings paperSource = " + i6);
- }
- } else {
- EPLog.w("EpsonService", "updatePrinterSettings paperSource = EPS_MPID_NOT_SPEC");
- i6 = 0;
- }
- int duplex = getDuplex(i, i3);
- if ((duplex == 0 || (i10 == 1 && (duplex & 2) != 0)) && i13 != 0) {
- EPLog.w("EpsonService", "updatePrinterSettings duplex = EPS_DUPLEX_NONE");
- i13 = 0;
- }
- int[] color = getColor(false, 0, i, i3);
- if (color != null) {
- int i23 = 0;
- while (true) {
- if (i23 >= color.length) {
- break;
- } else if (i14 == color[i23]) {
- i14 = color[i23];
- break;
- } else {
- i23++;
- }
- }
- if (i23 >= color.length) {
- i7 = color.length > 0 ? color[0] : 0;
- EPLog.w("EpsonService", "updatePrinterSettings color = " + i7);
- }
- } else {
- EPLog.w("EpsonService", "updatePrinterSettings color = " + 0);
- i7 = 0;
- }
- printSetting.paperSizeValue = i8;
- printSetting.paperTypeValue = i9;
- printSetting.layoutValue = i10;
- printSetting.qualityValue = i5;
- printSetting.paperSourceValue = i6;
- printSetting.duplexValue = i13;
- printSetting.colorValue = i7;
- printSetting.saveSettings();
- return 0;
- }
- }
- EPLog.w("EpsonService", "updatePrinterSettings Failed getPaperType");
- return -1;
- }
- }
- EPLog.w("EpsonService", "updatePrinterSettings Failed getPaperSize");
- return -1;
- } catch (RemoteException e) {
- e.printStackTrace();
- return -1;
- }
- }
- public int EpsonConnectUpdatePrinterSettings(String str) {
- int i;
- EpsSupportedMedia epsSupportedMedia;
- boolean z;
- boolean z2;
- int i2;
- int i3;
- EPLog.d("EpsonService", "EpsonConnectUpdatePrinterSettings() called.");
- PrintSetting instance = PrintSetting.getInstance(EpsonService.this, str);
- instance.loadSettings();
- int i4 = instance.paperSizeValue;
- int i5 = instance.paperTypeValue;
- int i6 = instance.layoutValue;
- int i7 = instance.qualityValue;
- int i8 = instance.paperSourceValue;
- int i9 = instance.duplexValue;
- int i10 = instance.colorValue;
- try {
- int i11 = 0;
- WiFiDirectManager.setPriorityToSimpleAP(EpsonService.this, false);
- int updateSettingsRemoteSourceType = instance.getUpdateSettingsRemoteSourceType();
- int supportedMedia = getSupportedMedia(true, updateSettingsRemoteSourceType, (String) null, (String) null);
- switch (updateSettingsRemoteSourceType) {
- case 1:
- epsSupportedMedia = mEcClientLib.mMediaAtRemote;
- i = mEcClientLib.mColorModeAtRemote;
- break;
- case 2:
- epsSupportedMedia = mEcClientLib.mMediaAtPhoto;
- i = mEcClientLib.mColorModeAtPhoto;
- break;
- case 3:
- epsSupportedMedia = mEcClientLib.mMediaAtLocal;
- i = mEcClientLib.mColorModeAtLocal;
- break;
- default:
- EPLog.e("EpsonService", "remoteSourceType is invalid.");
- return -1;
- }
- if (supportedMedia == 0) {
- int i12 = 0;
- while (true) {
- if (i12 >= epsSupportedMedia.mSizeList.length) {
- z = true;
- i12 = 0;
- } else if (i4 == epsSupportedMedia.mSizeList[i12].mMediaSizeID) {
- z = false;
- } else {
- i12++;
- }
- }
- if (z) {
- int defaultPaperSize = instance.getDefaultPaperSize();
- while (true) {
- if (i11 >= epsSupportedMedia.mSizeList.length) {
- i11 = i12;
- } else if (defaultPaperSize == epsSupportedMedia.mSizeList[i11].mMediaSizeID) {
- EPLog.w("EpsonService", "EpsonConnectUpdatePrinterSettings paperSize_index = " + i11);
- z = false;
- } else {
- i11++;
- }
- }
- if (z) {
- i11 = 0;
- }
- } else {
- i11 = i12;
- }
- int i13 = 0;
- while (true) {
- if (i13 >= epsSupportedMedia.mSizeList[i11].mTypeList.length) {
- z2 = true;
- i2 = 0;
- } else if (i5 == epsSupportedMedia.mSizeList[i11].mTypeList[i13].mMediaTypeId) {
- i2 = i13;
- z2 = false;
- } else {
- i13++;
- }
- }
- if (z2) {
- int defaultPaperType = instance.getDefaultPaperType();
- int i14 = 0;
- while (true) {
- if (i14 < epsSupportedMedia.mSizeList[i11].mTypeList.length) {
- if (defaultPaperType == epsSupportedMedia.mSizeList[i11].mTypeList[i14].mMediaTypeId) {
- EPLog.w("EpsonService", "EpsonConnectUpdatePrinterSettings paperType_index = " + i14);
- i2 = i14;
- z2 = false;
- } else {
- i14++;
- }
- }
- }
- if (z2) {
- i2 = 0;
- }
- }
- int i15 = epsSupportedMedia.mSizeList[i11].mMediaSizeID;
- int i16 = epsSupportedMedia.mSizeList[i11].mTypeList[i2].mMediaTypeId;
- EpsMediaType epsMediaType = epsSupportedMedia.mSizeList[i11].mTypeList[i2];
- int i17 = 8;
- if ((epsMediaType.mPaperSource & i8) == i8) {
- i3 = i8;
- } else if ((epsMediaType.mPaperSource & 1) == 1) {
- i3 = 1;
- } else if ((epsMediaType.mPaperSource & 2) == 2) {
- i3 = 2;
- } else if ((epsMediaType.mPaperSource & 4) == 4) {
- i3 = 4;
- } else if ((epsMediaType.mPaperSource & 8) == 8) {
- i3 = 8;
- } else if ((epsMediaType.mPaperSource & 16) == 16) {
- i3 = 16;
- } else {
- i3 = 128;
- if ((epsMediaType.mPaperSource & 128) != 128) {
- i3 = 32768;
- if ((epsMediaType.mPaperSource & 32768) != 32768) {
- if ((epsMediaType.mPaperSource & 32) == 32) {
- i3 = 32;
- } else {
- i3 = 64;
- if ((epsMediaType.mPaperSource & 64) != 64) {
- i3 = 2;
- }
- }
- }
- }
- }
- if ((epsMediaType.mLayout & i6) == i6) {
- i17 = i6 == 0 ? 2 : i6;
- } else if ((epsMediaType.mLayout & 1) == 1) {
- i17 = 1;
- } else if ((epsMediaType.mLayout & 2) == 2) {
- i17 = 2;
- } else if ((epsMediaType.mLayout & 4) == 4) {
- i17 = 4;
- } else if ((epsMediaType.mLayout & 8) != 8) {
- i17 = 2;
- }
- if ((epsMediaType.mQuality & i7) == i7) {
- if (i7 == 0) {
- i7 = 2;
- }
- } else if ((epsMediaType.mQuality & 1) == 1) {
- i7 = 1;
- } else if ((epsMediaType.mQuality & 2) == 2) {
- i7 = 2;
- } else {
- i7 = (epsMediaType.mQuality & 4) == 4 ? 4 : 2;
- }
- if (epsMediaType.mDuplex == 0 && i9 != 0) {
- i9 = 0;
- }
- if (((1 << i10) & i) == 0) {
- i10 = (i & 1) != 0 ? 0 : (2 & i) != 0 ? 1 : 0;
- }
- instance.paperSizeValue = i15;
- instance.paperTypeValue = i16;
- instance.layoutValue = i17;
- instance.layoutMultiPageValue = 0;
- instance.qualityValue = i7;
- instance.paperSourceValue = i3;
- instance.duplexValue = i9;
- instance.colorValue = i10;
- instance.printdate = 0;
- instance.saveSettings();
- return 0;
- }
- ExternalFileUtils instance2 = ExternalFileUtils.getInstance (getApplicationContext());
- instance2.getSupportedMedia().delete();
- instance2.getSavedSupportedMedia().delete();
- instance.paperSizeValue = instance.getDefaultPaperSize();
- instance.paperTypeValue = instance.getDefaultPaperType();
- instance.layoutValue = 2;
- instance.layoutMultiPageValue = 0;
- instance.qualityValue = 2;
- instance.paperSourceValue = 2;
- instance.duplexValue = 0;
- instance.printdate = 0;
- instance.saveSettings();
- return -1;
- } catch (RemoteException e) {
- e.printStackTrace();
- return -1;
- }
- }
- 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) {
- int i15;
- int i16;
- int i17 = i;
- EPLog.d("EpsonService", "EpsonConnectCreateJob() called.");
- mEcClientLib.resetCancel();
- epsJobattrib.mMediaSizeIdx = i2;
- epsJobattrib.mMediaTypeIdx = i3;
- epsJobattrib.mPrintLayout = i4;
- epsJobattrib.mPrintQuality = i5;
- epsJobattrib.mPaperSource = i6;
- if (i7 == 1) {
- epsJobattrib.mColorMode = 2;
- } else {
- epsJobattrib.mColorMode = 1;
- }
- epsJobattrib.mBrightness = i8;
- epsJobattrib.mContrast = i9;
- epsJobattrib.mSaturation = i10;
- epsJobattrib.mPrintDirection = i11;
- epsJobattrib.mDuplex = i12;
- int i18 = 0;
- int ensureLogin = ensureLogin(false);
- if (ensureLogin != 0) {
- return ensureLogin;
- }
- if (i17 == 1) {
- String str2 = str;
- i18 = (int) new File(str).length();
- i16 = i13;
- i15 = i14;
- } else {
- String str3 = str;
- i16 = 0;
- i15 = 0;
- }
- try {
- String createJobFileName = EcClientLibUtil.getCreateJobFileName(i, str);
- try {
- ensureLogin = mEcClientLib.CreateJob(i, createJobFileName == null ? i17 != 2 ? "iPrint" : "iPrint Photo" : createJobFileName, i18, epsJobattrib, i16, i15);
- mRemotePrintMaxFileSize = mEcClientLib.mEccJobInfo.mMaxFileSize;
- return ensureLogin;
- } catch (NullPointerException e) {
- e.printStackTrace();
- return ensureLogin;
- }
- } catch (Exception e2) {
- e2.printStackTrace();
- return -1;
- }
- }
- public int EpsonConnectChangePrintSetting() {
- EPLog.d("EpsonService", "EpsonConnectChangePrintSetting() called.");
- return mEcClientLib.ChangePrintSetting (epsJobattrib, EcClientLibUtil.quoteForJsonString (mailAddress), EcClientLibUtil.quoteForJsonString (accessKey), false);
- }
- public int EpsonConnectUploadFile(String str, int i) {
- EPLog.d("EpsonService", "EpsonConnectUploadFile() called. - " + str);
- int ensureLogin = ensureLogin(false);
- if (ensureLogin != 0) {
- return ensureLogin;
- }
- return mEcClientLib.UploadFile(str, (int) new File(str).length(), i);
- }
- public int EpsonConnectStartPrint(int i, int i2) {
- EPLog.d("EpsonService", "EpsonConnectStartPrint() called.");
- return mEcClientLib.StartPrint(i, i2);
- }
- public int EpsonConnectEndJob() {
- EPLog.d("EpsonService", "EpsonConnectEndJob() called.");
- int EndJob = mEcClientLib.EndJob();
- mEcClientLib.resetCancel();
- return EndJob;
- }
- public int EpsonConnectCheckSupportedFileType(String str) {
- EPLog.d("EpsonService", "EpsonConnectCheckSupportedFileType() called.");
- return 0;
- }
- public int EpsonConnectGetRenderingStatus(int[] iArr) {
- int GetRenderingStatus;
- synchronized (EpsonService.mConnect) {
- iArr[0] = 1;
- iArr[1] = 0;
- GetRenderingStatus = mEcClientLib.GetRenderingStatus();
- if (GetRenderingStatus == 0) {
- iArr[0] = mEcClientLib.mRenderStatus;
- iArr[1] = mEcClientLib.mCompletePage;
- }
- }
- return GetRenderingStatus;
- }
- public int EpsonConnectGetPreview(int i, String str) {
- int DownloadPreview;
- synchronized (EpsonService.mConnect) {
- EPLog.d("EpsonService", "EpsonConnectGetPreview() called.");
- DownloadPreview = mEcClientLib.DownloadPreview(i, str);
- }
- return DownloadPreview;
- }
- public int EpsonConnectGetSupportedMedia(int i, String str, String str2) {
- EpsSupportedMedia epsSupportedMedia;
- int i2 = i;
- String path = ExternalFileUtils.getInstance (getApplicationContext()).getSupportedMedia().getPath();
- WiFiDirectManager.setPriorityToSimpleAP(EpsonService.this, false);
- if (str == null || str.length() <= 0) {
- int ensureLogin = ensureLogin(false);
- if (ensureLogin != 0) {
- return ensureLogin;
- }
- } else {
- mEpsonConnectlogin = false;
- int Login = mEcClientLib.Login(EcClientLibUtil.quoteForJsonString(str), EcClientLibUtil.quoteForJsonString(str2), clientId);
- if (Login != 0) {
- return Login;
- }
- }
- int GetCapability = mEcClientLib.GetCapability();
- if (GetCapability != 0) {
- return GetCapability;
- }
- switch (i2) {
- case 1:
- epsSupportedMedia = mEcClientLib.mMediaAtRemote;
- break;
- case 2:
- epsSupportedMedia = mEcClientLib.mMediaAtPhoto;
- break;
- case 3:
- epsSupportedMedia = mEcClientLib.mMediaAtLocal;
- break;
- default:
- EPLog.e("EpsonService", "sourceType is invalid.");
- return -1;
- }
- try {
- File file = new File(path);
- DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(file));
- byte[] bArr = new byte[32];
- ByteBuffer wrap = ByteBuffer.wrap(bArr);
- wrap.order(ByteOrder.LITTLE_ENDIAN);
- wrap.clear();
- wrap.putInt(epsSupportedMedia.mJpegSizeLimit);
- wrap.putInt(r10);
- dataOutputStream.write(bArr, 0, wrap.position());
- wrap.clear();
- for (EpsMediaSize epsMediaSize : epsSupportedMedia.mSizeList) {
- wrap.putInt(epsMediaSize.mMediaSizeID);
- wrap.putInt(r13);
- dataOutputStream.write(bArr, 0, wrap.position());
- wrap.clear();
- for (EpsMediaType epsMediaType : epsMediaSize.mTypeList) {
- wrap.putInt(epsMediaType.mMediaTypeId);
- wrap.putInt(epsMediaType.mLayout);
- wrap.putInt(epsMediaType.mQuality);
- wrap.putInt(epsMediaType.mPaperSource);
- wrap.putInt(epsMediaType.mDuplex);
- dataOutputStream.write(bArr, 0, wrap.position());
- wrap.clear();
- }
- }
- wrap.putInt(epsSupportedMedia.mResolution);
- wrap.putInt(1);
- dataOutputStream.write(bArr, 0, wrap.position());
- wrap.clear();
- dataOutputStream.close();
- EPLog.i("EpsonService", "finishu output SUPPORTED_MEDIA for EC. filename = " + path + " sourceType = " + i2 + " filesize = " + file.length());
- Utils.copyFile(file, new File (getApplicationContext()).getSavedSupportedMedia().getPath()));
- return 0;
- } catch (IOException e) {
- EPLog.e("EpsonService", "get_epsonconnect_supported_media(): IOExceptin.");
- e.printStackTrace();
- return -1;
- }
- }
- public int ensureLogin(boolean z) {
- updateLoginInfo();
- if (z) {
- mEpsonConnectlogin = false;
- }
- if (!mEpsonConnectlogin) {
- int Login = mEcClientLib.Login (mailAddress), EcClientLibUtil.quoteForJsonString (accessKey), clientId);
- if (Login != 0) {
- return Login;
- }
- mEpsonConnectlogin = true;
- }
- return 0;
- }
- public int EpsonConnectGetRemotePrintMaxFileSize() {
- return mRemotePrintMaxFileSize;
- }
- public void EpsonConnectCancel() {
- mEcClientLib.cancel();
- }
- public void refreshRemotePrinterLogin() {
- updateLoginInfo();
- }
- };
- private int mCreatetSheetIndex = 0;
- volatile EPImageCreator mEPImageCreator;
- private final EscprLib mEscprLib = EscprLib.getInstance();
- Handler mHandler = new Handler(new Handler.Callback() {
- public boolean handleMessage(Message message) {
- int i = message.what;
- if (i != 30) {
- switch (i) {
- case 0:
- epsNotifyDataChange((String) message.obj);
- return true;
- case 1:
- epsNotifyContinueable(message.arg1);
- return true;
- case 2:
- epsNotifyError(message.arg1, message.arg2, ((Boolean) message.obj).booleanValue());
- return true;
- default:
- return true;
- }
- } else {
- epsNotifyPage(message.arg1);
- return true;
- }
- }
- });
- private LocalPrintThread mLocalPrintThread;
- private volatile int mSearchCount = 0;
- private String mailAddress = "";
- private Thread printingThread = null;
- private int probeMethod;
- private SearchingThread searchingPrinter = null;
- private int timeout_sec = -1;
- static /* synthetic */ int access$504(EpsonService epsonService) {
- int i = epsonService.mSearchCount + 1;
- epsonService.mSearchCount = i;
- return i;
- }
- static /* synthetic */ int access$506(EpsonService epsonService) {
- int i = epsonService.mSearchCount - 1;
- epsonService.mSearchCount = i;
- return i;
- }
- public void javaDebugCB() {
- System.out.println(debugString);
- debugString = "";
- }
- public void epsNotifyPage(int i) {
- EPLog.m304d(" Д percent = " + i);
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i2 = 0; i2 < beginBroadcast; i2++) {
- try {
- mCallbacks.getBroadcastItem(i2).onNotifyProgress(1, i);
- } catch (RemoteException e) {
- EPLog.e("Epson", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public void epsNotifyDataChange(String str) {
- String str2;
- EPLog.d(" ***************** epsNotifyDataChange() call: " + str);
- String str3 = "";
- String str4 = "";
- String[] split = str.split("\\|\\|");
- synchronized (mLockSearchingStatus) {
- if (!bNotifyPrinter) {
- bNotifyPrinter = true;
- }
- }
- synchronized (mLock) {
- String str5 = "";
- if (split.length >= 5) {
- str = split[0];
- str3 = split[1];
- str4 = split[2];
- if (split[3] != null) {
- str5 = split[3];
- }
- str2 = split[4] != null ? split[4] : "";
- } else if (split.length == 4) {
- str = split[0];
- str3 = split[1];
- str4 = split[2];
- if (split[3] != null) {
- str5 = split[3];
- str2 = "";
- } else {
- str2 = "";
- }
- } else if (split.length == 3) {
- str = split[0];
- str3 = split[1];
- str4 = split[2];
- str2 = "";
- } else {
- str2 = "";
- }
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i = 0; i < beginBroadcast; i++) {
- try {
- mCallbacks.getBroadcastItem(i).onFindPrinterResult(str, str3, str4, str5, str2);
- } catch (RemoteException e) {
- EPLog.e("Epson", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- private void updateLoginInfo() {
- clearRemotePrinterInfo();
- clientId = SharedPreferencesProvider.getInstace(this).getString(epson.common.Constants.PRINTER_CLIENT_ID, (String) null);
- EPLog.d("▲clientId = " + clientId);
- MyPrinter curPrinter = MyPrinter.getCurPrinter(this);
- mailAddress = curPrinter.getEmailAddress();
- accessKey = curPrinter.getRemotePrinterAccessKey(this);
- }
- private void clearRemotePrinterInfo() {
- StorageSecureStore.invalidateCache();
- new EPPrinterManager(getApplicationContext()).rollbackRemotePrinterInfo();
- }
- private synchronized void createSearchingThread() {
- EPLog.e("Epson", "createSearchingThread() call");
- searchingPrinter = new SearchingThread();
- }
- class SearchingThread extends Thread {
- private volatile boolean mExecuting_search_printer = false;
- SearchingThread() {
- }
- /* JADX WARNING: Code restructure failed: missing block: B:51:?, code lost:
- sleep(1000);
- epson.print.Util.EPLog.e("EpsonService", "sleep some second to waiting printing thread");
- */
- /* JADX WARNING: Code restructure failed: missing block: B:52:0x00fd, code lost:
- r2 = move-exception;
- */
- /* JADX WARNING: Code restructure failed: missing block: B:53:0x00fe, code lost:
- r2.printStackTrace();
- r2 = true;
- */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- public void run() {
- /*
- r7 = this;
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this
- r1 = 0
- boolean unused = r0.bEnd = r1
- r0 = 1
- r2 = 0
- L_0x0008:
- boolean r3 = interrupted()
- if (r3 == 0) goto L_0x0017
- java.lang.String r2 = "EpsonService"
- java.lang.String r3 = "user cancel searching printer"
- epson.print.Util.EPLog.e((java.lang.String) r2, (java.lang.String) r3)
- r2 = 1
- goto L_0x0025
- L_0x0017:
- java.lang.Object r3 = epson.print.service.EpsonService.mLockPrintingStatus
- monitor-enter(r3)
- epson.print.service.EpsonService r4 = epson.print.service.EpsonService.this // Catch:{ all -> 0x0104 }
- boolean r4 = r4.bPrinting // Catch:{ all -> 0x0104 }
- if (r4 != 0) goto L_0x00ee
- monitor-exit(r3) // Catch:{ all -> 0x0104 }
- L_0x0025:
- if (r2 == 0) goto L_0x0034
- java.lang.String r0 = "EpsonService"
- java.lang.String r1 = "bCancel = true"
- epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this
- epson.print.service.EpsonService.access$506(r0)
- return
- L_0x0034:
- java.lang.Object r2 = epson.print.service.EpsonService.mLockSearchingStatus
- monitor-enter(r2)
- epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this // Catch:{ all -> 0x00eb }
- boolean unused = r3.bSearching = r0 // Catch:{ all -> 0x00eb }
- r7.mExecuting_search_printer = r0 // Catch:{ all -> 0x00eb }
- monitor-exit(r2) // Catch:{ all -> 0x00eb }
- java.lang.String r2 = "EpsonService"
- java.lang.String r3 = "begin search printer"
- epson.print.Util.EPLog.e((java.lang.String) r2, (java.lang.String) r3)
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- int r2 = r2.timeout_sec
- r3 = -1
- r4 = 60
- if (r2 <= r3) goto L_0x005a
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- int r4 = r2.timeout_sec
- goto L_0x0070
- L_0x005a:
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- int r2 = r2.probeMethod
- r3 = 2
- if (r2 == r3) goto L_0x006a
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- java.lang.String r2 = r2.f406id
- goto L_0x0070
- L_0x006a:
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- java.lang.String r2 = r2.f407ip
- L_0x0070:
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- com.epson.mobilephone.common.wifidirect.WiFiDirectManager.setPriorityToSimpleAP(r2, r0)
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- com.epson.mobilephone.common.escpr.EscprLib r2 = r2.mEscprLib
- epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this
- android.os.Handler r3 = r3.mHandler
- r2.setHanlder(r3)
- java.lang.StringBuilder r2 = new java.lang.StringBuilder
- r2.<init>()
- java.lang.String r3 = "SearchingThread : search_printer2 ☆☆ timeout = "
- r2.append(r3)
- r2.append(r4)
- java.lang.String r2 = r2.toString()
- com.epson.mobilephone.common.EPLog.d(r2)
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- com.epson.mobilephone.common.escpr.EscprLib r2 = r2.mEscprLib
- epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this
- java.lang.String r3 = r3.f406id
- epson.print.service.EpsonService r5 = epson.print.service.EpsonService.this
- java.lang.String r5 = r5.f407ip
- epson.print.service.EpsonService r6 = epson.print.service.EpsonService.this
- int r6 = r6.probeMethod
- int r2 = r2.search_printer2(r3, r5, r6, r4)
- if (r2 != 0) goto L_0x00cc
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- java.lang.String r2 = r2.f406id
- if (r2 == 0) goto L_0x00cc
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- java.lang.String r2 = r2.f406id
- int r2 = r2.length()
- if (r2 <= 0) goto L_0x00cc
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this
- r2.bSetPrinter = r0
- L_0x00cc:
- java.lang.Object r0 = epson.print.service.EpsonService.mLockSearchingStatus
- monitor-enter(r0)
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ all -> 0x00e8 }
- boolean unused = r2.bSearching = r1 // Catch:{ all -> 0x00e8 }
- epson.print.service.EpsonService.bNotifyPrinter = r1 // Catch:{ all -> 0x00e8 }
- r7.mExecuting_search_printer = r1 // Catch:{ all -> 0x00e8 }
- monitor-exit(r0) // Catch:{ all -> 0x00e8 }
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this
- epson.print.service.EpsonService.access$506(r0)
- java.lang.String r0 = "Epson"
- java.lang.String r1 = "search printer finish"
- epson.print.Util.EPLog.e((java.lang.String) r0, (java.lang.String) r1)
- return
- L_0x00e8:
- r1 = move-exception
- monitor-exit(r0) // Catch:{ all -> 0x00e8 }
- throw r1
- L_0x00eb:
- r0 = move-exception
- monitor-exit(r2) // Catch:{ all -> 0x00eb }
- throw r0
- L_0x00ee:
- monitor-exit(r3) // Catch:{ all -> 0x0104 }
- r3 = 1000(0x3e8, double:4.94E-321)
- sleep(r3) // Catch:{ InterruptedException -> 0x00fd }
- java.lang.String r3 = "EpsonService"
- java.lang.String r4 = "sleep some second to waiting printing thread"
- epson.print.Util.EPLog.e((java.lang.String) r3, (java.lang.String) r4) // Catch:{ InterruptedException -> 0x00fd }
- goto L_0x0008
- L_0x00fd:
- r2 = move-exception
- r2.printStackTrace()
- r2 = 1
- goto L_0x0008
- L_0x0104:
- r0 = move-exception
- monitor-exit(r3) // Catch:{ all -> 0x0104 }
- throw r0
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.service.EpsonService.SearchingThread.run():void");
- }
- public void interrupt() {
- if (mExecuting_search_printer && mEscprLib.cancel_search_printer() == -1305) {
- mExecuting_search_printer = false;
- boolean unused = bEnd = true;
- }
- super.interrupt();
- synchronized (EpsonService.mLockSearchingStatus) {
- boolean unused2 = bSearching = false;
- }
- }
- }
- public boolean updateApfProgress(int i) {
- if (bCancelPrinting) {
- return false;
- }
- notifyProgress(2, i);
- return true;
- }
- private void stopSearchingThread() throws RemoteException {
- if (searchingPrinter != null) {
- mBinder.cancelSearchPrinter();
- }
- }
- private void startLocalNonPdfPrintThread(PrintSetting.Kind kind, EPImageList ePImageList, boolean z) {
- mLocalPrintThread = new LocalPrintThread(this, new LegacyRenderingController(this, ePImageList, kind), z);
- mLocalPrintThread.start();
- }
- private void startPdfPrintThread(String str, String str2, String str3, boolean z, int i, int i2, boolean z2) {
- mLocalPrintThread = new LocalPrintThread(this, new PdfRenderingController(this, str, str2, str3, z, new int[]{i, i2}), z2);
- mLocalPrintThread.start();
- }
- private synchronized int createECPrintingThread(final PrintSetting.Kind kind, final EPImageList ePImageList) {
- printingThread = new Thread() {
- /* JADX ERROR: IndexOutOfBoundsException in pass: RegionMakerVisitor
- java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
- at java.util.ArrayList.rangeCheck(ArrayList.java:657)
- at java.util.ArrayList.get(ArrayList.java:433)
- at jadx.core.dex.nodes.InsnNode.getArg(InsnNode.java:101)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:611)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:561)
- at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133)
- at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
- at jadx.core.dex.visitors.regions.RegionMaker.processExcHandler(RegionMaker.java:1043)
- at jadx.core.dex.visitors.regions.RegionMaker.processTryCatchBlocks(RegionMaker.java:975)
- at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:52)
- */
- public void run() {
- /*
- r29 = this;
- r7 = r29
- java.lang.Object r8 = epson.print.service.EpsonService.mPrinting
- monitor-enter(r8)
- java.lang.String r0 = "EpsonService"
- java.lang.String r1 = "createECPrintingThread() called."
- com.epson.mobilephone.common.EPLog.d(r0, r1) // Catch:{ all -> 0x040b }
- epson.print.screen.PrintSetting r0 = new epson.print.screen.PrintSetting // Catch:{ all -> 0x040b }
- epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
- epson.print.screen.PrintSetting$Kind r2 = r2 // Catch:{ all -> 0x040b }
- r0.<init>(r1, r2) // Catch:{ all -> 0x040b }
- r0.loadSettings() // Catch:{ all -> 0x040b }
- int r6 = r0.paperSizeValue // Catch:{ all -> 0x040b }
- int r13 = r0.paperTypeValue // Catch:{ all -> 0x040b }
- int r5 = r0.layoutValue // Catch:{ all -> 0x040b }
- int r4 = r0.qualityValue // Catch:{ all -> 0x040b }
- int r1 = r0.paperSourceValue // Catch:{ all -> 0x040b }
- int r3 = r0.colorValue // Catch:{ all -> 0x040b }
- int r2 = r0.copiesValue // Catch:{ all -> 0x040b }
- int r15 = r0.brightnessValue // Catch:{ all -> 0x040b }
- int r14 = r0.contrastValue // Catch:{ all -> 0x040b }
- int r12 = r0.saturationValue // Catch:{ all -> 0x040b }
- int r11 = r0.duplexValue // Catch:{ all -> 0x040b }
- int r10 = r0.feedDirectionValue // Catch:{ all -> 0x040b }
- r25 = 0
- epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
- r26 = r3
- r3 = 1
- boolean unused = r9.bPrinting = r3 // Catch:{ all -> 0x040b }
- r9 = 0
- boolean unused = epson.print.service.EpsonService.bCancelPrinting = r9 // Catch:{ all -> 0x040b }
- epson.print.service.EpsonService r3 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
- epson.provider.SharedPreferencesProvider$SharedPreferencesMulti r3 = epson.provider.SharedPreferencesProvider.getInstace(r3) // Catch:{ all -> 0x040b }
- java.lang.String r9 = "SOURCE_TYPE"
- r17 = r10
- r10 = 2
- int r3 = r3.getInt(r9, r10) // Catch:{ all -> 0x040b }
- epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- r10 = 0
- com.epson.mobilephone.common.wifidirect.WiFiDirectManager.setPriorityToSimpleAP(r9, r10) // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- epson.print.EPImageList r9 = r3 // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- epson.print.EPImage r9 = r9.get(r10) // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- r10 = 3
- r20 = r1
- r1 = 2
- if (r3 == r1) goto L_0x010b
- if (r3 != r10) goto L_0x0065
- goto L_0x010b
- L_0x0065:
- r1 = 1
- if (r3 != r1) goto L_0x0103
- epson.print.EPImageList r4 = r3 // Catch:{ Exception -> 0x0100, all -> 0x00fd }
- r5 = 0
- r4.get(r5) // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- epson.print.service.EpsonService r4 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- r4.epsNotifyPage(r5) // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- boolean r4 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- if (r4 == r1) goto L_0x00f7
- epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- epson.print.ecclient.EpsJobAttrib r1 = r1.epsJobattrib // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- r1.mCopies = r2 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- epson.print.service.IEpsonService$Stub r1 = r1.mBinder // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- int r9 = r1.EpsonConnectChangePrintSetting() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- if (r9 != 0) goto L_0x00f1
- epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- r2 = 50
- r1.epsNotifyPage(r2) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- boolean r1 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- r2 = 1
- if (r1 == r2) goto L_0x00e2
- int r1 = r0.startValue // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- int r2 = r0.endValue // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- epson.print.service.EpsonService r4 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- java.lang.String r6 = "PREFS_EPSON_CONNECT"
- epson.provider.SharedPreferencesProvider$SharedPreferencesMulti r4 = epson.provider.SharedPreferencesProvider.getInstace(r4, r6) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- java.lang.String r6 = "ENABLE_SHOW_PREVIEW"
- r10 = 1
- boolean r4 = r4.getBoolean(r6, r10) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- boolean r0 = r0.printAll // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- if (r4 == 0) goto L_0x00b4
- if (r0 != r10) goto L_0x00b6
- L_0x00b4:
- r1 = 0
- r2 = 0
- L_0x00b6:
- boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- if (r0 == r10) goto L_0x00dc
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- int r9 = r0.EpsonConnectStartPrint(r1, r2) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- if (r9 != 0) goto L_0x00d6
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- r1 = 100
- r0.epsNotifyPage(r1) // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- r28 = r3
- r1 = r9
- r9 = 1
- r15 = 1
- goto L_0x02be
- L_0x00d6:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- r0.<init>() // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- throw r0 // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- L_0x00dc:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- r0.<init>() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- throw r0 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- L_0x00e2:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- r0.<init>() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- throw r0 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- L_0x00e8:
- r0 = move-exception
- r1 = r0
- r2 = r3
- r3 = 1
- goto L_0x011b
- L_0x00ed:
- r0 = move-exception
- r2 = r3
- r3 = 1
- goto L_0x0122
- L_0x00f1:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- r0.<init>() // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- throw r0 // Catch:{ Exception -> 0x00ed, all -> 0x00e8 }
- L_0x00f7:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- r0.<init>() // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- throw r0 // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- L_0x00fd:
- r0 = move-exception
- r5 = 0
- goto L_0x0117
- L_0x0100:
- r0 = move-exception
- r5 = 0
- goto L_0x011f
- L_0x0103:
- r5 = 0
- r28 = r3
- r1 = 0
- r9 = 1
- r15 = 1
- goto L_0x02be
- L_0x010b:
- r1 = 100
- r16 = 0
- java.lang.String r0 = r9.loadImageFileName // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- if (r3 != r10) goto L_0x0125
- java.lang.String r0 = r9.webUrl // Catch:{ Exception -> 0x011e, all -> 0x0116 }
- goto L_0x0125
- L_0x0116:
- r0 = move-exception
- L_0x0117:
- r1 = r0
- r2 = r3
- r3 = 1
- r9 = 0
- L_0x011b:
- r15 = 1
- goto L_0x03da
- L_0x011e:
- r0 = move-exception
- L_0x011f:
- r2 = r3
- r3 = 1
- r9 = 0
- L_0x0122:
- r15 = 1
- goto L_0x0373
- L_0x0125:
- epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- epson.print.service.IEpsonService$Stub r9 = r9.mBinder // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- r23 = 0
- r24 = 0
- r10 = 0
- r27 = r2
- r21 = r17
- r2 = 0
- r10 = r3
- r22 = r11
- r11 = r0
- r0 = r12
- r12 = r6
- r19 = r14
- r14 = r5
- r18 = r15
- r15 = r4
- r16 = r20
- r17 = r26
- r20 = r0
- int r19 = r9.EpsonConnectCreateJob(r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24) // Catch:{ Exception -> 0x036e, all -> 0x0366 }
- if (r19 != 0) goto L_0x035a
- boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0353, all -> 0x034a }
- r9 = 1
- if (r0 == r9) goto L_0x033e
- epson.print.service.EpsonService r9 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0353, all -> 0x034a }
- epson.print.EPImageList r10 = r3 // Catch:{ Exception -> 0x0353, all -> 0x034a }
- r11 = 0
- r14 = 0
- r16 = 0
- r18 = 0
- r12 = r6
- r13 = r26
- r15 = r5
- r17 = r4
- r9.createPrintImage(r10, r11, r12, r13, r14, r15, r16, r17, r18) // Catch:{ Exception -> 0x0353, all -> 0x034a }
- r9 = 0
- L_0x0168:
- epson.print.EPImageList r0 = r3 // Catch:{ Exception -> 0x0337, all -> 0x032e }
- int r0 = r0.size() // Catch:{ Exception -> 0x0337, all -> 0x032e }
- if (r9 >= r0) goto L_0x0292
- epson.print.EPImageList r0 = r3 // Catch:{ Exception -> 0x028d, all -> 0x0287 }
- epson.print.EPImage r0 = r0.get(r9) // Catch:{ Exception -> 0x028d, all -> 0x0287 }
- epson.print.service.EpsonService r10 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0281, all -> 0x027a }
- r10.epsNotifyPage(r2) // Catch:{ Exception -> 0x0281, all -> 0x027a }
- boolean r10 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0281, all -> 0x027a }
- r11 = 1
- if (r10 == r11) goto L_0x0264
- epson.print.service.EpsonService r10 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0281, all -> 0x027a }
- int r12 = r9 + 1
- int unused = r10.mCreatetSheetIndex = r12 // Catch:{ Exception -> 0x0281, all -> 0x027a }
- epson.print.service.EpsonService$3$1 r10 = new epson.print.service.EpsonService$3$1 // Catch:{ Exception -> 0x0281, all -> 0x027a }
- r13 = 100
- r1 = r10
- r14 = r27
- r15 = 0
- r2 = r29
- r28 = r3
- r11 = r26
- r15 = 1
- r3 = r6
- r17 = r4
- r4 = r11
- r18 = r5
- r19 = r6
- r6 = r17
- r1.<init>(r3, r4, r5, r6) // Catch:{ Exception -> 0x0274, all -> 0x026d }
- epson.print.EPImageList r1 = r3 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- int r1 = r1.size() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- if (r12 >= r1) goto L_0x01b0
- r10.start() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- L_0x01b0:
- epson.print.service.EpsonService r1 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- r2 = 25
- r1.epsNotifyPage(r2) // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- epson.print.EPImageCreator r1 = new epson.print.EPImageCreator // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- android.content.Context r2 = r2.getApplicationContext() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- r1.<init>(r2) // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- int r1 = r1.createJpegImage(r0, r13) // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- if (r1 != 0) goto L_0x023c
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
- r3 = 50
- r2.epsNotifyPage(r3) // Catch:{ Exception -> 0x0234, all -> 0x022c }
- boolean r2 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0234, all -> 0x022c }
- if (r2 == r15) goto L_0x0226
- epson.print.service.EpsonService r2 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
- epson.print.service.IEpsonService$Stub r2 = r2.mBinder // Catch:{ Exception -> 0x0234, all -> 0x022c }
- java.lang.String r0 = r0.decodeImageFileName // Catch:{ Exception -> 0x0234, all -> 0x022c }
- int r1 = r2.EpsonConnectUploadFile(r0, r12) // Catch:{ Exception -> 0x0234, all -> 0x022c }
- if (r1 != 0) goto L_0x0220
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
- r2 = 75
- r0.epsNotifyPage(r2) // Catch:{ Exception -> 0x0234, all -> 0x022c }
- boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0234, all -> 0x022c }
- if (r0 == r15) goto L_0x021a
- r10.join() // Catch:{ Exception -> 0x0234, all -> 0x022c }
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0234, all -> 0x022c }
- r0.epsNotifyPage(r13) // Catch:{ Exception -> 0x0234, all -> 0x022c }
- boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0234, all -> 0x022c }
- if (r0 == r15) goto L_0x0214
- r25 = r10
- r26 = r11
- r9 = r12
- r27 = r14
- r4 = r17
- r5 = r18
- r6 = r19
- r3 = r28
- r2 = 0
- r19 = r1
- r1 = 100
- goto L_0x0168
- L_0x0214:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- r0.<init>() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- throw r0 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- L_0x021a:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- r0.<init>() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- throw r0 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- L_0x0220:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0234, all -> 0x022c }
- r0.<init>() // Catch:{ Exception -> 0x0234, all -> 0x022c }
- throw r0 // Catch:{ Exception -> 0x0234, all -> 0x022c }
- L_0x0226:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- r0.<init>() // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- throw r0 // Catch:{ Exception -> 0x025f, all -> 0x0259 }
- L_0x022c:
- r0 = move-exception
- r3 = r9
- r25 = r10
- r2 = r28
- goto L_0x0310
- L_0x0234:
- r0 = move-exception
- r3 = r9
- r25 = r10
- r2 = r28
- goto L_0x0317
- L_0x023c:
- r1 = -1200(0xfffffffffffffb50, float:NaN)
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x024f, all -> 0x0244 }
- r0.<init>() // Catch:{ Exception -> 0x024f, all -> 0x0244 }
- throw r0 // Catch:{ Exception -> 0x024f, all -> 0x0244 }
- L_0x0244:
- r0 = move-exception
- r1 = r0
- r3 = r9
- r25 = r10
- r2 = r28
- r9 = -1200(0xfffffffffffffb50, float:NaN)
- goto L_0x03da
- L_0x024f:
- r0 = move-exception
- r3 = r9
- r25 = r10
- r2 = r28
- r9 = -1200(0xfffffffffffffb50, float:NaN)
- goto L_0x0373
- L_0x0259:
- r0 = move-exception
- r1 = r0
- r3 = r9
- r25 = r10
- goto L_0x0270
- L_0x025f:
- r0 = move-exception
- r3 = r9
- r25 = r10
- goto L_0x0276
- L_0x0264:
- r28 = r3
- r15 = 1
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0274, all -> 0x026d }
- r0.<init>() // Catch:{ Exception -> 0x0274, all -> 0x026d }
- throw r0 // Catch:{ Exception -> 0x0274, all -> 0x026d }
- L_0x026d:
- r0 = move-exception
- r1 = r0
- r3 = r9
- L_0x0270:
- r2 = r28
- goto L_0x036b
- L_0x0274:
- r0 = move-exception
- r3 = r9
- L_0x0276:
- r2 = r28
- goto L_0x0372
- L_0x027a:
- r0 = move-exception
- r15 = 1
- r1 = r0
- r2 = r3
- L_0x027e:
- r3 = r9
- goto L_0x036b
- L_0x0281:
- r0 = move-exception
- r15 = 1
- r2 = r3
- L_0x0284:
- r3 = r9
- goto L_0x0372
- L_0x0287:
- r0 = move-exception
- r15 = 1
- r1 = r0
- r2 = r3
- goto L_0x0332
- L_0x028d:
- r0 = move-exception
- r15 = 1
- r2 = r3
- goto L_0x033a
- L_0x0292:
- r28 = r3
- r14 = r27
- r15 = 1
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x032a, all -> 0x0326 }
- epson.print.ecclient.EpsJobAttrib r0 = r0.epsJobattrib // Catch:{ Exception -> 0x032a, all -> 0x0326 }
- r0.mCopies = r14 // Catch:{ Exception -> 0x032a, all -> 0x0326 }
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x032a, all -> 0x0326 }
- epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x032a, all -> 0x0326 }
- int r1 = r0.EpsonConnectChangePrintSetting() // Catch:{ Exception -> 0x032a, all -> 0x0326 }
- if (r1 != 0) goto L_0x031a
- boolean r0 = epson.print.service.EpsonService.bCancelPrinting // Catch:{ Exception -> 0x0313, all -> 0x030c }
- if (r0 == r15) goto L_0x02fd
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x0313, all -> 0x030c }
- epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x0313, all -> 0x030c }
- r2 = 0
- int r1 = r0.EpsonConnectStartPrint(r2, r2) // Catch:{ Exception -> 0x0313, all -> 0x030c }
- if (r1 != 0) goto L_0x02f5
- L_0x02be:
- if (r25 == 0) goto L_0x02c6
- r25.join() // Catch:{ Exception -> 0x02d4 }
- r2 = r28
- goto L_0x02c8
- L_0x02c6:
- r2 = r28
- L_0x02c8:
- if (r2 == r15) goto L_0x02d6
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x02d4 }
- epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x02d4 }
- r0.EpsonConnectEndJob() // Catch:{ Exception -> 0x02d4 }
- goto L_0x02d6
- L_0x02d4:
- r0 = move-exception
- goto L_0x02e7
- L_0x02d6:
- if (r2 != r15) goto L_0x02de
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x02d4 }
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r15) // Catch:{ Exception -> 0x02d4 }
- goto L_0x02e3
- L_0x02de:
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x02d4 }
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r9) // Catch:{ Exception -> 0x02d4 }
- L_0x02e3:
- epson.print.service.EpsonService.onNotifyEndJob(r1) // Catch:{ Exception -> 0x02d4 }
- goto L_0x02ea
- L_0x02e7:
- r0.printStackTrace() // Catch:{ all -> 0x040b }
- L_0x02ea:
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
- r1 = 0
- boolean unused = r0.bPrinting = r1 // Catch:{ all -> 0x040b }
- L_0x02f0:
- boolean unused = epson.print.service.EpsonService.bCancelPrinting = r1 // Catch:{ all -> 0x040b }
- goto L_0x03d3
- L_0x02f5:
- r2 = r28
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0324, all -> 0x0322 }
- r0.<init>() // Catch:{ Exception -> 0x0324, all -> 0x0322 }
- throw r0 // Catch:{ Exception -> 0x0324, all -> 0x0322 }
- L_0x02fd:
- r2 = r28
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0309, all -> 0x0305 }
- r0.<init>() // Catch:{ Exception -> 0x0309, all -> 0x0305 }
- throw r0 // Catch:{ Exception -> 0x0309, all -> 0x0305 }
- L_0x0305:
- r0 = move-exception
- r1 = r0
- goto L_0x027e
- L_0x0309:
- r0 = move-exception
- goto L_0x0284
- L_0x030c:
- r0 = move-exception
- r2 = r28
- L_0x030f:
- r3 = r9
- L_0x0310:
- r9 = r1
- goto L_0x03d9
- L_0x0313:
- r0 = move-exception
- r2 = r28
- L_0x0316:
- r3 = r9
- L_0x0317:
- r9 = r1
- goto L_0x0373
- L_0x031a:
- r2 = r28
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0324, all -> 0x0322 }
- r0.<init>() // Catch:{ Exception -> 0x0324, all -> 0x0322 }
- throw r0 // Catch:{ Exception -> 0x0324, all -> 0x0322 }
- L_0x0322:
- r0 = move-exception
- goto L_0x030f
- L_0x0324:
- r0 = move-exception
- goto L_0x0316
- L_0x0326:
- r0 = move-exception
- r2 = r28
- goto L_0x0331
- L_0x032a:
- r0 = move-exception
- r2 = r28
- goto L_0x033a
- L_0x032e:
- r0 = move-exception
- r2 = r3
- r15 = 1
- L_0x0331:
- r1 = r0
- L_0x0332:
- r3 = r9
- r9 = r19
- goto L_0x03da
- L_0x0337:
- r0 = move-exception
- r2 = r3
- r15 = 1
- L_0x033a:
- r3 = r9
- r9 = r19
- goto L_0x0373
- L_0x033e:
- r2 = r3
- r15 = 1
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0348, all -> 0x0346 }
- r0.<init>() // Catch:{ Exception -> 0x0348, all -> 0x0346 }
- throw r0 // Catch:{ Exception -> 0x0348, all -> 0x0346 }
- L_0x0346:
- r0 = move-exception
- goto L_0x0369
- L_0x0348:
- r0 = move-exception
- goto L_0x0371
- L_0x034a:
- r0 = move-exception
- r2 = r3
- r15 = 1
- L_0x034d:
- r1 = r0
- r9 = r19
- r3 = 1
- goto L_0x03da
- L_0x0353:
- r0 = move-exception
- r2 = r3
- r15 = 1
- L_0x0356:
- r9 = r19
- r3 = 1
- goto L_0x0373
- L_0x035a:
- r2 = r3
- r15 = 1
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x0364, all -> 0x0362 }
- r0.<init>() // Catch:{ Exception -> 0x0364, all -> 0x0362 }
- throw r0 // Catch:{ Exception -> 0x0364, all -> 0x0362 }
- L_0x0362:
- r0 = move-exception
- goto L_0x034d
- L_0x0364:
- r0 = move-exception
- goto L_0x0356
- L_0x0366:
- r0 = move-exception
- r2 = r3
- r15 = 1
- L_0x0369:
- r1 = r0
- r3 = 1
- L_0x036b:
- r9 = 0
- goto L_0x03da
- L_0x036e:
- r0 = move-exception
- r2 = r3
- r15 = 1
- L_0x0371:
- r3 = 1
- L_0x0372:
- r9 = 0
- L_0x0373:
- r0.printStackTrace() // Catch:{ all -> 0x03d8 }
- java.lang.Object r1 = epson.print.service.EpsonService.mLock // Catch:{ all -> 0x03d8 }
- monitor-enter(r1) // Catch:{ all -> 0x03d8 }
- android.os.RemoteCallbackList<epson.print.service.IEpsonServiceCallback> r0 = epson.print.service.EpsonService.mCallbacks // Catch:{ all -> 0x03d5 }
- int r4 = r0.beginBroadcast() // Catch:{ all -> 0x03d5 }
- r5 = 0
- L_0x0382:
- if (r5 >= r4) goto L_0x039e
- android.os.RemoteCallbackList<epson.print.service.IEpsonServiceCallback> r0 = epson.print.service.EpsonService.mCallbacks // Catch:{ RemoteException -> 0x0391 }
- android.os.IInterface r0 = r0.getBroadcastItem(r5) // Catch:{ RemoteException -> 0x0391 }
- epson.print.service.IEpsonServiceCallback r0 = (epson.print.service.IEpsonServiceCallback) r0 // Catch:{ RemoteException -> 0x0391 }
- r6 = 0
- r0.onNotifyError(r6, r9, r6) // Catch:{ RemoteException -> 0x0391 }
- goto L_0x039b
- L_0x0391:
- r0 = move-exception
- java.lang.String r6 = "EpsonService"
- java.lang.String r0 = r0.toString() // Catch:{ all -> 0x03d5 }
- epson.print.Util.EPLog.e((java.lang.String) r6, (java.lang.String) r0) // Catch:{ all -> 0x03d5 }
- L_0x039b:
- int r5 = r5 + 1
- goto L_0x0382
- L_0x039e:
- android.os.RemoteCallbackList<epson.print.service.IEpsonServiceCallback> r0 = epson.print.service.EpsonService.mCallbacks // Catch:{ all -> 0x03d5 }
- r0.finishBroadcast() // Catch:{ all -> 0x03d5 }
- monitor-exit(r1) // Catch:{ all -> 0x03d5 }
- if (r25 == 0) goto L_0x03a9
- r25.join() // Catch:{ Exception -> 0x03b5 }
- L_0x03a9:
- if (r2 == r15) goto L_0x03b7
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03b5 }
- epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x03b5 }
- r0.EpsonConnectEndJob() // Catch:{ Exception -> 0x03b5 }
- goto L_0x03b7
- L_0x03b5:
- r0 = move-exception
- goto L_0x03c8
- L_0x03b7:
- if (r2 != r15) goto L_0x03bf
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03b5 }
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r15) // Catch:{ Exception -> 0x03b5 }
- goto L_0x03c4
- L_0x03bf:
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03b5 }
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r3) // Catch:{ Exception -> 0x03b5 }
- L_0x03c4:
- epson.print.service.EpsonService.onNotifyEndJob(r9) // Catch:{ Exception -> 0x03b5 }
- goto L_0x03cb
- L_0x03c8:
- r0.printStackTrace() // Catch:{ all -> 0x040b }
- L_0x03cb:
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
- r1 = 0
- boolean unused = r0.bPrinting = r1 // Catch:{ all -> 0x040b }
- goto L_0x02f0
- L_0x03d3:
- monitor-exit(r8) // Catch:{ all -> 0x040b }
- return
- L_0x03d5:
- r0 = move-exception
- monitor-exit(r1) // Catch:{ all -> 0x03d5 }
- throw r0 // Catch:{ all -> 0x03d8 }
- L_0x03d8:
- r0 = move-exception
- L_0x03d9:
- r1 = r0
- L_0x03da:
- if (r25 == 0) goto L_0x03df
- r25.join() // Catch:{ Exception -> 0x03eb }
- L_0x03df:
- if (r2 == r15) goto L_0x03ed
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03eb }
- epson.print.service.IEpsonService$Stub r0 = r0.mBinder // Catch:{ Exception -> 0x03eb }
- r0.EpsonConnectEndJob() // Catch:{ Exception -> 0x03eb }
- goto L_0x03ed
- L_0x03eb:
- r0 = move-exception
- goto L_0x03fe
- L_0x03ed:
- if (r2 != r15) goto L_0x03f5
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03eb }
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r15) // Catch:{ Exception -> 0x03eb }
- goto L_0x03fa
- L_0x03f5:
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ Exception -> 0x03eb }
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r3) // Catch:{ Exception -> 0x03eb }
- L_0x03fa:
- epson.print.service.EpsonService.onNotifyEndJob(r9) // Catch:{ Exception -> 0x03eb }
- goto L_0x0401
- L_0x03fe:
- r0.printStackTrace() // Catch:{ all -> 0x040b }
- L_0x0401:
- epson.print.service.EpsonService r0 = epson.print.service.EpsonService.this // Catch:{ all -> 0x040b }
- r2 = 0
- boolean unused = r0.bPrinting = r2 // Catch:{ all -> 0x040b }
- boolean unused = epson.print.service.EpsonService.bCancelPrinting = r2 // Catch:{ all -> 0x040b }
- throw r1 // Catch:{ all -> 0x040b }
- L_0x040b:
- r0 = move-exception
- monitor-exit(r8) // Catch:{ all -> 0x040b }
- throw r0
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.service.EpsonService.C23713.run():void");
- }
- };
- return 0;
- }
- /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r14v1, resolved type: epson.print.EPImageCreator} */
- /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r14v2, resolved type: java.lang.String} */
- /* JADX WARNING: type inference failed for: r14v0 */
- /* JADX WARNING: type inference failed for: r14v4 */
- /* JADX WARNING: type inference failed for: r14v5 */
- /* JADX WARNING: type inference failed for: r14v7 */
- /* JADX WARNING: type inference failed for: r14v8 */
- /* JADX ERROR: IndexOutOfBoundsException in pass: RegionMakerVisitor
- java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
- at java.util.ArrayList.rangeCheck(ArrayList.java:657)
- at java.util.ArrayList.get(ArrayList.java:433)
- at jadx.core.dex.nodes.InsnNode.getArg(InsnNode.java:101)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:611)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.traverseMonitorExits(RegionMaker.java:619)
- at jadx.core.dex.visitors.regions.RegionMaker.processMonitorEnter(RegionMaker.java:561)
- at jadx.core.dex.visitors.regions.RegionMaker.traverse(RegionMaker.java:133)
- at jadx.core.dex.visitors.regions.RegionMaker.makeRegion(RegionMaker.java:86)
- at jadx.core.dex.visitors.regions.RegionMaker.processExcHandler(RegionMaker.java:1043)
- at jadx.core.dex.visitors.regions.RegionMaker.processTryCatchBlocks(RegionMaker.java:975)
- at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:52)
- */
- /* JADX WARNING: Can't fix incorrect switch cases order */
- /* JADX WARNING: Multi-variable type inference failed */
- 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) {
- /*
- r17 = this;
- r1 = r17
- r0 = r20
- r2 = r22
- r9 = r23
- com.epson.mobilephone.common.EPLog.m68d()
- epson.print.EPImage r15 = r18.get(r19)
- epson.print.EPImageCreator r3 = new epson.print.EPImageCreator
- android.content.Context r4 = r17.getApplicationContext()
- r3.<init>(r4)
- java.lang.Object r4 = mCancelLock
- monitor-enter(r4)
- r1.mEPImageCreator = r3 // Catch:{ all -> 0x023d }
- monitor-exit(r4) // Catch:{ all -> 0x023d }
- java.lang.System.gc()
- r14 = 0
- boolean r4 = bCancelPrinting // Catch:{ Exception -> 0x022f }
- r5 = 1
- if (r4 == r5) goto L_0x0229
- com.epson.mobilephone.common.escpr.EscprLib r4 = r1.mEscprLib // Catch:{ Exception -> 0x022f }
- int[] r4 = r4.get_printable_area() // Catch:{ Exception -> 0x022f }
- epson.print.MyPrinter.getCurPrinter(r17) // Catch:{ Exception -> 0x022f }
- boolean r13 = epson.print.MyPrinter.isRemotePrinter(r17) // Catch:{ Exception -> 0x022f }
- java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ Exception -> 0x022f }
- r6.<init>() // Catch:{ Exception -> 0x022f }
- java.lang.String r7 = " ☆☆ isRemotePrinter "
- r6.append(r7) // Catch:{ Exception -> 0x022f }
- r6.append(r13) // Catch:{ Exception -> 0x022f }
- java.lang.String r6 = r6.toString() // Catch:{ Exception -> 0x022f }
- com.epson.mobilephone.common.EPLog.i(r6) // Catch:{ Exception -> 0x022f }
- r6 = 2
- r7 = 0
- if (r13 != r5) goto L_0x00e2
- android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
- epson.common.Info_paper r4 = epson.common.Info_paper.getInfoPaper(r4, r0) // Catch:{ Exception -> 0x022f }
- int[] r8 = new int[r6] // Catch:{ Exception -> 0x022f }
- if (r9 != r6) goto L_0x0065
- int r10 = r4.getPaper_width_boder() // Catch:{ Exception -> 0x022f }
- r8[r7] = r10 // Catch:{ Exception -> 0x022f }
- int r4 = r4.getPaper_height_boder() // Catch:{ Exception -> 0x022f }
- r8[r5] = r4 // Catch:{ Exception -> 0x022f }
- goto L_0x0073
- L_0x0065:
- if (r9 != r5) goto L_0x0073
- int r10 = r4.getPaper_width_boderless() // Catch:{ Exception -> 0x022f }
- r8[r7] = r10 // Catch:{ Exception -> 0x022f }
- int r4 = r4.getPaper_height_boderless() // Catch:{ Exception -> 0x022f }
- r8[r5] = r4 // Catch:{ Exception -> 0x022f }
- L_0x0073:
- int r4 = r15.srcWidth // Catch:{ Exception -> 0x022f }
- r10 = r8[r7] // Catch:{ Exception -> 0x022f }
- if (r4 <= r10) goto L_0x0080
- int r4 = r15.srcHeight // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- if (r4 <= r10) goto L_0x0080
- goto L_0x00e3
- L_0x0080:
- int r4 = r15.srcWidth // Catch:{ Exception -> 0x022f }
- r10 = r8[r7] // Catch:{ Exception -> 0x022f }
- if (r4 <= r10) goto L_0x009a
- r4 = r8[r7] // Catch:{ Exception -> 0x022f }
- float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r4 = r4 / r10
- int r10 = r15.srcHeight // Catch:{ Exception -> 0x022f }
- r8[r5] = r10 // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r10 = r10 * r4
- int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
- r8[r7] = r4 // Catch:{ Exception -> 0x022f }
- goto L_0x00e3
- L_0x009a:
- int r4 = r15.srcHeight // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- if (r4 <= r10) goto L_0x00b4
- r4 = r8[r5] // Catch:{ Exception -> 0x022f }
- float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
- r10 = r8[r7] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r4 = r4 / r10
- int r10 = r15.srcWidth // Catch:{ Exception -> 0x022f }
- r8[r7] = r10 // Catch:{ Exception -> 0x022f }
- r10 = r8[r7] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r10 = r10 * r4
- int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
- r8[r5] = r4 // Catch:{ Exception -> 0x022f }
- goto L_0x00e3
- L_0x00b4:
- int r4 = r15.srcWidth // Catch:{ Exception -> 0x022f }
- int r10 = r15.srcHeight // Catch:{ Exception -> 0x022f }
- if (r4 >= r10) goto L_0x00ce
- r4 = r8[r5] // Catch:{ Exception -> 0x022f }
- float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
- r10 = r8[r7] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r4 = r4 / r10
- int r10 = r15.srcWidth // Catch:{ Exception -> 0x022f }
- r8[r7] = r10 // Catch:{ Exception -> 0x022f }
- r10 = r8[r7] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r10 = r10 * r4
- int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
- r8[r5] = r4 // Catch:{ Exception -> 0x022f }
- goto L_0x00e3
- L_0x00ce:
- r4 = r8[r7] // Catch:{ Exception -> 0x022f }
- float r4 = (float) r4 // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r4 = r4 / r10
- int r10 = r15.srcHeight // Catch:{ Exception -> 0x022f }
- r8[r5] = r10 // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- float r10 = (float) r10 // Catch:{ Exception -> 0x022f }
- float r10 = r10 * r4
- int r4 = (int) r10 // Catch:{ Exception -> 0x022f }
- r8[r7] = r4 // Catch:{ Exception -> 0x022f }
- goto L_0x00e3
- L_0x00e2:
- r8 = r4
- L_0x00e3:
- r15.rotate = r7 // Catch:{ Exception -> 0x022f }
- epson.print.service.IEpsonService$Stub r4 = r1.mBinder // Catch:{ Exception -> 0x022f }
- int r4 = r4.getLang() // Catch:{ Exception -> 0x022f }
- switch(r4) {
- case 1: goto L_0x0142;
- case 2: goto L_0x0135;
- case 3: goto L_0x0135;
- case 4: goto L_0x00f0;
- case 5: goto L_0x0135;
- case 6: goto L_0x0135;
- case 7: goto L_0x00f0;
- default: goto L_0x00ee;
- } // Catch:{ Exception -> 0x022f }
- L_0x00ee:
- goto L_0x017f
- L_0x00f0:
- com.epson.mobilephone.common.escpr.EscprLib r4 = r1.mEscprLib // Catch:{ Exception -> 0x022f }
- boolean r4 = r4.pageS_needRotate2(r0) // Catch:{ Exception -> 0x022f }
- if (r4 == 0) goto L_0x011c
- r4 = r8[r7] // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- r8[r7] = r10 // Catch:{ Exception -> 0x022f }
- r8[r5] = r4 // Catch:{ Exception -> 0x022f }
- if (r24 != 0) goto L_0x010c
- boolean r4 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
- if (r4 != 0) goto L_0x010c
- int r4 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r4 = r4 + 90
- r15.rotate = r4 // Catch:{ Exception -> 0x022f }
- L_0x010c:
- if (r2 != r6) goto L_0x0118
- int r2 = r19 % 2
- if (r2 != r5) goto L_0x0118
- int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r2 = r2 + 180
- r15.rotate = r2 // Catch:{ Exception -> 0x022f }
- L_0x0118:
- r16 = 1
- goto L_0x0181
- L_0x011c:
- if (r24 != 0) goto L_0x0128
- boolean r4 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
- if (r4 != r5) goto L_0x0128
- int r4 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r4 = r4 + 90
- r15.rotate = r4 // Catch:{ Exception -> 0x022f }
- L_0x0128:
- if (r2 != r5) goto L_0x017f
- int r2 = r19 % 2
- if (r2 != r5) goto L_0x017f
- int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r2 = r2 + 180
- r15.rotate = r2 // Catch:{ Exception -> 0x022f }
- goto L_0x017f
- L_0x0135:
- if (r24 != 0) goto L_0x017f
- boolean r2 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
- if (r2 != r5) goto L_0x017f
- int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r2 = r2 + 90
- r15.rotate = r2 // Catch:{ Exception -> 0x022f }
- goto L_0x017f
- L_0x0142:
- r4 = r8[r7] // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- if (r4 > r10) goto L_0x014a
- r4 = 1
- goto L_0x014b
- L_0x014a:
- r4 = 0
- L_0x014b:
- if (r24 != 0) goto L_0x0166
- if (r4 != r5) goto L_0x015a
- boolean r10 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
- if (r10 != r5) goto L_0x015a
- int r10 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r10 = r10 + 90
- r15.rotate = r10 // Catch:{ Exception -> 0x022f }
- goto L_0x0166
- L_0x015a:
- if (r4 != 0) goto L_0x0166
- boolean r10 = r15.isPaperLandScape // Catch:{ Exception -> 0x022f }
- if (r10 != 0) goto L_0x0166
- int r10 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r10 = r10 + 90
- r15.rotate = r10 // Catch:{ Exception -> 0x022f }
- L_0x0166:
- int r10 = r19 % 2
- if (r10 != r5) goto L_0x017f
- if (r4 != r5) goto L_0x0175
- if (r2 != r5) goto L_0x0175
- int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r2 = r2 + 180
- r15.rotate = r2 // Catch:{ Exception -> 0x022f }
- goto L_0x017f
- L_0x0175:
- if (r4 != 0) goto L_0x017f
- if (r2 != r6) goto L_0x017f
- int r2 = r15.rotate // Catch:{ Exception -> 0x022f }
- int r2 = r2 + 180
- r15.rotate = r2 // Catch:{ Exception -> 0x022f }
- L_0x017f:
- r16 = 0
- L_0x0181:
- int r2 = r17.getLang() // Catch:{ Exception -> 0x022f }
- r4 = r25
- int r6 = r1.getStartPageResolution(r13, r4, r2) // Catch:{ Exception -> 0x022f }
- int r2 = r18.getRenderingMode() // Catch:{ Exception -> 0x022f }
- if (r2 != r5) goto L_0x01e1
- if (r24 != 0) goto L_0x01bb
- android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
- r7 = r8[r7] // Catch:{ Exception -> 0x022f }
- r8 = r8[r5] // Catch:{ Exception -> 0x022f }
- r2 = r3
- r3 = r4
- r4 = r15
- r5 = r6
- r6 = r7
- r7 = r8
- r8 = r20
- r9 = r23
- r10 = r24
- r11 = r21
- r12 = r26
- r0 = r14
- r14 = r16
- r2.createPrintImage(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14) // Catch:{ Exception -> 0x01b8 }
- java.lang.String r2 = r15.decodeImageFileName // Catch:{ Exception -> 0x01b8 }
- r15.printImageFileName = r2 // Catch:{ Exception -> 0x01b8 }
- r14 = r0
- goto L_0x0231
- L_0x01b8:
- r14 = r0
- goto L_0x022f
- L_0x01bb:
- android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
- r9 = r8[r7] // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- int r13 = r15.rotate // Catch:{ Exception -> 0x022f }
- r2 = r3
- r3 = r4
- r4 = r24
- r5 = r6
- r6 = r18
- r7 = r19
- r8 = r9
- r9 = r10
- r10 = r20
- r11 = r21
- r12 = r26
- r0 = r14
- r14 = r16
- java.lang.String r2 = r2.createMultiPrintImage(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14) // Catch:{ Exception -> 0x01b8 }
- r15.printImageFileName = r2 // Catch:{ Exception -> 0x01b8 }
- r14 = r0
- goto L_0x0231
- L_0x01e1:
- if (r24 == 0) goto L_0x020a
- java.lang.String r2 = "割り付け画像を生成"
- com.epson.mobilephone.common.EPLog.d(r2) // Catch:{ Exception -> 0x022f }
- android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
- r9 = r8[r7] // Catch:{ Exception -> 0x022f }
- r10 = r8[r5] // Catch:{ Exception -> 0x022f }
- int r13 = r15.rotate // Catch:{ Exception -> 0x022f }
- r2 = r3
- r3 = r4
- r4 = r24
- r5 = r6
- r6 = r18
- r7 = r19
- r8 = r9
- r9 = r10
- r10 = r20
- r11 = r21
- r12 = r26
- java.lang.String r0 = r2.createMultiPrintImage_org(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13) // Catch:{ Exception -> 0x022f }
- r15.printImageFileName = r0 // Catch:{ Exception -> 0x022f }
- goto L_0x0231
- L_0x020a:
- android.content.Context r4 = r17.getApplicationContext() // Catch:{ Exception -> 0x022f }
- r7 = r8[r7] // Catch:{ Exception -> 0x022f }
- r8 = r8[r5] // Catch:{ Exception -> 0x022f }
- r2 = r3
- r3 = r4
- r4 = r15
- r5 = r6
- r6 = r7
- r7 = r8
- r8 = r20
- r9 = r23
- r10 = r21
- r11 = r26
- r12 = r13
- r2.createPrintImage_origi(r3, r4, r5, r6, r7, r8, r9, r10, r11, r12) // Catch:{ Exception -> 0x022f }
- java.lang.String r0 = r15.decodeImageFileName // Catch:{ Exception -> 0x022f }
- r15.printImageFileName = r0 // Catch:{ Exception -> 0x022f }
- goto L_0x0231
- L_0x0229:
- java.lang.Exception r0 = new java.lang.Exception // Catch:{ Exception -> 0x022f }
- r0.<init>() // Catch:{ Exception -> 0x022f }
- throw r0 // Catch:{ Exception -> 0x022f }
- L_0x022f:
- r15.printImageFileName = r14
- L_0x0231:
- java.lang.Object r2 = mCancelLock
- monitor-enter(r2)
- r1.mEPImageCreator = r14 // Catch:{ all -> 0x023a }
- monitor-exit(r2) // Catch:{ all -> 0x023a }
- java.lang.String r0 = r15.printImageFileName
- return r0
- L_0x023a:
- r0 = move-exception
- monitor-exit(r2) // Catch:{ all -> 0x023a }
- throw r0
- L_0x023d:
- r0 = move-exception
- monitor-exit(r4) // Catch:{ all -> 0x023d }
- throw r0
- */
- 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");
- }
- private int getStartPageResolution(boolean z, int i, int i2) {
- if (z) {
- return EPImageCreator.getPrintAreaResolution(i2, i);
- }
- return mEscprLib.get_start_job_resolution2();
- }
- 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 {
- return mBinder.EpsonConnectCreateJob(i, str, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14);
- }
- private int epsonConnectEndJob() throws RemoteException {
- return mBinder.EpsonConnectEndJob();
- }
- private int epsonConnectUploadFile(String str, int i) throws RemoteException {
- return mBinder.EpsonConnectUploadFile(str, i);
- }
- private int epsonConnectChangePrintSetting() throws RemoteException {
- return mBinder.EpsonConnectChangePrintSetting();
- }
- private int epsonConnectStartPrint(int i, int i2) throws RemoteException {
- return mBinder.EpsonConnectStartPrint(i, i2);
- }
- private void setEpsonConnectCopies(int i) {
- epsJobattrib.mCopies = i;
- }
- public void waitIfSimpleAp() {
- int[] printerStatus;
- if (WiFiDirectManager.isSimpleAP(getApplicationContext())) {
- try {
- int[] iArr = new int[3];
- Thread.sleep(5000);
- int i = 0;
- do {
- printerStatus = getPrinterStatus();
- Thread.sleep(1000);
- i++;
- if (i >= 1800) {
- return;
- }
- } while (printerStatus[0] != 0);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- 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) {
- StringBuilder sb = new StringBuilder();
- sb.append("service:: paperSize = ");
- sb.append(i);
- sb.append(" paperType = ");
- int i12 = i2;
- sb.append(i12);
- sb.append(" layout = ");
- int i13 = i3;
- sb.append(i13);
- EPLog.m304d(sb.toString());
- return mEscprLib.start_job2(i, i12, i13, i4, i5, i6, i7, i8, i9, i10, i11, z);
- }
- public int getStartJobResolution() {
- return mEscprLib.get_start_job_resolution2();
- }
- public int startPage() {
- return mEscprLib.start_page();
- }
- public int endJob() {
- return mEscprLib.end_job();
- }
- public int printPage() {
- return mEscprLib.print_page();
- }
- public int getLang() {
- return mEscprLib.get_lang();
- }
- public int endPage(boolean z) {
- return mEscprLib.end_page(z);
- }
- public int initImage(String str) {
- return mEscprLib.init_image(str);
- }
- public int releaseImage() {
- return mEscprLib.release_image();
- }
- public int[] getPrintableArea() {
- return mEscprLib.get_printable_area();
- }
- @NonNull
- public int[] getLocalPrinterLayout1AreaSize(int i) {
- int[] iArr = mEscprLib.get_printable_area();
- if (i == 0) {
- return iArr;
- }
- return Info_paper.getMultiLayoutArea(i, iArr[0], iArr[1], mEscprLib.get_start_job_resolution2());
- }
- public boolean pageSneedRotate(int i) {
- return mEscprLib.pageS_needRotate2(i);
- }
- public int[] getPrinterStatus() {
- return mEscprLib.get_printer_status();
- }
- public Object getPrintLockObject() {
- return mPrinting;
- }
- public void setCancelPrinting(boolean z) {
- bCancelPrinting = z;
- }
- public boolean getCancelPrinting() {
- return bCancelPrinting;
- }
- public void setPrinting(boolean z) {
- bPrinting = z;
- }
- public void notifyEndJob(int i) {
- onNotifyEndJob(i);
- }
- public Context getLocalApplicationContext() {
- return getApplicationContext();
- }
- public void onCreate() {
- EPLog.i();
- super.onCreate();
- }
- public IBinder onBind(Intent intent) {
- EPLog.i();
- try {
- if (!isInitDriver) {
- mEscprLib.init_driver(getApplicationContext(), ExternalFileUtils.getInstance(getApplicationContext()).getSupportedMediaDir());
- isInitDriver = true;
- }
- updateLoginInfo();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return mBinder;
- }
- public void onRebind(Intent intent) {
- EPLog.i();
- mEscprLib.release_driver();
- isInitDriver = false;
- mEscprLib.init_driver(getApplicationContext(), ExternalFileUtils.getInstance(getApplicationContext()).getSupportedMediaDir());
- isInitDriver = true;
- clientId = SharedPreferencesProvider.getInstace(this).getString(epson.common.Constants.PRINTER_CLIENT_ID, (String) null);
- EPLog.d("▲clientId = " + clientId);
- MyPrinter curPrinter = MyPrinter.getCurPrinter(this);
- mailAddress = curPrinter.getEmailAddress();
- accessKey = curPrinter.getRemotePrinterAccessKey(this);
- super.onRebind(intent);
- }
- public boolean onUnbind(Intent intent) {
- EPLog.i();
- mEscprLib.setHanlder((Handler) null);
- mEscprLib.release_driver();
- isInitDriver = false;
- return super.onUnbind(intent);
- }
- public void onDestroy() {
- EPLog.i();
- super.onDestroy();
- }
- public static void onNotifyProgress(int i) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i2 = 0; i2 < beginBroadcast; i2++) {
- try {
- mCallbacks.getBroadcastItem(i2).onNotifyProgress(1, i);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public static void notifyProgress(int i, int i2) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i3 = 0; i3 < beginBroadcast; i3++) {
- try {
- mCallbacks.getBroadcastItem(i3).onNotifyProgress(i, i2);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public static void onNotifyContinueable(int i) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i2 = 0; i2 < beginBroadcast; i2++) {
- try {
- mCallbacks.getBroadcastItem(i2).onNotifyContinueable(i);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public void epsNotifyContinueable(int i) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i2 = 0; i2 < beginBroadcast; i2++) {
- try {
- mCallbacks.getBroadcastItem(i2).onNotifyContinueable(i);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public static void onNotifyEndJob(int i) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i2 = 0; i2 < beginBroadcast; i2++) {
- try {
- mCallbacks.getBroadcastItem(i2).onNotifyEndJob(i);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public static void onNotifyError(int i, int i2, boolean z) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i3 = 0; i3 < beginBroadcast; i3++) {
- try {
- mCallbacks.getBroadcastItem(i3).onNotifyError(i, i2, z);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- public void epsNotifyError(int i, int i2, boolean z) {
- synchronized (mLock) {
- int beginBroadcast = mCallbacks.beginBroadcast();
- for (int i3 = 0; i3 < beginBroadcast; i3++) {
- try {
- mCallbacks.getBroadcastItem(i3).onNotifyError(i, i2, z);
- } catch (RemoteException e) {
- EPLog.e("NotificationService", e.toString());
- }
- }
- mCallbacks.finishBroadcast();
- }
- }
- }
|