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/135/brian03110705:userdebug/test-keys");
ui_print("Target: qcom/msm8909/msm8909:7.1.2/136/brian03110818:userdebug/test-keys");
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "qcom/msm8909/msm8909:7.1.2/135/brian03110705:userdebug/test-keys" ||
    getprop("ro.build.fingerprint") == "qcom/msm8909/msm8909:7.1.2/136/brian03110818:userdebug/test-keys" ||
    abort("E3001: Package expects build fingerprint of qcom/msm8909/msm8909:7.1.2/135/brian03110705:userdebug/test-keys or qcom/msm8909/msm8909:7.1.2/136/brian03110818:userdebug/test-keys; this device has " + getprop("ro.build.fingerprint") + ".");
apply_patch_check("EMMC:/dev/block/bootdevice/by-name/boot:16276776:1f61a401c514f07779580fed5d1f4330b56fb29b:16276776:2b72e12ade635847e49097f5e862883dae7a0078") || abort("E3005: \"EMMC:/dev/block/bootdevice/by-name/boot:16276776:1f61a401c514f07779580fed5d1f4330b56fb29b:16276776:2b72e12ade635847e49097f5e862883dae7a0078\" has unexpected contents.");
apply_patch_space(22491136) || abort("E3006: Not enough free space on /cache to apply patches.");
if (range_sha1("/dev/block/bootdevice/by-name/system", "3724,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,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,66202,66203,66204,66509,66510,66574,66575,66576,66577,66664,66665,67328,67329,67334,67335,67340,67341,67351,67352,67365,67366,67381,67382,67410,67411,67421,67422,67459,67460,67732,67733,67734,67735,67736,67737,67738,67739,67812,67813,67886,67887,67930,67931,67932,67933,67936,67937,67938,67939,67940,67941,67942,67943,67944,67945,67947,67948,67954,67955,67960,67961,68036,68037,68040,68041,68046,68047,68048,68049,68050,68051,68052,68053,68054,68055,68056,68057,68063,68064,68065,68066,68087,68088,68111,68112,68113,68114,68125,68126,68169,68170,68221,68222,68541,68542,68649,68650,68651,68652,68660,68661,68666,68667,68679,68680,68694,68695,68738,68739,68752,68753,68798,68799,68810,68811,68918,68919,69235,69236,69334,69335,69372,69373,69402,69403,69422,69423,69431,69432,69616,69617,69759,69760,69770,69771,69788,69789,69798,69799,69933,69934,69940,69941,69970,69971,70001,70002,70191,70192,70198,70199,70205,70206,70211,70212,70216,70217,70230,70231,70239,70240,70244,70245,70275,70276,70293,70294,70324,70325,70379,70380,70397,70398,70428,70429,70448,70449,70457,70458,70465,70466,70489,70490,70539,70540,70551,70552,70556,70557,70561,70562,71367,71368,71372,71373,71377,71378,71394,71395,71399,71400,71406,71407,71411,71412,71417,71418,71423,71424,71428,71429,71434,71435,71440,71441,71445,71446,71450,71451,71456,71457,71462,71463,71468,71469,71474,71475,71479,71480,71485,71486,71491,71492,71496,71497,71502,71503,71508,71509,71513,71514,71519,71520,71525,71526,71530,71531,71536,71537,71542,71543,71547,71548,71553,71554,71559,71560,71564,71565,71570,71571,71576,71577,71581,71582,71587,71588,71593,71594,71598,71599,71604,71605,71610,71611,71615,71616,71621,71622,71627,71628,71632,71633,71638,71639,71644,71645,71649,71650,71655,71656,71661,71662,71669,71670,71677,71678,71691,71692,71697,71698,71720,71721,71750,71751,71793,71794,71830,71831,71837,71838,71896,71897,71901,71902,71920,71921,71925,71926,72099,72100,72269,72270,72276,72277,72291,72292,72301,72302,72311,72312,72321,72322,72331,72332,72341,72342,72351,72352,72361,72362,72371,72372,72381,72382,72396,72397,72406,72407,72416,72417,72431,72432,72441,72442,72451,72452,72461,72462,72471,72472,72481,72482,72491,72492,72501,72502,72511,72512,72521,72522,72536,72537,72546,72547,72556,72557,72566,72567,72576,72577,72591,72592,72601,72602,72611,72612,72621,72622,72636,72637,72646,72647,72656,72657,72666,72667,72681,72682,72691,72692,72701,72702,72711,72712,72721,72722,72736,72737,72746,72747,72756,72757,72766,72767,72776,72777,72786,72787,72795,72796,72810,72811,72820,72821,72830,72831,72840,72841,72850,72851,72860,72861,72870,72871,72880,72881,72890,72891,72905,72906,72915,72916,72925,72926,72935,72936,72945,72946,72955,72956,72965,72966,72975,72976,72985,72986,72995,72996,73005,73006,73020,73021,73030,73031,73040,73041,73050,73051,73060,73061,73070,73071,73085,73086,73095,73096,73105,73106,73115,73116,73125,73126,73135,73136,73145,73146,73155,73156,73170,73171,73180,73181,73190,73191,73200,73201,73215,73216,73230,73231,73240,73241,73250,73251,73260,73261,73270,73271,73280,73281,73290,73291,73305,73306,73315,73316,73325,73326,73335,73336,73350,73351,73360,73361,73370,73371,73380,73381,73395,73396,73405,73406,73415,73416,73425,73426,73440,73441,73450,73451,73460,73461,73470,73471,73480,73481,73490,73491,73505,73506,73515,73516,73525,73526,73535,73536,73545,73546,73560,73561,73570,73571,73580,73581,73590,73591,73600,73601,73610,73611,73625,73626,73635,73636,73645,73646,73655,73656,73665,73666,73675,73676,73690,73691,73700,73701,73710,73711,73720,73721,73730,73731,73740,73741,73750,73751,73760,73761,73770,73771,73780,73781,73795,73796,73805,73806,73815,73816,73825,73826,73835,73836,73845,73846,73855,73856,73865,73866,73875,73876,73885,73886,73900,73901,73910,73911,73920,73921,73930,73931,73940,73941,73950,73951,73960,73961,73970,73971,73980,73981,73990,73991,74005,74006,74015,74016,74025,74026,74035,74036,74045,74046,74055,74056,74065,74066,74075,74076,74085,74086,74100,74101,74110,74111,74120,74121,74130,74131,74140,74141,74150,74151,74160,74161,74170,74171,74180,74181,74190,74191,74200,74201,74210,74211,74220,74221,74235,74236,74245,74246,74255,74256,74265,74266,74275,74276,74285,74286,74295,74296,74305,74306,74315,74316,74330,74331,74340,74341,74350,74351,74360,74361,74370,74371,74380,74381,74390,74391,74405,74406,74415,74416,74425,74426,74435,74436,74445,74446,74455,74456,74465,74466,74475,74476,74485,74486,74495,74496,74505,74506,74515,74516,74530,74531,74540,74541,74550,74551,74560,74561,74570,74571,74580,74581,74590,74591,74600,74601,74610,74611,74620,74621,74635,74636,74645,74646,74655,74656,74665,74666,74680,74681,74690,74691,74700,74701,74710,74711,74720,74721,74730,74731,74740,74741,74750,74751,74760,74761,74770,74771,74785,74786,74795,74796,74805,74806,74815,74816,74825,74826,74835,74836,74845,74846,74855,74856,74870,74871,74880,74881,74890,74891,74900,74901,74910,74911,74920,74921,74935,74936,74945,74946,74955,74956,74965,74966,74975,74976,74985,74986,74995,74996,75005,75006,75015,75016,75030,75031,75040,75041,75050,75051,75060,75061,75171,75172,75235,75236,75240,75241,75247,75248,75261,75262,75268,75269,75327,75328,75349,75350,75363,75364,75396,75397,75490,75491,75505,75506,75515,75516,75560,75561,75593,75594,75604,75605,75611,75612,75617,75618,75731,75732,75751,75752,75757,75758,76434,76435,76454,76455,76467,76468,76481,76482,76545,76546,76551,76552,76558,76559,76565,76566,76573,76574,76643,76644,76652,76653,76660,76661,76680,76681,76702,76703,76972,76973,81795,81796,81825,81826,81833,81834,81948,81949,81971,81972,82022,82023,82052,82053,82077,82078,82091,82092,82097,82098,82111,82112,82116,82117,82152,82153,82159,82160,82166,82167,82175,82176,82185,82186,82194,82195,82251,82252,82270,82271,82302,82303,82308,82309,82320,82321,82376,82377,82389,82390,82558,82559,82573,82574,82649,82650,82708,82709,82730,82731,82775,82776,82790,82791,82795,82796,82801,82802,82807,82808,82813,82814,82819,82820,82825,82826,82833,82834,83136,83137,83141,83142,83169,83170,83183,83184,83188,83189,83195,83196,83205,83206,83237,83238,83243,83244,83250,83251,83258,83259,83266,83267,83271,83272,83276,83277,83283,83284,83290,83291,83297,83298,83303,83304,83309,83310,83315,83316,83321,83322,83327,83328,83332,83333,83338,83339,83344,83345,83350,83351,83356,83357,83363,83364,83369,83370,83375,83376,83380,83381,83387,83388,83394,83395,83401,83402,83411,83412,83421,83422,83429,83430,83435,83436,83449,83450,83459,83460,83465,83466,83473,83474,83479,83480,83485,83486,83491,83492,83498,83499,83503,83504,83509,83510,83515,83516,83520,83521,83526,83527,83532,83533,83537,83538,83542,83543,83548,83549,83553,83554,83561,83562,83568,83569,83573,83574,83579,83580,83722,83723,83735,83736,83764,83765,83786,83787,83825,83826,83967,83968,84001,84002,84008,84009,84144,84145,84163,84164,84200,84201,84210,84211,84232,84233,84482,84483,84524,84525,84537,84538,84545,84546,84552,84553,84558,84559,84567,84568,84574,84575,84606,84607,84624,84625,84639,84640,84648,84649,84655,84656,84662,84663,84681,84682,84713,84714,84738,84739,84787,84788,84799,84800,84806,84807,84821,84822,84824,84825,84832,84833,84842,84843,84849,84850,84875,84876,84895,84896,84913,84914,84943,84944,84948,84949,84953,84954,84958,84959,84972,84973,84975,84976,87441,87442,87444,87445,87449,87450,87455,87456,87462,87463,87518,87519,87521,87522,87933,87934,89153,89154,89161,89162,89340,89341,89345,89346,89353,89354,89397,89398,89419,89420,89424,89425,89429,89430,89439,89440,89445,89446,89451,89452,89460,89461,89495,89496,89500,89501,89511,89512,89519,89520,89524,89525,89530,89531,89711,89712,89748,89749,89756,89757,89775,89776,89802,89803,89831,89832,89839,89840,89845,89846,89857,89858,89878,89879,89885,89886,89914,89915,89954,89955,89962,89963,89974,89975,90040,90041,90059,90060,90093,90094,90098,90099,90107,90108,90113,90114,90123,90124,90129,90130,90159,90160,90299,90300,90310,90311,90315,90316,90321,90322,90341,90342,90343,90344,90355,90356,90364,90365,90376,90377,90384,90385,90391,90392,90398,90399,90410,90411,90417,90418,90425,90426,90433,90434,90440,90441,90445,90446,90452,90453,90457,90458,90465,90466,90472,90473,90484,90485,90489,90490,90498,90499,90506,90507,90513,90514,90520,90521,90528,90529,90536,90537,90542,90543,90549,90550,90556,90557,90558,90559,90596,90597,90634,90635,90674,90675,90677,90678,90679,90680,90681,90682,90694,90695,90696,90697,90698,90699,90720,90721,90732,90733,90734,90735,90736,90737,90861,90862,90863,90864,90870,90871,90872,90873,90874,90875,90876,90877,90878,90879,90880,90881,90889,90890,90895,90896,90902,90903,90909,90910,90922,90923,90929,90930,90950,90951,90962,90963,90964,90965,91015,91016,91022,91023,91028,91029,91083,91084,91089,91090,91095,91096,91102,91103,91108,91109,91283,91284,91291,91292,91297,91298,91303,91304,91310,91311,91320,91321,91375,91376,91388,91389,91418,91419,91424,91425,91431,91432,91437,91438,91445,91446,91451,91452,91457,91458,91463,91464,91540,91541,91559,91560,91635,91636,91641,91642,91648,91649,91854,98304,98306,98385,98386,106921,106922,107121,107122,127835,127836,127837,127838,131072,131073,163840,163842,163921,163922,168362,168370,168371,168376,168377,168384,168385,168388,168413,168418,168419,168437,168438,168457,168458,168463,168464,168468,168469,168474,168475,168486,168487,168493,168494,168507,168508,168518,168519,168521,168522,168530,168531,168535,168536,168541,168542,168547,168548,168551,168552,168555,168556,168560,168561,168565,168566,168569,168570,168574,168575,168578,168579,168583,168584,168588,168589,168601,168602,168607,168608,169638,169639,169645,169646,169654,169655,169661,169662,169665,169666,169667,169668,169675,169676,169694,169695,169700,169701,169705,169706,169711,169712,169723,169724,169730,169731,169736,169737,169747,169748,169753,169754,169755,169756,169757,169758,169759,169760,169764,169765,169767,169768,169774,169775,169778,169779,169786,169787,169790,169791,169820,169821,169834,169835,169859,169860,169896,169897,169923,169924,169968,169969,169993,169994,170005,170006,170034,170035,170061,170062,170074,170075,170076,170077,170080,170081,170083,170084,170086,170087,170090,170091,170094,170095,170102,170103,170105,170106,170110,170111,170120,170121,170125,170126,170131,170132,170136,170137,170142,170143,170146,170147,170151,170152,170156,170157,170164,170165,170170,170171,170174,170175,170180,170181,170185,170186,170189,170190,170195,170196,170200,170201,170205,170206,170209,170210,170216,170217,170220,170221,170226,170227,170233,170234,170237,170238,170248,170249,170251,170252,170257,170258,170262,170263,170278,170279,170282,170283,170287,170288,170293,170294,170299,170300,170305,170306,170311,170312,170316,170317,170319,170320,170326,170327,170333,170334,170340,170341,170345,170346,170353,170354,170360,170361,170364,170365,170371,170372,170378,170379,170386,170387,170390,170391,170401,170402,170405,170406,170417,170418,170421,170422,170426,170427,170432,170433,170438,170439,170445,170446,170454,170455,170460,170461,170468,170469,170473,170474,170476,170477,170481,170482,170487,170488,170493,170494,170501,170502,170509,170510,170513,170514,170522,170523,170524,170525,170532,170533,170540,170541,170547,170548,170604,170605,170627,170628,170635,170636,170645,170646,170653,170654,170662,170663,170675,170676,170687,170688,170698,170699,170711,170712,170720,170721,170729,170730,170740,170741,170751,170752,170760,170761,170769,170770,170774,170775,170782,170783,170793,170794,170804,170805,170815,170816,170867,170868,170876,170877,170885,170886,170901,170902,170906,170907,170920,170921,170929,170930,170973,170974,170987,170988,171004,171005,171014,171015,171023,171024,171052,171053,171065,171066,171076,171077,171090,171091,171101,171102,171113,171114,171128,171129,171140,171141,171158,171159,171165,171166,171170,171171,171212,171213,171223,171224,171233,171234,171245,171246,171256,171257,171264,171265,171274,171275,171286,171287,171298,171299,171303,171304,171313,171314,171323,171324,171334,171335,171342,171343,171351,171352,171366,171367,171395,171396,171406,171407,171429,171430,171488,171489,171503,171504,171509,171510,171554,171555,171568,171569,171584,171585,171600,171601,171607,171608,171621,171622,171633,171634,171646,171647,171655,171656,171667,171668,171678,171679,171706,171707,171785,171786,171797,171798,171808,171809,171820,171821,171829,171830,171852,171853,171860,171861,171871,171872,171881,171882,171900,171901,171944,171945,171954,171955,171967,171968,171975,171976,172012,172013,172059,172060,172068,172069,172074,172075,172083,172084,172104,172105,172111,172112,172113,172114,172116,172117,172119,172120,172122,172123,172126,172127,172129,172130,172132,172133,172135,172136,172139,172140,172144,172145,172147,172148,172151,172152,172154,172155,172157,172158,172160,172161,172164,172165,172167,172168,172171,172172,172173,172174,172175,172176,172238,172239,172240,172241,172242,172243,172253,172254,172255,172256,172297,172298,172299,172300,172301,172302,172521,172522,172523,172524,172557,172558,172559,172560,172561,172562,172797,172798,172799,172800,172808,172809,172810,172811,172812,172813,172826,172827,172828,172829,172861,172862,172863,172864,172865,172866,172873,172874,172875,172876,173484,173485,173486,173487,173488,173489,173573,173574,173575,173576,173642,173643,173644,173645,173646,173647,173741,173742,173743,173744,175699,175700,175701,175702,175703,175704,177229,177230,177231,177232,177379,177380,177381,177382,177383,177384,178074,178075,178076,178077,178084,178085,178086,178087,178088,178089,178090,178091,178092,178093,178105,178106,178107,178108,180696,180697,180698,180699,180700,180701,183065,183066,183067,183068,183551,183552,183553,183554,183555,183556,184451,184452,184453,184454,184611,184612,184613,184614,184615,184616,184892,184893,184894,184895,185878,185879,185880,185881,185882,185883,186469,186470,186471,186472,186478,186479,186480,186481,186482,186483,186493,186494,186495,186496,186509,186510,186511,186512,186513,186514,186548,186549,186550,186551,186557,186558,186559,186560,186561,186562,186573,186574,186575,186576,186636,186637,186638,186639,186640,186641,186647,186648,186649,186650,186884,186885,186886,186887,186888,186889,187046,187047,187048,187049,187096,187097,187098,187099,187100,187101,187234,187235,187236,187237,188916,188917,188918,188919,188920,188921,190228,190229,190230,190231,190241,190242,190243,190244,190245,190246,190297,190298,190299,190300,190336,190337,190338,190339,190340,190341,190342,190343,190344,190345,190401,190402,190403,190404,190409,190410,190411,190412,190413,190414,190437,190438,190439,190440,191854,191855,191856,191857,191858,191859,192908,192909,192910,192911,192914,192915,192916,192917,192918,192919,192932,192933,192934,192935,192941,192942,192943,192944,192945,192946,192962,192963,192964,192965,192977,192978,192979,192980,192981,192982,193062,193063,193064,193065,193066,193067,193068,193069,195467,195468,195469,195470,195513,195514,195515,195516,195517,195518,195635,195636,195637,195638,195641,195642,195643,195644,195645,195646,195657,195658,195659,195660,195721,195722,195723,195724,195725,195726,195815,195816,195817,195818,195951,195952,195953,195954,195955,195956,196202,196203,196204,196205,196216,196217,196218,196219,196220,196221,196264,196265,196266,196267,196268,196269,196270,196271,196272,196273,196274,196275,196276,196277,196278,196279,196280,196281,196282,196283,196284,196285,196286,196287,196288,196289,196290,196291,196300,196301,196302,196303,196304,196305,196314,196315,196316,196317,196374,196375,196376,196377,196378,196379,196554,196555,196556,196557,196558,196559,196560,196561,196562,196563,196587,196588,196589,196590,196591,196592,196602,196603,196604,196605,196606,196608,196609,229376,229378,229457,229458,251811,251812,251813,252681,252682,252683,252684,252685,252686,252687,252688,252722,252723,252730,252731,252732,252733,252734,252735,252736,252737,252769,252770,252824,252825,252860,252861,252862,252863,252864,252865,252866,252867,252868,252869,252870,252871,252872,252873,252874,252875,252876,252877,252878,252879,252880,252881,252882,252883,252884,252885,252886,252887,252888,252889,252890,252891,252892,252893,252894,252895,252896,252897,253053,253054,253162,253163,253306,253307,253408,253409,253599,253600,253759,253760,253823,253824,253972,253973,254177,254178,254272,254273,254427,254428,254490,254491,254492,254493,254494,254495,254496,254497,254498,254499,254500,254501,254502,254503,254512,254513,254514,254515,254517,254518,254519,254520,254547,254548,254549,254550,254576,254577,254578,254579,254606,254607,254608,254609,254621,254622,254623,254624,254632,254633,254634,254635,254639,254640,254641,254642,254648,254649,254650,254651,254652,254653,254654,254655,254657,254658,254659,254660,254669,254670,254671,254672,254673,254674,254675,254676,254677,254678,254679,254680,254681,254682,254683,254684,254762,254763,254764,254765,254766,254767,254768,254769,254770,254771,254772,254773,254774,254775,254776,254777,254779,254780,254781,254782,254783,254784,254785,254786,254822,254823,254824,254825,254861,254862,254863,254864,254865,254866,254867,254868,254869,254870,254871,254872,254873,254874,254876,254877,254879,254880,254881,254882,254883,254884,254885,254886,254887,254888,254889,254890,254891,254892,254893,254894,254895,254896,254897,254898,254899,254900,260321,260322,260323,260324,260325,260326,260327,260328,260329,260330,260331,260332,260336,260337,260340,260341,260345,260346,260350,260351,260355,260356,260357,260358,260359,260360,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,260427,260428,260429,260430,260431,260432,260433,260434,260435,260436,260437,260438,260439,260440,260444,260445,260450,260451,260452,260453,260576,260577,260578,260579,260580,260581,260582,260583,260584,260585,260586,260587,260588,260589,260591,260592,260593,260594,260596,260597,260598,260599,260601,260602,260603,260604,260606,260607,260608,260609,260611,260612,260613,260614,260616,260617,260618,260619,260621,260622,260623,260624,260625,260626,260627,260628,260629,260630,260631,260632,260638,260639,260640,260641,260642,260643,260649,260650,260651,260652,260733,260734,260735,260736,260737,260738,261124,261125,261126,261127,261129,261130,261131,261132,261133,261134,261140,261141,261142,261143,261148,261149,261150,261151,261152,261153,261170,261171,261172,261173,261203,261204,261205,261206,261207,261208,261227,261228,261229,261230,261240,261241,261242,261243,261244,261245,261268,261269,261270,261271,261272,261273,261274,261275,261277,261278,261279,261280,261284,261285,261286,261287,261289,261290,261291,261292,261294,261295,261296,261297,261299,261300,261301,261302,261304,261305,261306,261307,261309,261310,261311,261312,261314,261315,261316,261317,261320,261321,261322,261323,261325,261326,261327,261328,261331,261332,261333,261334,261336,261337,261338,261339,261349,261350,261351,261352,261353,261354,261355,261356,261357,261358,261359,261360,261361,261362,261367,261368,261369,261370,261371,261372,261379,261380,261381,261382,261404,261405,261406,261407,261408,261409,261454,261455,261456,261457,261471,261472,261473,261474,261475,261476,261492,261493,261494,261495,261496,261497,261498,261499,261512,261513,261514,261515,261517,261518,261519,261520,261522,261523,261524,261525,261527,261528,261529,261530,261532,261533,261534,261535,261537,261538,261539,261540,261542,261543,261544,261545,261547,261548,261549,261550,261552,261553,261554,261555,261557,261558,261559,261560,261567,261568,261569,261570,261572,261573,261574,261575,261576,261577,261578,261579,261580,261581,261582,261583,261584,261585,261590,261591,261592,261593,261594,261595,261602,261603,261604,261605,261609,261610,261611,261612,261613,261614,261621,261622,261623,261624,261625,261626,261627,261628,261630,261631,261632,261633,261635,261636,261637,261638,261640,261641,261642,261643,261645,261646,261647,261648,261650,261651,261652,261653,261655,261656,261657,261658,261766,261767,261768,261769,261770,261771,261772,261773,261774,261775,261776,261777,261778,261779,261780,261781,261782,261783,261784,261785,261786,261787,261788,261789,261797,261798,261799,261800,261808,261809,261810,261811,261812,261813,261820,261821,261822,261823,261830,261831,261832,261833,261834,261835,261836,261837,261838,261839,261840,261841,261850,261851,261852,261853,261854,261855,261871,261872,261873,261874,261876,261877,261878,261879,261881,261882,261883,261884,261886,261887,261888,261889,261894,261895,261896,261897,261899,261900,261901,261902,261903,261904,261905,261906,261911,261912,261913,261914,261915,261916,261926,261927,261928,261929,261954,261955,261956,261957,261958,261959,262045,262046,262047,262048,262111,262112,262113,262114,262115,262116,262117,262118,262133,262134,262135,262136,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") == "d363bbb4fab5c65405bbb388efe70baa29aa0bfa" || 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", "3724,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,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,66202,66203,66204,66509,66510,66574,66575,66576,66577,66664,66665,67328,67329,67334,67335,67340,67341,67351,67352,67365,67366,67381,67382,67410,67411,67421,67422,67459,67460,67732,67733,67734,67735,67736,67737,67738,67739,67812,67813,67886,67887,67930,67931,67932,67933,67936,67937,67938,67939,67940,67941,67942,67943,67944,67945,67947,67948,67954,67955,67960,67961,68036,68037,68040,68041,68046,68047,68048,68049,68050,68051,68052,68053,68054,68055,68056,68057,68063,68064,68065,68066,68087,68088,68111,68112,68113,68114,68125,68126,68169,68170,68221,68222,68541,68542,68649,68650,68651,68652,68660,68661,68666,68667,68679,68680,68694,68695,68738,68739,68752,68753,68798,68799,68810,68811,68918,68919,69235,69236,69334,69335,69372,69373,69402,69403,69422,69423,69431,69432,69616,69617,69759,69760,69770,69771,69788,69789,69798,69799,69933,69934,69940,69941,69970,69971,70001,70002,70191,70192,70198,70199,70205,70206,70211,70212,70216,70217,70230,70231,70239,70240,70244,70245,70275,70276,70293,70294,70324,70325,70379,70380,70397,70398,70428,70429,70448,70449,70457,70458,70465,70466,70489,70490,70539,70540,70551,70552,70556,70557,70561,70562,71367,71368,71372,71373,71377,71378,71394,71395,71399,71400,71406,71407,71411,71412,71417,71418,71423,71424,71428,71429,71434,71435,71440,71441,71445,71446,71450,71451,71456,71457,71462,71463,71468,71469,71474,71475,71479,71480,71485,71486,71491,71492,71496,71497,71502,71503,71508,71509,71513,71514,71519,71520,71525,71526,71530,71531,71536,71537,71542,71543,71547,71548,71553,71554,71559,71560,71564,71565,71570,71571,71576,71577,71581,71582,71587,71588,71593,71594,71598,71599,71604,71605,71610,71611,71615,71616,71621,71622,71627,71628,71632,71633,71638,71639,71644,71645,71649,71650,71655,71656,71661,71662,71669,71670,71677,71678,71691,71692,71697,71698,71720,71721,71750,71751,71793,71794,71830,71831,71837,71838,71896,71897,71901,71902,71920,71921,71925,71926,72099,72100,72269,72270,72276,72277,72291,72292,72301,72302,72311,72312,72321,72322,72331,72332,72341,72342,72351,72352,72361,72362,72371,72372,72381,72382,72396,72397,72406,72407,72416,72417,72431,72432,72441,72442,72451,72452,72461,72462,72471,72472,72481,72482,72491,72492,72501,72502,72511,72512,72521,72522,72536,72537,72546,72547,72556,72557,72566,72567,72576,72577,72591,72592,72601,72602,72611,72612,72621,72622,72636,72637,72646,72647,72656,72657,72666,72667,72681,72682,72691,72692,72701,72702,72711,72712,72721,72722,72736,72737,72746,72747,72756,72757,72766,72767,72776,72777,72786,72787,72795,72796,72810,72811,72820,72821,72830,72831,72840,72841,72850,72851,72860,72861,72870,72871,72880,72881,72890,72891,72905,72906,72915,72916,72925,72926,72935,72936,72945,72946,72955,72956,72965,72966,72975,72976,72985,72986,72995,72996,73005,73006,73020,73021,73030,73031,73040,73041,73050,73051,73060,73061,73070,73071,73085,73086,73095,73096,73105,73106,73115,73116,73125,73126,73135,73136,73145,73146,73155,73156,73170,73171,73180,73181,73190,73191,73200,73201,73215,73216,73230,73231,73240,73241,73250,73251,73260,73261,73270,73271,73280,73281,73290,73291,73305,73306,73315,73316,73325,73326,73335,73336,73350,73351,73360,73361,73370,73371,73380,73381,73395,73396,73405,73406,73415,73416,73425,73426,73440,73441,73450,73451,73460,73461,73470,73471,73480,73481,73490,73491,73505,73506,73515,73516,73525,73526,73535,73536,73545,73546,73560,73561,73570,73571,73580,73581,73590,73591,73600,73601,73610,73611,73625,73626,73635,73636,73645,73646,73655,73656,73665,73666,73675,73676,73690,73691,73700,73701,73710,73711,73720,73721,73730,73731,73740,73741,73750,73751,73760,73761,73770,73771,73780,73781,73795,73796,73805,73806,73815,73816,73825,73826,73835,73836,73845,73846,73855,73856,73865,73866,73875,73876,73885,73886,73900,73901,73910,73911,73920,73921,73930,73931,73940,73941,73950,73951,73960,73961,73970,73971,73980,73981,73990,73991,74005,74006,74015,74016,74025,74026,74035,74036,74045,74046,74055,74056,74065,74066,74075,74076,74085,74086,74100,74101,74110,74111,74120,74121,74130,74131,74140,74141,74150,74151,74160,74161,74170,74171,74180,74181,74190,74191,74200,74201,74210,74211,74220,74221,74235,74236,74245,74246,74255,74256,74265,74266,74275,74276,74285,74286,74295,74296,74305,74306,74315,74316,74330,74331,74340,74341,74350,74351,74360,74361,74370,74371,74380,74381,74390,74391,74405,74406,74415,74416,74425,74426,74435,74436,74445,74446,74455,74456,74465,74466,74475,74476,74485,74486,74495,74496,74505,74506,74515,74516,74530,74531,74540,74541,74550,74551,74560,74561,74570,74571,74580,74581,74590,74591,74600,74601,74610,74611,74620,74621,74635,74636,74645,74646,74655,74656,74665,74666,74680,74681,74690,74691,74700,74701,74710,74711,74720,74721,74730,74731,74740,74741,74750,74751,74760,74761,74770,74771,74785,74786,74795,74796,74805,74806,74815,74816,74825,74826,74835,74836,74845,74846,74855,74856,74870,74871,74880,74881,74890,74891,74900,74901,74910,74911,74920,74921,74935,74936,74945,74946,74955,74956,74965,74966,74975,74976,74985,74986,74995,74996,75005,75006,75015,75016,75030,75031,75040,75041,75050,75051,75060,75061,75171,75172,75235,75236,75240,75241,75247,75248,75261,75262,75268,75269,75327,75328,75349,75350,75363,75364,75396,75397,75490,75491,75505,75506,75515,75516,75560,75561,75593,75594,75604,75605,75611,75612,75617,75618,75731,75732,75751,75752,75757,75758,76434,76435,76454,76455,76467,76468,76481,76482,76545,76546,76551,76552,76558,76559,76565,76566,76573,76574,76643,76644,76652,76653,76660,76661,76680,76681,76702,76703,76972,76973,81795,81796,81825,81826,81833,81834,81948,81949,81971,81972,82022,82023,82052,82053,82077,82078,82091,82092,82097,82098,82111,82112,82116,82117,82152,82153,82159,82160,82166,82167,82175,82176,82185,82186,82194,82195,82251,82252,82270,82271,82302,82303,82308,82309,82320,82321,82376,82377,82389,82390,82558,82559,82573,82574,82649,82650,82708,82709,82730,82731,82775,82776,82790,82791,82795,82796,82801,82802,82807,82808,82813,82814,82819,82820,82825,82826,82833,82834,83136,83137,83141,83142,83169,83170,83183,83184,83188,83189,83195,83196,83205,83206,83237,83238,83243,83244,83250,83251,83258,83259,83266,83267,83271,83272,83276,83277,83283,83284,83290,83291,83297,83298,83303,83304,83309,83310,83315,83316,83321,83322,83327,83328,83332,83333,83338,83339,83344,83345,83350,83351,83356,83357,83363,83364,83369,83370,83375,83376,83380,83381,83387,83388,83394,83395,83401,83402,83411,83412,83421,83422,83429,83430,83435,83436,83449,83450,83459,83460,83465,83466,83473,83474,83479,83480,83485,83486,83491,83492,83498,83499,83503,83504,83509,83510,83515,83516,83520,83521,83526,83527,83532,83533,83537,83538,83542,83543,83548,83549,83553,83554,83561,83562,83568,83569,83573,83574,83579,83580,83722,83723,83735,83736,83764,83765,83786,83787,83825,83826,83967,83968,84001,84002,84008,84009,84144,84145,84163,84164,84200,84201,84210,84211,84232,84233,84482,84483,84524,84525,84537,84538,84545,84546,84552,84553,84558,84559,84567,84568,84574,84575,84606,84607,84624,84625,84639,84640,84648,84649,84655,84656,84662,84663,84681,84682,84713,84714,84738,84739,84787,84788,84799,84800,84806,84807,84821,84822,84824,84825,84832,84833,84842,84843,84849,84850,84875,84876,84895,84896,84913,84914,84943,84944,84948,84949,84953,84954,84958,84959,84972,84973,84975,84976,87441,87442,87444,87445,87449,87450,87455,87456,87462,87463,87518,87519,87521,87522,87933,87934,89153,89154,89161,89162,89340,89341,89345,89346,89353,89354,89397,89398,89419,89420,89424,89425,89429,89430,89439,89440,89445,89446,89451,89452,89460,89461,89495,89496,89500,89501,89511,89512,89519,89520,89524,89525,89530,89531,89711,89712,89748,89749,89756,89757,89775,89776,89802,89803,89831,89832,89839,89840,89845,89846,89857,89858,89878,89879,89885,89886,89914,89915,89954,89955,89962,89963,89974,89975,90040,90041,90059,90060,90093,90094,90098,90099,90107,90108,90113,90114,90123,90124,90129,90130,90159,90160,90299,90300,90310,90311,90315,90316,90321,90322,90341,90342,90343,90344,90355,90356,90364,90365,90376,90377,90384,90385,90391,90392,90398,90399,90410,90411,90417,90418,90425,90426,90433,90434,90440,90441,90445,90446,90452,90453,90457,90458,90465,90466,90472,90473,90484,90485,90489,90490,90498,90499,90506,90507,90513,90514,90520,90521,90528,90529,90536,90537,90542,90543,90549,90550,90556,90557,90558,90559,90596,90597,90634,90635,90674,90675,90677,90678,90679,90680,90681,90682,90694,90695,90696,90697,90698,90699,90720,90721,90732,90733,90734,90735,90736,90737,90861,90862,90863,90864,90870,90871,90872,90873,90874,90875,90876,90877,90878,90879,90880,90881,90889,90890,90895,90896,90902,90903,90909,90910,90922,90923,90929,90930,90950,90951,90962,90963,90964,90965,91015,91016,91022,91023,91028,91029,91083,91084,91089,91090,91095,91096,91102,91103,91108,91109,91283,91284,91291,91292,91297,91298,91303,91304,91310,91311,91320,91321,91375,91376,91388,91389,91418,91419,91424,91425,91431,91432,91437,91438,91445,91446,91451,91452,91457,91458,91463,91464,91540,91541,91559,91560,91635,91636,91641,91642,91648,91649,91854,98304,98306,98385,98386,106921,106922,107121,107122,127835,127836,127837,127838,131072,131073,163840,163842,163921,163922,168362,168370,168371,168376,168377,168384,168385,168388,168413,168418,168419,168437,168438,168457,168458,168463,168464,168468,168469,168474,168475,168486,168487,168493,168494,168507,168508,168518,168519,168521,168522,168530,168531,168535,168536,168541,168542,168547,168548,168551,168552,168555,168556,168560,168561,168565,168566,168569,168570,168574,168575,168578,168579,168583,168584,168588,168589,168601,168602,168607,168608,169638,169639,169645,169646,169654,169655,169661,169662,169665,169666,169667,169668,169675,169676,169694,169695,169700,169701,169705,169706,169711,169712,169723,169724,169730,169731,169736,169737,169747,169748,169753,169754,169755,169756,169757,169758,169759,169760,169764,169765,169767,169768,169774,169775,169778,169779,169786,169787,169790,169791,169820,169821,169834,169835,169859,169860,169896,169897,169923,169924,169968,169969,169993,169994,170005,170006,170034,170035,170061,170062,170074,170075,170076,170077,170080,170081,170083,170084,170086,170087,170090,170091,170094,170095,170102,170103,170105,170106,170110,170111,170120,170121,170125,170126,170131,170132,170136,170137,170142,170143,170146,170147,170151,170152,170156,170157,170164,170165,170170,170171,170174,170175,170180,170181,170185,170186,170189,170190,170195,170196,170200,170201,170205,170206,170209,170210,170216,170217,170220,170221,170226,170227,170233,170234,170237,170238,170248,170249,170251,170252,170257,170258,170262,170263,170278,170279,170282,170283,170287,170288,170293,170294,170299,170300,170305,170306,170311,170312,170316,170317,170319,170320,170326,170327,170333,170334,170340,170341,170345,170346,170353,170354,170360,170361,170364,170365,170371,170372,170378,170379,170386,170387,170390,170391,170401,170402,170405,170406,170417,170418,170421,170422,170426,170427,170432,170433,170438,170439,170445,170446,170454,170455,170460,170461,170468,170469,170473,170474,170476,170477,170481,170482,170487,170488,170493,170494,170501,170502,170509,170510,170513,170514,170522,170523,170524,170525,170532,170533,170540,170541,170547,170548,170604,170605,170627,170628,170635,170636,170645,170646,170653,170654,170662,170663,170675,170676,170687,170688,170698,170699,170711,170712,170720,170721,170729,170730,170740,170741,170751,170752,170760,170761,170769,170770,170774,170775,170782,170783,170793,170794,170804,170805,170815,170816,170867,170868,170876,170877,170885,170886,170901,170902,170906,170907,170920,170921,170929,170930,170973,170974,170987,170988,171004,171005,171014,171015,171023,171024,171052,171053,171065,171066,171076,171077,171090,171091,171101,171102,171113,171114,171128,171129,171140,171141,171158,171159,171165,171166,171170,171171,171212,171213,171223,171224,171233,171234,171245,171246,171256,171257,171264,171265,171274,171275,171286,171287,171298,171299,171303,171304,171313,171314,171323,171324,171334,171335,171342,171343,171351,171352,171366,171367,171395,171396,171406,171407,171429,171430,171488,171489,171503,171504,171509,171510,171554,171555,171568,171569,171584,171585,171600,171601,171607,171608,171621,171622,171633,171634,171646,171647,171655,171656,171667,171668,171678,171679,171706,171707,171785,171786,171797,171798,171808,171809,171820,171821,171829,171830,171852,171853,171860,171861,171871,171872,171881,171882,171900,171901,171944,171945,171954,171955,171967,171968,171975,171976,172012,172013,172059,172060,172068,172069,172074,172075,172083,172084,172104,172105,172111,172112,172113,172114,172116,172117,172119,172120,172122,172123,172126,172127,172129,172130,172132,172133,172135,172136,172139,172140,172144,172145,172147,172148,172151,172152,172154,172155,172157,172158,172160,172161,172164,172165,172167,172168,172171,172172,172173,172174,172175,172176,172238,172239,172240,172241,172242,172243,172253,172254,172255,172256,172297,172298,172299,172300,172301,172302,172521,172522,172523,172524,172557,172558,172559,172560,172561,172562,172797,172798,172799,172800,172808,172809,172810,172811,172812,172813,172826,172827,172828,172829,172861,172862,172863,172864,172865,172866,172873,172874,172875,172876,173484,173485,173486,173487,173488,173489,173573,173574,173575,173576,173642,173643,173644,173645,173646,173647,173741,173742,173743,173744,175699,175700,175701,175702,175703,175704,177229,177230,177231,177232,177379,177380,177381,177382,177383,177384,178074,178075,178076,178077,178084,178085,178086,178087,178088,178089,178090,178091,178092,178093,178105,178106,178107,178108,180696,180697,180698,180699,180700,180701,183065,183066,183067,183068,183551,183552,183553,183554,183555,183556,184451,184452,184453,184454,184611,184612,184613,184614,184615,184616,184892,184893,184894,184895,185878,185879,185880,185881,185882,185883,186469,186470,186471,186472,186478,186479,186480,186481,186482,186483,186493,186494,186495,186496,186509,186510,186511,186512,186513,186514,186548,186549,186550,186551,186557,186558,186559,186560,186561,186562,186573,186574,186575,186576,186636,186637,186638,186639,186640,186641,186647,186648,186649,186650,186884,186885,186886,186887,186888,186889,187046,187047,187048,187049,187096,187097,187098,187099,187100,187101,187234,187235,187236,187237,188916,188917,188918,188919,188920,188921,190228,190229,190230,190231,190241,190242,190243,190244,190245,190246,190297,190298,190299,190300,190336,190337,190338,190339,190340,190341,190342,190343,190344,190345,190401,190402,190403,190404,190409,190410,190411,190412,190413,190414,190437,190438,190439,190440,191854,191855,191856,191857,191858,191859,192908,192909,192910,192911,192914,192915,192916,192917,192918,192919,192932,192933,192934,192935,192941,192942,192943,192944,192945,192946,192962,192963,192964,192965,192977,192978,192979,192980,192981,192982,193062,193063,193064,193065,193066,193067,193068,193069,195467,195468,195469,195470,195513,195514,195515,195516,195517,195518,195635,195636,195637,195638,195641,195642,195643,195644,195645,195646,195657,195658,195659,195660,195721,195722,195723,195724,195725,195726,195815,195816,195817,195818,195951,195952,195953,195954,195955,195956,196202,196203,196204,196205,196216,196217,196218,196219,196220,196221,196264,196265,196266,196267,196268,196269,196270,196271,196272,196273,196274,196275,196276,196277,196278,196279,196280,196281,196282,196283,196284,196285,196286,196287,196288,196289,196290,196291,196300,196301,196302,196303,196304,196305,196314,196315,196316,196317,196374,196375,196376,196377,196378,196379,196554,196555,196556,196557,196558,196559,196560,196561,196562,196563,196587,196588,196589,196590,196591,196592,196602,196603,196604,196605,196606,196608,196609,229376,229378,229457,229458,251811,251812,251813,252681,252682,252683,252684,252685,252686,252687,252688,252722,252723,252730,252731,252732,252733,252734,252735,252736,252737,252769,252770,252824,252825,252860,252861,252862,252863,252864,252865,252866,252867,252868,252869,252870,252871,252872,252873,252874,252875,252876,252877,252878,252879,252880,252881,252882,252883,252884,252885,252886,252887,252888,252889,252890,252891,252892,252893,252894,252895,252896,252897,253053,253054,253162,253163,253306,253307,253408,253409,253599,253600,253759,253760,253823,253824,253972,253973,254177,254178,254272,254273,254427,254428,254490,254491,254492,254493,254494,254495,254496,254497,254498,254499,254500,254501,254502,254503,254512,254513,254514,254515,254517,254518,254519,254520,254547,254548,254549,254550,254576,254577,254578,254579,254606,254607,254608,254609,254621,254622,254623,254624,254632,254633,254634,254635,254639,254640,254641,254642,254648,254649,254650,254651,254652,254653,254654,254655,254657,254658,254659,254660,254669,254670,254671,254672,254673,254674,254675,254676,254677,254678,254679,254680,254681,254682,254683,254684,254762,254763,254764,254765,254766,254767,254768,254769,254770,254771,254772,254773,254774,254775,254776,254777,254779,254780,254781,254782,254783,254784,254785,254786,254822,254823,254824,254825,254861,254862,254863,254864,254865,254866,254867,254868,254869,254870,254871,254872,254873,254874,254876,254877,254879,254880,254881,254882,254883,254884,254885,254886,254887,254888,254889,254890,254891,254892,254893,254894,254895,254896,254897,254898,254899,254900,260321,260322,260323,260324,260325,260326,260327,260328,260329,260330,260331,260332,260336,260337,260340,260341,260345,260346,260350,260351,260355,260356,260357,260358,260359,260360,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,260427,260428,260429,260430,260431,260432,260433,260434,260435,260436,260437,260438,260439,260440,260444,260445,260450,260451,260452,260453,260576,260577,260578,260579,260580,260581,260582,260583,260584,260585,260586,260587,260588,260589,260591,260592,260593,260594,260596,260597,260598,260599,260601,260602,260603,260604,260606,260607,260608,260609,260611,260612,260613,260614,260616,260617,260618,260619,260621,260622,260623,260624,260625,260626,260627,260628,260629,260630,260631,260632,260638,260639,260640,260641,260642,260643,260649,260650,260651,260652,260733,260734,260735,260736,260737,260738,261124,261125,261126,261127,261129,261130,261131,261132,261133,261134,261140,261141,261142,261143,261148,261149,261150,261151,261152,261153,261170,261171,261172,261173,261203,261204,261205,261206,261207,261208,261227,261228,261229,261230,261240,261241,261242,261243,261244,261245,261268,261269,261270,261271,261272,261273,261274,261275,261277,261278,261279,261280,261284,261285,261286,261287,261289,261290,261291,261292,261294,261295,261296,261297,261299,261300,261301,261302,261304,261305,261306,261307,261309,261310,261311,261312,261314,261315,261316,261317,261320,261321,261322,261323,261325,261326,261327,261328,261331,261332,261333,261334,261336,261337,261338,261339,261349,261350,261351,261352,261353,261354,261355,261356,261357,261358,261359,261360,261361,261362,261367,261368,261369,261370,261371,261372,261379,261380,261381,261382,261404,261405,261406,261407,261408,261409,261454,261455,261456,261457,261471,261472,261473,261474,261475,261476,261492,261493,261494,261495,261496,261497,261498,261499,261512,261513,261514,261515,261517,261518,261519,261520,261522,261523,261524,261525,261527,261528,261529,261530,261532,261533,261534,261535,261537,261538,261539,261540,261542,261543,261544,261545,261547,261548,261549,261550,261552,261553,261554,261555,261557,261558,261559,261560,261567,261568,261569,261570,261572,261573,261574,261575,261576,261577,261578,261579,261580,261581,261582,261583,261584,261585,261590,261591,261592,261593,261594,261595,261602,261603,261604,261605,261609,261610,261611,261612,261613,261614,261621,261622,261623,261624,261625,261626,261627,261628,261630,261631,261632,261633,261635,261636,261637,261638,261640,261641,261642,261643,261645,261646,261647,261648,261650,261651,261652,261653,261655,261656,261657,261658,261766,261767,261768,261769,261770,261771,261772,261773,261774,261775,261776,261777,261778,261779,261780,261781,261782,261783,261784,261785,261786,261787,261788,261789,261797,261798,261799,261800,261808,261809,261810,261811,261812,261813,261820,261821,261822,261823,261830,261831,261832,261833,261834,261835,261836,261837,261838,261839,261840,261841,261850,261851,261852,261853,261854,261855,261871,261872,261873,261874,261876,261877,261878,261879,261881,261882,261883,261884,261886,261887,261888,261889,261894,261895,261896,261897,261899,261900,261901,261902,261903,261904,261905,261906,261911,261912,261913,261914,261915,261916,261926,261927,261928,261929,261954,261955,261956,261957,261958,261959,262045,262046,262047,262048,262111,262112,262113,262114,262115,262116,262117,262118,262133,262134,262135,262136,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:1f61a401c514f07779580fed5d1f4330b56fb29b:16276776:2b72e12ade635847e49097f5e862883dae7a0078",
            "-", 2b72e12ade635847e49097f5e862883dae7a0078, 16276776,
            1f61a401c514f07779580fed5d1f4330b56fb29b,
            package_extract_file("patch/boot.img.p")) ||
    abort("E3008: Failed to apply patch to EMMC:/dev/block/bootdevice/by-name/boot:16276776:1f61a401c514f07779580fed5d1f4330b56fb29b:16276776:2b72e12ade635847e49097f5e862883dae7a0078");

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

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