123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692 |
- package epson.print.service;
- import android.os.RemoteException;
- import com.epson.cameracopy.printlayout.ImageAndLayout;
- import com.epson.iprint.prtlogger.Analytics;
- import com.epson.mobilephone.common.wifidirect.WiFiDirectManager;
- import java.io.File;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
- import java.util.Locale;
- import epson.common.ExternalFileUtils;
- import epson.common.Info_paper;
- import epson.image.epsonImage;
- import epson.print.EPImageUtil;
- import epson.print.MyPrinter;
- import epson.print.screen.PrintSetting;
- class PrintAndLayoutThread extends Thread {
- private static final int DUPLEX_NONE = 0;
- private static final long REMOTE_FILE_SIZE_MAX = 10000000;
- private static final int[] REMOTE_IMAGE_CREATE_PROGRESS = {20, 25, 50, 70, 75};
- private static final int[] REMOTE_JPEG_QUALITYS = {95, 80};
- final int EPS_JOB_CANCELED = 40;
- private int mColorValue;
- private int mCopies;
- private final EpsonService mEpsonService;
- private final List<ImageAndLayout> mImageAndLayoutList;
- private boolean mIsBkRetry;
- private int mLayout;
- private int mPaperSizeId;
- private int mRemoteImageCreateProgress;
- public PrintAndLayoutThread(EpsonService epsonService, List<ImageAndLayout> list, boolean z) {
- mEpsonService = epsonService;
- mImageAndLayoutList = list;
- mIsBkRetry = z;
- }
- private int callStartJob() {
- int i;
- PrintSetting printSetting = new PrintSetting(mEpsonService, PrintSetting.Kind.cameracopy);
- printSetting.loadSettings();
- int i2 = printSetting.paperSizeValue;
- mPaperSizeId = i2;
- int i3 = printSetting.paperTypeValue;
- int i4 = printSetting.layoutValue;
- mLayout = i4;
- int i5 = printSetting.qualityValue;
- int i6 = printSetting.paperSourceValue;
- int i7 = printSetting.colorValue;
- mColorValue = i7;
- mCopies = printSetting.copiesValue;
- if (mEpsonService.getLang() == 2 || mEpsonService.getLang() == 3) {
- i = printSetting.feedDirectionValue;
- } else {
- i = 0;
- }
- return mEpsonService.startJob(i2, i3, i4, i5, i6, i7, 0, 0, 0, i, 0, mIsBkRetry);
- }
- private int getPrintRotation() {
- int lang = mEpsonService.getLang();
- return ((lang == 4 || lang == 7) && mEpsonService.pageSneedRotate(mPaperSizeId)) ? 1 : 0;
- }
- protected boolean createPrintImage(ImageAndLayout imageAndLayout, String str, int[] iArr) {
- int printRotation = getPrintRotation();
- int[] iArr2 = new int[2];
- boolean z = false;
- if ((printRotation & 1) != 0) {
- iArr2[0] = iArr[1];
- iArr2[1] = iArr[0];
- } else {
- iArr2[0] = iArr[0];
- iArr2[1] = iArr[1];
- }
- if (mColorValue == 1) {
- z = true;
- }
- return imageAndLayout.createPrintData(str, z, iArr2, printRotation);
- }
- private String getPrintFileName(int i) {
- return new File(ExternalFileUtils.getInstance(mEpsonService.getApplicationContext()).getPrintDir(), String.format(Locale.US, "_%02d.bmp", new Object[]{Integer.valueOf(i + 1)})).getPath();
- }
- public void run() {
- int i;
- synchronized (mEpsonService.getPrintLockObject()) {
- mEpsonService.setPrinting(true);
- mEpsonService.setCancelPrinting(false);
- if (MyPrinter.isRemotePrinter(mEpsonService)) {
- i = remotePrint();
- } else {
- i = localPrint();
- }
- if (i == 40) {
- i = 0;
- }
- mEpsonService.setPrinting(false);
- mEpsonService.setCancelPrinting(false);
- EpsonService.onNotifyEndJob(i);
- }
- }
- private int localPrint() {
- int i;
- try {
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), true);
- int callStartJob = callStartJob();
- if (callStartJob != 0) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return callStartJob;
- } else if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- } else {
- int[] printableArea = mEpsonService.getPrintableArea();
- int i2 = 0;
- i = 0;
- while (i2 < mCopies) {
- try {
- for (ImageAndLayout createPrintImage : mImageAndLayoutList) {
- String printFileName = getPrintFileName(0);
- if (!createPrintImage(createPrintImage, printFileName, printableArea)) {
- mEpsonService.epsNotifyError(-1, EpsonService.MEDIA_INFO_MEMORY_ERROR, false);
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return EpsonService.MEDIA_INFO_MEMORY_ERROR;
- } else if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- } else {
- int initImage = mEpsonService.initImage(printFileName);
- if (initImage != 0) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return initImage;
- } else if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- } else {
- int startPage = mEpsonService.startPage();
- if (startPage != 0) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return startPage;
- } else if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- } else {
- int printPage = mEpsonService.printPage();
- if (printPage != 0) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return printPage;
- } else if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- } else {
- int endPage = mEpsonService.endPage(false);
- if (endPage != 0) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return endPage;
- } else if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- } else {
- mEpsonService.releaseImage();
- if (mEpsonService.getCancelPrinting()) {
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), 0);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 40;
- }
- }
- }
- }
- }
- }
- }
- i2++;
- i = 1;
- } catch (Exception e) {
- e = e;
- try {
- e.printStackTrace();
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), i);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 0;
- } catch (Throwable th) {
- th = th;
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), i);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- throw th;
- }
- }
- }
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), i);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 0;
- }
- } catch (Exception e2) {
- e = e2;
- i = 0;
- e.printStackTrace();
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), i);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- return 0;
- } catch (Throwable th2) {
- th = th2;
- i = 0;
- mEpsonService.endJob();
- Analytics.savePrintInfo(mEpsonService.getApplicationContext(), i);
- mEpsonService.waitIfSimpleAp();
- WiFiDirectManager.setPriorityToSimpleAP(mEpsonService.getLocalApplicationContext(), false);
- throw th;
- }
- }
- private int remoteCreateJob() throws RemoteException {
- PrintSetting printSetting = new PrintSetting(mEpsonService, PrintSetting.Kind.cameracopy);
- printSetting.loadSettings();
- int i = printSetting.paperSizeValue;
- mPaperSizeId = i;
- int i2 = printSetting.paperTypeValue;
- int i3 = printSetting.layoutValue;
- mLayout = i3;
- int i4 = printSetting.qualityValue;
- int i5 = printSetting.paperSourceValue;
- int i6 = printSetting.colorValue;
- mColorValue = i6;
- mCopies = printSetting.copiesValue;
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmm", Locale.US);
- return mEpsonService.epsonConnectCreateJob(2, simpleDateFormat.format(new Date()) + ".jpg", i, i2, i3, i4, i5, i6, 0, 0, 0, 0, 0, 0, 0);
- }
- /* JADX WARNING: Removed duplicated region for block: B:136:0x01e9 */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- private int remotePrint() {
- /*
- r7 = this;
- r0 = -1
- r1 = 0
- epson.print.service.EpsonService r2 = r7.mEpsonService // Catch:{ Exception -> 0x01bc, all -> 0x01b8 }
- boolean r2 = r2.getCancelPrinting() // Catch:{ Exception -> 0x01bc, all -> 0x01b8 }
- if (r2 == 0) goto L_0x001e
- epson.print.service.EpsonService r0 = r7.mEpsonService
- android.content.Context r0 = r0.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r0, r1)
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x0019 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x0019 }
- goto L_0x001d
- L_0x0019:
- r0 = move-exception
- r0.printStackTrace()
- L_0x001d:
- return r1
- L_0x001e:
- int r2 = r7.remoteCreateJob() // Catch:{ Exception -> 0x01bc, all -> 0x01b8 }
- if (r2 == 0) goto L_0x003f
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x0034
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x0034:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x003a }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x003a }
- goto L_0x003e
- L_0x003a:
- r0 = move-exception
- r0.printStackTrace()
- L_0x003e:
- return r2
- L_0x003f:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r4 = 2
- r3.epsNotifyPage(r4) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- boolean r3 = r3.getCancelPrinting() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r3 == 0) goto L_0x0068
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x005d
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x005d:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x0063 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x0063 }
- goto L_0x0067
- L_0x0063:
- r0 = move-exception
- r0.printStackTrace()
- L_0x0067:
- return r1
- L_0x0068:
- java.lang.String r3 = r7.getPrintFileName(r1) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r4.<init>() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- java.lang.String r5 = "\\.\\w+$"
- java.lang.String r6 = ""
- java.lang.String r5 = r3.replaceFirst(r5, r6) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r4.append(r5) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- java.lang.String r5 = ".jpg"
- r4.append(r5) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- java.lang.String r4 = r4.toString() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- int r2 = r7.makeRemoteFile(r3, r4) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r2 == 0) goto L_0x00a6
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x009b
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x009b:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x00a1 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x00a1 }
- goto L_0x00a5
- L_0x00a1:
- r0 = move-exception
- r0.printStackTrace()
- L_0x00a5:
- return r2
- L_0x00a6:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r5 = 75
- r3.epsNotifyPage(r5) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- boolean r3 = r3.getCancelPrinting() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r3 == 0) goto L_0x00d0
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x00c5
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x00c5:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x00cb }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x00cb }
- goto L_0x00cf
- L_0x00cb:
- r0 = move-exception
- r0.printStackTrace()
- L_0x00cf:
- return r1
- L_0x00d0:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r5 = 1
- int r2 = r3.epsonConnectUploadFile(r4, r5) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r2 == 0) goto L_0x00f4
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x00e9
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x00e9:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x00ef }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x00ef }
- goto L_0x00f3
- L_0x00ef:
- r0 = move-exception
- r0.printStackTrace()
- L_0x00f3:
- return r2
- L_0x00f4:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r4 = 80
- r3.epsNotifyPage(r4) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- boolean r3 = r3.getCancelPrinting() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r3 == 0) goto L_0x011e
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x0113
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x0113:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x0119 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x0119 }
- goto L_0x011d
- L_0x0119:
- r0 = move-exception
- r0.printStackTrace()
- L_0x011d:
- return r1
- L_0x011e:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- int r4 = r7.mCopies // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r3.setEpsonConnectCopies(r4) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- int r2 = r3.epsonConnectChangePrintSetting() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r2 == 0) goto L_0x0148
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x013d
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x013d:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x0143 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x0143 }
- goto L_0x0147
- L_0x0143:
- r0 = move-exception
- r0.printStackTrace()
- L_0x0147:
- return r2
- L_0x0148:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- r4 = 90
- r3.epsNotifyPage(r4) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- boolean r3 = r3.getCancelPrinting() // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r3 == 0) goto L_0x0172
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x0167
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x0167:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x016d }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x016d }
- goto L_0x0171
- L_0x016d:
- r0 = move-exception
- r0.printStackTrace()
- L_0x0171:
- return r1
- L_0x0172:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- int r2 = r3.epsonConnectStartPrint(r1, r1) // Catch:{ Exception -> 0x01b6, all -> 0x01b4 }
- if (r2 == 0) goto L_0x0195
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r1)
- if (r2 == 0) goto L_0x018a
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x018a:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x0190 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x0190 }
- goto L_0x0194
- L_0x0190:
- r0 = move-exception
- r0.printStackTrace()
- L_0x0194:
- return r2
- L_0x0195:
- epson.print.service.EpsonService r3 = r7.mEpsonService // Catch:{ Exception -> 0x01b2 }
- r4 = 100
- r3.epsNotifyPage(r4) // Catch:{ Exception -> 0x01b2 }
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r5)
- if (r2 == 0) goto L_0x01ac
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- L_0x01ac:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x01d8 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x01d8 }
- goto L_0x01dc
- L_0x01b2:
- r3 = move-exception
- goto L_0x01bf
- L_0x01b4:
- r3 = move-exception
- goto L_0x01ba
- L_0x01b6:
- r3 = move-exception
- goto L_0x01be
- L_0x01b8:
- r3 = move-exception
- r2 = 0
- L_0x01ba:
- r5 = 0
- goto L_0x01de
- L_0x01bc:
- r3 = move-exception
- r2 = 0
- L_0x01be:
- r5 = 0
- L_0x01bf:
- r3.printStackTrace() // Catch:{ all -> 0x01dd }
- r2 = -1200(0xfffffffffffffb50, float:NaN)
- epson.print.service.EpsonService r3 = r7.mEpsonService
- android.content.Context r3 = r3.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r3, r5)
- epson.print.service.EpsonService r3 = r7.mEpsonService
- r3.epsNotifyError(r0, r2, r1)
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x01d8 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x01d8 }
- goto L_0x01dc
- L_0x01d8:
- r0 = move-exception
- r0.printStackTrace()
- L_0x01dc:
- return r1
- L_0x01dd:
- r3 = move-exception
- L_0x01de:
- epson.print.service.EpsonService r4 = r7.mEpsonService
- android.content.Context r4 = r4.getApplicationContext()
- com.epson.iprint.prtlogger.Analytics.savePrintInfo(r4, r5)
- if (r2 == 0) goto L_0x01ee
- epson.print.service.EpsonService r4 = r7.mEpsonService
- r4.epsNotifyError(r0, r2, r1)
- L_0x01ee:
- epson.print.service.EpsonService r0 = r7.mEpsonService // Catch:{ RemoteException -> 0x01f4 }
- r0.epsonConnectEndJob() // Catch:{ RemoteException -> 0x01f4 }
- goto L_0x01f8
- L_0x01f4:
- r0 = move-exception
- r0.printStackTrace()
- L_0x01f8:
- throw r3
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.service.PrintAndLayoutThread.remotePrint():int");
- }
- protected int[] getRemotePrintableArea(int i, int i2) {
- Info_paper infoPaper = Info_paper.getInfoPaper(mEpsonService.getApplicationContext(), i);
- int[] iArr = new int[2];
- if (i2 == 2) {
- iArr[0] = infoPaper.getPaper_width_boder();
- iArr[1] = infoPaper.getPaper_height_boder();
- } else if (i2 == 1) {
- iArr[0] = infoPaper.getPaper_width_boderless();
- iArr[1] = infoPaper.getPaper_height_boderless();
- }
- return iArr;
- }
- static int convertBmpToJpeg(String str, String str2) {
- return new epsonImage().bmp2Jpg2(str, str2);
- }
- protected EPImageUtil getEPImageUtil() {
- return new EPImageUtil();
- }
- private void updateRemoteImageCreateProgress() {
- int i = mRemoteImageCreateProgress;
- int[] iArr = REMOTE_IMAGE_CREATE_PROGRESS;
- if (i < iArr.length) {
- mEpsonService.epsNotifyPage(iArr[i]);
- mRemoteImageCreateProgress++;
- return;
- }
- mEpsonService.epsNotifyPage(iArr[iArr.length - 1]);
- }
- /* JADX WARNING: Code restructure failed: missing block: B:26:0x0072, code lost:
- r7 = r7 + 1;
- r6[0] = r6[0] / 2;
- r6[1] = r6[1] / 2;
- */
- /* Code decompiled incorrectly, please refer to instructions dump. */
- private int makeRemoteFile(java.lang.String r18, java.lang.String r19) {
- /*
- r17 = this;
- r0 = r17
- r1 = r18
- r2 = r19
- java.util.List<com.epson.cameracopy.printlayout.ImageAndLayout> r3 = r0.mImageAndLayoutList
- r4 = 0
- java.lang.Object r3 = r3.get(r4)
- com.epson.cameracopy.printlayout.ImageAndLayout r3 = (com.epson.cameracopy.printlayout.ImageAndLayout) r3
- epson.print.EPImageUtil r5 = r17.getEPImageUtil()
- int r6 = r0.mPaperSizeId
- int r7 = r0.mLayout
- int[] r6 = r0.getRemotePrintableArea(r6, r7)
- r0.mRemoteImageCreateProgress = r4
- r7 = 0
- L_0x001e:
- r8 = 2
- if (r7 >= r8) goto L_0x007f
- boolean r9 = r0.createPrintImage(r3, r1, r6)
- if (r9 != 0) goto L_0x002a
- r1 = -5201(0xffffffffffffebaf, float:NaN)
- return r1
- L_0x002a:
- r17.updateRemoteImageCreateProgress()
- epson.print.service.EpsonService r9 = r0.mEpsonService
- boolean r9 = r9.getCancelPrinting()
- if (r9 == 0) goto L_0x0036
- return r4
- L_0x0036:
- java.io.File r9 = new java.io.File
- r9.<init>(r2)
- r10 = 1
- if (r7 < r10) goto L_0x0043
- int[] r11 = REMOTE_JPEG_QUALITYS
- int r11 = r11.length
- int r11 = r11 - r10
- goto L_0x0044
- L_0x0043:
- r11 = 0
- L_0x0044:
- int[] r12 = REMOTE_JPEG_QUALITYS
- int r13 = r12.length
- if (r11 >= r13) goto L_0x0072
- r12 = r12[r11]
- int r12 = r5.bmp2jpg(r1, r2, r12)
- long r13 = r9.length()
- if (r12 != 0) goto L_0x0063
- r15 = 0
- int r12 = (r13 > r15 ? 1 : (r13 == r15 ? 0 : -1))
- if (r12 <= 0) goto L_0x0063
- r15 = 10000000(0x989680, double:4.9406565E-317)
- int r12 = (r13 > r15 ? 1 : (r13 == r15 ? 0 : -1))
- if (r12 >= 0) goto L_0x0063
- return r4
- L_0x0063:
- r17.updateRemoteImageCreateProgress()
- epson.print.service.EpsonService r12 = r0.mEpsonService
- boolean r12 = r12.getCancelPrinting()
- if (r12 == 0) goto L_0x006f
- return r4
- L_0x006f:
- int r11 = r11 + 1
- goto L_0x0044
- L_0x0072:
- int r7 = r7 + 1
- r9 = r6[r4]
- int r9 = r9 / r8
- r6[r4] = r9
- r9 = r6[r10]
- int r9 = r9 / r8
- r6[r10] = r9
- goto L_0x001e
- L_0x007f:
- r1 = -1205(0xfffffffffffffb4b, float:NaN)
- return r1
- */
- throw new UnsupportedOperationException("Method not decompiled: epson.print.service.PrintAndLayoutThread.makeRemoteFile(java.lang.String, java.lang.String):int");
- }
- protected int test_makeRemoteFile(String str, String str2) {
- return makeRemoteFile(str, str2);
- }
- }
|