Professional Documents
Culture Documents
=======
----------------------------------
PLEASE USE NOTEPAD ++ TO READ THIS
----------------------------------
===================================================================================
=======
# First of all repack does not works with all ROM's especially CYANOGENMOD
so here i will explain how to make it work (follow steps carefully,may be useful
for other ROM)
* Extractor.bat
*..
START 0F SCRIPT
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ui_print("Target: 1462268397");
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
unmount("/data");
endif;
show_progress(0.750000, 0);
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system",
package_extract_file("system.transfer.list"), "system.new.dat",
"system.patch.dat");
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"36,0,32770,32849,32851,33331,65535,65536,65538,98304,98306,98385,98387,98867,13107
1,131072,131074,163840,163842,163921,163923,164403,185342,196608,196610,229376,2293
78,229457,229459,262144,262146,294912,294914,294993,294995,295475,307199") ==
"0b20303394271424267e36a0ce7573f1b62ddc0d" then
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"48,32770,32849,32851,33331,65535,65536,65538,66050,97792,98304,98306,98385,98387,9
8867,131071,131072,131074,131586,163328,163840,163842,163921,163923,164403,185342,1
85854,196096,196608,196610,197122,228864,229376,229378,229457,229459,229971,261632,
262144,262146,262658,294400,294912,294914,294993,294995,295475,307199,307200") ==
"16902dcea1b74f8c9451cb2245c51465d949ec7e" then
else
abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
abort("system partition has unexpected contents after OTA update");
endif;
show_progress(0.020000, 10);
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
show_progress(0.200000, 10);
END OF SCRIPT
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
---------------------------------------------------------------------------
* As you can see in line number 90 , 92 there is range_sha1 check see below eg.
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"36,0,32770,32849,32851,33331,65535,65536,65538,98304,98306,98385,98387,98867,13107
1,131072,131074,163840,163842,163921,163923,164403,185342,196608,196610,229376,2293
78,229457,229459,262144,262146,294912,294914,294993,294995,295475,307199") ==
"0b20303394271424267e36a0ce7573f1b62ddc0d" then
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"48,32770,32849,32851,33331,65535,65536,65538,66050,97792,98304,98306,98385,98387,9
8867,131071,131072,131074,131586,163328,163840,163842,163921,163923,164403,185342,1
85854,196096,196608,196610,197122,228864,229376,229378,229457,229459,229971,261632,
262144,262146,262658,294400,294912,294914,294993,294995,295475,307199,307200") ==
"16902dcea1b74f8c9451cb2245c51465d949ec7e" then
"36,0,32770,32849,32851..........294995,295475,307199") ==
"0b20303394271424267e36a0ce7573f1b62ddc0d" then
"48,32770,32849,32851,..........,295475,307199,307200") ==
"16902dcea1b74f8c9451cb2245c51465d949ec7e" then
* How amazing REALLY double sha1 check of a single file and both are different(not
possible)
* THESE ARE SHA CHECK OF TRANSFER COMMAND LINES(a/c to xpirit's) FOUND found in
system.transfer.list of Cm rom's See Below
------------------------------------------------------
Example OF MY CM13.0 ROM , system.transfer.list CONTAINS
-----------------------------------------------------
3
130069
0
0
new
36,0,32770,32849,32851,33331,65535,65536,65538,98304,98306,98385,98387,98867,131071
,131072,131074,163840,163842,163921,163923,164403,185544,196608,196610,229376,22937
8,229457,229459,262144,262146,294912,294914,294993,294995,295475,307199
zero
48,32770,32849,32851,33331,65535,65536,65538,66050,97792,98304,98306,98385,98387,98
867,131071,131072,131074,131586,163328,163840,163842,163921,163923,164403,185544,18
6056,196096,196608,196610,197122,228864,229376,229378,229457,229459,229971,261632,2
62144,262146,262658,294400,294912,294914,294993,294995,295475,307199,307200
erase
12,66050,97792,131586,163328,186056,196096,197122,228864,229971,261632,262658,29440
0
----------------------------------------------------------
* and one more namley sha1_system.txt which contains sha1 check of system.new.dat
5.copy your sub folders for example:- addon.d, app, bin, fonts, framework,
buile.prop, etc.
to system folder (this message will also displayed in extractor)
------------------
system (FOLDER)
META-INF (FOLDER)
install (FOLDER)
system.transfer.list (FILE)
system.patch.dat (FILE)
system.new.dat (FILE)
file_contexts (FILE)
boot.img (FILE)
------------------
if you unable to find it(file_contexts) in zip file then extract ramdisk from
boot.img
look for "file_contexts" inside ramdisk folder
8.The extractor automatically finds size and creates three files as output :-
system.new.dat
system.transfer.list
sha1_system.txt --> sha1_sum of system.new.dat
9.Now copy system.new.dat system.transfer.list to ROM folder
----------------------------------------------------
in my case it (system.transfer.list) looks like this
____________________________------------------------
1
124680
erase 2,0,129024
new
76,0,32,33,164,539,692,696,13549,13550,14263,14264,14313,14314,14374,14375,14507,14
520,14522,14527,14657,14670,14672,14677,14805,14818,14820,14825,16941,16942,32767,3
2768,32770,32801,32802,33307,36711,36714,42767,42774,42988,42989,50105,50107,50114,
50120,50141,50142,50143,50162,52431,52432,55597,55600,65535,65536,65537,66042,89668
,89674,93810,93811,97042,97043,97070,97122,98100,98304,98306,98337,98338,98843,9884
4,100859,128209,128212,129023
-----------------------------------------------------------------------
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"76,0,32,33,164,539,692,696,13549,13550,14263,14264,14313,14314,14374,14375,14507,1
4520,14522,14527,14657,14670,14672,14677,14805,14818,14820,14825,16941,16942,32767,
32768,32770,32801,32802,33307,36711,36714,42767,42774,42988,42989,50105,50107,50114
,50120,50141,50142,50143,50162,52431,52432,55597,55600,65535,65536,65537,66042,8966
8,89674,93810,93811,97042,97043,97070,97122,98100,98304,98306,98337,98338,98843,988
44,100859,128209,128212,129023") == "16902dcea1b74f8c9451cb2245c51465d949ec7e" then
--------------------------------------------------->
2nd--> 16902dcea1b74f8c9451cb2245c51465d949ec7e
_____________________________________________________________________
____________________________________________________________________
ui_print("Target: 1462268397");
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
unmount("/data");
endif;
show_progress(0.750000, 0);
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system",
package_extract_file("system.transfer.list"), "system.new.dat",
"system.patch.dat");
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"76,0,32,33,164,539,692,696,13549,13550,14263,14264,14313,14314,14374,14375,14507,1
4520,14522,14527,14657,14670,14672,14677,14805,14818,14820,14825,16941,16942,32767,
32768,32770,32801,32802,33307,36711,36714,42767,42774,42988,42989,50105,50107,50114
,50120,50141,50142,50143,50162,52431,52432,55597,55600,65535,65536,65537,66042,8966
8,89674,93810,93811,97042,97043,97070,97122,98100,98304,98306,98337,98338,98843,988
44,100859,128209,128212,129023") == "bdd6a7e1352232b97db4286cc21fdc8ea91d40f7" then
if range_sha1("/dev/block/platform/msm_sdcc.1/by-name/system",
"76,0,32,33,164,539,692,696,13549,13550,14263,14264,14313,14314,14374,14375,14507,1
4520,14522,14527,14657,14670,14672,14677,14805,14818,14820,14825,16941,16942,32767,
32768,32770,32801,32802,33307,36711,36714,42767,42774,42988,42989,50105,50107,50114
,50120,50141,50142,50143,50162,52431,52432,55597,55600,65535,65536,65537,66042,8966
8,89674,93810,93811,97042,97043,97070,97122,98100,98304,98306,98337,98338,98843,988
44,100859,128209,128212,129023") == "bdd6a7e1352232b97db4286cc21fdc8ea91d40f7" then
else
abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
abort("system partition has unexpected contents after OTA update");
endif;
show_progress(0.020000, 10);
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
show_progress(0.200000, 10);
-----------------------------------------------------------------------------------
------------------------------------>
* NOW YOU CAN POINT OUT DIFFERENCE B/W old updater-script(see start of guide ) and
upater-script(see above )
//////////////
Precautions://
//////////////
* Please do not copy my lines in your updater-script just copy your own
system.transfer.list lines
and your sha1_system value (yes, some of course do this. please try to
understand)