Luсky+Рatcher v11.3.3版本的 MD5 值为:fcc08dfa98a57a21951c5463e292fdaf
以下内容为反编译后的 C1645.java 源代码,内容仅作参考
package javaroot.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.util.InternalZipConstants;
import org.jf.dexlib2.analysis.RegisterType;
import org.jf.dexlib2.dexbacked.raw.ItemType;
import p037.C2500;
import p040.C2631;
import p085.C2912;
import p085.C2975;
public class C1645 {
public static final byte[] f5361 = {100, 101, 121, 10, 48, 51, 53, 0};
public static String f5387 = "";
public static boolean f5413 = false;
public static boolean f5439 = false;
public static MappedByteBuffer f5465 = null;
public static int f5491 = 0;
public static byte[] f5517 = null;
public static byte[] f5543 = null;
public static byte[] f5569 = null;
public static byte[] f5595 = null;
public static byte[] f5621 = null;
public static byte[] f5647 = null;
public static byte[] f5673 = null;
public static byte[] f5699 = null;
public static byte[] f5725 = null;
public static byte[] f5751 = null;
public static byte[] f5777 = null;
public static byte[] f5803 = null;
public static byte[] f5829 = null;
public static byte[] f5835 = null;
public static byte[] f5837 = null;
public static byte[] f5839 = null;
public static byte[] f5841 = null;
public static byte[] f5843 = null;
public static byte[] f5845 = null;
public static byte[] f5846 = null;
public static byte[] f5794 = null;
public static byte[] f5821 = null;
public static byte[] f5362 = null;
public static byte[] f5416 = null;
public static byte[] f5389 = null;
public static byte[] f5470 = null;
public static byte[] f5443 = null;
public static byte[] f5740 = null;
public static byte[] f5497 = null;
public static byte[] f5551 = null;
public static byte[] f5524 = null;
public static byte[] f5605 = null;
public static byte[] f5578 = null;
public static byte[] f5659 = null;
public static byte[] f5632 = null;
public static byte[] f5686 = null;
public static byte[] f5836 = null;
public static byte[] f5713 = null;
public static byte[] f5834 = null;
public static byte[] f5838 = null;
public static byte[] f5840 = null;
public static byte[] f5842 = null;
public static byte[] f5767 = null;
public static byte[] f5844 = null;
public static byte[] f5363 = null;
public static byte[] f5364 = null;
public static byte[] f5365 = null;
public static byte[] f5366 = null;
public static byte[] f5367 = null;
public static byte[] f5368 = null;
public static byte[] f5369 = null;
public static byte[] f5370 = null;
public static byte[] f5371 = null;
public static byte[] f5372 = null;
public static byte[] f5373 = null;
public static byte[] f5374 = null;
public static byte[] f5375 = null;
public static byte[] f5376 = null;
public static byte[] f5377 = null;
public static byte[] f5378 = null;
public static byte[] f5379 = null;
public static byte[] f5380 = null;
public static byte[] f5381 = null;
public static byte[] f5382 = null;
public static byte[] f5383 = null;
public static byte[] f5384 = null;
public static byte[] f5385 = null;
public static byte[] f5386 = null;
public static byte[] f5388 = null;
public static byte[] f5390 = null;
public static byte[] f5391 = null;
public static byte[] f5392 = null;
public static byte[] f5393 = null;
public static byte[] f5394 = null;
public static byte[] f5395 = null;
public static byte[] f5396 = null;
public static byte[] f5397 = null;
public static byte[] f5398 = null;
public static byte[] f5399 = null;
public static byte[] f5400 = null;
public static byte[] f5401 = null;
public static byte[] f5402 = null;
public static byte[] f5403 = null;
public static byte[] f5404 = null;
public static byte[] f5405 = null;
public static byte[] f5406 = null;
public static byte[] f5407 = null;
public static byte[] f5408 = null;
public static byte[] f5409 = null;
public static byte[] f5410 = null;
public static byte[] f5411 = null;
public static byte[] f5412 = null;
public static byte[] f5414 = null;
public static byte[] f5415 = null;
public static byte[] f5417 = null;
public static byte[] f5418 = null;
public static byte[] f5419 = null;
public static byte[] f5420 = null;
public static byte[] f5421 = null;
public static byte[] f5422 = null;
public static byte[] f5423 = null;
public static byte[] f5424 = null;
public static byte[] f5425 = null;
public static byte[] f5426 = null;
public static byte[] f5427 = null;
public static byte[] f5428 = null;
public static byte[] f5429 = null;
public static byte[] f5430 = null;
public static byte[] f5431 = null;
public static byte[] f5432 = null;
public static byte[] f5433 = null;
public static byte[] f5434 = null;
public static byte[] f5435 = null;
public static byte[] f5436 = null;
public static byte[] f5437 = null;
public static byte[] f5438 = null;
public static byte[] f5440 = null;
public static byte[] f5441 = null;
public static byte[] f5442 = null;
public static byte[] f5444 = null;
public static byte[] f5445 = null;
public static byte[] f5446 = null;
public static byte[] f5447 = null;
public static byte[] f5448 = null;
public static byte[] f5449 = null;
public static byte[] f5450 = null;
public static byte[] f5451 = null;
public static byte[] f5452 = null;
public static byte[] f5453 = null;
public static byte[] f5454 = null;
public static byte[] f5455 = null;
public static byte[] f5456 = null;
public static byte[] f5457 = null;
public static byte[] f5458 = null;
public static byte[] f5459 = null;
public static byte[] f5460 = null;
public static byte[] f5461 = null;
public static byte[] f5462 = null;
public static byte[] f5463 = null;
public static byte[] f5464 = null;
public static byte[] f5466 = null;
public static byte[] f5467 = null;
public static byte[] f5468 = null;
public static byte[] f5469 = null;
public static byte[] f5471 = null;
public static byte[] f5472 = null;
public static byte[] f5473 = null;
public static byte[] f5474 = null;
public static byte[] f5475 = null;
public static byte[] f5476 = null;
public static byte[] f5477 = null;
public static byte[] f5478 = null;
public static byte[] f5479 = null;
public static byte[] f5480 = null;
public static byte[] f5481 = null;
public static byte[] f5482 = null;
public static byte[] f5483 = null;
public static byte[] f5484 = null;
public static byte[] f5485 = null;
public static byte[] f5486 = null;
public static byte[] f5487 = null;
public static byte[] f5488 = null;
public static byte[] f5489 = null;
public static byte[] f5490 = null;
public static byte[] f5492 = null;
public static byte[] f5493 = null;
public static byte[] f5494 = null;
public static byte[] f5495 = null;
public static byte[] f5496 = null;
public static byte[] f5498 = null;
public static byte[] f5499 = null;
public static byte[] f5500 = null;
public static byte[] f5501 = null;
public static byte[] f5502 = null;
public static byte[] f5503 = null;
public static byte[] f5504 = null;
public static byte[] f5505 = null;
public static byte[] f5506 = null;
public static byte[] f5507 = null;
public static byte[] f5508 = null;
public static byte[] f5509 = null;
public static byte[] f5510 = null;
public static byte[] f5511 = null;
public static byte[] f5512 = null;
public static byte[] f5513 = null;
public static byte[] f5514 = null;
public static byte[] f5515 = null;
public static byte[] f5516 = null;
public static byte[] f5518 = null;
public static byte[] f5519 = null;
public static byte[] f5520 = null;
public static byte[] f5521 = null;
public static byte[] f5522 = null;
public static byte[] f5523 = null;
public static byte[] f5525 = null;
public static byte[] f5526 = null;
public static byte[] f5527 = null;
public static byte[] f5528 = null;
public static byte[] f5529 = null;
public static byte[] f5530 = null;
public static byte[] f5531 = null;
public static byte[] f5532 = null;
public static byte[] f5533 = null;
public static byte[] f5534 = null;
public static byte[] f5535 = null;
public static byte[] f5536 = null;
public static byte[] f5537 = null;
public static byte[] f5538 = null;
public static byte[] f5539 = null;
public static byte[] f5540 = null;
public static byte[] f5541 = null;
public static byte[] f5542 = null;
public static byte[] f5544 = null;
public static byte[] f5545 = null;
public static byte[] f5546 = null;
public static byte[] f5547 = null;
public static byte[] f5548 = null;
public static byte[] f5549 = null;
public static byte[] f5550 = null;
public static byte[] f5552 = null;
public static byte[] f5553 = null;
public static byte[] f5554 = null;
public static byte[] f5555 = null;
public static byte[] f5556 = null;
public static byte[] f5557 = null;
public static byte[] f5558 = null;
public static byte[] f5559 = null;
public static byte[] f5560 = null;
public static byte[] f5561 = null;
public static byte[] f5562 = null;
public static byte[] f5563 = null;
public static byte[] f5564 = null;
public static byte[] f5565 = null;
public static byte[] f5566 = null;
public static byte[] f5567 = null;
public static byte[] f5568 = null;
public static byte[] f5570 = null;
public static byte[] f5571 = null;
public static byte[] f5572 = null;
public static byte[] f5573 = null;
public static byte[] f5574 = null;
public static byte[] f5575 = null;
public static byte[] f5576 = null;
public static byte[] f5577 = null;
public static byte[] f5579 = null;
public static byte[] f5580 = null;
public static byte[] f5581 = null;
public static byte[] f5582 = null;
public static byte[] f5583 = null;
public static byte[] f5584 = null;
public static byte[] f5585 = null;
public static byte[] f5586 = null;
public static byte[] f5587 = null;
public static byte[] f5588 = null;
public static byte[] f5589 = null;
public static byte[] f5590 = null;
public static byte[] f5591 = null;
public static byte[] f5592 = null;
public static byte[] f5593 = null;
public static byte[] f5594 = null;
public static byte[] f5596 = null;
public static byte[] f5597 = null;
public static byte[] f5598 = null;
public static byte[] f5599 = null;
public static byte[] f5600 = null;
public static byte[] f5601 = null;
public static byte[] f5602 = null;
public static byte[] f5603 = null;
public static byte[] f5604 = null;
public static byte[] f5606 = null;
public static byte[] f5607 = null;
public static byte[] f5608 = null;
public static byte[] f5609 = null;
public static byte[] f5610 = null;
public static byte[] f5611 = null;
public static byte[] f5612 = null;
public static byte[] f5613 = null;
public static byte[] f5614 = null;
public static byte[] f5615 = null;
public static byte[] f5616 = null;
public static byte[] f5617 = null;
public static byte[] f5618 = null;
public static byte[] f5619 = null;
public static byte[] f5620 = null;
public static byte[] f5622 = null;
public static byte[] f5623 = null;
public static byte[] f5624 = null;
public static byte[] f5625 = null;
public static byte[] f5626 = null;
public static byte[] f5627 = null;
public static byte[] f5628 = null;
public static byte[] f5629 = null;
public static byte[] f5630 = null;
public static byte[] f5631 = null;
public static byte[] f5633 = null;
public static byte[] f5634 = null;
public static byte[] f5635 = null;
public static byte[] f5636 = null;
public static byte[] f5637 = null;
public static byte[] f5638 = null;
public static byte[] f5639 = null;
public static byte[] f5640 = null;
public static byte[] f5641 = null;
public static byte[] f5642 = null;
public static byte[] f5643 = null;
public static byte[] f5644 = null;
public static byte[] f5645 = null;
public static byte[] f5646 = null;
public static byte[] f5648 = null;
public static byte[] f5649 = null;
public static byte[] f5650 = null;
public static byte[] f5651 = null;
public static byte[] f5652 = null;
public static byte[] f5653 = null;
public static byte[] f5654 = null;
public static byte[] f5655 = null;
public static byte[] f5656 = null;
public static byte[] f5657 = null;
public static byte[] f5658 = null;
public static byte[] f5660 = null;
public static byte[] f5661 = null;
public static byte[] f5662 = null;
public static byte[] f5663 = null;
public static byte[] f5664 = null;
public static byte[] f5665 = null;
public static byte[] f5666 = null;
public static byte[] f5667 = null;
public static byte[] f5668 = null;
public static byte[] f5669 = null;
public static byte[] f5670 = null;
public static byte[] f5671 = null;
public static byte[] f5672 = null;
public static byte[] f5674 = null;
public static byte[] f5675 = null;
public static byte[] f5676 = null;
public static byte[] f5677 = null;
public static byte[] f5678 = null;
public static byte[] f5679 = null;
public static byte[] f5680 = null;
public static byte[] f5681 = null;
public static byte[] f5682 = null;
public static byte[] f5683 = null;
public static byte[] f5684 = null;
public static byte[] f5685 = null;
public static byte[] f5687 = null;
public static byte[] f5688 = null;
public static byte[] f5689 = null;
public static byte[] f5690 = null;
public static byte[] f5691 = null;
public static byte[] f5692 = null;
public static byte[] f5693 = null;
public static byte[] f5694 = null;
public static byte[] f5695 = null;
public static byte[] f5696 = null;
public static byte[] f5697 = null;
public static byte[] f5698 = null;
public static byte[] f5700 = null;
public static byte[] f5701 = null;
public static byte[] f5702 = null;
public static byte[] f5703 = null;
public static byte[] f5704 = null;
public static byte[] f5705 = null;
public static byte[] f5706 = null;
public static byte[] f5707 = null;
public static byte[] f5708 = null;
public static byte[] f5709 = null;
public static byte[] f5710 = null;
public static byte[] f5711 = null;
public static byte[] f5712 = null;
public static byte[] f5714 = null;
public static byte[] f5715 = null;
public static byte[] f5716 = null;
public static byte[] f5717 = null;
public static byte[] f5718 = null;
public static byte[] f5719 = null;
public static byte[] f5720 = null;
public static byte[] f5721 = null;
public static byte[] f5722 = null;
public static byte[] f5723 = null;
public static byte[] f5724 = null;
public static byte[] f5726 = null;
public static byte[] f5727 = null;
public static byte[] f5728 = null;
public static byte[] f5729 = null;
public static byte[] f5730 = null;
public static byte[] f5731 = null;
public static byte[] f5732 = null;
public static byte[] f5733 = null;
public static byte[] f5734 = null;
public static byte[] f5735 = null;
public static byte[] f5736 = null;
public static byte[] f5737 = null;
public static byte[] f5738 = null;
public static byte[] f5739 = null;
public static byte[] f5741 = null;
public static byte[] f5742 = null;
public static byte[] f5743 = null;
public static byte[] f5744 = null;
public static byte[] f5745 = null;
public static byte[] f5746 = null;
public static byte[] f5747 = null;
public static byte[] f5748 = null;
public static byte[] f5749 = null;
public static byte[] f5750 = null;
public static byte[] f5752 = null;
public static byte[] f5753 = null;
public static byte[] f5754 = null;
public static byte[] f5755 = null;
public static byte[] f5756 = null;
public static byte[] f5757 = null;
public static byte[] f5758 = null;
public static byte[] f5759 = null;
public static byte[] f5760 = null;
public static byte[] f5761 = null;
public static byte[] f5762 = null;
public static byte[] f5763 = null;
public static byte[] f5764 = null;
public static byte[] f5765 = null;
public static byte[] f5766 = null;
public static byte[] f5768 = null;
public static byte[] f5769 = null;
public static byte[] f5770 = null;
public static byte[] f5771 = null;
public static byte[] f5772 = null;
public static byte[] f5773 = null;
public static byte[] f5774 = null;
public static byte[] f5775 = null;
public static byte[] f5776 = null;
public static byte[] f5778 = null;
public static byte[] f5779 = null;
public static byte[] f5780 = null;
public static byte[] f5781 = null;
public static byte[] f5782 = null;
public static byte[] f5783 = null;
public static byte[] f5784 = null;
public static byte[] f5785 = null;
public static byte[] f5786 = null;
public static byte[] f5787 = null;
public static byte[] f5788 = null;
public static byte[] f5789 = null;
public static byte[] f5790 = null;
public static byte[] f5791 = null;
public static byte[] f5792 = null;
public static byte[] f5793 = null;
public static byte[] f5795 = null;
public static byte[] f5796 = null;
public static byte[] f5797 = null;
public static byte[] f5798 = null;
public static byte[] f5799 = null;
public static byte[] f5800 = null;
public static byte[] f5801 = null;
public static byte[] f5802 = null;
public static byte[] f5804 = null;
public static byte[] f5805 = null;
public static byte[] f5806 = null;
public static byte[] f5807 = null;
public static byte[] f5808 = null;
public static byte[] f5809 = null;
public static byte[] f5810 = null;
public static byte[] f5811 = null;
public static byte[] f5812 = null;
public static byte[] f5813 = null;
public static byte[] f5814 = null;
public static byte[] f5815 = null;
public static byte[] f5816 = null;
public static byte[] f5817 = null;
public static byte[] f5818 = null;
public static byte[] f5819 = null;
public static byte[] f5820 = null;
public static byte[] f5822 = null;
public static byte[] f5823 = null;
public static byte[] f5824 = null;
public static byte[] f5825 = null;
public static boolean f5826 = false;
public static boolean f5827 = false;
public static boolean f5828 = false;
public static boolean f5830 = false;
public static boolean f5831 = false;
public static boolean f5832 = false;
public static ArrayList<C2631> f5833 = null;
public class C1646 extends ArrayList<C2631> {
C1646() {
add(new C2631(C1645.f5372, null, C1645.f5374, null, "", false));
add(new C2631(C1645.f5376, null, C1645.f5378, null, "", false));
add(new C2631(C1645.f5380, null, C1645.f5382, null, "", false));
add(new C2631(C1645.f5384, null, C1645.f5386, null, "", false));
add(new C2631(C1645.f5390, null, C1645.f5392, null, "", false));
add(new C2631(C1645.f5446, null, C1645.f5448, null, "", false));
add(new C2631(C1645.f5450, null, C1645.f5452, null, "", false));
add(new C2631(C1645.f5472, null, C1645.f5474, null, "", false));
}
}
public class C1647 extends ArrayList<String> {
C1647() {
add("boolean android.content.pm.PackageParser$SigningDetails.checkCapability(android.content.pm.PackageParser$SigningDetails, int)");
}
}
public class C1648 extends ArrayList<String> {
C1648() {
add("boolean java.security.Signature.verify(byte[])");
add("boolean java.security.Signature.verify(byte[], int, int)");
}
}
class C1649 {
C1649() {
}
}
class C1650 extends ArrayList<C2631> {
C1650() {
add(new C2631(C1645.f5551, null, C1645.f5605, null, "", false));
add(new C2631(C1645.f5659, null, C1645.f5686, null, "", false));
add(new C2631(C1645.f5713, null, C1645.f5838, null, "", false));
add(new C2631(C1645.f5842, null, C1645.f5844, null, "", false));
add(new C2631(C1645.f5364, null, C1645.f5366, null, "", false));
add(new C2631(C1645.f5368, null, C1645.f5370, null, "", false));
add(new C2631(C1645.f5432, null, C1645.f5434, null, "", false));
add(new C2631(C1645.f5436, null, C1645.f5438, null, "", false));
add(new C2631(C1645.f5441, null, C1645.f5444, null, "", false));
add(new C2631(C1645.f5467, null, C1645.f5469, null, "", false));
}
}
public class C1651 extends ArrayList<String> {
C1651() {
add("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])");
}
}
public class C1652 extends ArrayList<String> {
final boolean f5847;
final boolean f5848;
final boolean f5849;
C1652(boolean z, boolean z2, boolean z3) {
this.f5847 = z;
this.f5848 = z2;
this.f5849 = z3;
if (z) {
add("boolean java.security.MessageDigest.isEqual(byte[], byte[])");
}
if (!z2 && z3) {
add("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])");
}
}
}
public class C1653 extends ArrayList<C2631> {
C1653() {
add(new C2631(C1645.f5543, null, C1645.f5595, null, "", false));
add(new C2631(C1645.f5647, null, C1645.f5699, null, "", false));
add(new C2631(C1645.f5751, null, C1645.f5803, null, "", false));
add(new C2631(C1645.f5406, null, C1645.f5408, null, "", false));
add(new C2631(C1645.f5410, null, C1645.f5412, null, "", false));
add(new C2631(C1645.f5415, null, C1645.f5418, null, "", false));
add(new C2631(C1645.f5420, null, C1645.f5422, null, "", false));
add(new C2631(C1645.f5454, null, C1645.f5456, null, "", false));
add(new C2631(C1645.f5458, null, C1645.f5460, null, "", false));
add(new C2631(C1645.f5476, null, C1645.f5478, null, "", false));
}
}
public class C1654 extends ArrayList<String> {
final boolean f5850;
final boolean f5851;
final boolean f5852;
C1654(boolean z, boolean z2, boolean z3) {
this.f5850 = z;
this.f5851 = z2;
this.f5852 = z3;
if (z) {
add("boolean java.security.MessageDigest.isEqual(byte[], byte[])");
}
if (!z2 && z3) {
add("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])");
}
}
}
public class C1655 extends ArrayList<C2631> {
C1655() {
add(new C2631(C1645.f5543, null, C1645.f5595, null, "", false));
add(new C2631(C1645.f5647, null, C1645.f5699, null, "", false));
add(new C2631(C1645.f5751, null, C1645.f5803, null, "", false));
add(new C2631(C1645.f5406, null, C1645.f5408, null, "", false));
add(new C2631(C1645.f5410, null, C1645.f5412, null, "", false));
add(new C2631(C1645.f5415, null, C1645.f5418, null, "", false));
add(new C2631(C1645.f5420, null, C1645.f5422, null, "", false));
add(new C2631(C1645.f5454, null, C1645.f5456, null, "", false));
add(new C2631(C1645.f5458, null, C1645.f5460, null, "", false));
add(new C2631(C1645.f5476, null, C1645.f5478, null, "", false));
}
}
public class C1656 extends ArrayList<String> {
C1656() {
add("int com.android.server.pm.PackageManagerServiceUtils.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])");
add("int com.android.server.pm.PackageManagerService.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])");
add("void com.android.server.pm.PackageManagerService.checkDowngrade(android.content.pm.PackageParser$Package, android.content.pm.PackageInfoLite)");
add("android.content.pm.PackageParser$Package com.android.server.pm.PackageManagerService.scanPackageDirtyLI(android.content.pm.PackageParser$Package, int, int, long, android.os.UserHandle)");
}
}
public class C1657 extends ArrayList<C2631> {
C1657() {
add(new C2631(C1645.f5835, null, C1645.f5839, null, "", false));
add(new C2631(C1645.f5843, null, C1645.f5846, null, "", false));
add(new C2631(C1645.f5821, null, C1645.f5416, null, "", false));
add(new C2631(C1645.f5470, null, C1645.f5740, null, "", false));
add(new C2631(C1645.f5428, null, C1645.f5430, null, "", false));
add(new C2631(C1645.f5424, null, C1645.f5426, null, "", false));
add(new C2631(C1645.f5462, null, C1645.f5464, null, "", false));
}
}
public static void main(String[] strArr) {
boolean z;
boolean z2;
boolean z3;
boolean z4;
boolean z5;
String str;
boolean z6;
ArrayList arrayList;
String str2;
?? r33;
Exception exc;
FileNotFoundException fileNotFoundException;
ArrayList arrayList2;
ArrayList arrayList3;
?? contains;
ArrayList arrayList4;
boolean z7;
Iterator it;
ArrayList arrayList5;
File file;
Exception exc2;
boolean z8;
FileChannel fileChannel;
int position;
boolean z9;
String str3;
String str4;
String str5;
String str6;
String str7;
File file2;
Exception exc3;
char c;
int i;
ArrayList arrayList6;
int i2;
String str8;
String str9;
Exception exc4;
boolean z10;
boolean z11;
String str10;
String str11;
String str12;
String str13;
String str14;
String str15;
boolean z12;
String str16;
String str17;
String str18;
String str19;
String str20;
ArrayList arrayList7;
String str21;
Iterator it2;
Iterator it3;
String str22;
String str23;
String str24;
boolean z13;
Exception exc5;
String str25;
String str26;
String str27;
String str28;
String str29;
String str30;
Exception exc6;
String[] strArr2;
boolean z14;
int i3;
int position2;
byte b;
String str31;
StringBuilder sb;
boolean z15;
FileChannel fileChannel2;
String str32;
Exception exc7;
boolean z16;
C2500.m7142(new C1649());
try {
System.out.println(strArr[0]);
System.out.println(strArr[1]);
System.out.println(strArr[2]);
System.out.println(strArr[3]);
System.out.println(strArr[4]);
String str33 = strArr[4];
if (str33 != null && str33.equals("OnlyDalvik")) {
f5413 = true;
}
} catch (Exception e) {
e.printStackTrace();
}
String str34 = strArr[3];
if (str34 != null) {
f5387 = str34;
}
if (!strArr[4].equals("framework") && !strArr[4].equals("OnlyDalvik")) {
C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
}
if ((strArr[1].contains("core.odex") || strArr[1].contains("core.jar") || strArr[1].contains("core-libart.jar") || strArr[1].contains("conscrypt.jar") || strArr[1].contains("core-oj.jar") || strArr[1].contains("boot.oat") || strArr[1].contains("core-libart.odex")) && strArr[4].equals("framework")) {
if (strArr[1].contains("core-oj.jar")) {
z = false;
} else if (strArr[1].contains("conscrypt.jar")) {
z = true;
z2 = false;
C2975.f9323 = Boolean.FALSE;
strArr[0] = "patch";
new C1619();
} else {
z = true;
}
z2 = true;
C2975.f9323 = Boolean.FALSE;
strArr[0] = "patch";
new C1619();
} else {
z = false;
z2 = false;
}
if ((strArr[1].contains("services.jar") || strArr[1].contains("services.odex")) && strArr[4].equals("framework")) {
C2975.f9323 = Boolean.FALSE;
strArr[0] = "patch";
new C1619();
z3 = true;
} else {
z3 = false;
}
if (strArr[0].contains("patch")) {
if (strArr[0].contains("_patch1")) {
z = true;
}
if (strArr[0].contains("_patch2")) {
z2 = true;
}
if (strArr[0].contains("_patch3")) {
z3 = true;
}
z4 = strArr[0].contains("_patch4");
new C1619();
} else {
z4 = false;
}
if (strArr[0].contains("restore")) {
if (strArr[0].contains("restoreCore")) {
z = true;
z2 = true;
}
if (strArr[0].contains("restoreServices")) {
z3 = true;
z4 = true;
}
new C1622();
}
f5833 = new C1650();
if (strArr[0].contains("restore") || strArr[0].contains("patch") || strArr[0].contains("all")) {
ArrayList arrayList8 = new ArrayList();
arrayList8.clear();
String str35 = "";
if (z || z2) {
ArrayList arrayList9 = new ArrayList();
String str36 = "Oat Core1uni patched!\n";
String str37 = "Oat Core1uni restored!\n";
String str38 = "Oat Core2 restored!\n";
String str39 = "Oat Core2 patched!\n";
z5 = z4;
try {
try {
try {
if (strArr[4].equals("framework")) {
str = "Oat Core1uni restored!\n";
z6 = z3;
arrayList = arrayList8;
} else {
if (f5413) {
z6 = z3;
arrayList = arrayList8;
String[] strArr3 = {"/data/dalvik-cache/x86/system@framework@boot.oat", "/data/dalvik-cache/x86_64/system@framework@boot.oat", "/data/dalvik-cache/arm64/system@framework@boot.oat", "/data/dalvik-cache/arm/system@framework@boot.oat", "/data/dalvik-cache/oat/x86/system@framework@boot.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm/system@framework@boot.oat", "/data/dalvik-cache/x86/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/x86_64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/arm64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/arm/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/x86/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/arm/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/x86/system@framework@boot-core-oj.oat", "/data/dalvik-cache/x86_64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/arm64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/arm/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/x86/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/arm/system@framework@boot-core-oj.oat"};
int i4 = 0;
for (int i5 = 24; i4 < i5; i5 = 24) {
String str40 = strArr3[i4];
String[] strArr4 = strArr3;
if (new File(str40).exists()) {
arrayList9.add(new File(str40));
try {
if (!C2500.m6998(str40).equals("")) {
C2500.m7078("/system", "RW");
}
} catch (Throwable th) {
th.printStackTrace();
}
}
i4++;
strArr3 = strArr4;
}
} else {
z6 = z3;
String[] strArr5 = {"/system/framework/x86/boot.oat", "/system/framework/x86_64/boot.oat", "/system/framework/arm64/boot.oat", "/system/framework/arm/boot.oat", "/system/framework/oat/x86/boot.oat", "/system/framework/oat/x86_64/boot.oat", "/system/framework/oat/arm64/boot.oat", "/system/framework/oat/arm/boot.oat", "/system/framework/x86/boot-conscrypt.oat", "/system/framework/x86_64/boot-conscrypt.oat", "/system/framework/arm64/boot-conscrypt.oat", "/system/framework/arm/boot-conscrypt.oat", "/system/framework/oat/x86/boot-conscrypt.oat", "/system/framework/oat/x86_64/boot-conscrypt.oat", "/system/framework/oat/arm64/boot-conscrypt.oat", "/system/framework/oat/arm/boot-conscrypt.oat", "/system/framework/x86/boot-core-oj.oat", "/system/framework/x86_64/boot-core-oj.oat", "/system/framework/arm64/boot-core-oj.oat", "/system/framework/arm/boot-core-oj.oat", "/system/framework/oat/x86/boot-core-oj.oat", "/system/framework/oat/x86_64/boot-core-oj.oat", "/system/framework/oat/arm64/boot-core-oj.oat", "/system/framework/oat/arm/boot-core-oj.oat"};
arrayList = arrayList8;
int i6 = 0;
for (int i7 = 24; i6 < i7; i7 = 24) {
String str41 = strArr5[i6];
String[] strArr6 = strArr5;
if (new File(str41).exists()) {
arrayList9.add(new File(str41));
try {
if (!C2500.m6998(str41).equals("")) {
C2500.m7078("/system", "RW");
}
} catch (Throwable th2) {
th2.printStackTrace();
}
}
i6++;
strArr5 = strArr6;
}
}
System.out.println("check cache");
if (arrayList9.size() > 0 && C2975.f9299 >= 24) {
C2500.m7078("/system", "RW");
System.out.println("found cache android 7");
if (z2) {
m5419(strArr, z2);
}
m5418(arrayList9, strArr, z, z2);
}
if (arrayList9.size() <= 0 || (i = C2975.f9299) < 21 || i > 23) {
str = "Oat Core1uni restored!\n";
} else {
System.out.println("found cache");
if (z2) {
m5419(strArr, z2);
}
m5418(arrayList9, strArr, z, z2);
if ((!z || f5827) && (!z2 || f5828)) {
str = "Oat Core1uni restored!\n";
arrayList6 = arrayList9;
str2 = "";
i2 = 0;
} else {
if (f5827) {
z = false;
}
if (f5828) {
z2 = false;
}
Iterator it4 = arrayList9.iterator();
i2 = 0;
while (it4.hasNext()) {
File file3 = (File) it4.next();
int i8 = i2 + 1;
Iterator it5 = it4;
PrintStream printStream = System.out;
StringBuilder sb2 = new StringBuilder();
ArrayList arrayList10 = arrayList9;
sb2.append("oat file for patch:");
sb2.append(file3.getAbsolutePath());
printStream.println(sb2.toString());
try {
long currentTimeMillis = System.currentTimeMillis();
FileChannel channel = new RandomAccessFile(file3, InternalZipConstants.WRITE_MODE).getChannel();
str9 = str35;
try {
MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
f5465 = map;
map.position(4120);
int m7185 = C2500.m7185(f5465.get(), f5465.get(), f5465.get(), f5465.get());
System.out.println("Start position:" + m7185);
f5465.position(m7185);
boolean z17 = false;
boolean z18 = false;
boolean z19 = false;
boolean z20 = false;
r33 = r33;
while (true) {
try {
if (!f5465.hasRemaining()) {
str8 = str37;
break;
}
boolean z21 = z17;
int position3 = f5465.position();
byte b2 = f5465.get();
boolean z22 = z;
if (m5417(position3, b2, f5484, f5485, f5486, f5487, z22)) {
try {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str37);
}
f5826 = true;
z18 = true;
z19 = true;
z21 = true;
} catch (Exception e2) {
exc4 = e2;
str8 = str37;
r33 = z22;
try {
System.out.println(str9 + exc4);
channel.close();
System.out.println("time=" + (System.currentTimeMillis() - currentTimeMillis));
} catch (IOException e3) {
e = e3;
e.printStackTrace();
str35 = str9;
it4 = it5;
i2 = i8;
arrayList9 = arrayList10;
str37 = str8;
}
str35 = str9;
it4 = it5;
i2 = i8;
arrayList9 = arrayList10;
str37 = str8;
}
}
if (m5417(position3, b2, f5488, f5489, f5490, f5492, z)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str37);
}
f5826 = true;
z18 = true;
z19 = true;
z21 = true;
}
if (m5417(position3, b2, f5493, f5494, f5495, f5496, z)) {
if (strArr[0].contains("patch")) {
z10 = z19;
System.out.println("position:" + position3);
System.out.println("Oat Core11 patched!\n");
} else {
z10 = z19;
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core11 restored!\n");
}
f5827 = true;
z18 = true;
} else {
z10 = z19;
}
if (m5417(position3, b2, f5514, f5515, f5516, f5518, z)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str37);
}
f5827 = true;
z18 = true;
z21 = true;
z10 = true;
}
if (m5417(position3, b2, f5519, f5520, f5521, f5522, z)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str37);
}
f5827 = true;
z18 = true;
z21 = true;
z10 = true;
}
if (m5417(position3, b2, f5523, f5525, f5526, f5527, z)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str37);
}
f5827 = true;
z18 = true;
z21 = true;
z10 = true;
}
if (m5417(position3, b2, f5528, f5529, f5530, f5531, z)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str37);
}
f5827 = true;
z18 = true;
z21 = true;
z10 = true;
}
if (m5417(position3, b2, f5532, f5533, f5534, f5535, z)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position3);
System.out.println("Oat Core11 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core11 restored!\n");
}
f5827 = true;
z18 = true;
}
if (m5417(position3, b2, f5498, f5499, f5500, f5501, z)) {
z11 = z20;
if (strArr[0].contains("patch")) {
System.out.println("Oat Core12 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core12 restored!\n");
}
f5828 = true;
z10 = true;
} else {
z11 = z20;
}
if (m5417(position3, b2, f5536, f5537, f5538, f5539, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core12 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core12 restored!\n");
}
f5828 = true;
z19 = true;
} else {
z19 = z10;
}
r33 = z2;
if (m5417(position3, b2, f5502, f5503, f5504, f5505, r33)) {
str8 = str37;
try {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z11 = true;
} catch (Exception e4) {
e = e4;
exc4 = e;
r33 = r33;
System.out.println(str9 + exc4);
channel.close();
System.out.println("time=" + (System.currentTimeMillis() - currentTimeMillis));
str35 = str9;
it4 = it5;
i2 = i8;
arrayList9 = arrayList10;
str37 = str8;
}
} else {
str8 = str37;
}
if (m5417(position3, b2, f5506, f5507, f5508, f5509, z2)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z11 = true;
}
if (m5417(position3, b2, f5510, f5511, f5512, f5513, z2)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z11 = true;
}
if (m5417(position3, b2, f5540, f5541, f5542, f5544, z2)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z11 = true;
}
if (m5417(position3, b2, f5545, f5546, f5547, f5548, z2)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z11 = true;
}
if (m5417(position3, b2, f5549, f5550, f5552, f5553, z2)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z11 = true;
}
r33 = z2;
if (m5417(position3, b2, f5554, f5555, f5556, f5557, r33)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
System.out.println("position:" + position3);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5830 = true;
z20 = true;
} else {
z20 = z11;
}
if ((z && z2 && z21 && z20) || ((z && z2 && z21 && z18 && z19 && z20) || ((z && !z2 && z21) || ((z && !z2 && z21 && z18 && z19) || (!z && z2 && z20))))) {
break;
}
f5465.position(position3 + 1);
z17 = z21;
str37 = str8;
r33 = r33;
} catch (Exception e5) {
e = e5;
str8 = str37;
}
}
channel.close();
System.out.println("time=" + (System.currentTimeMillis() - currentTimeMillis));
} catch (IOException e6) {
e = e6;
str8 = str37;
}
} catch (IOException e7) {
e = e7;
str8 = str37;
str9 = str35;
}
str35 = str9;
it4 = it5;
i2 = i8;
arrayList9 = arrayList10;
str37 = str8;
}
str = str37;
arrayList6 = arrayList9;
str2 = str35;
}
if ((f5826 || f5827 || f5828 || f5830) && i2 == arrayList6.size()) {
if (!f5413) {
new File("/data/dalvik-cache/arm/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/arm/system@framework@boot.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/arm64/system@framework@boot.art").delete();
new File("/data/dalvik-cache/x86/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/x86/system@framework@boot.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/x86_64/system@framework@boot.art").delete();
new File("/data/dalvik-cache/oat/arm/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/oat/arm/system@framework@boot.art").delete();
new File("/data/dalvik-cache/oat/arm64/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/oat/arm64/system@framework@boot.art").delete();
new File("/data/dalvik-cache/oat/x86/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/oat/x86/system@framework@boot.art").delete();
new File("/data/dalvik-cache/oat/x86_64/system@framework@boot.oat").delete();
new File("/data/dalvik-cache/oat/x86_64/system@framework@boot.art").delete();
}
System.out.println("patched cache " + C2975.f9250 + "/reboot");
C2500.m7073();
C2500.m6899();
}
contains = strArr[4].contains("framework");
String str42 = "/system/framework/core-libart.jar";
if (contains == 0) {
try {
if (!strArr[1].contains("core.jar")) {
if (!strArr[1].contains("core-libart.jar")) {
if (!strArr[1].contains("core-oj.jar")) {
if (strArr[1].contains("conscrypt.jar")) {
}
arrayList4 = arrayList;
c = 1;
if (!strArr[c].contains("core.odex") || strArr[c].contains("core-libart.odex") || strArr[c].contains("boot.oat")) {
arrayList4.add(new File(strArr[1]));
}
}
}
}
c = 1;
if (C2500.m7173(new File(strArr[1]))) {
File file4 = new File(strArr[1]);
m5422(file4, C2500.m6942(file4).getAbsolutePath());
File file5 = new File(C2500.m6942(file4).getAbsolutePath() + "/classes.dex");
if (file5.exists()) {
arrayList4 = arrayList;
arrayList4.add(file5);
c = 1;
if (!strArr[c].contains("core.odex")) {
}
arrayList4.add(new File(strArr[1]));
}
arrayList4 = arrayList;
c = 1;
if (!strArr[c].contains("core.odex")) {
}
arrayList4.add(new File(strArr[1]));
} else {
arrayList4 = arrayList;
if (!strArr[c].contains("core.odex")) {
}
arrayList4.add(new File(strArr[1]));
}
} catch (FileNotFoundException e8) {
fileNotFoundException = e8;
arrayList3 = arrayList;
fileNotFoundException.printStackTrace();
System.out.println("Error: core.odex not found!\n\nPlease Odex core.jar and try again!");
arrayList5 = arrayList3;
if (!z6) {
}
System.out.println("Start patch for services.jar");
if (!f5413) {
}
if (str15.equals(str2)) {
}
z12 = z6;
String str43 = "Core4 restored!FixForCM\n";
String str44 = "Core4 patched!FixForCM\n";
String str45 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
}
try {
String str46 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
} catch (FileNotFoundException unused) {
System.out.println("Error: services.odex not found!\n\nPlease Odex services.jar and try again!");
} catch (Exception e9) {
System.out.println("Exception e" + e9.toString());
}
C2500.m6899();
} catch (Exception e10) {
exc = e10;
arrayList2 = arrayList;
exc.printStackTrace();
System.out.println("Exception e" + exc.toString());
arrayList5 = arrayList2;
if (!z6) {
}
System.out.println("Start patch for services.jar");
if (!f5413) {
}
if (str15.equals(str2)) {
}
z12 = z6;
String str432 = "Core4 restored!FixForCM\n";
String str442 = "Core4 patched!FixForCM\n";
String str452 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
}
String str462 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
} else {
arrayList4 = arrayList;
if (strArr[4].contains("ART")) {
if (new File("/system/framework/core-libart.odex").exists() && new File("/system/framework/core-libart.odex").length() != 0) {
arrayList4.add(new File("/system/framework/core-libart.odex"));
}
if (C2500.m7173(new File("/system/framework/core-libart.jar"))) {
m5422(new File("/system/framework/core-libart.jar"), "/data/app");
File file6 = new File("/data/app/classes.dex");
if (file6.exists()) {
arrayList4.add(file6);
}
}
} else {
if (f5413) {
PrintStream printStream2 = System.out;
StringBuilder sb3 = new StringBuilder();
sb3.append("OnlyDalvik: add for patch ");
z7 = z;
sb3.append(strArr[1]);
printStream2.println(sb3.toString());
File file7 = new File(strArr[1]);
if (file7.exists()) {
arrayList4.add(file7);
} else {
throw new FileNotFoundException();
}
} else {
z7 = z;
File file8 = new File(strArr[1]);
if (file8.exists()) {
if (file8.toString().contains("system@framework@core.jar@classes.dex")) {
File file9 = new File("/system/framework/core.odex");
if (file9.exists() && file9.length() == 0) {
file9.delete();
}
}
arrayList4.add(file8);
if (file8.toString().contains("/system/framework/core.odex") && C2975.f9299 < 20 && !C2975.f9246.contains("ART")) {
File file10 = new File("/system/framework/core-libart.odex");
if (file10.exists()) {
if (file10.length() == 0) {
file10.delete();
} else {
arrayList4.add(file10);
}
}
}
} else {
throw new FileNotFoundException();
}
}
it = arrayList4.iterator();
boolean z23 = z2;
boolean z24 = z7;
while (it.hasNext()) {
File file11 = (File) it.next();
PrintStream printStream3 = System.out;
Iterator it6 = it;
StringBuilder sb4 = new StringBuilder();
r33 = arrayList4;
sb4.append("file for patch: ");
sb4.append(file11.getAbsolutePath());
sb4.append(" size:");
String str47 = str42;
String str48 = str38;
sb4.append(file11.length());
printStream3.println(sb4.toString());
FileChannel channel2 = new RandomAccessFile(file11, InternalZipConstants.WRITE_MODE).getChannel();
String str49 = str39;
f5465 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel2.size());
if (!file11.getName().contains("boot.oat")) {
try {
ArrayList arrayList11 = new ArrayList();
arrayList11.add(file11);
if (!file11.getName().contains("core-oj.oat")) {
try {
} catch (Exception e11) {
exc2 = e11;
file = file11;
z8 = false;
exc2.printStackTrace();
fileChannel = channel2;
str3 = str;
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
}
m5418(arrayList11, strArr, z24, z23);
if ((!z24 || f5827) && (!z23 || f5828)) {
file = file11;
z8 = false;
} else {
if (f5827) {
z24 = false;
}
if (f5828) {
z23 = false;
}
f5465 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel2.size());
boolean z25 = false;
while (f5465.hasRemaining()) {
try {
position = f5465.position();
byte b3 = f5465.get();
if (m5417(position, b3, f5480, f5481, f5482, f5483, z24)) {
z8 = z25;
try {
if (strArr[0].contains("patch")) {
file = file11;
try {
System.out.println("Core patched!\n");
} catch (Exception e12) {
e = e12;
exc2 = e;
exc2.printStackTrace();
fileChannel = channel2;
str3 = str;
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
} else {
file = file11;
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
} catch (Exception e13) {
e = e13;
file = file11;
exc2 = e;
exc2.printStackTrace();
fileChannel = channel2;
str3 = str;
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
} else {
z9 = z25;
file = file11;
}
if (m5417(position, b3, f5727, f5728, f5729, f5730, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5731, f5732, f5733, f5734, z23)) {
if (strArr[0].contains("patch")) {
System.out.println("Core unsigned install patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core unsigned install restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5735, f5736, f5737, f5738, z23)) {
if (strArr[0].contains("patch")) {
System.out.println("Core unsigned install patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core unsigned install restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5739, f5741, f5742, f5743, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5744, f5745, f5746, f5747, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5748, f5749, f5750, f5752, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5753, f5754, f5755, f5756, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5757, f5758, f5759, f5760, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5761, f5762, f5763, f5764, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5765, f5766, f5768, f5769, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5770, f5771, f5772, f5773, z23)) {
if (strArr[0].contains("patch")) {
System.out.println("Core unsigned install patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core unsigned install restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5774, f5775, f5776, f5778, z23)) {
if (strArr[0].contains("patch")) {
System.out.println("Core unsigned install patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core unsigned install restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5779, f5780, f5781, f5782, z23)) {
if (strArr[0].contains("patch")) {
System.out.println("Core unsigned install patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core unsigned install restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5809, f5810, f5811, f5812, z23)) {
if (strArr[0].contains("patch")) {
System.out.println("Core unsigned install patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core unsigned install restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5813, f5814, f5815, f5816, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5817, f5818, f5819, f5820, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5783, f5784, f5785, f5786, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5787, f5788, f5789, f5790, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5791, f5792, f5793, f5795, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5796, f5797, f5798, f5799, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5800, f5801, f5802, f5804, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5805, f5806, f5807, f5808, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z9 = true;
}
if (m5417(position, b3, f5822, f5823, f5824, f5825, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Core 2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core 2 restored!\n");
}
z25 = true;
} else {
z25 = z9;
}
} catch (Exception e14) {
e = e14;
z8 = z25;
}
try {
f5465.position(position + 1);
file11 = file;
} catch (Exception e15) {
e = e15;
z8 = z25;
exc2 = e;
exc2.printStackTrace();
fileChannel = channel2;
str3 = str;
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
}
z8 = z25;
file = file11;
}
} catch (Exception e16) {
file = file11;
exc2 = e16;
}
fileChannel = channel2;
} else {
file = file11;
f5465.position(4120);
int m71852 = C2500.m7185(f5465.get(), f5465.get(), f5465.get(), f5465.get());
System.out.println("Start position:" + m71852);
f5465.position(m71852);
boolean z26 = false;
while (f5465.hasRemaining()) {
try {
int position4 = f5465.position();
byte b4 = f5465.get();
if (m5417(position4, b4, f5484, f5485, f5486, f5487, z24)) {
z8 = z26;
try {
if (strArr[0].contains("patch")) {
try {
System.out.println("position:" + position4);
System.out.println(str36);
} catch (Exception e17) {
e = e17;
fileChannel = channel2;
str3 = str;
exc3 = e;
System.out.println(str2 + exc3);
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
}
if (strArr[0].contains("restore")) {
str3 = str;
try {
System.out.println(str3);
} catch (Exception e18) {
e = e18;
fileChannel = channel2;
exc3 = e;
System.out.println(str2 + exc3);
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
} else {
str3 = str;
}
f5827 = true;
z8 = true;
} catch (Exception e19) {
e = e19;
str3 = str;
fileChannel = channel2;
exc3 = e;
System.out.println(str2 + exc3);
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
} else {
z8 = z26;
str3 = str;
}
if (m5417(position4, b4, f5488, f5489, f5490, f5492, z24)) {
fileChannel = channel2;
try {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println(str36);
}
if (strArr[0].contains("restore")) {
System.out.println(str3);
}
f5827 = true;
z8 = true;
} catch (Exception e20) {
e = e20;
exc3 = e;
System.out.println(str2 + exc3);
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
} else {
fileChannel = channel2;
}
if (m5417(position4, b4, f5493, f5494, f5495, f5496, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println("Oat Core11 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core11 restored!\n");
}
f5827 = true;
z8 = true;
}
if (m5417(position4, b4, f5514, f5515, f5516, f5518, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println(str36);
}
if (strArr[0].contains("restore")) {
System.out.println(str3);
}
f5827 = true;
z8 = true;
}
if (m5417(position4, b4, f5519, f5520, f5521, f5522, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println(str36);
}
if (strArr[0].contains("restore")) {
System.out.println(str3);
}
f5827 = true;
z8 = true;
}
if (m5417(position4, b4, f5523, f5525, f5526, f5527, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println(str36);
}
if (strArr[0].contains("restore")) {
System.out.println(str3);
}
f5827 = true;
z8 = true;
}
if (m5417(position4, b4, f5528, f5529, f5530, f5531, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println(str36);
}
if (strArr[0].contains("restore")) {
System.out.println(str3);
}
f5827 = true;
z8 = true;
}
if (m5417(position4, b4, f5532, f5533, f5534, f5535, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("position:" + position4);
System.out.println("Oat Core11 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core11 restored!\n");
}
f5827 = true;
z8 = true;
}
if (m5417(position4, b4, f5498, f5499, f5500, f5501, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core12 patched!\n");
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core12 restored!\n");
}
f5828 = true;
z8 = true;
}
if (m5417(position4, b4, f5536, f5537, f5538, f5539, z24)) {
if (strArr[0].contains("patch")) {
System.out.println("Oat Core12 patched!\n");
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core12 restored!\n");
}
f5828 = true;
z8 = true;
}
if (m5417(position4, b4, f5502, f5503, f5504, f5505, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z8 = true;
}
if (m5417(position4, b4, f5506, f5507, f5508, f5509, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z8 = true;
}
if (m5417(position4, b4, f5510, f5511, f5512, f5513, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z8 = true;
}
if (m5417(position4, b4, f5540, f5541, f5542, f5544, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z8 = true;
}
if (m5417(position4, b4, f5545, f5546, f5547, f5548, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z8 = true;
}
if (m5417(position4, b4, f5549, f5550, f5552, f5553, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z8 = true;
}
if (m5417(position4, b4, f5554, f5555, f5556, f5557, z23)) {
if (strArr[0].contains("patch")) {
System.out.println(str49);
System.out.println("position:" + position4);
}
if (strArr[0].contains("restore")) {
System.out.println(str48);
}
f5830 = true;
z26 = true;
} else {
z26 = z8;
}
if (z24) {
try {
if ((f5826 & z23) && f5827 && f5828 && f5830) {
z8 = true;
break;
}
} catch (Exception e21) {
exc3 = e21;
z8 = z26;
System.out.println(str2 + exc3);
fileChannel.close();
if (!strArr[4].contains("framework")) {
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
}
if (!z24 && z23 && f5830) {
z8 = true;
break;
} else {
f5465.position(position4 + 1);
str = str3;
channel2 = fileChannel;
}
} catch (Exception e22) {
e = e22;
fileChannel = channel2;
z8 = z26;
}
}
fileChannel = channel2;
z8 = z26;
}
str3 = str;
fileChannel.close();
if (!strArr[4].contains("framework")) {
if (file.toString().endsWith("/classes.dex")) {
f5439 = false;
C2500.m6908(file);
if (z8) {
String replace = strArr[1].replace(".jar", "-patched.jar");
String str50 = strArr[1];
new File(replace).delete();
ArrayList arrayList12 = new ArrayList();
str4 = str48;
System.out.println("add files");
String absolutePath = file.getAbsolutePath();
str5 = str36;
StringBuilder sb5 = new StringBuilder();
str6 = str49;
sb5.append(C2500.m6942(file).getAbsolutePath());
sb5.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
arrayList12.add(new C2912(absolutePath, sb5.toString()));
try {
C2500.m6986(str50, replace, arrayList12);
System.out.println("add files finish");
new File(str50).delete();
} catch (Exception e23) {
e23.printStackTrace();
new File(replace).delete();
}
} else {
str4 = str48;
str5 = str36;
str6 = str49;
f5439 = true;
}
} else {
str4 = str48;
str5 = str36;
str6 = str49;
}
if (!file.toString().endsWith("/core.odex") && !file.toString().endsWith("/core-libart.odex")) {
file2 = file;
if (file2.toString().endsWith("/boot.oat") && z8) {
file2.renameTo(new File(file2.getAbsolutePath().replace("/boot.oat", "/boot-patched.oat")));
}
str7 = str47;
}
file2 = file;
C2500.m6909(file2, null);
if (z8) {
if (file2.toString().endsWith("/core.odex")) {
file2.renameTo(new File(file2.getAbsolutePath().replace("/core.odex", "/core-patched.odex")));
}
if (file2.toString().endsWith("/core-libart.odex")) {
file2.renameTo(new File(file2.getAbsolutePath().replace("/core-libart.odex", "/core-libart-patched.odex")));
}
}
if (file2.toString().endsWith("/boot.oat")) {
file2.renameTo(new File(file2.getAbsolutePath().replace("/boot.oat", "/boot-patched.oat")));
}
str7 = str47;
} else {
str4 = str48;
str5 = str36;
str6 = str49;
File file12 = file;
if (file12.toString().endsWith("/classes.dex")) {
C2500.m6908(file12);
} else {
C2500.m6909(file12, "/system/framework/core.jar");
}
if (strArr[4].contains("ART")) {
if (file12.toString().contains("/classes.dex") && z8) {
System.out.println("start");
str7 = str47;
if (C2500.m6877(str7, "/system/framework/core-libart.backup", true, false)) {
System.out.println("good space");
new File("/system/framework/core-libart.backup").delete();
ArrayList arrayList13 = new ArrayList();
System.out.println("add files");
arrayList13.add(new C2912("/data/app/classes.dex", "/data/app/"));
try {
C2500.m6986(str7, "/system/framework/core-libart.backup", arrayList13);
System.out.println("add files finish");
C2500.m7094("chmod", "0644", "/system/framework/core-libart.backup");
C2500.m7094("chown", "0:0", "/system/framework/core-libart.backup");
C2500.m7094("chmod", "0.0", "/system/framework/core-libart.backup");
C2500.m7094("rm", str7);
if (new File(str7).exists()) {
new File(str7).delete();
}
C2500.m7094("mv", "/system/framework/core.backup", str7);
if (!new File(str7).exists()) {
new File("/system/framework/core-libart.backup").renameTo(new File(str7));
}
C2500.m7094("chmod", "0644", str7);
C2500.m7094("chown", "0:0", str7);
C2500.m7094("chmod", "0.0", str7);
File m6947 = C2500.m6947(str7);
if (m6947 != null) {
C2500.m7094("rm", m6947.getAbsolutePath());
if (m6947.exists()) {
m6947.delete();
}
}
new File("/data/dalvik-cache/arm/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/arm/system@framework@arm@boot.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/arm64/system@framework@arm@boot.art").delete();
new File("/data/dalvik-cache/x86/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/x86/system@framework@arm@boot.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.art").delete();
} catch (Exception e24) {
e24.printStackTrace();
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
new File("/system/framework/core.backup").delete();
}
System.out.println("finish");
} else {
new File("/system/framework/core-libart.backup").delete();
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
}
}
str7 = str47;
} else {
str7 = str47;
if (!f5413) {
if (file12.toString().contains("system@framework@core.jar@classes.dex") && z8) {
System.out.println("LuckyPatcher: dalvik-cache patched! ");
File file13 = new File("/system/framework/core.patched");
if (C2500.m6877(file12.getAbsolutePath(), "/system/framework/core.patched", true, false)) {
C2500.m7094("chmod", "0644", "/system/framework/core.patched");
C2500.m7094("chown", "0.0", "/system/framework/core.patched");
C2500.m7094("chown", "0:0", "/system/framework/core.patched");
} else {
file13.delete();
System.out.println("LuckyPatcher: not space to system for odex core.jar! ");
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
}
}
if (new File("/system/framework/core.patched").exists()) {
System.out.println("LuckyPatcher: root found core.patched! ");
}
if (new File("/system/framework/core.odex").exists()) {
System.out.println("LuckyPatcher: root found core.odex! ");
}
}
}
}
str42 = str7;
str = str3;
it = it6;
str38 = str4;
str36 = str5;
str39 = str6;
arrayList4 = r33;
}
arrayList5 = arrayList4;
}
}
z7 = z;
it = arrayList4.iterator();
boolean z232 = z2;
boolean z242 = z7;
while (it.hasNext()) {
}
arrayList5 = arrayList4;
}
}
if (contains == 0) {
}
z7 = z;
it = arrayList4.iterator();
boolean z2322 = z2;
boolean z2422 = z7;
while (it.hasNext()) {
}
arrayList5 = arrayList4;
} catch (FileNotFoundException e25) {
e = e25;
r33 = contains;
fileNotFoundException = e;
arrayList3 = r33;
fileNotFoundException.printStackTrace();
System.out.println("Error: core.odex not found!\n\nPlease Odex core.jar and try again!");
arrayList5 = arrayList3;
if (!z6) {
}
System.out.println("Start patch for services.jar");
if (!f5413) {
}
if (str15.equals(str2)) {
}
z12 = z6;
String str4322 = "Core4 restored!FixForCM\n";
String str4422 = "Core4 patched!FixForCM\n";
String str4522 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
}
String str4622 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
} catch (Exception e26) {
e = e26;
r33 = contains;
exc = e;
arrayList2 = r33;
exc.printStackTrace();
System.out.println("Exception e" + exc.toString());
arrayList5 = arrayList2;
if (!z6) {
}
System.out.println("Start patch for services.jar");
if (!f5413) {
}
if (str15.equals(str2)) {
}
z12 = z6;
String str43222 = "Core4 restored!FixForCM\n";
String str44222 = "Core4 patched!FixForCM\n";
String str45222 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
}
String str46222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
} catch (FileNotFoundException e27) {
e = e27;
fileNotFoundException = e;
arrayList3 = r33;
fileNotFoundException.printStackTrace();
System.out.println("Error: core.odex not found!\n\nPlease Odex core.jar and try again!");
arrayList5 = arrayList3;
if (!z6) {
}
System.out.println("Start patch for services.jar");
if (!f5413) {
}
if (str15.equals(str2)) {
}
z12 = z6;
String str432222 = "Core4 restored!FixForCM\n";
String str442222 = "Core4 patched!FixForCM\n";
String str452222 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
}
String str462222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
} catch (Exception e28) {
e = e28;
exc = e;
arrayList2 = r33;
exc.printStackTrace();
System.out.println("Exception e" + exc.toString());
arrayList5 = arrayList2;
if (!z6) {
}
System.out.println("Start patch for services.jar");
if (!f5413) {
}
if (str15.equals(str2)) {
}
z12 = z6;
String str4322222 = "Core4 restored!FixForCM\n";
String str4422222 = "Core4 patched!FixForCM\n";
String str4522222 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
}
String str4622222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
contains = strArr[4].contains("framework");
String str422 = "/system/framework/core-libart.jar";
} catch (FileNotFoundException e29) {
e = e29;
r33 = arrayList;
} catch (Exception e30) {
e = e30;
r33 = arrayList;
}
str2 = "";
} else {
z6 = z3;
z5 = z4;
arrayList5 = arrayList8;
str2 = "";
}
if (!z6 || z5) {
System.out.println("Start patch for services.jar");
if (!f5413) {
str15 = new File("/system/framework/arm/services.odex").exists() ? "/arm" : str2;
if (new File("/system/framework/arm64/services.odex").exists()) {
str15 = "/arm64";
}
if (new File("/system/framework/x86/services.odex").exists()) {
str15 = "/x86";
}
if (new File("/system/framework/x86_64/services.odex").exists()) {
str15 = "/x86_64";
}
if (new File("/system/framework/arm/services.odex.xz").exists()) {
str15 = "/arm";
}
if (new File("/system/framework/arm64/services.odex.xz").exists()) {
str15 = "/arm64";
}
if (new File("/system/framework/x86/services.odex.xz").exists()) {
str15 = "/x86";
}
if (new File("/system/framework/x86_64/services.odex.xz").exists()) {
str15 = "/x86_64";
}
if (new File("/system/framework/oat/arm/services.odex").exists()) {
str15 = "/oat/arm";
}
if (new File("/system/framework/oat/arm64/services.odex").exists()) {
str15 = "/oat/arm64";
}
if (new File("/system/framework/oat/x86/services.odex").exists()) {
str15 = "/oat/x86";
}
if (new File("/system/framework/oat/x86_64/services.odex").exists()) {
str15 = "/oat/x86_64";
}
if (new File("/system/framework/oat/arm/services.odex.xz").exists()) {
str15 = "/oat/arm";
}
if (new File("/system/framework/oat/arm64/services.odex.xz").exists()) {
str15 = "/oat/arm64";
}
if (new File("/system/framework/oat/x86/services.odex.xz").exists()) {
str15 = "/oat/x86";
}
str14 = "/system/framework";
str13 = "/services.odex";
if (new File("/system/framework/oat/x86_64/services.odex.xz").exists()) {
str15 = "/oat/x86_64";
}
} else {
if (new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache";
str11 = "/arm";
str12 = "/system@framework@services.jar@classes.dex";
} else {
str10 = str2;
str11 = str10;
str12 = str11;
}
if (new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache";
str11 = "/arm64";
str12 = "/system@framework@services.jar@classes.dex";
}
if (new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache";
str11 = "/x86";
str12 = "/system@framework@services.jar@classes.dex";
}
if (new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache";
str11 = "/x86_64";
str12 = "/system@framework@services.jar@classes.dex";
}
if (new File("/data/dalvik-cache/oat/arm/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache/oat";
str11 = "/arm";
str12 = "/system@framework@services.jar@classes.dex";
}
if (new File("/data/dalvik-cache/oat/arm64/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache/oat";
str11 = "/arm64";
str12 = "/system@framework@services.jar@classes.dex";
}
if (new File("/data/dalvik-cache/oat/x86/system@framework@services.jar@classes.dex").exists()) {
str10 = "/data/dalvik-cache/oat";
str11 = "/x86";
str12 = "/system@framework@services.jar@classes.dex";
}
str13 = str12;
str14 = str10;
str15 = str11;
if (new File("/data/dalvik-cache/oat/x86_64/system@framework@services.jar@classes.dex").exists()) {
str14 = "/data/dalvik-cache/oat";
str15 = "/x86_64";
str13 = "/system@framework@services.jar@classes.dex";
}
}
if (!str15.equals(str2) || C2975.f9299 < 24) {
z12 = z6;
} else {
File file14 = new File(str14 + str15 + str13);
try {
if (!C2500.m6998(file14.getAbsolutePath()).equals(str2)) {
C2500.m7078("/system", "RW");
}
} catch (Throwable th3) {
th3.printStackTrace();
}
if (new File(str14 + str15 + "/services.odex.xz").exists()) {
System.out.println("try unpack services.odex.xz");
if (C2500.m6868(new File(str14 + str15 + "/services.odex.xz"), "/system/framework" + str15)) {
C2500.m7094("chmod", "644", str14 + str15 + str13);
C2500.m7094("chown", "0:0", str14 + str15 + str13);
C2500.m7094("chown", "0.0", str14 + str15 + str13);
} else {
new File(str14 + str15 + str13).delete();
System.out.println("not enought space for unpack services.odex.xz");
z16 = false;
if (!z16 && z6) {
z12 = z6;
if (C2975.f9299 >= 28 && m5421(strArr, z12)) {
m5420(file14, strArr, z12);
} else {
m5420(file14, strArr, z12);
}
} else {
z12 = z6;
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
}
if ((!f5827 || f5828 || f5832) && !f5413) {
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
}
C2500.m7073();
C2500.m6899();
}
}
z16 = true;
if (!z16) {
}
z12 = z6;
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
}
String str43222222 = "Core4 restored!FixForCM\n";
String str44222222 = "Core4 patched!FixForCM\n";
String str45222222 = "Core4 restored!InstallLocationPolice\n";
if (str15.equals(str2)) {
str16 = "Core4 restored!\n";
str17 = str2;
str18 = "Core4 restored!FixForCM\n";
str19 = "Core4 patched!\n";
} else {
int i9 = C2975.f9299;
String str51 = "Core4 patched!\n";
if (i9 < 21 || i9 > 23) {
str16 = "Core4 restored!\n";
str17 = str2;
str18 = "Core4 restored!FixForCM\n";
str19 = str51;
} else {
File file15 = new File(str14 + str15 + str13);
try {
if (C2500.m6998(file15.getAbsolutePath()).equals(str2)) {
str31 = str2;
} else {
str31 = str2;
try {
C2500.m7078("/system", "RW");
} catch (Throwable th4) {
th = th4;
th.printStackTrace();
sb = new StringBuilder();
sb.append(str14);
sb.append(str15);
String str52 = "Core4 restored!\n";
sb.append("/services.odex.xz");
if (new File(sb.toString()).exists()) {
}
z15 = true;
if (z15) {
}
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
String str46222222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
}
} catch (Throwable th5) {
th = th5;
str31 = str2;
}
sb = new StringBuilder();
sb.append(str14);
sb.append(str15);
String str522 = "Core4 restored!\n";
sb.append("/services.odex.xz");
if (new File(sb.toString()).exists()) {
System.out.println("try unpack services.odex.xz");
if (C2500.m6868(new File(str14 + str15 + "/services.odex.xz"), "/system/framework" + str15)) {
C2500.m7094("chmod", "644", str14 + str15 + str13);
C2500.m7094("chown", "0:0", str14 + str15 + str13);
C2500.m7094("chown", "0.0", str14 + str15 + str13);
} else {
new File(str14 + str15 + str13).delete();
System.out.println("not enought space for unpack services.odex.xz");
z15 = false;
if (z15) {
m5420(file15, strArr, z12);
if ((f5827 || !z12) && (f5828 || !z12)) {
str18 = "Core4 restored!FixForCM\n";
str19 = str51;
str17 = str31;
str16 = str522;
} else {
try {
FileChannel channel3 = new RandomAccessFile(file15, InternalZipConstants.WRITE_MODE).getChannel();
MappedByteBuffer map2 = channel3.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel3.size());
f5465 = map2;
map2.position(4120);
int m71853 = C2500.m7185(f5465.get(), f5465.get(), f5465.get(), f5465.get());
System.out.println("Start position:" + m71853);
f5465.position(m71853);
while (true) {
try {
if (!f5465.hasRemaining()) {
fileChannel2 = channel3;
str18 = str43222222;
str19 = str51;
str32 = str31;
str16 = str522;
break;
}
int position5 = f5465.position();
byte b5 = f5465.get();
fileChannel2 = channel3;
String str53 = str43222222;
str19 = str51;
str32 = str31;
str16 = str522;
try {
if (m5417(position5, b5, f5558, f5559, f5560, f5561, z12)) {
try {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
} catch (Exception e31) {
exc7 = e31;
str18 = str53;
try {
PrintStream printStream4 = System.out;
StringBuilder sb6 = new StringBuilder();
str17 = str32;
} catch (IOException e32) {
e = e32;
str17 = str32;
e.printStackTrace();
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
String str462222222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
try {
sb6.append(str17);
sb6.append(exc7);
printStream4.println(sb6.toString());
fileChannel2.close();
} catch (IOException e33) {
e = e33;
e.printStackTrace();
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
String str4622222222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
String str46222222222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
}
if (m5417(position5, b5, f5562, f5563, f5564, f5565, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5566, f5567, f5568, f5570, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5571, f5572, f5573, f5574, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5588, f5589, f5590, f5591, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5592, f5593, f5594, f5596, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5597, f5598, f5599, f5600, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5601, f5602, f5603, f5604, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5606, f5607, f5608, f5609, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5610, f5611, f5612, f5613, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
str18 = str53;
try {
System.out.println(str18);
} catch (Exception e34) {
e = e34;
exc7 = e;
PrintStream printStream42 = System.out;
StringBuilder sb62 = new StringBuilder();
str17 = str32;
sb62.append(str17);
sb62.append(exc7);
printStream42.println(sb62.toString());
fileChannel2.close();
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
String str462222222222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
C2500.m6899();
}
} else {
str18 = str53;
}
f5832 = true;
} else {
str18 = str53;
}
if (m5417(position5, b5, f5614, f5615, f5616, f5617, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str18);
}
f5832 = true;
}
if (m5417(position5, b5, f5618, f5619, f5620, f5622, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str18);
}
f5832 = true;
}
if (m5417(position5, b5, f5575, f5576, f5577, f5579, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str18);
}
f5832 = true;
}
if (m5417(position5, b5, f5580, f5581, f5582, f5583, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str18);
}
f5832 = true;
}
if (m5417(position5, b5, f5584, f5585, f5586, f5587, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str18);
}
f5832 = true;
}
if (m5417(position5, b5, f5623, f5624, f5625, f5626, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5627, f5628, f5629, f5630, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5631, f5633, f5634, f5635, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5636, f5637, f5638, f5639, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5640, f5641, f5642, f5643, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5649, f5650, f5651, f5652, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5644, f5645, f5646, f5648, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5675, f5676, f5677, f5678, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5679, f5680, f5681, f5682, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
}
if (m5417(position5, b5, f5653, f5654, f5655, f5656, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5657, f5658, f5660, f5661, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5662, f5663, f5664, f5665, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5666, f5667, f5668, f5669, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (m5417(position5, b5, f5670, f5671, f5672, f5674, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
}
if (z12 && f5827 && f5828 && f5832) {
break;
}
f5465.position(position5 + 1);
str522 = str16;
str51 = str19;
str43222222 = str18;
channel3 = fileChannel2;
str31 = str32;
} catch (Exception e35) {
e = e35;
str18 = str53;
}
} catch (Exception e36) {
e = e36;
fileChannel2 = channel3;
str18 = str43222222;
str19 = str51;
str32 = str31;
str16 = str522;
}
}
str17 = str32;
fileChannel2.close();
} catch (IOException e37) {
e = e37;
str18 = "Core4 restored!FixForCM\n";
str19 = str51;
str17 = str31;
str16 = str522;
}
}
} else {
str18 = "Core4 restored!FixForCM\n";
str19 = str51;
str17 = str31;
str16 = str522;
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
}
if ((!f5827 || f5828 || f5832) && !f5413) {
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
}
C2500.m7073();
C2500.m6899();
}
}
z15 = true;
if (z15) {
}
if (!f5827) {
}
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
C2500.m7073();
C2500.m6899();
}
}
String str4622222222222 = "/system/framework/services.jar";
if (!strArr[4].contains("framework")) {
char c2 = 1;
if (strArr[1].contains("services.jar") && C2500.m7173(new File(strArr[1]))) {
File file16 = new File(strArr[1]);
m5422(file16, C2500.m6942(file16).getAbsolutePath());
File file17 = new File(C2500.m6942(file16).getAbsolutePath() + "/classes.dex");
if (file17.exists()) {
arrayList7 = arrayList5;
arrayList7.add(file17);
} else {
arrayList7 = arrayList5;
}
c2 = 1;
} else {
arrayList7 = arrayList5;
}
if (strArr[c2].contains("services.odex")) {
str20 = str17;
arrayList7.add(new File(strArr[1]));
} else {
str20 = str17;
}
} else {
str20 = str17;
arrayList7 = arrayList5;
if (strArr[4].contains("ART")) {
if (new File("/system/framework/services.odex").exists() && new File("/system/framework/services.odex").length() != 0) {
System.out.println("Add services.odex for patch");
arrayList7.add(new File("/system/framework/services.odex"));
}
if (C2500.m7173(new File("/system/framework/services.jar"))) {
System.out.println("services.jar contain classes,dex");
m5422(new File("/system/framework/services.jar"), "/data/app");
File file18 = new File("/data/app/classes.dex");
if (file18.exists()) {
System.out.println("Add classes.dex for patch");
arrayList7.add(file18);
}
}
} else if (f5413) {
File file19 = new File(strArr[2]);
if (file19.exists()) {
arrayList7.add(file19);
} else {
throw new FileNotFoundException();
}
} else {
PrintStream printStream5 = System.out;
StringBuilder sb7 = new StringBuilder();
sb7.append("Vhodjashij file ");
str21 = str18;
sb7.append(strArr[2]);
printStream5.println(sb7.toString());
File file20 = new File(strArr[2]);
if (file20.exists()) {
if (file20.toString().contains("system@framework@services.jar@classes.dex")) {
System.out.println("Vhodjashij file byl dalvick-cache " + strArr[2]);
m5422(new File("/system/framework/services.jar"), "/data/app");
file20 = new File("/data/app/classes.dex");
if (!file20.exists()) {
file20 = file20;
}
File file21 = new File("/system/framework/services.odex");
if (file21.exists() && file21.length() == 0) {
file21.delete();
}
}
System.out.println("Add file for patch " + file20.toString());
arrayList7.add(file20);
it2 = arrayList7.iterator();
while (it2.hasNext()) {
File file22 = (File) it2.next();
System.out.println("Start patch for " + file22.toString());
boolean m7035 = C2500.m7035(file22);
FileChannel channel4 = new RandomAccessFile(file22, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel4.map(FileChannel.MapMode.READ_WRITE, 0L, (long) ((int) channel4.size()));
if (!m7035) {
f5517 = null;
f5491 = 0;
boolean z27 = false;
while (f5465.hasRemaining()) {
try {
position2 = f5465.position();
b = f5465.get();
it3 = it2;
str22 = str20;
} catch (Exception e38) {
e = e38;
it3 = it2;
str22 = str20;
}
try {
if (m5417(position2, b, f5683, f5684, f5685, f5687, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
z27 = true;
}
if (m5417(position2, b, f5696, f5697, f5698, f5700, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
z27 = true;
}
if (m5417(position2, b, f5722, f5723, f5724, f5726, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
z27 = true;
}
if (m5417(position2, b, f5701, f5702, f5703, f5704, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!checkUpgradeKeySetLP\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!checkUpgradeKeySetLP\n");
}
z27 = true;
}
if (m5417(position2, b, f5705, f5706, f5707, f5708, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\nCM12");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\nCM12");
}
z27 = true;
}
if (m5417(position2, b, f5709, f5710, f5711, f5712, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\nCM12");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\nCM12");
}
z27 = true;
}
if (m5417(position2, b, f5688, f5689, f5690, f5691, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\nCM11");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\nCM11");
}
z27 = true;
}
if (m5417(position2, b, f5692, f5693, f5694, f5695, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 policy patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 policy restored!\n");
}
z27 = true;
}
if (m5417(position2, b, f5714, f5715, f5716, f5717, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 policy patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 policy restored!\n");
}
z27 = true;
}
if (m5417(position2, b, f5718, f5719, f5720, f5721, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 policy patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 policy restored!\n");
}
z27 = true;
}
f5465.position(position2 + 1);
str20 = str22;
it2 = it3;
} catch (Exception e39) {
e = e39;
Exception exc8 = e;
exc8.printStackTrace();
z14 = z27;
System.out.println(str22 + exc8);
i3 = f5491;
if (i3 > 0) {
f5465.position(i3);
f5465.put(f5517);
f5465.force();
}
str23 = str4622222222222;
str24 = str21;
z13 = z14;
channel4.close();
if (strArr[4].contains("framework")) {
}
}
}
it3 = it2;
str22 = str20;
z14 = z27;
i3 = f5491;
if (i3 > 0 && f5517 != null) {
f5465.position(i3);
f5465.put(f5517);
f5465.force();
}
str23 = str4622222222222;
str24 = str21;
z13 = z14;
} else {
it3 = it2;
str22 = str20;
m5420(file22, strArr, z12);
if ((f5827 || !z12) && (f5828 || !z12)) {
str23 = str4622222222222;
str24 = str21;
z13 = false;
} else {
MappedByteBuffer map3 = channel4.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel4.size());
f5465 = map3;
map3.position(4120);
str23 = str4622222222222;
int m71854 = C2500.m7185(f5465.get(), f5465.get(), f5465.get(), f5465.get());
System.out.println("Start position:" + m71854);
f5465.position(m71854);
boolean z28 = false;
while (true) {
try {
if (!f5465.hasRemaining()) {
String str54 = str21;
z13 = z28;
str24 = str54;
break;
}
int position6 = f5465.position();
byte b6 = f5465.get();
if (m5417(position6, b6, f5558, f5559, f5560, f5561, z12)) {
try {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z28 = true;
} catch (Exception e40) {
exc5 = e40;
String str55 = str21;
z13 = z28;
str24 = str55;
System.out.println(str22 + exc5);
channel4.close();
if (strArr[4].contains("framework")) {
}
}
}
try {
if (m5417(position6, b6, f5562, f5563, f5564, f5565, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z28 = true;
}
if (m5417(position6, b6, f5566, f5567, f5568, f5570, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z28 = true;
}
if (m5417(position6, b6, f5571, f5572, f5573, f5574, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z28 = true;
}
if (m5417(position6, b6, f5588, f5589, f5590, f5591, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z28 = true;
}
if (m5417(position6, b6, f5592, f5593, f5594, f5596, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z28 = true;
}
if (m5417(position6, b6, f5597, f5598, f5599, f5600, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z28 = true;
}
if (m5417(position6, b6, f5601, f5602, f5603, f5604, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z28 = true;
}
if (m5417(position6, b6, f5606, f5607, f5608, f5609, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z28 = true;
}
if (m5417(position6, b6, f5610, f5611, f5612, f5613, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str44222222);
}
if (strArr[0].contains("restore")) {
str25 = str21;
try {
System.out.println(str25);
} catch (Exception e41) {
exc5 = e41;
z13 = z28;
str24 = str25;
System.out.println(str22 + exc5);
channel4.close();
if (strArr[4].contains("framework")) {
}
}
} else {
str25 = str21;
}
f5832 = true;
z28 = true;
} else {
str25 = str21;
}
try {
z13 = z28;
str24 = str25;
try {
if (m5417(position6, b6, f5614, f5615, f5616, f5617, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str44222222);
}
if (strArr[0].contains("restore")) {
System.out.println(str24);
}
f5832 = true;
z13 = true;
}
if (m5417(position6, b6, f5618, f5619, f5620, f5622, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str44222222);
}
if (strArr[0].contains("restore")) {
System.out.println(str24);
}
f5832 = true;
z13 = true;
}
if (m5417(position6, b6, f5575, f5576, f5577, f5579, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str44222222);
}
if (strArr[0].contains("restore")) {
System.out.println(str24);
}
f5832 = true;
z13 = true;
}
if (m5417(position6, b6, f5580, f5581, f5582, f5583, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str44222222);
}
if (strArr[0].contains("restore")) {
System.out.println(str24);
}
f5832 = true;
z13 = true;
}
if (m5417(position6, b6, f5584, f5585, f5586, f5587, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str44222222);
}
if (strArr[0].contains("restore")) {
System.out.println(str24);
}
f5832 = true;
z13 = true;
}
if (m5417(position6, b6, f5623, f5624, f5625, f5626, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5627, f5628, f5629, f5630, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5631, f5633, f5634, f5635, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5653, f5654, f5655, f5656, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5657, f5658, f5660, f5661, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5662, f5663, f5664, f5665, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5666, f5667, f5668, f5669, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5670, f5671, f5672, f5674, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
f5827 = true;
z13 = true;
}
if (m5417(position6, b6, f5636, f5637, f5638, f5639, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z13 = true;
}
if (m5417(position6, b6, f5640, f5641, f5642, f5643, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z13 = true;
}
if (m5417(position6, b6, f5649, f5650, f5651, f5652, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z13 = true;
}
if (m5417(position6, b6, f5644, f5645, f5646, f5648, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z13 = true;
}
if (m5417(position6, b6, f5675, f5676, f5677, f5678, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z13 = true;
}
if (m5417(position6, b6, f5679, f5680, f5681, f5682, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println(str45222222);
}
f5828 = true;
z13 = true;
}
if (z12 && f5827 && f5828 && f5832) {
break;
}
f5465.position(position6 + 1);
boolean z29 = z13;
str21 = str24;
z28 = z29;
} catch (Exception e42) {
e = e42;
exc5 = e;
System.out.println(str22 + exc5);
channel4.close();
if (strArr[4].contains("framework")) {
}
}
} catch (Exception e43) {
e = e43;
z13 = z28;
str24 = str25;
}
} catch (Exception e44) {
e = e44;
boolean z30 = z28;
str24 = str21;
z13 = z30;
}
} catch (Exception e45) {
e = e45;
String str56 = str21;
z13 = z28;
str24 = str56;
}
}
}
}
channel4.close();
if (strArr[4].contains("framework")) {
System.out.println("Rebuild file!");
if (file22.toString().endsWith("/classes.dex")) {
C2500.m6908(file22);
if (z13) {
f5439 = false;
String replace2 = strArr[1].replace("/services.jar", "/services-patched.jar");
String str57 = strArr[1];
new File(replace2).delete();
ArrayList arrayList14 = new ArrayList();
str26 = str22;
str27 = str24;
System.out.println("add files");
String absolutePath2 = file22.getAbsolutePath();
str28 = str44222222;
StringBuilder sb8 = new StringBuilder();
str29 = str45222222;
sb8.append(C2500.m6942(file22).getAbsolutePath());
sb8.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
arrayList14.add(new C2912(absolutePath2, sb8.toString()));
try {
C2500.m6986(str57, replace2, arrayList14);
System.out.println("add files finish");
new File(str57).delete();
} catch (Exception e46) {
e46.printStackTrace();
new File(replace2).delete();
}
} else {
str26 = str22;
str27 = str24;
str28 = str44222222;
str29 = str45222222;
f5439 = true;
}
} else {
str26 = str22;
str27 = str24;
str28 = str44222222;
str29 = str45222222;
}
if (file22.toString().endsWith("/services.odex")) {
if (!C2500.m7035(file22)) {
C2500.m6909(file22, null);
}
if (z13) {
file22.renameTo(new File(file22.getAbsolutePath().replace("/services.odex", "/services-patched.odex")));
}
}
str30 = str23;
str4622222222222 = str30;
str20 = str26;
str21 = str27;
str44222222 = str28;
str45222222 = str29;
it2 = it3;
} else {
str26 = str22;
str27 = str24;
str28 = str44222222;
str29 = str45222222;
if (file22.toString().endsWith("/classes.dex")) {
C2500.m6908(file22);
str30 = str23;
} else {
str30 = str23;
C2500.m6909(file22, str30);
}
if (file22.toString().contains("system@framework@services.jar@classes.dex") && z13) {
System.out.println("LuckyPatcher: dalvik-cache patched! ");
}
if (file22.toString().contains("/classes.dex") && z13) {
System.out.println("start");
if (C2500.m6877(str30, "/system/framework/services.backup", true, false)) {
System.out.println("good space");
new File("/system/framework/services.backup").delete();
ArrayList arrayList15 = new ArrayList();
System.out.println("add files");
arrayList15.add(new C2912("/data/app/classes.dex", "/data/app/"));
try {
C2500.m6986(str30, "/system/framework/services.backup", arrayList15);
System.out.println("add files finish");
C2500.m7094("chmod", "0644", "/system/framework/services.backup");
C2500.m7094("chown", "0:0", "/system/framework/services.backup");
C2500.m7094("chmod", "0.0", "/system/framework/services.backup");
File file23 = new File("/system/framework/services.odex");
File m69472 = C2500.m6947(str30);
if (file23.exists()) {
try {
System.out.println("fix odex na osnove rebuild services");
C2500.m6909(file23, "/system/framework/services.backup");
} catch (Exception e47) {
exc6 = e47;
exc6.printStackTrace();
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
new File("/system/framework/services.backup").delete();
System.out.println("finish");
if (!f5413) {
}
str4622222222222 = str30;
str20 = str26;
str21 = str27;
str44222222 = str28;
str45222222 = str29;
it2 = it3;
}
}
new File(C2975.f9250 + "/ClearDalvik.on").createNewFile();
new File(str30).delete();
C2500.m7094("rm", str30);
new File("/system/framework/services.backup").renameTo(new File(str30));
if (!new File(str30).exists()) {
try {
String[] strArr7 = new String[3];
strArr7[0] = "mv";
try {
strArr7[1] = "/system/framework/services.backup";
strArr7[2] = str30;
C2500.m7094(strArr7);
} catch (Exception e48) {
e = e48;
exc6 = e;
exc6.printStackTrace();
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
new File("/system/framework/services.backup").delete();
System.out.println("finish");
if (!f5413) {
}
str4622222222222 = str30;
str20 = str26;
str21 = str27;
str44222222 = str28;
str45222222 = str29;
it2 = it3;
}
} catch (Exception e49) {
exc6 = e49;
exc6.printStackTrace();
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
new File("/system/framework/services.backup").delete();
System.out.println("finish");
if (!f5413) {
}
str4622222222222 = str30;
str20 = str26;
str21 = str27;
str44222222 = str28;
str45222222 = str29;
it2 = it3;
}
}
if (m69472 != null) {
try {
strArr2 = new String[2];
strArr2[0] = "rm";
} catch (Exception e50) {
e = e50;
}
try {
strArr2[1] = m69472.getAbsolutePath();
C2500.m7094(strArr2);
if (m69472.exists()) {
m69472.delete();
}
} catch (Exception e51) {
e = e51;
e.printStackTrace();
C2500.m7045();
System.out.println("finish");
if (!f5413) {
}
str4622222222222 = str30;
str20 = str26;
str21 = str27;
str44222222 = str28;
str45222222 = str29;
it2 = it3;
}
}
new File("/data/dalvik-cache/arm/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/arm/system@framework@arm@boot.art").delete();
new File("/data/dalvik-cache/arm64/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/arm64/system@framework@arm@boot.art").delete();
new File("/data/dalvik-cache/x86/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/x86/system@framework@arm@boot.art").delete();
new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.oat").delete();
new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.art").delete();
C2500.m7045();
} catch (Exception e52) {
e = e52;
}
System.out.println("finish");
} else {
new File("/system/framework/services.backup").delete();
File file24 = new File(strArr[2]);
FileChannel channel5 = new RandomAccessFile(file24, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel5.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel5.size());
f5517 = null;
f5491 = 0;
while (f5465.hasRemaining()) {
try {
int position7 = f5465.position();
byte b7 = f5465.get();
if (m5417(position7, b7, f5683, f5684, f5685, f5687, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
}
if (m5417(position7, b7, f5696, f5697, f5698, f5700, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
}
if (m5417(position7, b7, f5722, f5723, f5724, f5726, z12)) {
if (strArr[0].contains("patch")) {
System.out.println(str19);
}
if (strArr[0].contains("restore")) {
System.out.println(str16);
}
}
if (m5417(position7, b7, f5701, f5702, f5703, f5704, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!checkUpgradeKeySetLP\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!checkUpgradeKeySetLP\n");
}
}
if (m5417(position7, b7, f5705, f5706, f5707, f5708, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\nCM12");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\nCM12");
}
}
if (m5417(position7, b7, f5709, f5710, f5711, f5712, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\nCM12");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\nCM12");
}
}
if (m5417(position7, b7, f5688, f5689, f5690, f5691, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\nCM11");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\nCM11");
}
}
if (m5417(position7, b7, f5692, f5693, f5694, f5695, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 policy patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 policy restored!\n");
}
}
if (m5417(position7, b7, f5718, f5719, f5720, f5721, z12)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 policy patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 policy restored!\n");
}
}
f5465.position(position7 + 1);
} catch (Exception e53) {
e53.printStackTrace();
}
}
int i10 = f5491;
if (i10 > 0 && f5517 != null) {
f5465.position(i10);
f5465.put(f5517);
f5465.force();
}
channel5.close();
if (file24.toString().endsWith("/classes.dex")) {
C2500.m6908(file24);
} else {
C2500.m6909(file24, str30);
}
System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
}
}
if (!f5413) {
if (new File("/system/framework/services.patched").exists()) {
System.out.println("LuckyPatcher: root found services.patched! ");
}
if (new File("/system/framework/services.odex").exists()) {
System.out.println("LuckyPatcher: root found services.odex! ");
}
if (strArr[0].contains("restore")) {
new File("/system/framework/patch3.done").delete();
}
}
str4622222222222 = str30;
str20 = str26;
str21 = str27;
str44222222 = str28;
str45222222 = str29;
it2 = it3;
}
}
} else {
throw new FileNotFoundException();
}
}
}
str21 = str18;
it2 = arrayList7.iterator();
while (it2.hasNext()) {
}
}
}
C2500.m6899();
}
private static boolean m5417(int i, byte b, byte[] bArr, byte[] bArr2, byte[] bArr3, byte[] bArr4, boolean z) {
if (bArr != null && b == bArr[0] && z) {
try {
f5465.position((bArr.length - 1) + i);
if (f5465.get() == bArr[bArr.length - 1] || bArr2[bArr.length - 1] == 1) {
if (bArr4[0] == 0) {
bArr3[0] = b;
}
f5465.position(i + 1);
byte b2 = f5465.get();
int i2 = 1;
while (true) {
if (b2 != bArr[i2] && bArr2[i2] != 1) {
f5465.position(i);
break;
}
if (bArr4[i2] == 0) {
bArr3[i2] = b2;
}
if (bArr4[i2] == 3) {
bArr3[i2] = (byte) (b2 & RegisterType.DOUBLE_HI);
}
if (bArr4[i2] == 2) {
int i3 = b2 & RegisterType.DOUBLE_HI;
bArr3[i2] = (byte) (i3 + (i3 * 16));
}
if (bArr4[i2] == 20) {
bArr3[i2] = (byte) (b2 & RegisterType.DOUBLE_HI);
}
if (bArr4[i2] == 21) {
bArr3[i2] = (byte) ((b2 & RegisterType.DOUBLE_HI) + 16);
}
i2++;
if (i2 == bArr.length) {
f5465.position(i);
f5465.put(bArr3);
f5465.force();
return true;
}
b2 = f5465.get();
}
}
} catch (IllegalArgumentException unused) {
}
}
return false;
}
static void m5418(ArrayList<File> arrayList, String[] strArr, boolean z, boolean z2) {
boolean z3;
Iterator<File> it;
int i;
Iterator<C2500.C2508> it2;
Iterator<C2500.C2508> it3;
Iterator<C2500.C2508> it4;
Iterator<C2500.C2508> it5;
Iterator<C2631> it6;
Iterator<C2631> it7;
Iterator<C2500.C2508> it8;
int i2;
boolean z4 = z;
try {
Iterator<File> it9 = arrayList.iterator();
boolean z5 = false;
boolean z6 = false;
while (it9.hasNext()) {
File next = it9.next();
if (next.exists()) {
if (next.getAbsolutePath().contains("conscrypt")) {
z5 = true;
}
if (next.getAbsolutePath().contains("core-oj")) {
z6 = true;
}
}
}
Iterator<File> it10 = arrayList.iterator();
int i3 = 0;
while (it10.hasNext()) {
File next2 = it10.next();
boolean contains = next2.getAbsolutePath().toLowerCase().contains("boot.oat");
boolean contains2 = next2.getAbsolutePath().toLowerCase().contains("conscrypt");
boolean contains3 = next2.getAbsolutePath().toLowerCase().contains("core-oj");
int i4 = i3 + 1;
System.out.println("oat file for patch:" + next2.getAbsolutePath());
int i5 = 10;
if (contains2 && z4 && z5) {
C2500.C2509 m7205 = new C2500("").m7205(next2, new C1651());
System.out.println(m7205.f7115);
try {
Iterator<C2500.C2508> it11 = m7205.f7116.iterator();
while (it11.hasNext()) {
C2500.C2508 next3 = it11.next();
System.out.println(next3.f7111);
try {
if (next3.f7112 != 0 && next2.canWrite()) {
FileChannel channel = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
z3 = z5;
try {
f5465 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
Iterator<C2631> it12 = f5833.iterator();
while (it12.hasNext()) {
C2631 next4 = it12.next();
int[] iArr = new int[i5];
iArr[0] = 4090;
iArr[1] = 4091;
iArr[2] = 4092;
iArr[3] = 4093;
iArr[4] = 4094;
iArr[5] = 4095;
iArr[6] = 4096;
iArr[7] = 4097;
iArr[8] = 4098;
iArr[9] = 4099;
Iterator<C2631> it13 = it12;
int i6 = 0;
while (true) {
if (i6 < i5) {
int i7 = iArr[i6];
it = it10;
try {
f5465.position(next3.f7112 + i7);
byte[] bArr = next4.f7550;
int length = bArr.length;
it8 = it11;
int i8 = 0;
boolean z7 = true;
while (i8 < length) {
i = i4;
try {
byte[] bArr2 = bArr;
if (f5465.get() != bArr[i8]) {
z7 = false;
}
i8++;
i4 = i;
bArr = bArr2;
} catch (Exception e) {
e = e;
try {
e.printStackTrace();
it10 = it;
it11 = it8;
z5 = z3;
i4 = i;
i5 = 10;
} catch (Exception e2) {
e = e2;
e.printStackTrace();
if (!contains) {
}
z5 = z3;
if (contains3) {
C2500.C2509 m72052 = new C2500("").m7205(next2, new C1654(z2, z5, z4));
System.out.println(m72052.f7115);
try {
it2 = m72052.f7116.iterator();
while (it2.hasNext()) {
}
} catch (Exception e3) {
e = e3;
}
}
z4 = z;
it10 = it;
i3 = i;
}
}
}
i2 = i4;
if (z7) {
f5465.position(next3.f7112 + i7);
f5465.put(next4.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core1uni restored!\n");
}
f5827 = true;
} else {
i6++;
it10 = it;
it11 = it8;
i4 = i2;
i5 = 10;
}
} catch (Exception e4) {
e = e4;
it8 = it11;
i = i4;
e.printStackTrace();
it10 = it;
it11 = it8;
z5 = z3;
i4 = i;
i5 = 10;
}
} else {
it = it10;
it8 = it11;
i2 = i4;
break;
}
}
it12 = it13;
it10 = it;
it11 = it8;
i4 = i2;
i5 = 10;
}
it = it10;
it8 = it11;
i = i4;
channel.close();
} catch (Exception e5) {
e = e5;
it = it10;
it8 = it11;
i = i4;
e.printStackTrace();
it10 = it;
it11 = it8;
z5 = z3;
i4 = i;
i5 = 10;
}
} else {
z3 = z5;
it = it10;
it8 = it11;
i = i4;
}
} catch (Exception e6) {
e = e6;
z3 = z5;
}
it10 = it;
it11 = it8;
z5 = z3;
i4 = i;
i5 = 10;
}
} catch (Exception e7) {
e = e7;
z3 = z5;
it = it10;
i = i4;
}
}
z3 = z5;
it = it10;
i = i4;
if ((!contains && z2 && z3) || (contains && !z3 && (z4 || z2))) {
z5 = z3;
C2500.C2509 m72053 = new C2500("").m7205(next2, new C1652(z2, z5, z4));
System.out.println(m72053.f7115);
try {
Iterator<C2500.C2508> it14 = m72053.f7116.iterator();
while (it14.hasNext()) {
C2500.C2508 next5 = it14.next();
System.out.println(next5.f7111);
if (next5.f7111.equals("boolean java.security.MessageDigest.isEqual(byte[], byte[])")) {
System.out.println(next5.f7111);
System.out.println(next5.f7112);
try {
} catch (Exception e8) {
e = e8;
it5 = it14;
}
if (next5.f7112 != 0 && next2.canWrite()) {
FileChannel channel2 = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel2.size());
Iterator<C2631> it15 = new C1653().iterator();
while (it15.hasNext()) {
C2631 next6 = it15.next();
int[] iArr2 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
int i9 = 0;
while (true) {
if (i9 < 10) {
int i10 = iArr2[i9];
it5 = it14;
try {
f5465.position(next5.f7112 + i10);
byte[] bArr3 = next6.f7550;
int length2 = bArr3.length;
it7 = it15;
int i11 = 0;
boolean z8 = true;
while (i11 < length2) {
int[] iArr3 = iArr2;
byte[] bArr4 = bArr3;
if (f5465.get() != bArr3[i11]) {
z8 = false;
}
i11++;
iArr2 = iArr3;
bArr3 = bArr4;
}
int[] iArr4 = iArr2;
if (z8) {
f5465.position(next5.f7112 + i10);
f5465.put(next6.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Oat Core2 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core2 restored!\n");
}
f5828 = true;
} else {
i9++;
it14 = it5;
it15 = it7;
iArr2 = iArr4;
}
} catch (Exception e9) {
e = e9;
e.printStackTrace();
if (next5.f7111.equals("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])")) {
}
it14 = it5;
}
} else {
it5 = it14;
it7 = it15;
break;
}
}
it14 = it5;
it15 = it7;
}
it5 = it14;
channel2.close();
if (next5.f7111.equals("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])")) {
System.out.println(next5.f7111);
System.out.println(next5.f7112);
if (next5.f7112 != 0 && next2.canWrite()) {
FileChannel channel3 = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel3.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel3.size());
Iterator<C2631> it16 = f5833.iterator();
while (it16.hasNext()) {
C2631 next7 = it16.next();
int[] iArr5 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
int i12 = 0;
while (true) {
if (i12 < 10) {
int i13 = iArr5[i12];
f5465.position(next5.f7112 + i13);
byte[] bArr5 = next7.f7550;
int length3 = bArr5.length;
it6 = it16;
int i14 = 0;
boolean z9 = true;
while (i14 < length3) {
int[] iArr6 = iArr5;
byte[] bArr6 = bArr5;
if (f5465.get() != bArr5[i14]) {
z9 = false;
}
i14++;
iArr5 = iArr6;
bArr5 = bArr6;
}
int[] iArr7 = iArr5;
if (z9) {
f5465.position(next5.f7112 + i13);
f5465.put(next7.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Oat Core1uni patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Oat Core1uni restored!\n");
}
f5827 = true;
} else {
i12++;
it16 = it6;
iArr5 = iArr7;
}
} else {
it6 = it16;
break;
}
}
it16 = it6;
}
channel3.close();
}
}
it14 = it5;
}
}
it5 = it14;
if (next5.f7111.equals("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])")) {
}
it14 = it5;
}
} catch (Exception e10) {
e10.printStackTrace();
}
} else {
z5 = z3;
}
if (contains3 && z2 && z6) {
C2500.C2509 m720522 = new C2500("").m7205(next2, new C1654(z2, z5, z4));
System.out.println(m720522.f7115);
it2 = m720522.f7116.iterator();
while (it2.hasNext()) {
C2500.C2508 next8 = it2.next();
System.out.println(next8.f7111);
if (next8.f7111.equals("boolean java.security.MessageDigest.isEqual(byte[], byte[])")) {
System.out.println(next8.f7111);
System.out.println(next8.f7112);
if (next8.f7112 != 0 && next2.canWrite()) {
FileChannel channel4 = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel4.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel4.size());
Iterator<C2631> it17 = new C1655().iterator();
while (it17.hasNext()) {
C2631 next9 = it17.next();
int[] iArr8 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
int i15 = 0;
int i16 = 10;
while (true) {
if (i15 < i16) {
int i17 = iArr8[i15];
f5465.position(next8.f7112 + i17);
byte[] bArr7 = next9.f7550;
int length4 = bArr7.length;
int i18 = 0;
boolean z10 = true;
while (i18 < length4) {
Iterator<C2500.C2508> it18 = it2;
if (f5465.get() != bArr7[i18]) {
z10 = false;
}
i18++;
it2 = it18;
}
it4 = it2;
if (z10) {
break;
}
i15++;
it2 = it4;
i16 = 10;
} else {
it4 = it2;
break;
}
}
it2 = it4;
}
it3 = it2;
channel4.close();
it2 = it3;
}
}
it3 = it2;
it2 = it3;
}
}
z4 = z;
it10 = it;
i3 = i;
}
if ((f5827 || f5828) && i3 == arrayList.size() && C2975.f9299 >= 24) {
System.out.println("patched cache " + C2975.f9250 + "/reboot");
C2500.m7073();
C2500.m6899();
}
} catch (Exception e11) {
e11.printStackTrace();
}
}
static boolean m5419(String[] strArr, boolean z) {
ArrayList arrayList = new ArrayList();
int i = 10;
char c = 4;
char c2 = 3;
char c3 = 2;
char c4 = 1;
char c5 = 0;
if (arrayList.size() == 0) {
String[] strArr2 = {"/system/framework/x86/boot.oat", "/system/framework/x86_64/boot.oat", "/system/framework/arm64/boot.oat", "/system/framework/arm/boot.oat", "/system/framework/oat/x86/boot.oat", "/system/framework/oat/x86_64/boot.oat", "/system/framework/oat/arm64/boot.oat", "/system/framework/oat/arm/boot.oat", "/data/dalvik-cache/x86/system@framework@boot.oat", "/data/dalvik-cache/x86_64/system@framework@boot.oat", "/data/dalvik-cache/arm64/system@framework@boot.oat", "/data/dalvik-cache/arm/system@framework@boot.oat", "/data/dalvik-cache/oat/x86/system@framework@boot.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm/system@framework@boot.oat"};
int i2 = 0;
for (int i3 = 16; i2 < i3; i3 = 16) {
String str = strArr2[i2];
if (C2500.m6898(str)) {
arrayList.add(new File(str));
}
i2++;
}
}
Iterator it = arrayList.iterator();
boolean z2 = false;
while (it.hasNext()) {
File file = (File) it.next();
try {
Iterator<C2500.C2508> it2 = new C2500("").m7205(file, new C1648()).f7116.iterator();
while (it2.hasNext()) {
C2500.C2508 next = it2.next();
System.out.println(next.f7111);
if (next.f7111.equals("boolean java.security.Signature.verify(byte[])")) {
System.out.println(next.f7111);
System.out.println(next.f7112);
if (next.f7112 != 0 && file.canWrite()) {
try {
FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, channel.size());
Iterator<C2631> it3 = f5833.iterator();
while (it3.hasNext()) {
C2631 next2 = it3.next();
int[] iArr = new int[i];
iArr[c5] = 4090;
iArr[c4] = 4091;
iArr[c3] = 4092;
iArr[c2] = 4093;
iArr[c] = 4094;
iArr[5] = 4095;
iArr[6] = 4096;
iArr[7] = 4097;
iArr[8] = 4098;
iArr[9] = 4099;
int i4 = 0;
while (true) {
if (i4 < i) {
int i5 = iArr[i4];
f5465.position(next.f7112 + i5);
boolean z3 = true;
for (byte b : next2.f7550) {
if (f5465.get() != b) {
z3 = false;
}
}
if (z3) {
f5465.position(next.f7112 + i5);
f5465.put(next2.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!coreHard\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!coreHard\n");
}
z2 = true;
} else {
i4++;
i = 10;
}
}
}
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
channel.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
if (next.f7111.equals("boolean java.security.Signature.verify(byte[], int, int)")) {
System.out.println(next.f7111);
System.out.println(next.f7112);
if (next.f7112 != 0 && file.canWrite()) {
try {
FileChannel channel2 = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, channel2.size());
Iterator<C2631> it4 = f5833.iterator();
while (it4.hasNext()) {
C2631 next3 = it4.next();
int[] iArr2 = new int[10];
iArr2[0] = 4090;
iArr2[1] = 4091;
iArr2[2] = 4092;
iArr2[3] = 4093;
iArr2[4] = 4094;
iArr2[5] = 4095;
iArr2[6] = 4096;
try {
iArr2[7] = 4097;
} catch (Exception e2) {
e = e2;
try {
e.printStackTrace();
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
} catch (Exception e3) {
e = e3;
e.printStackTrace();
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
}
try {
iArr2[8] = 4098;
try {
iArr2[9] = 4099;
int i6 = 0;
int i7 = 10;
while (true) {
if (i6 < i7) {
int i8 = iArr2[i6];
f5465.position(next.f7112 + i8);
boolean z4 = true;
for (byte b2 : next3.f7550) {
if (f5465.get() != b2) {
z4 = false;
}
}
if (z4) {
break;
}
i6++;
i7 = 10;
}
}
} catch (Exception e4) {
e = e4;
}
} catch (Exception e5) {
e = e5;
e.printStackTrace();
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
}
channel2.close();
} catch (Exception e6) {
e = e6;
}
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
}
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
} catch (Exception e7) {
e = e7;
e.printStackTrace();
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
i = 10;
c = 4;
c2 = 3;
c3 = 2;
c4 = 1;
c5 = 0;
}
return z2;
}
static void m5420(File file, String[] strArr, boolean z) {
C2500.C2509 m7205 = new C2500("").m7205(file, new C1656());
System.out.println(m7205.f7115);
try {
Iterator<C2500.C2508> it = m7205.f7116.iterator();
while (it.hasNext()) {
C2500.C2508 next = it.next();
System.out.println(next.f7111);
int i = 4093;
char c = 3;
int i2 = 4092;
char c2 = 2;
int i3 = 4091;
int i4 = 10;
if (next.f7111.equals("int com.android.server.pm.PackageManagerService.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])") || next.f7111.equals("int com.android.server.pm.PackageManagerServiceUtils.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])")) {
System.out.println(next.f7111);
System.out.println(next.f7112);
if (next.f7112 != 0 && file.canWrite()) {
FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, channel.size());
Iterator<C2631> it2 = new C1657().iterator();
while (it2.hasNext()) {
C2631 next2 = it2.next();
int[] iArr = new int[i4];
iArr[0] = 4090;
iArr[1] = i3;
iArr[c2] = i2;
iArr[c] = i;
iArr[4] = 4094;
iArr[5] = 4095;
iArr[6] = 4096;
iArr[7] = 4097;
iArr[8] = 4098;
iArr[9] = 4099;
int i5 = 0;
while (true) {
if (i5 < i4) {
int i6 = iArr[i5];
f5465.position(next.f7112 + i6);
boolean z2 = true;
for (byte b : next2.f7550) {
if (f5465.get() != b) {
z2 = false;
}
}
if (z2) {
f5465.position(next.f7112 + i6);
f5465.put(next2.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!\n");
}
f5827 = true;
} else {
i5++;
i4 = 10;
}
}
}
i4 = 10;
i = 4093;
c = 3;
i2 = 4092;
c2 = 2;
i3 = 4091;
}
channel.close();
}
}
if (next.f7111.equals("void com.android.server.pm.PackageManagerService.checkDowngrade(android.content.pm.PackageParser$Package, android.content.pm.PackageInfoLite)")) {
System.out.println(next.f7111);
System.out.println(next.f7112);
if (next.f7112 != 0 && file.canWrite()) {
FileChannel channel2 = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, channel2.size());
Iterator<C2631> it3 = new C1646().iterator();
while (it3.hasNext()) {
C2631 next3 = it3.next();
int[] iArr2 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
int i7 = 0;
int i8 = 10;
while (true) {
if (i7 < i8) {
int i9 = iArr2[i7];
f5465.position(next.f7112 + i9);
boolean z3 = true;
for (byte b2 : next3.f7550) {
if (f5465.get() != b2) {
z3 = false;
}
}
if (z3) {
f5465.position(next.f7112 + i9);
f5465.put(next3.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!InstallLocationPolice\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!InstallLocationPolice\n");
}
f5828 = true;
} else {
i7++;
i8 = 10;
}
}
}
}
channel2.close();
}
}
if (next.f7111.equals("android.content.pm.PackageParser$Package com.android.server.pm.PackageManagerService.scanPackageDirtyLI(android.content.pm.PackageParser$Package, int, int, long, android.os.UserHandle)")) {
System.out.println(next.f7111);
System.out.println(next.f7112);
System.out.println(next.f7113);
if (next.f7112 != 0 && file.canWrite()) {
FileChannel channel3 = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel3.map(FileChannel.MapMode.READ_WRITE, next.f7112 + 4095, next.f7113);
while (f5465.hasRemaining()) {
int position = f5465.position();
byte b3 = f5465.get();
if (m5417(position, b3, f5394, f5395, f5396, f5397, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5398, f5399, f5400, f5401, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5402, f5403, f5404, f5405, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5610, f5611, f5612, f5613, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5614, f5615, f5616, f5617, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5618, f5619, f5620, f5622, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5575, f5576, f5577, f5579, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5580, f5581, f5582, f5583, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
if (m5417(position, b3, f5584, f5585, f5586, f5587, z)) {
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!FixForCM\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!FixForCM\n");
}
f5832 = true;
}
f5465.position(position + 1);
}
channel3.close();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
static boolean m5421(String[] strArr, boolean z) {
ArrayList arrayList = new ArrayList();
char c = 1;
char c2 = 2;
char c3 = 3;
char c4 = 4;
char c5 = 5;
String[] strArr2 = {"/system/framework/arm/boot-framework.oat", "/system/framework/arm64/boot-framework.oat", "/system/framework/x86/boot-framework.oat", "/system/framework/x86_64/boot-framework.oat", "/system/framework/oat/arm/boot-framework.oat", "/system/framework/oat/arm64/boot-framework.oat", "/system/framework/oat/x86/boot-framework.oat", "/system/framework/oat/x86_64/boot-framework.oat", "/system/framework/arm/framework.odex", "/system/framework/arm64/framework.odex", "/system/framework/x86/framework.odex", "/system/framework/x86_64/framework.odex", "/system/framework/oat/arm/framework.odex", "/system/framework/oat/arm64/framework.odex", "/system/framework/oat/x86/framework.odex", "/system/framework/oat/x86_64/framework.odex", "/data/dalvik-cache/arm/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/arm64/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/x86/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/x86_64/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/arm/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/arm64/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/x86/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/x86_64/system@framework@framework.jar@classes.dex"};
int i = 0;
for (int i2 = 24; i < i2; i2 = 24) {
String str = strArr2[i];
if (C2500.m6898(str)) {
arrayList.add(new File(str));
}
i++;
}
if (arrayList.size() == 0) {
String[] strArr3 = {"/system/framework/x86/boot.oat", "/system/framework/x86_64/boot.oat", "/system/framework/arm64/boot.oat", "/system/framework/arm/boot.oat", "/system/framework/oat/x86/boot.oat", "/system/framework/oat/x86_64/boot.oat", "/system/framework/oat/arm64/boot.oat", "/system/framework/oat/arm/boot.oat", "/data/dalvik-cache/x86/system@framework@boot.oat", "/data/dalvik-cache/x86_64/system@framework@boot.oat", "/data/dalvik-cache/arm64/system@framework@boot.oat", "/data/dalvik-cache/arm/system@framework@boot.oat", "/data/dalvik-cache/oat/x86/system@framework@boot.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm/system@framework@boot.oat"};
for (int i3 = 0; i3 < 16; i3++) {
String str2 = strArr3[i3];
if (C2500.m6898(str2)) {
arrayList.add(new File(str2));
}
}
}
Iterator it = arrayList.iterator();
boolean z2 = false;
while (it.hasNext()) {
File file = (File) it.next();
try {
C2500.C2509 m7205 = new C2500("").m7205(file, new C1647());
System.out.println(m7205.f7115);
Iterator<C2500.C2508> it2 = m7205.f7116.iterator();
while (it2.hasNext()) {
C2500.C2508 next = it2.next();
System.out.println(next.f7111);
if (next.f7111.equals("boolean android.content.pm.PackageParser$SigningDetails.checkCapability(android.content.pm.PackageParser$SigningDetails, int)")) {
System.out.println(next.f7111);
System.out.println(next.f7112);
if (next.f7112 != 0 && file.canWrite()) {
FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
f5465 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, channel.size());
Iterator<C2631> it3 = f5833.iterator();
while (it3.hasNext()) {
C2631 next2 = it3.next();
int[] iArr = new int[10];
iArr[0] = 4090;
iArr[c] = 4091;
iArr[c2] = 4092;
iArr[c3] = 4093;
iArr[c4] = 4094;
iArr[c5] = 4095;
try {
iArr[6] = 4096;
try {
iArr[7] = 4097;
try {
iArr[8] = 4098;
try {
iArr[9] = 4099;
int i4 = 10;
int i5 = 0;
while (true) {
if (i5 < i4) {
int i6 = iArr[i5];
f5465.position(next.f7112 + i6);
boolean z3 = true;
for (byte b : next2.f7550) {
if (f5465.get() != b) {
z3 = false;
}
}
if (z3) {
f5465.position(next.f7112 + i6);
f5465.put(next2.f7552);
f5465.force();
if (strArr[0].contains("patch")) {
System.out.println("Core4 patched!android9 checkCapability\n");
}
if (strArr[0].contains("restore")) {
System.out.println("Core4 restored!android9 checkCapability\n");
}
z2 = true;
} else {
i5++;
i4 = 10;
}
}
}
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
} catch (Throwable th) {
th = th;
th.printStackTrace();
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
}
} catch (Throwable th2) {
th = th2;
th.printStackTrace();
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
}
} catch (Throwable th3) {
th = th3;
th.printStackTrace();
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
}
} catch (Throwable th4) {
th = th4;
}
}
channel.close();
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
}
}
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
}
} catch (Throwable th5) {
th = th5;
}
c = 1;
c2 = 2;
c3 = 3;
c4 = 4;
c5 = 5;
}
return z2;
}
public static void m5422(File file, String str) {
try {
FileInputStream fileInputStream = new FileInputStream(file);
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
boolean z = false;
for (ZipEntry nextEntry = zipInputStream.getNextEntry(); nextEntry != null; nextEntry = zipInputStream.getNextEntry()) {
if (nextEntry.getName().equals("classes.dex")) {
FileOutputStream fileOutputStream = new FileOutputStream(str + "/classes.dex");
byte[] bArr = new byte[InternalZipConstants.UFT8_NAMES_FLAG];
while (true) {
int read = zipInputStream.read(bArr);
if (read == -1) {
break;
} else {
fileOutputStream.write(bArr, 0, read);
}
}
C2500.m7094("chmod", "777", str + "/classes.dex");
C2500.m7094("chown", "0.0", str + "/classes.dex");
C2500.m7094("chown", "0:0", str + "/classes.dex");
zipInputStream.closeEntry();
fileOutputStream.close();
z = true;
}
if (z) {
break;
}
}
zipInputStream.close();
fileInputStream.close();
} catch (Exception e) {
try {
new ZipFile(file).extractFile("classes.dex", str);
} catch (ZipException e2) {
System.out.println("Error classes.dex decompress! " + e2);
System.out.println("Exception e1" + e.toString());
} catch (Exception e3) {
System.out.println("Error classes.dex decompress! " + e3);
System.out.println("Exception e1" + e.toString());
}
System.out.println("Exception e" + e.toString());
}
}
}