getprop("ro.product.device") == "msm8909" || abort("E3004: This package is for \"msm8909\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Source: qcom/msm8909/msm8909:7.1.2/133/brian01150104:userdebug/test-keys");
ui_print("Target: qcom/msm8909/msm8909:7.1.2/134/brian01170247:userdebug/test-keys");
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "qcom/msm8909/msm8909:7.1.2/133/brian01150104:userdebug/test-keys" ||
    getprop("ro.build.fingerprint") == "qcom/msm8909/msm8909:7.1.2/134/brian01170247:userdebug/test-keys" ||
    abort("E3001: Package expects build fingerprint of qcom/msm8909/msm8909:7.1.2/133/brian01150104:userdebug/test-keys or qcom/msm8909/msm8909:7.1.2/134/brian01170247:userdebug/test-keys; this device has " + getprop("ro.build.fingerprint") + ".");
apply_patch_check("EMMC:/dev/block/bootdevice/by-name/boot:16276776:d51109ab17b4aee63642506175ccbc6ff6ef8069:16276776:069b77af2ca1eb3e402f4e5b66fdd01da2349996") || abort("E3005: \"EMMC:/dev/block/bootdevice/by-name/boot:16276776:d51109ab17b4aee63642506175ccbc6ff6ef8069:16276776:069b77af2ca1eb3e402f4e5b66fdd01da2349996\" has unexpected contents.");
apply_patch_space(22482944) || abort("E3006: Not enough free space on /cache to apply patches.");
if (range_sha1("/dev/block/bootdevice/by-name/system", "3694,1,80,81,306,2816,2817,2818,2819,2820,2821,2822,2823,2832,2833,2940,2941,2942,2943,3036,3037,3045,3046,3047,3048,3049,3050,3051,3052,3069,3070,3089,3090,3091,3092,3102,3103,3157,3158,3159,3160,3172,3173,3177,3178,3179,3180,3190,3191,3205,3206,3207,3208,3244,3245,3254,3255,3256,3257,3300,3301,3327,3328,3329,3330,3382,3383,3392,3393,3394,3395,3433,3434,3446,3447,3448,3449,3450,3451,3530,3531,3532,3533,3766,3767,3768,6942,6943,6944,8086,8087,8311,8312,9151,9152,9156,9157,9158,9159,9168,9169,9177,9178,9179,9180,9208,9209,9274,9275,9276,9277,9345,9346,9354,9355,9356,9357,9386,9387,9393,9394,9395,9396,9417,9418,9422,9423,9424,9425,9433,9434,9440,9441,9442,9443,9461,9462,9467,9468,9469,9470,9482,9483,9488,9489,9490,9491,9506,9507,9513,9514,9515,9516,9529,9530,9531,9532,9533,9534,9612,9613,9614,9615,9616,9617,9629,9630,9634,9635,9636,9637,9638,9639,9698,9699,9700,9701,9702,9703,9768,9769,9770,9771,9772,9773,21723,21725,21987,21988,22999,23000,23043,23044,23074,23075,23403,23404,24372,24406,24980,24981,25086,25087,25379,25380,25592,25593,26513,26516,26517,26518,26584,26585,26586,26587,26753,26754,26898,26899,27072,27073,27244,27245,27605,27606,27623,27865,27868,27869,27878,27879,27880,27881,27898,27899,27920,27921,28030,28031,28069,28070,28073,28074,28085,28086,28552,28553,28554,28555,28577,28578,28599,28600,28839,28840,29952,29953,30249,30250,30368,30369,30846,30847,30848,30849,31374,31375,31390,31391,31422,31423,31484,31485,31491,31492,32768,32770,32849,32850,48416,48419,48424,48425,48442,48443,48472,48473,65531,65532,65533,65534,65536,65537,67723,67724,67725,67798,67799,67872,67873,67916,67917,67918,67919,67922,67923,67924,67925,67926,67927,67928,67929,67930,67931,67933,67934,67940,67941,67946,67947,68022,68023,68026,68027,68032,68033,68034,68035,68036,68037,68038,68039,68040,68041,68042,68043,68049,68050,68051,68052,68073,68074,68097,68098,68099,68100,68111,68112,68155,68156,68207,68208,68527,68528,68635,68636,68637,68638,68646,68647,68652,68653,68665,68666,68680,68681,68724,68725,68738,68739,68784,68785,68796,68797,68904,68905,69221,69222,69320,69321,69358,69359,69388,69389,69408,69409,69417,69418,69602,69603,69745,69746,69756,69757,69774,69775,69784,69785,69919,69920,69926,69927,69956,69957,69987,69988,70177,70178,70184,70185,70191,70192,70197,70198,70202,70203,70216,70217,70225,70226,70230,70231,70261,70262,70279,70280,70310,70311,70365,70366,70383,70384,70414,70415,70434,70435,70443,70444,70451,70452,70475,70476,70525,70526,70537,70538,70542,70543,70547,70548,71353,71354,71358,71359,71363,71364,71380,71381,71385,71386,71392,71393,71397,71398,71403,71404,71409,71410,71414,71415,71420,71421,71426,71427,71431,71432,71436,71437,71442,71443,71448,71449,71454,71455,71460,71461,71465,71466,71471,71472,71477,71478,71482,71483,71488,71489,71494,71495,71499,71500,71505,71506,71511,71512,71516,71517,71522,71523,71528,71529,71533,71534,71539,71540,71545,71546,71550,71551,71556,71557,71562,71563,71567,71568,71573,71574,71579,71580,71584,71585,71590,71591,71596,71597,71601,71602,71607,71608,71613,71614,71618,71619,71624,71625,71630,71631,71635,71636,71641,71642,71647,71648,71655,71656,71663,71664,71677,71678,71683,71684,71706,71707,71736,71737,71779,71780,71816,71817,71823,71824,71882,71883,71887,71888,71906,71907,71911,71912,72085,72086,72255,72256,72262,72263,72277,72278,72287,72288,72297,72298,72307,72308,72317,72318,72327,72328,72337,72338,72347,72348,72357,72358,72367,72368,72382,72383,72392,72393,72402,72403,72417,72418,72427,72428,72437,72438,72447,72448,72457,72458,72467,72468,72477,72478,72487,72488,72497,72498,72507,72508,72522,72523,72532,72533,72542,72543,72552,72553,72562,72563,72577,72578,72587,72588,72597,72598,72607,72608,72622,72623,72632,72633,72642,72643,72652,72653,72667,72668,72677,72678,72687,72688,72697,72698,72707,72708,72722,72723,72732,72733,72742,72743,72752,72753,72762,72763,72772,72773,72781,72782,72796,72797,72806,72807,72816,72817,72826,72827,72836,72837,72846,72847,72856,72857,72866,72867,72876,72877,72891,72892,72901,72902,72911,72912,72921,72922,72931,72932,72941,72942,72951,72952,72961,72962,72971,72972,72981,72982,72991,72992,73006,73007,73016,73017,73026,73027,73036,73037,73046,73047,73056,73057,73071,73072,73081,73082,73091,73092,73101,73102,73111,73112,73121,73122,73131,73132,73141,73142,73156,73157,73166,73167,73176,73177,73186,73187,73201,73202,73216,73217,73226,73227,73236,73237,73246,73247,73256,73257,73266,73267,73276,73277,73291,73292,73301,73302,73311,73312,73321,73322,73336,73337,73346,73347,73356,73357,73366,73367,73381,73382,73391,73392,73401,73402,73411,73412,73426,73427,73436,73437,73446,73447,73456,73457,73466,73467,73476,73477,73491,73492,73501,73502,73511,73512,73521,73522,73531,73532,73546,73547,73556,73557,73566,73567,73576,73577,73586,73587,73596,73597,73611,73612,73621,73622,73631,73632,73641,73642,73651,73652,73661,73662,73676,73677,73686,73687,73696,73697,73706,73707,73716,73717,73726,73727,73736,73737,73746,73747,73756,73757,73766,73767,73781,73782,73791,73792,73801,73802,73811,73812,73821,73822,73831,73832,73841,73842,73851,73852,73861,73862,73871,73872,73886,73887,73896,73897,73906,73907,73916,73917,73926,73927,73936,73937,73946,73947,73956,73957,73966,73967,73976,73977,73991,73992,74001,74002,74011,74012,74021,74022,74031,74032,74041,74042,74051,74052,74061,74062,74071,74072,74086,74087,74096,74097,74106,74107,74116,74117,74126,74127,74136,74137,74146,74147,74156,74157,74166,74167,74176,74177,74186,74187,74196,74197,74206,74207,74221,74222,74231,74232,74241,74242,74251,74252,74261,74262,74271,74272,74281,74282,74291,74292,74301,74302,74316,74317,74326,74327,74336,74337,74346,74347,74356,74357,74366,74367,74376,74377,74391,74392,74401,74402,74411,74412,74421,74422,74431,74432,74441,74442,74451,74452,74461,74462,74471,74472,74481,74482,74491,74492,74501,74502,74516,74517,74526,74527,74536,74537,74546,74547,74556,74557,74566,74567,74576,74577,74586,74587,74596,74597,74606,74607,74621,74622,74631,74632,74641,74642,74651,74652,74666,74667,74676,74677,74686,74687,74696,74697,74706,74707,74716,74717,74726,74727,74736,74737,74746,74747,74756,74757,74771,74772,74781,74782,74791,74792,74801,74802,74811,74812,74821,74822,74831,74832,74841,74842,74856,74857,74866,74867,74876,74877,74886,74887,74896,74897,74906,74907,74921,74922,74931,74932,74941,74942,74951,74952,74961,74962,74971,74972,74981,74982,74991,74992,75001,75002,75016,75017,75026,75027,75036,75037,75046,75047,75157,75158,75221,75222,75226,75227,75233,75234,75247,75248,75254,75255,75313,75314,75335,75336,75349,75350,75382,75383,75476,75477,75491,75492,75501,75502,75546,75547,75579,75580,75590,75591,75597,75598,75603,75604,75717,75718,75737,75738,75743,75744,76420,76421,76440,76441,76453,76454,76467,76468,76531,76532,76537,76538,76544,76545,76551,76552,76559,76560,76629,76630,76638,76639,76646,76647,76666,76667,76688,76689,76958,76959,81781,81782,81811,81812,81819,81820,81934,81935,81957,81958,82008,82009,82038,82039,82063,82064,82077,82078,82083,82084,82097,82098,82102,82103,82138,82139,82145,82146,82152,82153,82161,82162,82171,82172,82180,82181,82237,82238,82256,82257,82288,82289,82294,82295,82306,82307,82362,82363,82375,82376,82544,82545,82559,82560,82635,82636,82694,82695,82716,82717,82761,82762,82776,82777,82781,82782,82787,82788,82793,82794,82799,82800,82805,82806,82811,82812,82819,82820,83122,83123,83127,83128,83155,83156,83169,83170,83174,83175,83181,83182,83191,83192,83223,83224,83229,83230,83236,83237,83244,83245,83252,83253,83257,83258,83262,83263,83269,83270,83276,83277,83283,83284,83289,83290,83295,83296,83301,83302,83307,83308,83313,83314,83318,83319,83324,83325,83330,83331,83336,83337,83342,83343,83349,83350,83355,83356,83361,83362,83366,83367,83373,83374,83380,83381,83387,83388,83397,83398,83407,83408,83415,83416,83421,83422,83435,83436,83445,83446,83451,83452,83459,83460,83465,83466,83471,83472,83477,83478,83484,83485,83489,83490,83495,83496,83501,83502,83506,83507,83512,83513,83518,83519,83523,83524,83528,83529,83534,83535,83539,83540,83547,83548,83554,83555,83559,83560,83565,83566,83708,83709,83721,83722,83750,83751,83772,83773,83811,83812,83953,83954,83987,83988,83994,83995,84130,84131,84149,84150,84186,84187,84196,84197,84218,84219,84468,84469,84510,84511,84523,84524,84531,84532,84538,84539,84544,84545,84553,84554,84560,84561,84592,84593,84610,84611,84625,84626,84634,84635,84641,84642,84648,84649,84667,84668,84699,84700,84724,84725,84773,84774,84785,84786,84792,84793,84807,84808,84810,84811,84818,84819,84828,84829,84835,84836,84861,84862,84881,84882,84899,84900,84929,84930,84934,84935,84939,84940,84944,84945,84958,84959,84961,84962,87427,87428,87430,87431,87435,87436,87441,87442,87448,87449,87504,87505,87507,87508,87919,87920,89139,89140,89147,89148,89326,89327,89331,89332,89339,89340,89383,89384,89405,89406,89410,89411,89415,89416,89425,89426,89431,89432,89437,89438,89446,89447,89481,89482,89486,89487,89497,89498,89505,89506,89510,89511,89516,89517,89697,89698,89734,89735,89742,89743,89761,89762,89788,89789,89817,89818,89825,89826,89831,89832,89843,89844,89864,89865,89871,89872,89900,89901,89940,89941,89948,89949,89960,89961,90026,90027,90045,90046,90079,90080,90084,90085,90093,90094,90099,90100,90109,90110,90115,90116,90145,90146,90285,90286,90296,90297,90301,90302,90307,90308,90327,90328,90329,90330,90341,90342,90350,90351,90362,90363,90370,90371,90377,90378,90384,90385,90396,90397,90403,90404,90411,90412,90419,90420,90426,90427,90431,90432,90438,90439,90443,90444,90451,90452,90458,90459,90470,90471,90475,90476,90484,90485,90492,90493,90499,90500,90506,90507,90514,90515,90522,90523,90528,90529,90535,90536,90542,90543,90544,90545,90582,90583,90620,90621,90660,90661,90663,90664,90665,90666,90667,90668,90680,90681,90682,90683,90684,90685,90706,90707,90718,90719,90720,90721,90722,90723,90847,90848,90849,90850,90856,90857,90858,90859,90860,90861,90862,90863,90864,90865,90866,90867,90875,90876,90881,90882,90888,90889,90895,90896,90908,90909,90915,90916,90936,90937,90948,90949,90950,90951,91001,91002,91008,91009,91014,91015,91069,91070,91075,91076,91081,91082,91088,91089,91094,91095,91269,91270,91277,91278,91283,91284,91289,91290,91296,91297,91306,91307,91361,91362,91374,91375,91404,91405,91410,91411,91417,91418,91423,91424,91431,91432,91437,91438,91443,91444,91449,91450,91526,91527,91545,91546,91621,91622,91627,91628,91634,91635,91840,98304,98306,98385,98386,106921,106922,107121,107122,127835,127836,127837,127838,131072,131073,163840,163842,163921,163922,168362,168369,168370,168374,168375,168381,168382,168384,168409,168414,168434,168453,168454,168458,168459,168462,168463,168467,168468,168479,168480,168486,168487,168500,168501,168511,168512,168514,168515,168522,168523,168526,168527,168531,168532,168536,168537,168540,168541,168544,168545,168549,168550,168554,168555,168558,168559,168563,168564,168567,168568,168572,168573,168577,168578,168590,168591,168595,168596,169626,169627,169632,169633,169641,169642,169647,169648,169650,169651,169652,169653,169660,169661,169679,169680,169685,169686,169690,169691,169696,169697,169708,169709,169715,169716,169721,169722,169732,169733,169738,169739,169740,169741,169742,169743,169744,169745,169749,169750,169752,169753,169759,169760,169763,169764,169771,169772,169775,169776,169805,169806,169819,169820,169844,169845,169881,169882,169908,169909,169953,169954,169978,169979,169990,169991,170019,170020,170046,170047,170059,170060,170061,170062,170065,170066,170068,170069,170071,170072,170075,170076,170079,170080,170087,170088,170090,170091,170095,170096,170105,170106,170110,170111,170116,170117,170121,170122,170127,170128,170131,170132,170136,170137,170141,170142,170149,170150,170155,170156,170159,170160,170165,170166,170170,170171,170174,170175,170180,170181,170185,170186,170190,170191,170194,170195,170201,170202,170205,170206,170211,170212,170218,170219,170222,170223,170233,170234,170236,170237,170242,170243,170247,170248,170263,170264,170267,170268,170272,170273,170278,170279,170284,170285,170290,170291,170296,170297,170301,170302,170304,170305,170311,170312,170318,170319,170325,170326,170330,170331,170338,170339,170345,170346,170349,170350,170356,170357,170363,170364,170371,170372,170375,170376,170386,170387,170390,170391,170402,170403,170406,170407,170411,170412,170417,170418,170423,170424,170430,170431,170439,170440,170445,170446,170453,170454,170458,170459,170461,170462,170466,170467,170472,170473,170478,170479,170486,170487,170494,170495,170498,170499,170507,170508,170509,170510,170517,170518,170525,170526,170532,170533,170589,170590,170612,170613,170620,170621,170630,170631,170638,170639,170647,170648,170660,170661,170672,170673,170683,170684,170696,170697,170705,170706,170714,170715,170725,170726,170736,170737,170745,170746,170754,170755,170759,170760,170767,170768,170778,170779,170789,170790,170800,170801,170852,170853,170861,170862,170870,170871,170886,170887,170891,170892,170905,170906,170914,170915,170958,170959,170972,170973,170989,170990,170999,171000,171008,171009,171037,171038,171050,171051,171061,171062,171075,171076,171086,171087,171098,171099,171113,171114,171125,171126,171143,171144,171150,171151,171155,171156,171197,171198,171208,171209,171218,171219,171230,171231,171241,171242,171249,171250,171259,171260,171271,171272,171283,171284,171288,171289,171298,171299,171308,171309,171319,171320,171327,171328,171336,171337,171351,171352,171380,171381,171391,171392,171414,171415,171473,171474,171488,171489,171494,171495,171539,171540,171553,171554,171569,171570,171585,171586,171592,171593,171606,171607,171618,171619,171631,171632,171640,171641,171652,171653,171663,171664,171691,171692,171770,171771,171782,171783,171793,171794,171805,171806,171814,171815,171837,171838,171845,171846,171856,171857,171866,171867,171885,171886,171929,171930,171939,171940,171952,171953,171960,171961,171997,171998,172044,172045,172053,172054,172059,172060,172068,172069,172089,172090,172096,172097,172098,172099,172101,172102,172104,172105,172107,172108,172111,172112,172114,172115,172117,172118,172120,172121,172124,172125,172129,172130,172132,172133,172136,172137,172139,172140,172142,172143,172145,172146,172149,172150,172152,172153,172156,172157,172158,172159,172160,172161,172223,172224,172225,172226,172227,172228,172238,172239,172240,172241,172282,172283,172284,172285,172286,172287,172506,172507,172508,172509,172542,172543,172544,172545,172546,172547,172782,172783,172784,172785,172793,172794,172795,172796,172797,172798,172811,172812,172813,172814,172846,172847,172848,172849,172850,172851,172858,172859,172860,172861,173469,173470,173471,173472,173473,173474,173558,173559,173560,173561,173627,173628,173629,173630,173631,173632,173726,173727,173728,173729,175684,175685,175686,175687,175688,175689,177214,177215,177216,177217,177364,177365,177366,177367,177368,177369,178059,178060,178061,178062,178069,178070,178071,178072,178073,178074,178075,178076,178077,178078,178090,178091,178092,178093,180681,180682,180683,180684,180685,180686,183050,183051,183052,183053,183536,183537,183538,183539,183540,183541,184436,184437,184438,184439,184596,184597,184598,184599,184600,184601,184877,184878,184879,184880,185863,185864,185865,185866,185867,185868,186454,186455,186456,186457,186463,186464,186465,186466,186467,186468,186478,186479,186480,186481,186494,186495,186496,186497,186498,186499,186533,186534,186535,186536,186542,186543,186544,186545,186546,186547,186558,186559,186560,186561,186621,186622,186623,186624,186625,186626,186632,186633,186634,186635,186869,186870,186871,186872,186873,186874,187031,187032,187033,187034,187081,187082,187083,187084,187085,187086,187219,187220,187221,187222,188901,188902,188903,188904,188905,188906,190213,190214,190215,190216,190226,190227,190228,190229,190230,190231,190282,190283,190284,190285,190321,190322,190323,190324,190325,190326,190327,190328,190329,190330,190386,190387,190388,190389,190394,190395,190396,190397,190398,190399,190422,190423,190424,190425,191839,191840,191841,191842,191843,191844,192893,192894,192895,192896,192899,192900,192901,192902,192903,192904,192917,192918,192919,192920,192926,192927,192928,192929,192930,192931,192947,192948,192949,192950,192962,192963,192964,192965,192966,192967,193047,193048,193049,193050,193051,193052,193053,193054,195452,195453,195454,195455,195498,195499,195500,195501,195502,195503,195620,195621,195622,195623,195626,195627,195628,195629,195630,195631,195642,195643,195644,195645,195706,195707,195708,195709,195710,195711,195800,195801,195802,195803,195936,195937,195938,195939,195940,195941,196187,196188,196189,196190,196201,196202,196203,196204,196205,196206,196249,196250,196251,196252,196253,196254,196255,196256,196257,196258,196259,196260,196261,196262,196263,196264,196265,196266,196267,196268,196269,196270,196271,196272,196273,196274,196275,196276,196285,196286,196287,196288,196289,196290,196299,196300,196301,196302,196359,196360,196361,196362,196363,196364,196539,196540,196541,196542,196543,196544,196545,196546,196547,196548,196572,196573,196574,196575,196576,196577,196587,196588,196589,196590,196591,196592,196593,196594,196595,196596,196597,196598,196599,196600,196601,196602,196603,196604,196605,196608,196609,229376,229378,229457,229458,252723,252755,252756,252810,252811,252846,252847,252848,252849,252850,252851,252852,252853,252854,252855,252856,252857,252858,252859,252860,252861,252862,252863,252864,252865,252866,252867,252868,252869,252870,252871,252872,252873,252874,252875,252876,252877,252878,252879,252880,252881,252882,252883,253039,253040,253148,253149,253292,253293,253394,253395,253585,253586,253745,253746,253809,253810,253958,253959,254163,254164,254258,254259,254413,254414,254476,254477,254478,254479,254480,254481,254482,254483,254484,254485,254486,254487,254488,254489,254498,254499,254500,254501,254503,254504,254505,254506,254533,254534,254535,254536,254562,254563,254564,254565,254592,254593,254594,254595,254607,254608,254609,254610,254618,254619,254620,254621,254625,254626,254627,254628,254634,254635,254636,254637,254638,254639,254640,254641,254643,254644,254645,254646,254655,254656,254657,254658,254659,254660,254661,254662,254663,254664,254665,254666,254667,254668,254669,254670,254748,254749,254750,254751,254752,254753,254754,254755,254756,254757,254758,254759,254760,254761,254762,254763,254765,254766,254767,254768,254769,254770,254771,254772,254808,254809,254810,254811,254847,254848,254849,254850,254851,254852,254853,254854,254855,254856,254857,254858,254859,254860,254862,254863,254865,254866,254867,254868,254869,254870,254871,254872,254873,254874,254875,254876,254877,254878,254879,254880,254881,254882,254883,254884,254885,254886,260307,260308,260309,260310,260311,260312,260313,260314,260315,260316,260317,260318,260322,260323,260326,260327,260331,260332,260336,260337,260341,260342,260343,260344,260345,260346,260349,260350,260351,260352,260353,260354,260355,260356,260357,260358,260359,260360,260361,260362,260363,260364,260365,260366,260367,260368,260369,260370,260371,260372,260373,260374,260375,260376,260377,260378,260379,260380,260381,260382,260383,260384,260385,260386,260387,260388,260389,260390,260391,260392,260393,260394,260395,260396,260397,260398,260399,260400,260401,260402,260403,260404,260405,260406,260407,260408,260409,260410,260411,260412,260413,260414,260415,260416,260417,260418,260419,260420,260421,260422,260423,260424,260425,260426,260430,260431,260436,260437,260438,260439,260562,260563,260564,260565,260566,260567,260568,260569,260570,260571,260572,260573,260574,260575,260577,260578,260579,260580,260582,260583,260584,260585,260587,260588,260589,260590,260592,260593,260594,260595,260597,260598,260599,260600,260602,260603,260604,260605,260607,260608,260609,260610,260611,260612,260613,260614,260615,260616,260617,260618,260624,260625,260626,260627,260628,260629,260635,260636,260637,260638,260719,260720,260721,260722,260723,260724,261110,261111,261112,261113,261115,261116,261117,261118,261119,261120,261126,261127,261128,261129,261134,261135,261136,261137,261138,261139,261156,261157,261158,261159,261189,261190,261191,261192,261193,261194,261213,261214,261215,261216,261226,261227,261228,261229,261230,261231,261254,261255,261256,261257,261258,261259,261260,261261,261263,261264,261265,261266,261270,261271,261272,261273,261275,261276,261277,261278,261280,261281,261282,261283,261285,261286,261287,261288,261290,261291,261292,261293,261295,261296,261297,261298,261300,261301,261302,261303,261306,261307,261308,261309,261311,261312,261313,261314,261317,261318,261319,261320,261322,261323,261324,261325,261335,261336,261337,261338,261339,261340,261341,261342,261343,261344,261345,261346,261347,261348,261353,261354,261355,261356,261357,261358,261365,261366,261367,261368,261390,261391,261392,261393,261394,261395,261440,261441,261442,261443,261457,261458,261459,261460,261461,261462,261478,261479,261480,261481,261482,261483,261484,261485,261498,261499,261500,261501,261503,261504,261505,261506,261508,261509,261510,261511,261513,261514,261515,261516,261518,261519,261520,261521,261523,261524,261525,261526,261528,261529,261530,261531,261533,261534,261535,261536,261538,261539,261540,261541,261543,261544,261545,261546,261553,261554,261555,261556,261558,261559,261560,261561,261562,261563,261564,261565,261566,261567,261568,261569,261570,261571,261576,261577,261578,261579,261580,261581,261588,261589,261590,261591,261595,261596,261597,261598,261599,261600,261607,261608,261609,261610,261611,261612,261613,261614,261616,261617,261618,261619,261621,261622,261623,261624,261626,261627,261628,261629,261631,261632,261633,261634,261636,261637,261638,261639,261641,261642,261643,261644,261752,261753,261754,261755,261756,261757,261758,261759,261760,261761,261762,261763,261764,261765,261766,261767,261768,261769,261770,261771,261772,261773,261774,261775,261783,261784,261785,261786,261794,261795,261796,261797,261798,261799,261806,261807,261808,261809,261816,261817,261818,261819,261820,261821,261822,261823,261824,261825,261826,261827,261836,261837,261838,261839,261840,261841,261857,261858,261859,261860,261862,261863,261864,261865,261867,261868,261869,261870,261872,261873,261874,261875,261880,261881,261882,261883,261885,261886,261887,261888,261889,261890,261891,261892,261897,261898,261899,261900,261901,261902,261912,261913,261914,261915,261940,261941,261942,261943,261944,261945,262031,262032,262033,262034,262097,262098,262099,262100,262101,262102,262103,262104,262119,262120,262121,262122,262123,262124,262125,262126,262127,262128,262129,262130,262131,262132,262137,262138,262139,262140,262141,262144,262145,294912,294914,294993,294994,295487,295488,300403,300405,300406,300407,300408,300409,300410,300411,300421,300422,300423,300424,300459,300460,300466,300467,300468,300469,300482,300483,300496,300497,300498,300499,300514,300515,301303,301304,301305,301306,301307,301308,301309,301310,305216,305217,305275,305276,305277,305278,305279,305280,305281,305282,305460,305461,305468,305469,305470,305471,305487,305488,305498,305499,305500,305501,305520,305521,305533,305534,305535,305536,305556,305557,305578,305579,305580,305581,305598,305599,305606,305607,305608,305609,305636,305637,305665,305666,305667,305668,305719,305720,305753,305754,305755,305756,305772,305773,305782,305783,305784,305785,305795,305796,305899,305900,305901,305902,305933,305934,306479,306480,306481,306482,308207,308208,308223,308224,308225,308226,308241,308242,308308,308309,308310,308311,308324,308325,308335,308336,308337,308338,308360,308361,308464,308465,308466,308467,308514,308515,308521,308522,308523,308524,308532,308533,308542,308543,308544,308545,308567,308568,308578,308579,308580,308581,308591,308592,308624,308625,308626,308627,308653,308654,313384,313385,313386,313387,313388,313389,313390,313391,314050,314051,314415,314416,314417,314418,314419,314420,314438,314439,314440,314441,314468,314469,314470,314471,314472,314473,314553,314554,314555,314556,314557,314558,314559,314560,314567,314568,314569,314570,314571,314572") == "143ec62dfb204acb40ba016a331ff36562f5c439" || block_image_verify("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat")) then
ui_print("Verified system image...");
else
check_first_block("/dev/block/bootdevice/by-name/system");
ifelse (block_image_recover("/dev/block/bootdevice/by-name/system", "3694,1,80,81,306,2816,2817,2818,2819,2820,2821,2822,2823,2832,2833,2940,2941,2942,2943,3036,3037,3045,3046,3047,3048,3049,3050,3051,3052,3069,3070,3089,3090,3091,3092,3102,3103,3157,3158,3159,3160,3172,3173,3177,3178,3179,3180,3190,3191,3205,3206,3207,3208,3244,3245,3254,3255,3256,3257,3300,3301,3327,3328,3329,3330,3382,3383,3392,3393,3394,3395,3433,3434,3446,3447,3448,3449,3450,3451,3530,3531,3532,3533,3766,3767,3768,6942,6943,6944,8086,8087,8311,8312,9151,9152,9156,9157,9158,9159,9168,9169,9177,9178,9179,9180,9208,9209,9274,9275,9276,9277,9345,9346,9354,9355,9356,9357,9386,9387,9393,9394,9395,9396,9417,9418,9422,9423,9424,9425,9433,9434,9440,9441,9442,9443,9461,9462,9467,9468,9469,9470,9482,9483,9488,9489,9490,9491,9506,9507,9513,9514,9515,9516,9529,9530,9531,9532,9533,9534,9612,9613,9614,9615,9616,9617,9629,9630,9634,9635,9636,9637,9638,9639,9698,9699,9700,9701,9702,9703,9768,9769,9770,9771,9772,9773,21723,21725,21987,21988,22999,23000,23043,23044,23074,23075,23403,23404,24372,24406,24980,24981,25086,25087,25379,25380,25592,25593,26513,26516,26517,26518,26584,26585,26586,26587,26753,26754,26898,26899,27072,27073,27244,27245,27605,27606,27623,27865,27868,27869,27878,27879,27880,27881,27898,27899,27920,27921,28030,28031,28069,28070,28073,28074,28085,28086,28552,28553,28554,28555,28577,28578,28599,28600,28839,28840,29952,29953,30249,30250,30368,30369,30846,30847,30848,30849,31374,31375,31390,31391,31422,31423,31484,31485,31491,31492,32768,32770,32849,32850,48416,48419,48424,48425,48442,48443,48472,48473,65531,65532,65533,65534,65536,65537,67723,67724,67725,67798,67799,67872,67873,67916,67917,67918,67919,67922,67923,67924,67925,67926,67927,67928,67929,67930,67931,67933,67934,67940,67941,67946,67947,68022,68023,68026,68027,68032,68033,68034,68035,68036,68037,68038,68039,68040,68041,68042,68043,68049,68050,68051,68052,68073,68074,68097,68098,68099,68100,68111,68112,68155,68156,68207,68208,68527,68528,68635,68636,68637,68638,68646,68647,68652,68653,68665,68666,68680,68681,68724,68725,68738,68739,68784,68785,68796,68797,68904,68905,69221,69222,69320,69321,69358,69359,69388,69389,69408,69409,69417,69418,69602,69603,69745,69746,69756,69757,69774,69775,69784,69785,69919,69920,69926,69927,69956,69957,69987,69988,70177,70178,70184,70185,70191,70192,70197,70198,70202,70203,70216,70217,70225,70226,70230,70231,70261,70262,70279,70280,70310,70311,70365,70366,70383,70384,70414,70415,70434,70435,70443,70444,70451,70452,70475,70476,70525,70526,70537,70538,70542,70543,70547,70548,71353,71354,71358,71359,71363,71364,71380,71381,71385,71386,71392,71393,71397,71398,71403,71404,71409,71410,71414,71415,71420,71421,71426,71427,71431,71432,71436,71437,71442,71443,71448,71449,71454,71455,71460,71461,71465,71466,71471,71472,71477,71478,71482,71483,71488,71489,71494,71495,71499,71500,71505,71506,71511,71512,71516,71517,71522,71523,71528,71529,71533,71534,71539,71540,71545,71546,71550,71551,71556,71557,71562,71563,71567,71568,71573,71574,71579,71580,71584,71585,71590,71591,71596,71597,71601,71602,71607,71608,71613,71614,71618,71619,71624,71625,71630,71631,71635,71636,71641,71642,71647,71648,71655,71656,71663,71664,71677,71678,71683,71684,71706,71707,71736,71737,71779,71780,71816,71817,71823,71824,71882,71883,71887,71888,71906,71907,71911,71912,72085,72086,72255,72256,72262,72263,72277,72278,72287,72288,72297,72298,72307,72308,72317,72318,72327,72328,72337,72338,72347,72348,72357,72358,72367,72368,72382,72383,72392,72393,72402,72403,72417,72418,72427,72428,72437,72438,72447,72448,72457,72458,72467,72468,72477,72478,72487,72488,72497,72498,72507,72508,72522,72523,72532,72533,72542,72543,72552,72553,72562,72563,72577,72578,72587,72588,72597,72598,72607,72608,72622,72623,72632,72633,72642,72643,72652,72653,72667,72668,72677,72678,72687,72688,72697,72698,72707,72708,72722,72723,72732,72733,72742,72743,72752,72753,72762,72763,72772,72773,72781,72782,72796,72797,72806,72807,72816,72817,72826,72827,72836,72837,72846,72847,72856,72857,72866,72867,72876,72877,72891,72892,72901,72902,72911,72912,72921,72922,72931,72932,72941,72942,72951,72952,72961,72962,72971,72972,72981,72982,72991,72992,73006,73007,73016,73017,73026,73027,73036,73037,73046,73047,73056,73057,73071,73072,73081,73082,73091,73092,73101,73102,73111,73112,73121,73122,73131,73132,73141,73142,73156,73157,73166,73167,73176,73177,73186,73187,73201,73202,73216,73217,73226,73227,73236,73237,73246,73247,73256,73257,73266,73267,73276,73277,73291,73292,73301,73302,73311,73312,73321,73322,73336,73337,73346,73347,73356,73357,73366,73367,73381,73382,73391,73392,73401,73402,73411,73412,73426,73427,73436,73437,73446,73447,73456,73457,73466,73467,73476,73477,73491,73492,73501,73502,73511,73512,73521,73522,73531,73532,73546,73547,73556,73557,73566,73567,73576,73577,73586,73587,73596,73597,73611,73612,73621,73622,73631,73632,73641,73642,73651,73652,73661,73662,73676,73677,73686,73687,73696,73697,73706,73707,73716,73717,73726,73727,73736,73737,73746,73747,73756,73757,73766,73767,73781,73782,73791,73792,73801,73802,73811,73812,73821,73822,73831,73832,73841,73842,73851,73852,73861,73862,73871,73872,73886,73887,73896,73897,73906,73907,73916,73917,73926,73927,73936,73937,73946,73947,73956,73957,73966,73967,73976,73977,73991,73992,74001,74002,74011,74012,74021,74022,74031,74032,74041,74042,74051,74052,74061,74062,74071,74072,74086,74087,74096,74097,74106,74107,74116,74117,74126,74127,74136,74137,74146,74147,74156,74157,74166,74167,74176,74177,74186,74187,74196,74197,74206,74207,74221,74222,74231,74232,74241,74242,74251,74252,74261,74262,74271,74272,74281,74282,74291,74292,74301,74302,74316,74317,74326,74327,74336,74337,74346,74347,74356,74357,74366,74367,74376,74377,74391,74392,74401,74402,74411,74412,74421,74422,74431,74432,74441,74442,74451,74452,74461,74462,74471,74472,74481,74482,74491,74492,74501,74502,74516,74517,74526,74527,74536,74537,74546,74547,74556,74557,74566,74567,74576,74577,74586,74587,74596,74597,74606,74607,74621,74622,74631,74632,74641,74642,74651,74652,74666,74667,74676,74677,74686,74687,74696,74697,74706,74707,74716,74717,74726,74727,74736,74737,74746,74747,74756,74757,74771,74772,74781,74782,74791,74792,74801,74802,74811,74812,74821,74822,74831,74832,74841,74842,74856,74857,74866,74867,74876,74877,74886,74887,74896,74897,74906,74907,74921,74922,74931,74932,74941,74942,74951,74952,74961,74962,74971,74972,74981,74982,74991,74992,75001,75002,75016,75017,75026,75027,75036,75037,75046,75047,75157,75158,75221,75222,75226,75227,75233,75234,75247,75248,75254,75255,75313,75314,75335,75336,75349,75350,75382,75383,75476,75477,75491,75492,75501,75502,75546,75547,75579,75580,75590,75591,75597,75598,75603,75604,75717,75718,75737,75738,75743,75744,76420,76421,76440,76441,76453,76454,76467,76468,76531,76532,76537,76538,76544,76545,76551,76552,76559,76560,76629,76630,76638,76639,76646,76647,76666,76667,76688,76689,76958,76959,81781,81782,81811,81812,81819,81820,81934,81935,81957,81958,82008,82009,82038,82039,82063,82064,82077,82078,82083,82084,82097,82098,82102,82103,82138,82139,82145,82146,82152,82153,82161,82162,82171,82172,82180,82181,82237,82238,82256,82257,82288,82289,82294,82295,82306,82307,82362,82363,82375,82376,82544,82545,82559,82560,82635,82636,82694,82695,82716,82717,82761,82762,82776,82777,82781,82782,82787,82788,82793,82794,82799,82800,82805,82806,82811,82812,82819,82820,83122,83123,83127,83128,83155,83156,83169,83170,83174,83175,83181,83182,83191,83192,83223,83224,83229,83230,83236,83237,83244,83245,83252,83253,83257,83258,83262,83263,83269,83270,83276,83277,83283,83284,83289,83290,83295,83296,83301,83302,83307,83308,83313,83314,83318,83319,83324,83325,83330,83331,83336,83337,83342,83343,83349,83350,83355,83356,83361,83362,83366,83367,83373,83374,83380,83381,83387,83388,83397,83398,83407,83408,83415,83416,83421,83422,83435,83436,83445,83446,83451,83452,83459,83460,83465,83466,83471,83472,83477,83478,83484,83485,83489,83490,83495,83496,83501,83502,83506,83507,83512,83513,83518,83519,83523,83524,83528,83529,83534,83535,83539,83540,83547,83548,83554,83555,83559,83560,83565,83566,83708,83709,83721,83722,83750,83751,83772,83773,83811,83812,83953,83954,83987,83988,83994,83995,84130,84131,84149,84150,84186,84187,84196,84197,84218,84219,84468,84469,84510,84511,84523,84524,84531,84532,84538,84539,84544,84545,84553,84554,84560,84561,84592,84593,84610,84611,84625,84626,84634,84635,84641,84642,84648,84649,84667,84668,84699,84700,84724,84725,84773,84774,84785,84786,84792,84793,84807,84808,84810,84811,84818,84819,84828,84829,84835,84836,84861,84862,84881,84882,84899,84900,84929,84930,84934,84935,84939,84940,84944,84945,84958,84959,84961,84962,87427,87428,87430,87431,87435,87436,87441,87442,87448,87449,87504,87505,87507,87508,87919,87920,89139,89140,89147,89148,89326,89327,89331,89332,89339,89340,89383,89384,89405,89406,89410,89411,89415,89416,89425,89426,89431,89432,89437,89438,89446,89447,89481,89482,89486,89487,89497,89498,89505,89506,89510,89511,89516,89517,89697,89698,89734,89735,89742,89743,89761,89762,89788,89789,89817,89818,89825,89826,89831,89832,89843,89844,89864,89865,89871,89872,89900,89901,89940,89941,89948,89949,89960,89961,90026,90027,90045,90046,90079,90080,90084,90085,90093,90094,90099,90100,90109,90110,90115,90116,90145,90146,90285,90286,90296,90297,90301,90302,90307,90308,90327,90328,90329,90330,90341,90342,90350,90351,90362,90363,90370,90371,90377,90378,90384,90385,90396,90397,90403,90404,90411,90412,90419,90420,90426,90427,90431,90432,90438,90439,90443,90444,90451,90452,90458,90459,90470,90471,90475,90476,90484,90485,90492,90493,90499,90500,90506,90507,90514,90515,90522,90523,90528,90529,90535,90536,90542,90543,90544,90545,90582,90583,90620,90621,90660,90661,90663,90664,90665,90666,90667,90668,90680,90681,90682,90683,90684,90685,90706,90707,90718,90719,90720,90721,90722,90723,90847,90848,90849,90850,90856,90857,90858,90859,90860,90861,90862,90863,90864,90865,90866,90867,90875,90876,90881,90882,90888,90889,90895,90896,90908,90909,90915,90916,90936,90937,90948,90949,90950,90951,91001,91002,91008,91009,91014,91015,91069,91070,91075,91076,91081,91082,91088,91089,91094,91095,91269,91270,91277,91278,91283,91284,91289,91290,91296,91297,91306,91307,91361,91362,91374,91375,91404,91405,91410,91411,91417,91418,91423,91424,91431,91432,91437,91438,91443,91444,91449,91450,91526,91527,91545,91546,91621,91622,91627,91628,91634,91635,91840,98304,98306,98385,98386,106921,106922,107121,107122,127835,127836,127837,127838,131072,131073,163840,163842,163921,163922,168362,168369,168370,168374,168375,168381,168382,168384,168409,168414,168434,168453,168454,168458,168459,168462,168463,168467,168468,168479,168480,168486,168487,168500,168501,168511,168512,168514,168515,168522,168523,168526,168527,168531,168532,168536,168537,168540,168541,168544,168545,168549,168550,168554,168555,168558,168559,168563,168564,168567,168568,168572,168573,168577,168578,168590,168591,168595,168596,169626,169627,169632,169633,169641,169642,169647,169648,169650,169651,169652,169653,169660,169661,169679,169680,169685,169686,169690,169691,169696,169697,169708,169709,169715,169716,169721,169722,169732,169733,169738,169739,169740,169741,169742,169743,169744,169745,169749,169750,169752,169753,169759,169760,169763,169764,169771,169772,169775,169776,169805,169806,169819,169820,169844,169845,169881,169882,169908,169909,169953,169954,169978,169979,169990,169991,170019,170020,170046,170047,170059,170060,170061,170062,170065,170066,170068,170069,170071,170072,170075,170076,170079,170080,170087,170088,170090,170091,170095,170096,170105,170106,170110,170111,170116,170117,170121,170122,170127,170128,170131,170132,170136,170137,170141,170142,170149,170150,170155,170156,170159,170160,170165,170166,170170,170171,170174,170175,170180,170181,170185,170186,170190,170191,170194,170195,170201,170202,170205,170206,170211,170212,170218,170219,170222,170223,170233,170234,170236,170237,170242,170243,170247,170248,170263,170264,170267,170268,170272,170273,170278,170279,170284,170285,170290,170291,170296,170297,170301,170302,170304,170305,170311,170312,170318,170319,170325,170326,170330,170331,170338,170339,170345,170346,170349,170350,170356,170357,170363,170364,170371,170372,170375,170376,170386,170387,170390,170391,170402,170403,170406,170407,170411,170412,170417,170418,170423,170424,170430,170431,170439,170440,170445,170446,170453,170454,170458,170459,170461,170462,170466,170467,170472,170473,170478,170479,170486,170487,170494,170495,170498,170499,170507,170508,170509,170510,170517,170518,170525,170526,170532,170533,170589,170590,170612,170613,170620,170621,170630,170631,170638,170639,170647,170648,170660,170661,170672,170673,170683,170684,170696,170697,170705,170706,170714,170715,170725,170726,170736,170737,170745,170746,170754,170755,170759,170760,170767,170768,170778,170779,170789,170790,170800,170801,170852,170853,170861,170862,170870,170871,170886,170887,170891,170892,170905,170906,170914,170915,170958,170959,170972,170973,170989,170990,170999,171000,171008,171009,171037,171038,171050,171051,171061,171062,171075,171076,171086,171087,171098,171099,171113,171114,171125,171126,171143,171144,171150,171151,171155,171156,171197,171198,171208,171209,171218,171219,171230,171231,171241,171242,171249,171250,171259,171260,171271,171272,171283,171284,171288,171289,171298,171299,171308,171309,171319,171320,171327,171328,171336,171337,171351,171352,171380,171381,171391,171392,171414,171415,171473,171474,171488,171489,171494,171495,171539,171540,171553,171554,171569,171570,171585,171586,171592,171593,171606,171607,171618,171619,171631,171632,171640,171641,171652,171653,171663,171664,171691,171692,171770,171771,171782,171783,171793,171794,171805,171806,171814,171815,171837,171838,171845,171846,171856,171857,171866,171867,171885,171886,171929,171930,171939,171940,171952,171953,171960,171961,171997,171998,172044,172045,172053,172054,172059,172060,172068,172069,172089,172090,172096,172097,172098,172099,172101,172102,172104,172105,172107,172108,172111,172112,172114,172115,172117,172118,172120,172121,172124,172125,172129,172130,172132,172133,172136,172137,172139,172140,172142,172143,172145,172146,172149,172150,172152,172153,172156,172157,172158,172159,172160,172161,172223,172224,172225,172226,172227,172228,172238,172239,172240,172241,172282,172283,172284,172285,172286,172287,172506,172507,172508,172509,172542,172543,172544,172545,172546,172547,172782,172783,172784,172785,172793,172794,172795,172796,172797,172798,172811,172812,172813,172814,172846,172847,172848,172849,172850,172851,172858,172859,172860,172861,173469,173470,173471,173472,173473,173474,173558,173559,173560,173561,173627,173628,173629,173630,173631,173632,173726,173727,173728,173729,175684,175685,175686,175687,175688,175689,177214,177215,177216,177217,177364,177365,177366,177367,177368,177369,178059,178060,178061,178062,178069,178070,178071,178072,178073,178074,178075,178076,178077,178078,178090,178091,178092,178093,180681,180682,180683,180684,180685,180686,183050,183051,183052,183053,183536,183537,183538,183539,183540,183541,184436,184437,184438,184439,184596,184597,184598,184599,184600,184601,184877,184878,184879,184880,185863,185864,185865,185866,185867,185868,186454,186455,186456,186457,186463,186464,186465,186466,186467,186468,186478,186479,186480,186481,186494,186495,186496,186497,186498,186499,186533,186534,186535,186536,186542,186543,186544,186545,186546,186547,186558,186559,186560,186561,186621,186622,186623,186624,186625,186626,186632,186633,186634,186635,186869,186870,186871,186872,186873,186874,187031,187032,187033,187034,187081,187082,187083,187084,187085,187086,187219,187220,187221,187222,188901,188902,188903,188904,188905,188906,190213,190214,190215,190216,190226,190227,190228,190229,190230,190231,190282,190283,190284,190285,190321,190322,190323,190324,190325,190326,190327,190328,190329,190330,190386,190387,190388,190389,190394,190395,190396,190397,190398,190399,190422,190423,190424,190425,191839,191840,191841,191842,191843,191844,192893,192894,192895,192896,192899,192900,192901,192902,192903,192904,192917,192918,192919,192920,192926,192927,192928,192929,192930,192931,192947,192948,192949,192950,192962,192963,192964,192965,192966,192967,193047,193048,193049,193050,193051,193052,193053,193054,195452,195453,195454,195455,195498,195499,195500,195501,195502,195503,195620,195621,195622,195623,195626,195627,195628,195629,195630,195631,195642,195643,195644,195645,195706,195707,195708,195709,195710,195711,195800,195801,195802,195803,195936,195937,195938,195939,195940,195941,196187,196188,196189,196190,196201,196202,196203,196204,196205,196206,196249,196250,196251,196252,196253,196254,196255,196256,196257,196258,196259,196260,196261,196262,196263,196264,196265,196266,196267,196268,196269,196270,196271,196272,196273,196274,196275,196276,196285,196286,196287,196288,196289,196290,196299,196300,196301,196302,196359,196360,196361,196362,196363,196364,196539,196540,196541,196542,196543,196544,196545,196546,196547,196548,196572,196573,196574,196575,196576,196577,196587,196588,196589,196590,196591,196592,196593,196594,196595,196596,196597,196598,196599,196600,196601,196602,196603,196604,196605,196608,196609,229376,229378,229457,229458,252723,252755,252756,252810,252811,252846,252847,252848,252849,252850,252851,252852,252853,252854,252855,252856,252857,252858,252859,252860,252861,252862,252863,252864,252865,252866,252867,252868,252869,252870,252871,252872,252873,252874,252875,252876,252877,252878,252879,252880,252881,252882,252883,253039,253040,253148,253149,253292,253293,253394,253395,253585,253586,253745,253746,253809,253810,253958,253959,254163,254164,254258,254259,254413,254414,254476,254477,254478,254479,254480,254481,254482,254483,254484,254485,254486,254487,254488,254489,254498,254499,254500,254501,254503,254504,254505,254506,254533,254534,254535,254536,254562,254563,254564,254565,254592,254593,254594,254595,254607,254608,254609,254610,254618,254619,254620,254621,254625,254626,254627,254628,254634,254635,254636,254637,254638,254639,254640,254641,254643,254644,254645,254646,254655,254656,254657,254658,254659,254660,254661,254662,254663,254664,254665,254666,254667,254668,254669,254670,254748,254749,254750,254751,254752,254753,254754,254755,254756,254757,254758,254759,254760,254761,254762,254763,254765,254766,254767,254768,254769,254770,254771,254772,254808,254809,254810,254811,254847,254848,254849,254850,254851,254852,254853,254854,254855,254856,254857,254858,254859,254860,254862,254863,254865,254866,254867,254868,254869,254870,254871,254872,254873,254874,254875,254876,254877,254878,254879,254880,254881,254882,254883,254884,254885,254886,260307,260308,260309,260310,260311,260312,260313,260314,260315,260316,260317,260318,260322,260323,260326,260327,260331,260332,260336,260337,260341,260342,260343,260344,260345,260346,260349,260350,260351,260352,260353,260354,260355,260356,260357,260358,260359,260360,260361,260362,260363,260364,260365,260366,260367,260368,260369,260370,260371,260372,260373,260374,260375,260376,260377,260378,260379,260380,260381,260382,260383,260384,260385,260386,260387,260388,260389,260390,260391,260392,260393,260394,260395,260396,260397,260398,260399,260400,260401,260402,260403,260404,260405,260406,260407,260408,260409,260410,260411,260412,260413,260414,260415,260416,260417,260418,260419,260420,260421,260422,260423,260424,260425,260426,260430,260431,260436,260437,260438,260439,260562,260563,260564,260565,260566,260567,260568,260569,260570,260571,260572,260573,260574,260575,260577,260578,260579,260580,260582,260583,260584,260585,260587,260588,260589,260590,260592,260593,260594,260595,260597,260598,260599,260600,260602,260603,260604,260605,260607,260608,260609,260610,260611,260612,260613,260614,260615,260616,260617,260618,260624,260625,260626,260627,260628,260629,260635,260636,260637,260638,260719,260720,260721,260722,260723,260724,261110,261111,261112,261113,261115,261116,261117,261118,261119,261120,261126,261127,261128,261129,261134,261135,261136,261137,261138,261139,261156,261157,261158,261159,261189,261190,261191,261192,261193,261194,261213,261214,261215,261216,261226,261227,261228,261229,261230,261231,261254,261255,261256,261257,261258,261259,261260,261261,261263,261264,261265,261266,261270,261271,261272,261273,261275,261276,261277,261278,261280,261281,261282,261283,261285,261286,261287,261288,261290,261291,261292,261293,261295,261296,261297,261298,261300,261301,261302,261303,261306,261307,261308,261309,261311,261312,261313,261314,261317,261318,261319,261320,261322,261323,261324,261325,261335,261336,261337,261338,261339,261340,261341,261342,261343,261344,261345,261346,261347,261348,261353,261354,261355,261356,261357,261358,261365,261366,261367,261368,261390,261391,261392,261393,261394,261395,261440,261441,261442,261443,261457,261458,261459,261460,261461,261462,261478,261479,261480,261481,261482,261483,261484,261485,261498,261499,261500,261501,261503,261504,261505,261506,261508,261509,261510,261511,261513,261514,261515,261516,261518,261519,261520,261521,261523,261524,261525,261526,261528,261529,261530,261531,261533,261534,261535,261536,261538,261539,261540,261541,261543,261544,261545,261546,261553,261554,261555,261556,261558,261559,261560,261561,261562,261563,261564,261565,261566,261567,261568,261569,261570,261571,261576,261577,261578,261579,261580,261581,261588,261589,261590,261591,261595,261596,261597,261598,261599,261600,261607,261608,261609,261610,261611,261612,261613,261614,261616,261617,261618,261619,261621,261622,261623,261624,261626,261627,261628,261629,261631,261632,261633,261634,261636,261637,261638,261639,261641,261642,261643,261644,261752,261753,261754,261755,261756,261757,261758,261759,261760,261761,261762,261763,261764,261765,261766,261767,261768,261769,261770,261771,261772,261773,261774,261775,261783,261784,261785,261786,261794,261795,261796,261797,261798,261799,261806,261807,261808,261809,261816,261817,261818,261819,261820,261821,261822,261823,261824,261825,261826,261827,261836,261837,261838,261839,261840,261841,261857,261858,261859,261860,261862,261863,261864,261865,261867,261868,261869,261870,261872,261873,261874,261875,261880,261881,261882,261883,261885,261886,261887,261888,261889,261890,261891,261892,261897,261898,261899,261900,261901,261902,261912,261913,261914,261915,261940,261941,261942,261943,261944,261945,262031,262032,262033,262034,262097,262098,262099,262100,262101,262102,262103,262104,262119,262120,262121,262122,262123,262124,262125,262126,262127,262128,262129,262130,262131,262132,262137,262138,262139,262140,262141,262144,262145,294912,294914,294993,294994,295487,295488,300403,300405,300406,300407,300408,300409,300410,300411,300421,300422,300423,300424,300459,300460,300466,300467,300468,300469,300482,300483,300496,300497,300498,300499,300514,300515,301303,301304,301305,301306,301307,301308,301309,301310,305216,305217,305275,305276,305277,305278,305279,305280,305281,305282,305460,305461,305468,305469,305470,305471,305487,305488,305498,305499,305500,305501,305520,305521,305533,305534,305535,305536,305556,305557,305578,305579,305580,305581,305598,305599,305606,305607,305608,305609,305636,305637,305665,305666,305667,305668,305719,305720,305753,305754,305755,305756,305772,305773,305782,305783,305784,305785,305795,305796,305899,305900,305901,305902,305933,305934,306479,306480,306481,306482,308207,308208,308223,308224,308225,308226,308241,308242,308308,308309,308310,308311,308324,308325,308335,308336,308337,308338,308360,308361,308464,308465,308466,308467,308514,308515,308521,308522,308523,308524,308532,308533,308542,308543,308544,308545,308567,308568,308578,308579,308580,308581,308591,308592,308624,308625,308626,308627,308653,308654,313384,313385,313386,313387,313388,313389,313390,313391,314050,314051,314415,314416,314417,314418,314419,314420,314438,314439,314440,314441,314468,314469,314470,314471,314472,314473,314553,314554,314555,314556,314557,314558,314559,314560,314567,314568,314569,314570,314571,314572") && block_image_verify("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat"), ui_print("system recovered successfully."), abort("E1004: system partition fails to recover"));
endif;

# ---- start making changes here ----

ui_print("Patching system image after verification.");
show_progress(0.900000, 0);
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
  abort("E1001: Failed to update system image.");
ui_print("Patching boot image...");
show_progress(0.100000, 10);
apply_patch("EMMC:/dev/block/bootdevice/by-name/boot:16276776:d51109ab17b4aee63642506175ccbc6ff6ef8069:16276776:069b77af2ca1eb3e402f4e5b66fdd01da2349996",
            "-", 069b77af2ca1eb3e402f4e5b66fdd01da2349996, 16276776,
            d51109ab17b4aee63642506175ccbc6ff6ef8069,
            package_extract_file("patch/boot.img.p")) ||
    abort("E3008: Failed to apply patch to EMMC:/dev/block/bootdevice/by-name/boot:16276776:d51109ab17b4aee63642506175ccbc6ff6ef8069:16276776:069b77af2ca1eb3e402f4e5b66fdd01da2349996");

# ---- radio update tasks ----

ui_print("Patching firmware images...");
set_progress(1.000000);
