gendisjawi commited on
Commit
9a55c7b
1 Parent(s): 6d16e75

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
.gitattributes CHANGED
@@ -42,3 +42,18 @@ xvideos.com_72337be9231ae23883c3b36a59ff406c.mp4 filter=lfs diff=lfs merge=lfs -
42
  m3u8.dev-1714250632366.mp4 filter=lfs diff=lfs merge=lfs -text
43
  m3u8.dev-1714250578185.ts filter=lfs diff=lfs merge=lfs -text
44
  CrossOver_24_0_3_TNT.dmg filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  m3u8.dev-1714250632366.mp4 filter=lfs diff=lfs merge=lfs -text
43
  m3u8.dev-1714250578185.ts filter=lfs diff=lfs merge=lfs -text
44
  CrossOver_24_0_3_TNT.dmg filter=lfs diff=lfs merge=lfs -text
45
+ images/boot.img filter=lfs diff=lfs merge=lfs -text
46
+ images/cust.img filter=lfs diff=lfs merge=lfs -text
47
+ images/dtbo.img filter=lfs diff=lfs merge=lfs -text
48
+ images/dummy_modemst.img filter=lfs diff=lfs merge=lfs -text
49
+ images/logo.img filter=lfs diff=lfs merge=lfs -text
50
+ images/misc.img filter=lfs diff=lfs merge=lfs -text
51
+ images/persist.img filter=lfs diff=lfs merge=lfs -text
52
+ images/recovery.img filter=lfs diff=lfs merge=lfs -text
53
+ images/super.img filter=lfs diff=lfs merge=lfs -text
54
+ images/tz.mbn filter=lfs diff=lfs merge=lfs -text
55
+ images/tz_debug.mbn filter=lfs diff=lfs merge=lfs -text
56
+ images/userdata.img filter=lfs diff=lfs merge=lfs -text
57
+ images/vmlinux filter=lfs diff=lfs merge=lfs -text
58
+ images/xbl.elf filter=lfs diff=lfs merge=lfs -text
59
+ images/xbl_debug.elf filter=lfs diff=lfs merge=lfs -text
flash_all.bat ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
2
+ if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
3
+
4
+ for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
5
+ if [%version%] EQU [] set version=0
6
+ set anticheck="antirollback check pass"
7
+ if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
8
+ echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
9
+
10
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || echo Missmatching image and device
11
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || exit /B 1
12
+
13
+ fastboot %* erase boot || @echo "Erase boot error" && exit /B 1
14
+ fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
15
+ fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
16
+ fastboot %* flash xbl %~dp0images\xbl.elf || @echo "Flash xbl error" && exit /B 1
17
+ fastboot %* flash xblbak %~dp0images\xbl.elf || @echo "Flash xblbak error" && exit /B 1
18
+ fastboot %* flash xbl_config %~dp0images\xbl_config.elf || @echo "Flash xbl_config error" && exit /B 1
19
+ fastboot %* flash xbl_configbak %~dp0images\xbl_config.elf || @echo "Flash xbl_configbak error" && exit /B 1
20
+ fastboot %* flash abl %~dp0images\abl.elf || @echo "Flash abl error" && exit /B 1
21
+ fastboot %* flash ablbak %~dp0images\abl.elf || @echo "Flash ablbak error" && exit /B 1
22
+ fastboot %* flash tz %~dp0images\tz.mbn || @echo "Flash tz error" && exit /B 1
23
+ fastboot %* flash tzbak %~dp0images\tz.mbn || @echo "Flash tzbak error" && exit /B 1
24
+ fastboot %* flash hyp %~dp0images\hyp.mbn || @echo "Flash hyp error" && exit /B 1
25
+ fastboot %* flash hypbak %~dp0images\hyp.mbn || @echo "Flash hypbak error" && exit /B 1
26
+ fastboot %* flash devcfg %~dp0images\devcfg.mbn || @echo "Flash devcfg error" && exit /B 1
27
+ fastboot %* flash devcfgbak %~dp0images\devcfg.mbn || @echo "Flash devcfgbak error" && exit /B 1
28
+ fastboot %* flash storsec %~dp0images\storsec.mbn || @echo "Flash storsec error" && exit /B 1
29
+ ::fastboot %* flash storsecbak %~dp0images\storsec.mbn || @echo "Flash storsecbak error" && exit /B 1
30
+ fastboot %* flash bluetooth %~dp0images\BTFM.bin || @echo "Flash bluetooth error" && exit /B 1
31
+ fastboot %* flash cmnlib %~dp0images\cmnlib.mbn || @echo "Flash cmnlib error" && exit /B 1
32
+ fastboot %* flash cmnlibbak %~dp0images\cmnlib.mbn || @echo "Flash cmnlibbak error" && exit /B 1
33
+ fastboot %* flash cmnlib64 %~dp0images\cmnlib64.mbn || @echo "Flash cmnlib64 error" && exit /B 1
34
+ fastboot %* flash cmnlib64bak %~dp0images\cmnlib64.mbn || @echo "Flash cmnlib64bak error" && exit /B 1
35
+ fastboot %* flash modem %~dp0images\NON-HLOS.bin || @echo "Flash modem error" && exit /B 1
36
+ fastboot %* flash dsp %~dp0images\dspso.bin || @echo "Flash dsp error" && exit /B 1
37
+ fastboot %* erase metadata || @echo "Erase metadata error" && exit 1
38
+ fastboot %* flash metadata %~dp0images\metadata.img || @echo "Flash metadata error" && exit /B 1
39
+ fastboot %* flash keymaster %~dp0images\km41.mbn || @echo "Flash keymaster error" && exit /B 1
40
+ fastboot %* flash keymasterbak %~dp0images\km41.mbn || @echo "Flash keymasterbak error" && exit /B 1
41
+ fastboot %* flash logo %~dp0images\logo.img || @echo "Flash logo error" && exit /B 1
42
+ ::fastboot %* flash splash %~dp0images\splash.img || @echo "Flash splash error" && exit /B 1
43
+ fastboot %* flash misc %~dp0images\misc.img || @echo "Flash misc error" && exit /B 1
44
+ fastboot %* flash aop %~dp0images\aop.mbn || @echo "Flash aop error" && exit /B 1
45
+ fastboot %* flash aopbak %~dp0images\aop.mbn || @echo "Flash aopbak error" && exit /B 1
46
+ fastboot %* flash qupfw %~dp0images\qupv3fw.elf || @echo "Flash qupfw error" && exit /B 1
47
+ fastboot %* flash qupfwbak %~dp0images\qupv3fw.elf || @echo "Flash qupfwbak error" && exit /B 1
48
+ fastboot %* flash imagefv %~dp0images\imagefv.elf || @echo "Flash imagefv error" && exit /B 1
49
+ fastboot %* flash uefisecapp %~dp0images\uefi_sec.mbn || @echo "Flash uefisecapp error" && exit /B 1
50
+ fastboot %* flash uefisecappbak %~dp0images\uefi_sec.mbn || @echo "Flash uefisecappbak error" && exit /B 1
51
+ fastboot %* flash multiimgoem %~dp0images\multi_image.mbn || @echo "Flash multiimgoem error" && exit /B 1
52
+ fastboot %* flash vbmeta %~dp0images\vbmeta.img || @echo "Flash vbmeta error" && exit /B 1
53
+ fastboot %* flash dtbo %~dp0images\dtbo.img || @echo "Flash dtbo error" && exit /B 1
54
+ fastboot %* flash super %~dp0images\super.img || @echo "Flash super error" && exit /B 1
55
+ fastboot %* flash vbmeta_system %~dp0images\vbmeta_system.img || @echo "Flash vbmeta_system error" && exit /B 1
56
+ fastboot %* flash cache %~dp0images\cache.img || @echo "Flash cache error" && exit /B 1
57
+ fastboot %* flash userdata %~dp0images\userdata.img || @echo "Flash userdata error" && exit /B 1
58
+ fastboot %* flash recovery %~dp0images\recovery.img || @echo "Flash recovery error" && exit /B 1
59
+ fastboot %* erase secdata || @echo "Erase secdata error" && exit /B 1
60
+ fastboot %* flash cust %~dp0images\cust.img || @echo "Flash cust error" && exit /B 1
61
+ fastboot %* flash boot %~dp0images\boot.img || @echo "Flash boot error" && exit /B 1
62
+ fastboot %* reboot || @echo "Reboot error" && exit /B 1
flash_all.sh ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if [ -e $(dirname $0)/images/anti_version.txt ]; then
2
+ CURRENT_ANTI_VER=`cat $(dirname $0)/images/anti_version.txt`
3
+ fi
4
+
5
+ if [ -z "$CURRENT_ANTI_VER" ]; then CURRENT_ANTI_VER=0; fi
6
+ ver=`fastboot $* getvar anti 2>&1 | grep -oP "anti: \K[0-9]+"`
7
+ if [ -z "$ver" ]; then ver=0; fi
8
+ if [ $ver -gt $CURRENT_ANTI_VER ]; then echo "Current device antirollback version is greater than this pakcage"; exit 1; fi
9
+
10
+ fastboot $* getvar product 2>&1 | grep "^product: courbet*"
11
+ if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
12
+
13
+ fastboot $* erase boot
14
+ if [ $? -ne 0 ] ; then echo "Erase boot error"; exit 1; fi
15
+ fastboot $* flash crclist `dirname $0`/images/crclist.txt
16
+ if [ $? -ne 0 ] ; then echo "Flash crclist error"; exit 1; fi
17
+ fastboot $* flash sparsecrclist `dirname $0`/images/sparsecrclist.txt
18
+ if [ $? -ne 0 ] ; then echo "Flash sparsecrclist error"; exit 1; fi
19
+ fastboot $* flash xbl `dirname $0`/images/xbl.elf
20
+ if [ $? -ne 0 ] ; then echo "Flash xbl error"; exit 1; fi
21
+ fastboot $* flash xblbak `dirname $0`/images/xbl.elf
22
+ if [ $? -ne 0 ] ; then echo "Flash xblbak error"; exit 1; fi
23
+ fastboot $* flash xbl_config `dirname $0`/images/xbl_config.elf
24
+ if [ $? -ne 0 ] ; then echo "Flash xbl_config error"; exit 1; fi
25
+ fastboot $* flash xbl_configbak `dirname $0`/images/xbl_config.elf
26
+ if [ $? -ne 0 ] ; then echo "Flash xbl_configbak error"; exit 1; fi
27
+ fastboot $* flash abl `dirname $0`/images/abl.elf
28
+ if [ $? -ne 0 ] ; then echo "Flash abl error"; exit 1; fi
29
+ fastboot $* flash ablbak `dirname $0`/images/abl.elf
30
+ if [ $? -ne 0 ] ; then echo "Flash ablbak error"; exit 1; fi
31
+ fastboot $* flash tz `dirname $0`/images/tz.mbn
32
+ if [ $? -ne 0 ] ; then echo "Flash tz error"; exit 1; fi
33
+ fastboot $* flash tzbak `dirname $0`/images/tz.mbn
34
+ if [ $? -ne 0 ] ; then echo "Flash tzbak error"; exit 1; fi
35
+ fastboot $* flash hyp `dirname $0`/images/hyp.mbn
36
+ if [ $? -ne 0 ] ; then echo "Flash hyp error"; exit 1; fi
37
+ fastboot $* flash hypbak `dirname $0`/images/hyp.mbn
38
+ if [ $? -ne 0 ] ; then echo "Flash hypbak error"; exit 1; fi
39
+ fastboot $* flash devcfg `dirname $0`/images/devcfg.mbn
40
+ if [ $? -ne 0 ] ; then echo "Flash devcfg error"; exit 1; fi
41
+ fastboot $* flash devcfgbak `dirname $0`/images/devcfg.mbn
42
+ if [ $? -ne 0 ] ; then echo "Flash devcfgbak error"; exit 1; fi
43
+ fastboot $* flash storsec `dirname $0`/images/storsec.mbn
44
+ if [ $? -ne 0 ] ; then echo "Flash storsec error"; exit 1; fi
45
+ #fastboot $* flash storsecbak `dirname $0`/images/storsec.mbn
46
+ #if [ $? -ne 0 ] ; then echo "Flash storsecbak error"; exit 1; fi
47
+ fastboot $* flash bluetooth `dirname $0`/images/BTFM.bin
48
+ if [ $? -ne 0 ] ; then echo "Flash bluetooth error"; exit 1; fi
49
+ fastboot $* flash cmnlib `dirname $0`/images/cmnlib.mbn
50
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib error"; exit 1; fi
51
+ fastboot $* flash cmnlibbak `dirname $0`/images/cmnlib.mbn
52
+ if [ $? -ne 0 ] ; then echo "Flash cmnlibbak error"; exit 1; fi
53
+ fastboot $* flash cmnlib64 `dirname $0`/images/cmnlib64.mbn
54
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib64 error"; exit 1; fi
55
+ fastboot $* flash cmnlib64bak `dirname $0`/images/cmnlib64.mbn
56
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib64bak error"; exit 1; fi
57
+ fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
58
+ if [ $? -ne 0 ] ; then echo "Flash modem error"; exit 1; fi
59
+ fastboot $* flash dsp `dirname $0`/images/dspso.bin
60
+ if [ $? -ne 0 ] ; then echo "Flash dsp error"; exit 1; fi
61
+ fastboot $* erase metadata
62
+ if [ $? -ne 0 ] ; then echo "Erase metadata error"; exit 1; fi
63
+ fastboot $* flash metadata `dirname $0`/images/metadata.img
64
+ if [ $? -ne 0 ] ; then echo "Flash metadata error"; exit 1; fi
65
+ fastboot $* flash keymaster `dirname $0`/images/km41.mbn
66
+ if [ $? -ne 0 ] ; then echo "Flash keymaster error"; exit 1; fi
67
+ fastboot $* flash keymasterbak `dirname $0`/images/km41.mbn
68
+ if [ $? -ne 0 ] ; then echo "Flash keymaster error"; exit 1; fi
69
+ fastboot $* flash logo `dirname $0`/images/logo.img
70
+ if [ $? -ne 0 ] ; then echo "Flash logo error"; exit 1; fi
71
+ #fastboot $* flash splash `dirname $0`/images/splash.img
72
+ #if [ $? -ne 0 ] ; then echo "Flash splash error"; exit 1; fi
73
+ fastboot $* flash misc `dirname $0`/images/misc.img
74
+ if [ $? -ne 0 ] ; then echo "Flash misc error"; exit 1; fi
75
+ fastboot $* flash aop `dirname $0`/images/aop.mbn
76
+ if [ $? -ne 0 ] ; then echo "Flash aop error"; exit 1; fi
77
+ fastboot $* flash aopbak `dirname $0`/images/aop.mbn
78
+ if [ $? -ne 0 ] ; then echo "Flash aopbak error"; exit 1; fi
79
+ fastboot $* flash qupfw `dirname $0`/images/qupv3fw.elf
80
+ if [ $? -ne 0 ] ; then echo "Flash qupfw error"; exit 1; fi
81
+ fastboot $* flash qupfwbak `dirname $0`/images/qupv3fw.elf
82
+ if [ $? -ne 0 ] ; then echo "Flash qupfwbak error"; exit 1; fi
83
+ fastboot $* flash imagefv `dirname $0`/images/imagefv.elf
84
+ if [ $? -ne 0 ] ; then echo "Flash imagefv error"; exit 1; fi
85
+ fastboot $* flash uefisecapp `dirname $0`/images/uefi_sec.mbn
86
+ if [ $? -ne 0 ] ; then echo "Flash uefisecapp error"; exit 1; fi
87
+ fastboot $* flash uefisecappbak `dirname $0`/images/uefi_sec.mbn
88
+ if [ $? -ne 0 ] ; then echo "Flash uefisecappbak error"; exit 1; fi
89
+ fastboot $* flash multiimgoem `dirname $0`/images/multi_image.mbn
90
+ if [ $? -ne 0 ] ; then echo "Flash multiimgoem error"; exit 1; fi
91
+ fastboot $* flash vbmeta `dirname $0`/images/vbmeta.img
92
+ if [ $? -ne 0 ] ; then echo "Flash vbmeta error"; exit 1; fi
93
+ fastboot $* flash dtbo `dirname $0`/images/dtbo.img
94
+ if [ $? -ne 0 ] ; then echo "Flash dtbo error"; exit 1; fi
95
+ fastboot $* flash super `dirname $0`/images/super.img
96
+ if [ $? -ne 0 ] ; then echo "Flash super error"; exit 1; fi
97
+ fastboot $* flash vbmeta_system `dirname $0`/images/vbmeta_system.img
98
+ if [ $? -ne 0 ] ; then echo "Flash vbmeta_system error"; exit 1; fi
99
+ fastboot $* flash cache `dirname $0`/images/cache.img
100
+ if [ $? -ne 0 ] ; then echo "Flash cache error"; exit 1; fi
101
+ fastboot $* flash userdata `dirname $0`/images/userdata.img
102
+ if [ $? -ne 0 ] ; then echo "Flash userdata error"; exit 1; fi
103
+ fastboot $* flash recovery `dirname $0`/images/recovery.img
104
+ if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
105
+ fastboot $* erase secdata
106
+ if [ $? -ne 0 ] ; then echo "Erase secdata error"; exit 1; fi
107
+ fastboot $* flash cust `dirname $0`/images/cust.img
108
+ if [ $? -ne 0 ] ; then echo "Flash cust error"; exit 1; fi
109
+ fastboot $* flash boot `dirname $0`/images/boot.img
110
+ if [ $? -ne 0 ] ; then echo "Flash boot error"; exit 1; fi
111
+ fastboot $* reboot
112
+ if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
flash_all_debug.bat ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
2
+ if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
3
+
4
+ for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
5
+ if [%version%] EQU [] set version=0
6
+ set anticheck="antirollback check pass"
7
+ if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
8
+ echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
9
+
10
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || echo Missmatching image and device
11
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || exit /B 1
12
+
13
+ fastboot %* erase boot || @echo "Erase boot error" && exit /B 1
14
+ ::fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
15
+ ::fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
16
+ fastboot %* flash xbl %~dp0images\xbl_debug.elf || @echo "Flash xbl error" && exit /B 1
17
+ fastboot %* flash xblbak %~dp0images\xbl_debug.elf || @echo "Flash xblbak error" && exit /B 1
18
+ fastboot %* flash xbl_config %~dp0images\xbl_config_debug.elf || @echo "Flash xbl_config error" && exit /B 1
19
+ fastboot %* flash xbl_configbak %~dp0images\xbl_config_debug.elf || @echo "Flash xbl_configbak error" && exit /B 1
20
+ fastboot %* flash abl %~dp0images\abl.elf || @echo "Flash abl error" && exit /B 1
21
+ fastboot %* flash ablbak %~dp0images\abl.elf || @echo "Flash ablbak error" && exit /B 1
22
+ fastboot %* flash tz %~dp0images\tz_debug.mbn || @echo "Flash tz error" && exit /B 1
23
+ fastboot %* flash tzbak %~dp0images\tz_debug.mbn || @echo "Flash tzbak error" && exit /B 1
24
+ fastboot %* flash hyp %~dp0images\hyp_debug.mbn || @echo "Flash hyp error" && exit /B 1
25
+ fastboot %* flash hypbak %~dp0images\hyp_debug.mbn || @echo "Flash hypbak error" && exit /B 1
26
+ fastboot %* flash devcfg %~dp0images\devcfg_debug.mbn || @echo "Flash devcfg error" && exit /B 1
27
+ fastboot %* flash devcfgbak %~dp0images\devcfg_debug.mbn || @echo "Flash devcfgbak error" && exit /B 1
28
+ fastboot %* flash storsec %~dp0images\storsec_debug.mbn || @echo "Flash storsec error" && exit /B 1
29
+ ::fastboot %* flash storsecbak %~dp0images\storsec.mbn || @echo "Flash storsecbak error" && exit /B 1
30
+ fastboot %* flash bluetooth %~dp0images\BTFM.bin || @echo "Flash bluetooth error" && exit /B 1
31
+ fastboot %* flash cmnlib %~dp0images\cmnlib_debug.mbn || @echo "Flash cmnlib error" && exit /B 1
32
+ fastboot %* flash cmnlibbak %~dp0images\cmnlib_debug.mbn || @echo "Flash cmnlibbak error" && exit /B 1
33
+ fastboot %* flash cmnlib64 %~dp0images\cmnlib64_debug.mbn || @echo "Flash cmnlib64 error" && exit /B 1
34
+ fastboot %* flash cmnlib64bak %~dp0images\cmnlib64_debug.mbn || @echo "Flash cmnlib64bak error" && exit /B 1
35
+ fastboot %* flash modem %~dp0images\NON-HLOS.bin || @echo "Flash modem error" && exit /B 1
36
+ fastboot %* flash dsp %~dp0images\dspso.bin || @echo "Flash dsp error" && exit /B 1
37
+ fastboot %* flash metadata %~dp0images\metadata.img || @echo "Flash metadata error" && exit /B 1
38
+ fastboot %* flash keymaster %~dp0images\km41_debug.mbn || @echo "Flash keymaster error" && exit /B 1
39
+ fastboot %* flash keymasterbak %~dp0images\km41_debug.mbn || @echo "Flash keymasterbak error" && exit /B 1
40
+ fastboot %* flash logo %~dp0images\logo.img || @echo "Flash logo error" && exit /B 1
41
+ ::fastboot %* flash splash %~dp0images\splash.img || @echo "Flash splash error" && exit /B 1
42
+ fastboot %* flash misc %~dp0images\misc.img || @echo "Flash misc error" && exit /B 1
43
+ fastboot %* flash aop %~dp0images\aop.mbn || @echo "Flash aop error" && exit /B 1
44
+ fastboot %* flash aopbak %~dp0images\aop.mbn || @echo "Flash aopbak error" && exit /B 1
45
+ fastboot %* flash qupfw %~dp0images\qupv3fw.elf || @echo "Flash qupfw error" && exit /B 1
46
+ fastboot %* flash qupfwbak %~dp0images\qupv3fw.elf || @echo "Flash qupfwbak error" && exit /B 1
47
+ fastboot %* flash imagefv %~dp0images\imagefv.elf || @echo "Flash imagefv error" && exit /B 1
48
+ fastboot %* flash uefisecapp %~dp0images\uefi_sec_debug.mbn || @echo "Flash uefisecapp error" && exit /B 1
49
+ fastboot %* flash uefisecappbak %~dp0images\uefi_sec_debug.mbn || @echo "Flash uefisecappbak error" && exit /B 1
50
+ fastboot %* flash multiimgoem %~dp0images\multi_image.mbn || @echo "Flash multiimgoem error" && exit /B 1
51
+ fastboot %* flash vbmeta %~dp0images\vbmeta.img || @echo "Flash vbmeta error" && exit /B 1
52
+ fastboot %* flash dtbo %~dp0images\dtbo.img || @echo "Flash dtbo error" && exit /B 1
53
+ fastboot %* flash super %~dp0images\super.img || @echo "Flash super error" && exit /B 1
54
+ fastboot %* flash vbmeta_system %~dp0images\vbmeta_system.img || @echo "Flash vbmeta_system error" && exit /B 1
55
+ fastboot %* flash cache %~dp0images\cache.img || @echo "Flash cache error" && exit /B 1
56
+ fastboot %* flash userdata %~dp0images\userdata.img || @echo "Flash userdata error" && exit /B 1
57
+ fastboot %* flash recovery %~dp0images\recovery.img || @echo "Flash recovery error" && exit /B 1
58
+ fastboot %* erase secdata || @echo "Erase secdata error" && exit /B 1
59
+ fastboot %* flash cust %~dp0images\cust.img || @echo "Flash cust error" && exit /B 1
60
+ fastboot %* flash boot %~dp0images\boot.img || @echo "Flash boot error" && exit /B 1
61
+ fastboot %* reboot || @echo "Reboot error" && exit /B 1
flash_all_except_storage.bat ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
2
+ if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
3
+
4
+ for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
5
+ if [%version%] EQU [] set version=0
6
+ set anticheck="antirollback check pass"
7
+ if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
8
+ echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
9
+
10
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || echo Missmatching image and device
11
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || exit /B 1
12
+
13
+ fastboot %* erase boot || @echo "Erase boot error" && exit /B 1
14
+ fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
15
+ fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
16
+ fastboot %* flash xbl %~dp0images\xbl.elf || @echo "Flash xbl error" && exit /B 1
17
+ fastboot %* flash xblbak %~dp0images\xbl.elf || @echo "Flash xblbak error" && exit /B 1
18
+ fastboot %* flash xbl_config %~dp0images\xbl_config.elf || @echo "Flash xbl_config error" && exit /B 1
19
+ fastboot %* flash xbl_configbak %~dp0images\xbl_config.elf || @echo "Flash xbl_configbak error" && exit /B 1
20
+ fastboot %* flash abl %~dp0images\abl.elf || @echo "Flash abl error" && exit /B 1
21
+ fastboot %* flash ablbak %~dp0images\abl.elf || @echo "Flash ablbak error" && exit /B 1
22
+ fastboot %* flash tz %~dp0images\tz.mbn || @echo "Flash tz error" && exit /B 1
23
+ fastboot %* flash tzbak %~dp0images\tz.mbn || @echo "Flash tzbak error" && exit /B 1
24
+ fastboot %* flash hyp %~dp0images\hyp.mbn || @echo "Flash hyp error" && exit /B 1
25
+ fastboot %* flash hypbak %~dp0images\hyp.mbn || @echo "Flash hypbak error" && exit /B 1
26
+ fastboot %* flash devcfg %~dp0images\devcfg.mbn || @echo "Flash devcfg error" && exit /B 1
27
+ fastboot %* flash devcfgbak %~dp0images\devcfg.mbn || @echo "Flash devcfgbak error" && exit /B 1
28
+ fastboot %* flash storsec %~dp0images\storsec.mbn || @echo "Flash storsec error" && exit /B 1
29
+ ::fastboot %* flash storsecbak %~dp0images\storsec.mbn || @echo "Flash storsecbak error" && exit /B 1
30
+ fastboot %* flash bluetooth %~dp0images\BTFM.bin || @echo "Flash bluetooth error" && exit /B 1
31
+ fastboot %* flash cmnlib %~dp0images\cmnlib.mbn || @echo "Flash cmnlib error" && exit /B 1
32
+ fastboot %* flash cmnlibbak %~dp0images\cmnlib.mbn || @echo "Flash cmnlibbak error" && exit /B 1
33
+ fastboot %* flash cmnlib64 %~dp0images\cmnlib64.mbn || @echo "Flash cmnlib64 error" && exit /B 1
34
+ fastboot %* flash cmnlib64bak %~dp0images\cmnlib64.mbn || @echo "Flash cmnlib64bak error" && exit /B 1
35
+ fastboot %* flash modem %~dp0images\NON-HLOS.bin || @echo "Flash modem error" && exit /B 1
36
+ fastboot %* flash dsp %~dp0images\dspso.bin || @echo "Flash dsp error" && exit /B 1
37
+ fastboot %* flash keymaster %~dp0images\km41.mbn || @echo "Flash keymaster error" && exit /B 1
38
+ fastboot %* flash keymasterbak %~dp0images\km41.mbn || @echo "Flash keymasterbak error" && exit /B 1
39
+ fastboot %* flash logo %~dp0images\logo.img || @echo "Flash logo error" && exit /B 1
40
+ ::fastboot %* flash splash %~dp0images\splash.img || @echo "Flash splash error" && exit /B 1
41
+ ::fastboot %* flash misc %~dp0images\misc.img || @echo "Flash misc error" && exit /B 1
42
+ fastboot %* flash aop %~dp0images\aop.mbn || @echo "Flash aop error" && exit /B 1
43
+ fastboot %* flash aopbak %~dp0images\aop.mbn || @echo "Flash aopbak error" && exit /B 1
44
+ fastboot %* flash qupfw %~dp0images\qupv3fw.elf || @echo "Flash qupfw error" && exit /B 1
45
+ fastboot %* flash qupfwbak %~dp0images\qupv3fw.elf || @echo "Flash qupfwbak error" && exit /B 1
46
+ fastboot %* flash imagefv %~dp0images\imagefv.elf || @echo "Flash imagefv error" && exit /B 1
47
+ fastboot %* flash uefisecapp %~dp0images\uefi_sec.mbn || @echo "Flash uefisecapp error" && exit /B 1
48
+ fastboot %* flash uefisecappbak %~dp0images\uefi_sec.mbn || @echo "Flash uefisecappbak error" && exit /B 1
49
+ fastboot %* flash multiimgoem %~dp0images\multi_image.mbn || @echo "Flash multiimgoem error" && exit /B 1
50
+ fastboot %* flash vbmeta %~dp0images\vbmeta.img || @echo "Flash vbmeta error" && exit /B 1
51
+ fastboot %* flash dtbo %~dp0images\dtbo.img || @echo "Flash dtbo error" && exit /B 1
52
+ fastboot %* flash super %~dp0images\super.img || @echo "Flash super error" && exit /B 1
53
+ fastboot %* flash vbmeta_system %~dp0images\vbmeta_system.img || @echo "Flash vbmeta_system error" && exit /B 1
54
+ fastboot %* flash cache %~dp0images\cache.img || @echo "Flash cache error" && exit /B 1
55
+ fastboot %* flash recovery %~dp0images\recovery.img || @echo "Flash recovery error" && exit /B 1
56
+ fastboot %* erase secdata || @echo "Erase secdata error" && exit /B 1
57
+ ::fastboot %* flash cust %~dp0images\cust.img || @echo "Flash cust error" && exit /B 1
58
+ fastboot %* flash boot %~dp0images\boot.img || @echo "Flash boot error" && exit /B 1
59
+ fastboot %* reboot || @echo "Reboot error" && exit /B 1
flash_all_except_storage.sh ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if [ -e $(dirname $0)/images/anti_version.txt ]; then
2
+ CURRENT_ANTI_VER=`cat $(dirname $0)/images/anti_version.txt`
3
+ fi
4
+
5
+ if [ -z "$CURRENT_ANTI_VER" ]; then CURRENT_ANTI_VER=0; fi
6
+ ver=`fastboot $* getvar anti 2>&1 | grep -oP "anti: \K[0-9]+"`
7
+ if [ -z "$ver" ]; then ver=0; fi
8
+ if [ $ver -gt $CURRENT_ANTI_VER ]; then echo "Current device antirollback version is greater than this pakcage"; exit 1; fi
9
+
10
+ fastboot $* getvar product 2>&1 | grep "^product: courbet*"
11
+ if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
12
+
13
+ fastboot $* erase boot
14
+ if [ $? -ne 0 ] ; then echo "Erase boot error"; exit 1; fi
15
+ fastboot $* flash crclist `dirname $0`/images/crclist.txt
16
+ if [ $? -ne 0 ] ; then echo "Flash crclist error"; exit 1; fi
17
+ fastboot $* flash sparsecrclist `dirname $0`/images/sparsecrclist.txt
18
+ if [ $? -ne 0 ] ; then echo "Flash sparsecrclist error"; exit 1; fi
19
+ fastboot $* flash xbl `dirname $0`/images/xbl.elf
20
+ if [ $? -ne 0 ] ; then echo "Flash xbl error"; exit 1; fi
21
+ fastboot $* flash xblbak `dirname $0`/images/xbl.elf
22
+ if [ $? -ne 0 ] ; then echo "Flash xblbak error"; exit 1; fi
23
+ fastboot $* flash xbl_config `dirname $0`/images/xbl_config.elf
24
+ if [ $? -ne 0 ] ; then echo "Flash xbl_config error"; exit 1; fi
25
+ fastboot $* flash xbl_configbak `dirname $0`/images/xbl_config.elf
26
+ if [ $? -ne 0 ] ; then echo "Flash xbl_configbak error"; exit 1; fi
27
+ fastboot $* flash abl `dirname $0`/images/abl.elf
28
+ if [ $? -ne 0 ] ; then echo "Flash abl error"; exit 1; fi
29
+ fastboot $* flash ablbak `dirname $0`/images/abl.elf
30
+ if [ $? -ne 0 ] ; then echo "Flash ablbak error"; exit 1; fi
31
+ fastboot $* flash tz `dirname $0`/images/tz.mbn
32
+ if [ $? -ne 0 ] ; then echo "Flash tz error"; exit 1; fi
33
+ fastboot $* flash tzbak `dirname $0`/images/tz.mbn
34
+ if [ $? -ne 0 ] ; then echo "Flash tzbak error"; exit 1; fi
35
+ fastboot $* flash hyp `dirname $0`/images/hyp.mbn
36
+ if [ $? -ne 0 ] ; then echo "Flash hyp error"; exit 1; fi
37
+ fastboot $* flash hypbak `dirname $0`/images/hyp.mbn
38
+ if [ $? -ne 0 ] ; then echo "Flash hypbak error"; exit 1; fi
39
+ fastboot $* flash devcfg `dirname $0`/images/devcfg.mbn
40
+ if [ $? -ne 0 ] ; then echo "Flash devcfg error"; exit 1; fi
41
+ fastboot $* flash devcfgbak `dirname $0`/images/devcfg.mbn
42
+ if [ $? -ne 0 ] ; then echo "Flash devcfgbak error"; exit 1; fi
43
+ fastboot $* flash storsec `dirname $0`/images/storsec.mbn
44
+ if [ $? -ne 0 ] ; then echo "Flash storsec error"; exit 1; fi
45
+ #fastboot $* flash storsecbak `dirname $0`/images/storsec.mbn
46
+ #if [ $? -ne 0 ] ; then echo "Flash storsecbak error"; exit 1; fi
47
+ fastboot $* flash bluetooth `dirname $0`/images/BTFM.bin
48
+ if [ $? -ne 0 ] ; then echo "Flash bluetooth error"; exit 1; fi
49
+ fastboot $* flash cmnlib `dirname $0`/images/cmnlib.mbn
50
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib error"; exit 1; fi
51
+ fastboot $* flash cmnlibbak `dirname $0`/images/cmnlib.mbn
52
+ if [ $? -ne 0 ] ; then echo "Flash cmnlibbak error"; exit 1; fi
53
+ fastboot $* flash cmnlib64 `dirname $0`/images/cmnlib64.mbn
54
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib64 error"; exit 1; fi
55
+ fastboot $* flash cmnlib64bak `dirname $0`/images/cmnlib64.mbn
56
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib64bak error"; exit 1; fi
57
+ fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
58
+ if [ $? -ne 0 ] ; then echo "Flash modem error"; exit 1; fi
59
+ fastboot $* flash dsp `dirname $0`/images/dspso.bin
60
+ if [ $? -ne 0 ] ; then echo "Flash dsp error"; exit 1; fi
61
+ fastboot $* flash keymaster `dirname $0`/images/km41.mbn
62
+ if [ $? -ne 0 ] ; then echo "Flash keymaster error"; exit 1; fi
63
+ fastboot $* flash keymasterbak `dirname $0`/images/km41.mbn
64
+ if [ $? -ne 0 ] ; then echo "Flash keymaster error"; exit 1; fi
65
+ fastboot $* flash logo `dirname $0`/images/logo.img
66
+ if [ $? -ne 0 ] ; then echo "Flash logo error"; exit 1; fi
67
+ #fastboot $* flash splash `dirname $0`/images/splash.img
68
+ #if [ $? -ne 0 ] ; then echo "Flash splash error"; exit 1; fi
69
+ #fastboot $* flash misc `dirname $0`/images/misc.img
70
+ #if [ $? -ne 0 ] ; then echo "Flash misc error"; exit 1; fi
71
+ fastboot $* flash aop `dirname $0`/images/aop.mbn
72
+ if [ $? -ne 0 ] ; then echo "Flash aop error"; exit 1; fi
73
+ fastboot $* flash aopbak `dirname $0`/images/aop.mbn
74
+ if [ $? -ne 0 ] ; then echo "Flash aopbak error"; exit 1; fi
75
+ fastboot $* flash qupfw `dirname $0`/images/qupv3fw.elf
76
+ if [ $? -ne 0 ] ; then echo "Flash qupfw error"; exit 1; fi
77
+ fastboot $* flash qupfwbak `dirname $0`/images/qupv3fw.elf
78
+ if [ $? -ne 0 ] ; then echo "Flash qupfwbak error"; exit 1; fi
79
+ fastboot $* flash imagefv `dirname $0`/images/imagefv.elf
80
+ if [ $? -ne 0 ] ; then echo "Flash imagefv error"; exit 1; fi
81
+ fastboot $* flash uefisecapp `dirname $0`/images/uefi_sec.mbn
82
+ if [ $? -ne 0 ] ; then echo "Flash uefisecapp error"; exit 1; fi
83
+ fastboot $* flash uefisecappbak `dirname $0`/images/uefi_sec.mbn
84
+ if [ $? -ne 0 ] ; then echo "Flash uefisecappbak error"; exit 1; fi
85
+ fastboot $* flash multiimgoem `dirname $0`/images/multi_image.mbn
86
+ if [ $? -ne 0 ] ; then echo "Flash multiimgoem error"; exit 1; fi
87
+ fastboot $* flash vbmeta `dirname $0`/images/vbmeta.img
88
+ if [ $? -ne 0 ] ; then echo "Flash vbmeta error"; exit 1; fi
89
+ fastboot $* flash dtbo `dirname $0`/images/dtbo.img
90
+ if [ $? -ne 0 ] ; then echo "Flash dtbo error"; exit 1; fi
91
+ fastboot $* flash super `dirname $0`/images/super.img
92
+ if [ $? -ne 0 ] ; then echo "Flash super error"; exit 1; fi
93
+ fastboot $* flash vbmeta_system `dirname $0`/images/vbmeta_system.img
94
+ if [ $? -ne 0 ] ; then echo "Flash vbmeta_system error"; exit 1; fi
95
+ fastboot $* flash cache `dirname $0`/images/cache.img
96
+ if [ $? -ne 0 ] ; then echo "Flash cache error"; exit 1; fi
97
+ fastboot $* flash recovery `dirname $0`/images/recovery.img
98
+ if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
99
+ fastboot $* erase secdata
100
+ if [ $? -ne 0 ] ; then echo "Erase secdata error"; exit 1; fi
101
+ #fastboot $* flash cust `dirname $0`/images/cust.img
102
+ #if [ $? -ne 0 ] ; then echo "Flash cust error"; exit 1; fi
103
+ fastboot $* flash boot `dirname $0`/images/boot.img
104
+ if [ $? -ne 0 ] ; then echo "Flash boot error"; exit 1; fi
105
+ fastboot $* reboot
106
+ if [ $? -ne 0 ] ; then echo "Reboot error"; exit 1; fi
flash_all_lock.bat ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
2
+ if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
3
+ for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
4
+ if [%version%] EQU [] set version=0
5
+ set anticheck="antirollback check pass"
6
+ if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
7
+ echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
8
+
9
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || echo Missmatching image and device
10
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || exit /B 1
11
+
12
+ fastboot %* erase boot || @echo "Erase boot error" && exit /B 1
13
+ fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
14
+ fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
15
+ fastboot %* flash xbl %~dp0images\xbl.elf || @echo "Flash xbl error" && exit /B 1
16
+ fastboot %* flash xblbak %~dp0images\xbl.elf || @echo "Flash xblbak error" && exit /B 1
17
+ fastboot %* flash xbl_config %~dp0images\xbl_config.elf || @echo "Flash xbl_config error" && exit /B 1
18
+ fastboot %* flash xbl_configbak %~dp0images\xbl_config.elf || @echo "Flash xbl_configbak error" && exit /B 1
19
+ fastboot %* flash abl %~dp0images\abl.elf || @echo "Flash abl error" && exit /B 1
20
+ fastboot %* flash ablbak %~dp0images\abl.elf || @echo "Flash ablbak error" && exit /B 1
21
+ fastboot %* flash tz %~dp0images\tz.mbn || @echo "Flash tz error" && exit /B 1
22
+ fastboot %* flash tzbak %~dp0images\tz.mbn || @echo "Flash tzbak error" && exit /B 1
23
+ fastboot %* flash hyp %~dp0images\hyp.mbn || @echo "Flash hyp error" && exit /B 1
24
+ fastboot %* flash hypbak %~dp0images\hyp.mbn || @echo "Flash hypbak error" && exit /B 1
25
+ fastboot %* flash devcfg %~dp0images\devcfg.mbn || @echo "Flash devcfg error" && exit /B 1
26
+ fastboot %* flash devcfgbak %~dp0images\devcfg.mbn || @echo "Flash devcfgbak error" && exit /B 1
27
+ fastboot %* flash storsec %~dp0images\storsec.mbn || @echo "Flash storsec error" && exit /B 1
28
+ ::fastboot %* flash storsecbak %~dp0images\storsec.mbn || @echo "Flash storsecbak error" && exit /B 1
29
+ fastboot %* flash bluetooth %~dp0images\BTFM.bin || @echo "Flash bluetooth error" && exit /B 1
30
+ fastboot %* flash cmnlib %~dp0images\cmnlib.mbn || @echo "Flash cmnlib error" && exit /B 1
31
+ fastboot %* flash cmnlibbak %~dp0images\cmnlib.mbn || @echo "Flash cmnlibbak error" && exit /B 1
32
+ fastboot %* flash cmnlib64 %~dp0images\cmnlib64.mbn || @echo "Flash cmnlib64 error" && exit /B 1
33
+ fastboot %* flash cmnlib64bak %~dp0images\cmnlib64.mbn || @echo "Flash cmnlib64bak error" && exit /B 1
34
+ fastboot %* flash modem %~dp0images\NON-HLOS.bin || @echo "Flash modem error" && exit /B 1
35
+ fastboot %* flash dsp %~dp0images\dspso.bin || @echo "Flash dsp error" && exit /B 1
36
+ fastboot %* erase metadata || @echo "Erase metadata error" && exit 1
37
+ fastboot %* flash metadata %~dp0images\metadata.img || @echo "Flash metadata error" && exit /B 1
38
+ fastboot %* flash keymaster %~dp0images\km41.mbn || @echo "Flash keymaster error" && exit /B 1
39
+ fastboot %* flash keymasterbak %~dp0images\km41.mbn || @echo "Flash keymasterbak error" && exit /B 1
40
+ fastboot %* flash logo %~dp0images\logo.img || @echo "Flash logo error" && exit /B 1
41
+ ::fastboot %* flash splash %~dp0images\splash.img || @echo "Flash splash error" && exit /B 1
42
+ ::fastboot %* flash misc %~dp0images\misc.img || @echo "Flash misc error" && exit /B 1
43
+ fastboot %* flash aop %~dp0images\aop.mbn || @echo "Flash aop error" && exit /B 1
44
+ fastboot %* flash aopbak %~dp0images\aop.mbn || @echo "Flash aopbak error" && exit /B 1
45
+ fastboot %* flash qupfw %~dp0images\qupv3fw.elf || @echo "Flash qupfw error" && exit /B 1
46
+ fastboot %* flash qupfwbak %~dp0images\qupv3fw.elf || @echo "Flash qupfwbak error" && exit /B 1
47
+ fastboot %* flash imagefv %~dp0images\imagefv.elf || @echo "Flash imagefv error" && exit /B 1
48
+ fastboot %* flash uefisecapp %~dp0images\uefi_sec.mbn || @echo "Flash uefisecapp error" && exit /B 1
49
+ fastboot %* flash uefisecappbak %~dp0images\uefi_sec.mbn || @echo "Flash uefisecappbak error" && exit /B 1
50
+ fastboot %* flash multiimgoem %~dp0images\multi_image.mbn || @echo "Flash multiimgoem error" && exit /B 1
51
+ fastboot %* flash vbmeta %~dp0images\vbmeta.img || @echo "Flash vbmeta error" && exit /B 1
52
+ fastboot %* flash dtbo %~dp0images\dtbo.img || @echo "Flash dtbo error" && exit /B 1
53
+ fastboot %* flash super %~dp0images\super.img || @echo "Flash super error" && exit /B 1
54
+ fastboot %* flash vbmeta_system %~dp0images\vbmeta_system.img || @echo "Flash vbmeta_system error" && exit /B 1
55
+ fastboot %* flash cache %~dp0images\cache.img || @echo "Flash cache error" && exit /B 1
56
+ fastboot %* flash userdata %~dp0images\userdata.img || @echo "Flash userdata error" && exit /B 1
57
+ fastboot %* flash recovery %~dp0images\recovery.img || @echo "Flash recovery error" && exit /B 1
58
+ fastboot %* erase secdata || @echo "Erase secdata error" && exit /B 1
59
+ fastboot %* flash cust %~dp0images\cust.img || @echo "Flash cust error" && exit /B 1
60
+ fastboot %* flash boot %~dp0images\boot.img || @echo "Flash boot error" && exit /B 1
61
+ fastboot %* oem lock || @echo "Oem lock error" && exit /B 1
flash_all_lock.sh ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if [ -e $(dirname $0)/images/anti_version.txt ]; then
2
+ CURRENT_ANTI_VER=`cat $(dirname $0)/images/anti_version.txt`
3
+ fi
4
+
5
+ if [ -z "$CURRENT_ANTI_VER" ]; then CURRENT_ANTI_VER=0; fi
6
+ ver=`fastboot $* getvar anti 2>&1 | grep -oP "anti: \K[0-9]+"`
7
+ if [ -z "$ver" ]; then ver=0; fi
8
+ if [ $ver -gt $CURRENT_ANTI_VER ]; then echo "Current device antirollback version is greater than this pakcage"; exit 1; fi
9
+
10
+ fastboot $* getvar product 2>&1 | grep "^product: courbet*"
11
+ if [ $? -ne 0 ] ; then echo "Missmatching image and device"; exit 1; fi
12
+
13
+ fastboot $* erase boot
14
+ if [ $? -ne 0 ] ; then echo "Erase boot error"; exit 1; fi
15
+ fastboot $* flash crclist `dirname $0`/images/crclist.txt
16
+ if [ $? -ne 0 ] ; then echo "Flash crclist error"; exit 1; fi
17
+ fastboot $* flash sparsecrclist `dirname $0`/images/sparsecrclist.txt
18
+ if [ $? -ne 0 ] ; then echo "Flash sparsecrclist error"; exit 1; fi
19
+ fastboot $* flash xbl `dirname $0`/images/xbl.elf
20
+ if [ $? -ne 0 ] ; then echo "Flash xbl error"; exit 1; fi
21
+ fastboot $* flash xblbak `dirname $0`/images/xbl.elf
22
+ if [ $? -ne 0 ] ; then echo "Flash xblbak error"; exit 1; fi
23
+ fastboot $* flash xbl_config `dirname $0`/images/xbl_config.elf
24
+ if [ $? -ne 0 ] ; then echo "Flash xbl_config error"; exit 1; fi
25
+ fastboot $* flash xbl_configbak `dirname $0`/images/xbl_config.elf
26
+ if [ $? -ne 0 ] ; then echo "Flash xbl_configbak error"; exit 1; fi
27
+ fastboot $* flash abl `dirname $0`/images/abl.elf
28
+ if [ $? -ne 0 ] ; then echo "Flash abl error"; exit 1; fi
29
+ fastboot $* flash ablbak `dirname $0`/images/abl.elf
30
+ if [ $? -ne 0 ] ; then echo "Flash ablbak error"; exit 1; fi
31
+ fastboot $* flash tz `dirname $0`/images/tz.mbn
32
+ if [ $? -ne 0 ] ; then echo "Flash tz error"; exit 1; fi
33
+ fastboot $* flash tzbak `dirname $0`/images/tz.mbn
34
+ if [ $? -ne 0 ] ; then echo "Flash tzbak error"; exit 1; fi
35
+ fastboot $* flash hyp `dirname $0`/images/hyp.mbn
36
+ if [ $? -ne 0 ] ; then echo "Flash hyp error"; exit 1; fi
37
+ fastboot $* flash hypbak `dirname $0`/images/hyp.mbn
38
+ if [ $? -ne 0 ] ; then echo "Flash hypbak error"; exit 1; fi
39
+ fastboot $* flash devcfg `dirname $0`/images/devcfg.mbn
40
+ if [ $? -ne 0 ] ; then echo "Flash devcfg error"; exit 1; fi
41
+ fastboot $* flash devcfgbak `dirname $0`/images/devcfg.mbn
42
+ if [ $? -ne 0 ] ; then echo "Flash devcfgbak error"; exit 1; fi
43
+ fastboot $* flash storsec `dirname $0`/images/storsec.mbn
44
+ if [ $? -ne 0 ] ; then echo "Flash storsec error"; exit 1; fi
45
+ #fastboot $* flash storsecbak `dirname $0`/images/storsec.mbn
46
+ #if [ $? -ne 0 ] ; then echo "Flash storsecbak error"; exit 1; fi
47
+ fastboot $* flash bluetooth `dirname $0`/images/BTFM.bin
48
+ if [ $? -ne 0 ] ; then echo "Flash bluetooth error"; exit 1; fi
49
+ fastboot $* flash cmnlib `dirname $0`/images/cmnlib.mbn
50
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib error"; exit 1; fi
51
+ fastboot $* flash cmnlibbak `dirname $0`/images/cmnlib.mbn
52
+ if [ $? -ne 0 ] ; then echo "Flash cmnlibbak error"; exit 1; fi
53
+ fastboot $* flash cmnlib64 `dirname $0`/images/cmnlib64.mbn
54
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib64 error"; exit 1; fi
55
+ fastboot $* flash cmnlib64bak `dirname $0`/images/cmnlib64.mbn
56
+ if [ $? -ne 0 ] ; then echo "Flash cmnlib64bak error"; exit 1; fi
57
+ fastboot $* flash modem `dirname $0`/images/NON-HLOS.bin
58
+ if [ $? -ne 0 ] ; then echo "Flash modem error"; exit 1; fi
59
+ fastboot $* flash dsp `dirname $0`/images/dspso.bin
60
+ if [ $? -ne 0 ] ; then echo "Flash dsp error"; exit 1; fi
61
+ fastboot $* erase metadata
62
+ if [ $? -ne 0 ] ; then echo "Erase metadata error"; exit 1; fi
63
+ fastboot $* flash metadata `dirname $0`/images/metadata.img
64
+ if [ $? -ne 0 ] ; then echo "Flash metadata error"; exit 1; fi
65
+ fastboot $* flash keymaster `dirname $0`/images/km41.mbn
66
+ if [ $? -ne 0 ] ; then echo "Flash keymaster error"; exit 1; fi
67
+ fastboot $* flash keymasterbak `dirname $0`/images/km41.mbn
68
+ if [ $? -ne 0 ] ; then echo "Flash keymaster error"; exit 1; fi
69
+ fastboot $* flash logo `dirname $0`/images/logo.img
70
+ if [ $? -ne 0 ] ; then echo "Flash logo error"; exit 1; fi
71
+ #fastboot $* flash splash `dirname $0`/images/splash.img
72
+ #if [ $? -ne 0 ] ; then echo "Flash splash error"; exit 1; fi
73
+ #fastboot $* flash misc `dirname $0`/images/misc.img
74
+ #if [ $? -ne 0 ] ; then echo "Flash misc error"; exit 1; fi
75
+ fastboot $* flash aop `dirname $0`/images/aop.mbn
76
+ if [ $? -ne 0 ] ; then echo "Flash aop error"; exit 1; fi
77
+ fastboot $* flash aopbak `dirname $0`/images/aop.mbn
78
+ if [ $? -ne 0 ] ; then echo "Flash aopbak error"; exit 1; fi
79
+ fastboot $* flash qupfw `dirname $0`/images/qupv3fw.elf
80
+ if [ $? -ne 0 ] ; then echo "Flash qupfw error"; exit 1; fi
81
+ fastboot $* flash qupfwbak `dirname $0`/images/qupv3fw.elf
82
+ if [ $? -ne 0 ] ; then echo "Flash qupfwbak error"; exit 1; fi
83
+ fastboot $* flash imagefv `dirname $0`/images/imagefv.elf
84
+ if [ $? -ne 0 ] ; then echo "Flash imagefv error"; exit 1; fi
85
+ fastboot $* flash uefisecapp `dirname $0`/images/uefi_sec.mbn
86
+ if [ $? -ne 0 ] ; then echo "Flash uefisecapp error"; exit 1; fi
87
+ fastboot $* flash uefisecappbak `dirname $0`/images/uefi_sec.mbn
88
+ if [ $? -ne 0 ] ; then echo "Flash uefisecappbak error"; exit 1; fi
89
+ fastboot $* flash multiimgoem `dirname $0`/images/multi_image.mbn
90
+ if [ $? -ne 0 ] ; then echo "Flash multiimgoem error"; exit 1; fi
91
+ fastboot $* flash vbmeta `dirname $0`/images/vbmeta.img
92
+ if [ $? -ne 0 ] ; then echo "Flash vbmeta error"; exit 1; fi
93
+ fastboot $* flash dtbo `dirname $0`/images/dtbo.img
94
+ if [ $? -ne 0 ] ; then echo "Flash dtbo error"; exit 1; fi
95
+ fastboot $* flash super `dirname $0`/images/super.img
96
+ if [ $? -ne 0 ] ; then echo "Flash super error"; exit 1; fi
97
+ fastboot $* flash vbmeta_system `dirname $0`/images/vbmeta_system.img
98
+ if [ $? -ne 0 ] ; then echo "Flash vbmeta_system error"; exit 1; fi
99
+ fastboot $* flash cache `dirname $0`/images/cache.img
100
+ if [ $? -ne 0 ] ; then echo "Flash cache error"; exit 1; fi
101
+ fastboot $* flash userdata `dirname $0`/images/userdata.img
102
+ if [ $? -ne 0 ] ; then echo "Flash userdata error"; exit 1; fi
103
+ fastboot $* flash recovery `dirname $0`/images/recovery.img
104
+ if [ $? -ne 0 ] ; then echo "Flash recovery error"; exit 1; fi
105
+ fastboot $* erase secdata
106
+ if [ $? -ne 0 ] ; then echo "Erase secdata error"; exit 1; fi
107
+ fastboot $* flash cust `dirname $0`/images/cust.img
108
+ if [ $? -ne 0 ] ; then echo "Flash cust error"; exit 1; fi
109
+ fastboot $* flash boot `dirname $0`/images/boot.img
110
+ if [ $? -ne 0 ] ; then echo "Flash boot error"; exit 1; fi
111
+ fastboot $* oem lock
112
+ if [ $? -ne 0 ] ; then echo "Oem lock error"; exit 1; fi
flash_debug_only.bat ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if exist %~dp0images\anti_version.txt (for /f "delims==" %%a in (%~dp0images\anti_version.txt) do (set CURRENT_ANTI_VER=%%a))
2
+ if [%CURRENT_ANTI_VER%] EQU [] set CURRENT_ANTI_VER=0
3
+
4
+ for /f "tokens=2 delims=: " %%i in ('fastboot %* getvar anti 2^>^&1 ^| findstr /r /c:"anti:"') do (set version=%%i)
5
+ if [%version%] EQU [] set version=0
6
+ set anticheck="antirollback check pass"
7
+ if %version% GTR %CURRENT_ANTI_VER% set anticheck="Current device antirollback version is greater than this pakcage"
8
+ echo %anticheck% | findstr /r /c:"pass" || @echo "Antirollback check error" && exit /B 1
9
+
10
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || echo Missmatching image and device
11
+ fastboot %* getvar product 2>&1 | findstr /r /c:"^product: courbet*" || exit /B 1
12
+
13
+ ::fastboot %* erase boot || @echo "Erase boot error" && exit /B 1
14
+ ::fastboot %* flash crclist %~dp0images\crclist.txt || @echo "Flash crclist error" && exit /B 1
15
+ ::fastboot %* flash sparsecrclist %~dp0images\sparsecrclist.txt || @echo "Flash sparsecrclist error" && exit /B 1
16
+ fastboot %* flash xbl %~dp0images\xbl_debug.elf || @echo "Flash xbl error" && exit /B 1
17
+ fastboot %* flash xblbak %~dp0images\xbl_debug.elf || @echo "Flash xblbak error" && exit /B 1
18
+ fastboot %* flash xbl_config %~dp0images\xbl_config_debug.elf || @echo "Flash xbl_config error" && exit /B 1
19
+ fastboot %* flash xbl_configbak %~dp0images\xbl_config_debug.elf || @echo "Flash xbl_configbak error" && exit /B 1
20
+ fastboot %* flash tz %~dp0images\tz_debug.mbn || @echo "Flash tz error" && exit /B 1
21
+ fastboot %* flash tzbak %~dp0images\tz_debug.mbn || @echo "Flash tzbak error" && exit /B 1
22
+ fastboot %* flash hyp %~dp0images\hyp_debug.mbn || @echo "Flash hyp error" && exit /B 1
23
+ fastboot %* flash hypbak %~dp0images\hyp_debug.mbn || @echo "Flash hypbak error" && exit /B 1
24
+ fastboot %* flash devcfg %~dp0images\devcfg_debug.mbn || @echo "Flash devcfg error" && exit /B 1
25
+ fastboot %* flash devcfgbak %~dp0images\devcfg_debug.mbn || @echo "Flash devcfgbak error" && exit /B 1
26
+ fastboot %* flash storsec %~dp0images\storsec_debug.mbn || @echo "Flash storsec error" && exit /B 1
27
+ ::fastboot %* flash storsecbak %~dp0images\storsec.mbn || @echo "Flash storsecbak error" && exit /B 1
28
+ fastboot %* flash cmnlib %~dp0images\cmnlib_debug.mbn || @echo "Flash cmnlib error" && exit /B 1
29
+ fastboot %* flash cmnlibbak %~dp0images\cmnlib_debug.mbn || @echo "Flash cmnlibbak error" && exit /B 1
30
+ fastboot %* flash cmnlib64 %~dp0images\cmnlib64_debug.mbn || @echo "Flash cmnlib64 error" && exit /B 1
31
+ fastboot %* flash cmnlib64bak %~dp0images\cmnlib64_debug.mbn || @echo "Flash cmnlib64bak error" && exit /B 1
32
+ fastboot %* flash keymaster %~dp0images\km41_debug.mbn || @echo "Flash keymaster error" && exit /B 1
33
+ fastboot %* flash keymasterbak %~dp0images\km41_debug.mbn || @echo "Flash keymasterbak error" && exit /B 1
34
+ ::fastboot %* flash splash %~dp0images\splash.img || @echo "Flash splash error" && exit /B 1
35
+ fastboot %* flash uefisecapp %~dp0images\uefi_sec_debug.mbn || @echo "Flash uefisecapp error" && exit /B 1
36
+ fastboot %* flash uefisecappbak %~dp0images\uefi_sec_debug.mbn || @echo "Flash uefisecappbak error" && exit /B 1
37
+ fastboot %* reboot || @echo "Reboot error" && exit /B 1
flash_gen_crc_list.py ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ from __future__ import print_function
3
+ import getopt, posixpath, signal, struct, sys
4
+ import os
5
+ import binascii
6
+
7
+ sparse_file_list = {
8
+ "metadata" : "metadata.img",
9
+ "cache" : "cache.img",
10
+ "cust" : "cust.img",
11
+ "super" : "super.img",
12
+ "userdata" : "userdata.img",
13
+ }
14
+
15
+ unsparse_file_list = {
16
+ "xbl":"xbl.elf",
17
+ "xblbak":"xbl.elf",
18
+ "xbl_config":"xbl_config.elf",
19
+ "xbl_configbak":"xbl_config.elf",
20
+ "abl":"abl.elf",
21
+ "ablbak":"abl.elf",
22
+ "tz":"tz.mbn",
23
+ "tzbak":"tz.mbn",
24
+ "hyp":"hyp.mbn",
25
+ "hypbak":"hyp.mbn",
26
+ "devcfg":"devcfg.mbn",
27
+ "devcfgbak":"devcfg.mbn",
28
+ "storsec":"storsec.mbn",
29
+ "bluetooth":"BTFM.bin",
30
+ "cmnlib":"cmnlib.mbn",
31
+ "cmnlibbak":"cmnlib.mbn",
32
+ "cmnlib64":"cmnlib64.mbn",
33
+ "cmnlib64bak":"cmnlib64.mbn",
34
+ "logfs":"logfs_ufs_8mb.bin",
35
+ "modem":"NON-HLOS.bin",
36
+ "dsp":"dspso.bin",
37
+ "keymaster":"km41.mbn",
38
+ "keymasterbak":"km41.mbn",
39
+ "aop":"aop.mbn",
40
+ "aopbak":"aop.mbn",
41
+ "qupfw":"qupv3fw.elf",
42
+ "qupfwbak":"qupv3fw.elf",
43
+ "imagefv":"imagefv.elf",
44
+ "imagefvbak":"imagefv.elf",
45
+ "uefisecapp":"uefi_sec.mbn",
46
+ "uefisecappbak":"uefi_sec.mbn",
47
+ "multiimgoem":"multi_image.mbn",
48
+ "logo":"logo.img",
49
+ "misc":"misc.img",
50
+ "recovery":"recovery.img",
51
+ "boot":"boot.img",
52
+ "vbmeta_system":"vbmeta_system.img",
53
+ "vbmeta":"vbmeta.img",
54
+ "dtbo":"dtbo.img",
55
+ "persist":"persist.img",
56
+ "persistbak":"persist.img",
57
+ "bluetooth":"BTFM.bin",
58
+ }
59
+
60
+ MAX_DOWNLOAD_SIZE = 768*1024*1024;
61
+ MAX_SPARSE_PARTS = 20;
62
+
63
+ SPARSE_IMAGE_HEAD_SZ = 28;
64
+ SPARSE_CHUNK_HEAD_SZ = 12;
65
+ SPARSE_OVER_HEAD_SZ = SPARSE_IMAGE_HEAD_SZ + 2*SPARSE_CHUNK_HEAD_SZ + 4
66
+
67
+ file_list=dict(unsparse_file_list,**sparse_file_list)
68
+
69
+ class SparseChunk:
70
+ def __init__(self):
71
+ self.type = 0
72
+ self.size = 0
73
+ self.total_sz = 0
74
+ self.data_sz = 0
75
+ self.bksz = 0
76
+ self.data = []
77
+
78
+ def split_sparse_chunk(backed_sz,bck,sck):
79
+ split_max_len = MAX_DOWNLOAD_SIZE - SPARSE_OVER_HEAD_SZ
80
+ backed_real_sz = backed_sz - SPARSE_CHUNK_HEAD_SZ - 4
81
+
82
+ if backed_real_sz + bck.data_sz <= split_max_len:
83
+ return 0
84
+ elif split_max_len - backed_real_sz <= split_max_len / 8:
85
+ return 0
86
+ else:
87
+ split_sz = bck.bksz * ((split_max_len - backed_real_sz) / bck.bksz)
88
+
89
+ sck.type = bck.type
90
+ sck.size = bck.size
91
+ sck.bksz = bck.bksz
92
+
93
+ sck.data_sz = bck.data_sz - split_sz
94
+ sck.total_sz = sck.data_sz + SPARSE_CHUNK_HEAD_SZ
95
+ sck.data = bck.data[split_sz:]
96
+ sck.size = sck.total_sz / sck.bksz
97
+
98
+ bck.data_sz = split_sz
99
+ bck.total_sz = bck.data_sz + SPARSE_CHUNK_HEAD_SZ
100
+ bck.data = bck.data[:bck.data_sz]
101
+ bck.size = bck.total_sz / bck.bksz
102
+ return 1
103
+
104
+ def check_resparse_point(backedsize,chunk):
105
+ next_sz = chunk.total_sz
106
+ if backedsize[0] + next_sz > MAX_DOWNLOAD_SIZE - 2*SPARSE_CHUNK_HEAD_SZ:
107
+ backedsize[0] = next_sz + SPARSE_IMAGE_HEAD_SZ + SPARSE_CHUNK_HEAD_SZ
108
+ result = 1
109
+ else:
110
+ backedsize[0] += next_sz
111
+ result = 0
112
+ return result
113
+
114
+ def read_chunk_from_file(FH,blk_sz):
115
+ chunk = SparseChunk()
116
+ header_bin = FH.read(12)
117
+ header = struct.unpack("<2H2I", header_bin)
118
+ chunk.type = header[0]
119
+ reserved1 = header[1]
120
+ chunk.size = header[2]
121
+ chunk.total_sz = header[3]
122
+ chunk.bksz = blk_sz
123
+ chunk.data_sz = chunk.total_sz - SPARSE_CHUNK_HEAD_SZ
124
+ if chunk.type == 0xCAC1:
125
+ if chunk.data_sz != (chunk.size * blk_sz):
126
+ raise Exception(" Raw chunk input size (%u) does not match output size (%u)!!!"
127
+ % (chunk.data_sz, chunk.size * blk_sz))
128
+ else:
129
+ chunk.data = FH.read(chunk.data_sz)
130
+ elif chunk.type == 0xCAC2:
131
+ if chunk.data_sz != 4:
132
+ raise Exception("Fill chunk should have 4 bytes of fill, but this has %u!!!"
133
+ % (chunk.data_sz), end="")
134
+ else:
135
+ chunk.data = FH.read(4)
136
+ elif chunk.type == 0xCAC3:
137
+ if chunk.data_sz != 0:
138
+ print("Don't care chunk input size is non-zero (%u)" % (chunk.data_sz))
139
+ elif chunk.type == 0xCAC4:
140
+ if chunk.data_sz != 4:
141
+ raise Exception("CRC32 chunk should have 4 bytes of CRC, but this has %u!!!"
142
+ % (chunk.data_sz), end="")
143
+ else:
144
+ chunk.data = FH.read(4)
145
+ crc = struct.unpack("<I",chunk.data)
146
+ print("Unverified CRC32 0x%08X" % (crc))
147
+ else:
148
+ raise Exception("Unknown chunk type 0x%04X!!!" % (chunk.type), end="")
149
+ return chunk
150
+
151
+ def calulate_sparse_chunk_crc(chunk,crc):
152
+ if chunk.type == 0xCAC1:
153
+ crc = binascii.crc32(chunk.data,crc)
154
+ elif chunk.type == 0xCAC2:
155
+ fill_buf = chunk.data*(chunk.bksz/chunk.data_sz)
156
+ for j in xrange(1,chunk.size+1):
157
+ crc = binascii.crc32(fill_buf,crc)
158
+ return crc
159
+
160
+ def gen_sparse_crc(path):
161
+ sparse_parts = 0
162
+ crc_result_list = [0 for i in range(MAX_SPARSE_PARTS)]
163
+ backedsize = [SPARSE_IMAGE_HEAD_SZ]
164
+
165
+ FH = open(path, 'rb')
166
+ header_bin = FH.read(SPARSE_IMAGE_HEAD_SZ)
167
+ header = struct.unpack("<I4H4I", header_bin)
168
+
169
+ magic = header[0]
170
+ major_version = header[1]
171
+ minor_version = header[2]
172
+ file_hdr_sz = header[3]
173
+ chunk_hdr_sz = header[4]
174
+ blk_sz = header[5]
175
+ total_blks = header[6]
176
+ total_chunks = header[7]
177
+ image_checksum = header[8]
178
+
179
+
180
+ if magic != 0xED26FF3A:
181
+ raise Exception("%s: Magic should be 0xED26FF3A but is 0x%08X"
182
+ % (path, magic))
183
+ if major_version != 1 or minor_version != 0:
184
+ raise Exception("%s: I only know about version 1.0, but this is version %u.%u"
185
+ % (path, major_version, minor_version))
186
+ if file_hdr_sz != 28:
187
+ raise Exception("%s: The file header size was expected to be 28, but is %u."
188
+ % (path, file_hdr_sz))
189
+ if chunk_hdr_sz != 12:
190
+ raise Exception("%s: The chunk header size was expected to be 12, but is %u."
191
+ % (path, chunk_hdr_sz))
192
+
193
+ print("%s: Total of %u %u-byte output blocks in %u input chunks."
194
+ % (path, total_blks, blk_sz, total_chunks))
195
+
196
+ if image_checksum != 0:
197
+ print("checksum=0x%08X" % (image_checksum))
198
+
199
+ offset = 0
200
+
201
+ for i in xrange(1,total_chunks+1):
202
+ rchunk = read_chunk_from_file(FH,blk_sz)
203
+ split_flag = 1
204
+ sck = SparseChunk()
205
+ while(split_flag == 1):
206
+ split_flag = split_sparse_chunk(backedsize[0],rchunk,sck)
207
+ sparse_parts += check_resparse_point(backedsize,rchunk)
208
+ crc_result_list[sparse_parts] = calulate_sparse_chunk_crc(rchunk,crc_result_list[sparse_parts])
209
+ rchunk = sck
210
+ return sparse_parts + 1, crc_result_list
211
+
212
+ def gen_crc(file_path):
213
+ f = open(file_path, "rb")
214
+ crc = binascii.crc32(f.read())
215
+ return crc
216
+
217
+ def get_sparse_count(cmd):
218
+ line = os.popen(cmd, 'r').readline()
219
+ if line[0]=='I' or line[0]=='i':
220
+ return -1;
221
+ return int(line)
222
+
223
+ #------------------------------------------------------------------------------
224
+ if __name__ == "__main__":
225
+ thispath = os.path.dirname(__file__)
226
+ path = os.path.join(thispath, 'images')
227
+ crclist = os.path.join(path, 'crclist.txt')
228
+ sparsecrclist = os.path.join(path, 'sparsecrclist.txt')
229
+ crc = 0
230
+ try:
231
+ fs = open(sparsecrclist, 'w')
232
+ f = open(crclist, 'w')
233
+ fs.write("SPARSECRC-LIST\n")
234
+ f.write("CRC-LIST\n")
235
+ for ptn in file_list:
236
+ filepath = os.path.join(path, file_list[ptn])
237
+ print(filepath)
238
+ if not os.path.isfile(filepath):
239
+ print(filepath + ' doesn\'t exist, skip it')
240
+ continue
241
+ if unsparse_file_list.has_key(ptn):
242
+ crc = gen_crc(filepath)
243
+ if crc:
244
+ f.write(ptn + ' ' + hex(crc & (2**32-1)) + '\n')
245
+ else:
246
+ size = os.path.getsize(filepath)
247
+ parts,crclist = gen_sparse_crc(filepath)
248
+ if parts == 0:
249
+ raise Exception("sparse file error!!!!!!!")
250
+ else:
251
+ fs.write(ptn + ' ' + str(parts))
252
+ for i in xrange(1,parts+1):
253
+ fs.write(' ' + hex(crclist[i-1] & (2**32-1)))
254
+ fs.write('\n')
255
+ except Exception, e:
256
+ os.remove(crclist)
257
+ os.remove(sparsecrclist)
258
+ raise
259
+
flash_gen_md5_list.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ import os
3
+ import binascii
4
+ import xml.etree.cElementTree as ET
5
+ from xml.etree import ElementTree
6
+ from xml.dom import minidom
7
+ import re
8
+
9
+ import hashlib
10
+ def md5sum(filename, blocksize=65536):
11
+ h = hashlib.md5()
12
+ with open(filename, "rb") as f:
13
+ for block in iter(lambda: f.read(blocksize), b""):
14
+ h.update(block)
15
+ return h.hexdigest()
16
+
17
+ def prettify(elem):
18
+ """Return a pretty-printed XML string for the Element.
19
+ """
20
+ rough_string = ElementTree.tostring(elem, 'utf-8')
21
+ reparsed = minidom.parseString(rough_string)
22
+ return reparsed.toprettyxml(indent=" ")
23
+
24
+ def search_sec_level(filename):
25
+ with open(filename, "rb") as file:
26
+ try:
27
+ while True:
28
+ line = file.readline()
29
+ if line:
30
+ a = re.match(".*PLATFORM_SECURITY_PATCH :=",line)
31
+ if a != None:
32
+ break
33
+ else:
34
+ break
35
+ finally:
36
+ file.close()
37
+ return line[6:43]
38
+
39
+
40
+ def gen_md5_xml():
41
+ root_path = os.path.dirname(__file__)
42
+ path = os.path.join(root_path, 'images')
43
+ files = [os.path.join(path, f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]
44
+ xml = os.path.join(root_path, "md5sum.xml")
45
+ root = ET.Element("root")
46
+ digests = ET.SubElement(root, "digests")
47
+ for file in files:
48
+ file = os.path.join(root_path, file)
49
+ digest = ET.SubElement(digests, "digest", name=os.path.basename(file), hash="md5")
50
+ digest.text = md5sum(file)
51
+
52
+ sec_patch_level = ET.SubElement(root, "security-patch-level")
53
+ security = ET.SubElement(sec_patch_level, "level")
54
+ source_path = os.popen('echo $ANDROID_BUILD_TOP').read()
55
+ sec_path = os.path.join(source_path[:-1],'build/core/version_defaults.mk')
56
+ security.text = search_sec_level(sec_path)
57
+ xml_str = prettify(root)
58
+
59
+ with open(xml,"w") as f:
60
+ f.write(xml_str)
61
+
62
+ #------------------------------------------------------------------------------
63
+ if __name__ == "__main__":
64
+ gen_md5_xml()
65
+
images/BTFM.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9cdd6d0dd614eac788fcfa9abfa4c86f60e76f42c98077a4ab976483a06d92e0
3
+ size 798720
images/NON-HLOS.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58c9792a024b62fd2a95e438591716105e1ca0333d4e8e399c693250c3db2ad1
3
+ size 156037120
images/abl.elf ADDED
Binary file (209 kB). View file
 
images/anti_version.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 3
images/aop.mbn ADDED
Binary file (164 kB). View file
 
images/boot.img ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dab89de84131bf9e2482963e46b49cdd020c4ac4dfcb835e9e7e52aaa04ca50e
3
+ size 134217728
images/cache.img ADDED
Binary file (123 kB). View file
 
images/cmnlib.mbn ADDED
Binary file (399 kB). View file
 
images/cmnlib64.mbn ADDED
Binary file (520 kB). View file
 
images/cmnlib64_debug.mbn ADDED
Binary file (520 kB). View file
 
images/cmnlib_debug.mbn ADDED
Binary file (399 kB). View file
 
images/crclist.txt ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CRC-LIST
2
+ cmnlib 0xae0607e1
3
+ storsec 0x8c448cd5
4
+ persistbak 0x9b419da5
5
+ boot 0x346e44be
6
+ misc 0x1147406a
7
+ bluetooth 0xc2762bd1
8
+ imagefv 0xe5bd1605
9
+ vbmeta 0x7f63b593
10
+ qupfw 0x8f21c040
11
+ logo 0x1de6eff4
12
+ aopbak 0x7c6bc2a7
13
+ xblbak 0x516a546d
14
+ tz 0xc428e0e4
15
+ recovery 0x495e93fd
16
+ uefisecapp 0xd9b39615
17
+ multiimgoem 0x11ffca6
18
+ keymasterbak 0x4455d076
19
+ abl 0x265f76ac
20
+ dsp 0x65e33fb9
21
+ imagefvbak 0xe5bd1605
22
+ persist 0x9b419da5
23
+ devcfg 0x2ad5c46a
24
+ hypbak 0xb526e034
25
+ uefisecappbak 0xd9b39615
26
+ logfs 0x62f52b13
27
+ devcfgbak 0x2ad5c46a
28
+ keymaster 0x4455d076
29
+ cmnlib64 0xbeb52d8d
30
+ aop 0x7c6bc2a7
31
+ cmnlib64bak 0xbeb52d8d
32
+ tzbak 0xc428e0e4
33
+ qupfwbak 0x8f21c040
34
+ xbl_configbak 0xae824c8a
35
+ vbmeta_system 0x529e5259
36
+ xbl_config 0xae824c8a
37
+ cmnlibbak 0xae0607e1
38
+ hyp 0xb526e034
39
+ xbl 0x516a546d
40
+ ablbak 0x265f76ac
41
+ modem 0x1a5076bc
42
+ dtbo 0x62921112
images/cust.img ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71ca2f7647a1a741802dcd5f188b13608fc095720de9581a1fc32e451dfd0041
3
+ size 380031256
images/devcfg.mbn ADDED
Binary file (43.1 kB). View file
 
images/devcfg_debug.mbn ADDED
Binary file (43.1 kB). View file
 
images/dspso.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0a077329656e2424b3cdb80d2dfa3e6d58f0df69b0e6da76d62274e8f17abdd
3
+ size 67108864
images/dtbo.img ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2fd1d1cb7e01463cacab9c01b69476304a97eb79b6335aef923bee8f4b2c9c1
3
+ size 33554432
images/dummy.img ADDED
Binary file (8.19 kB). View file
 
images/dummy_devinfo.img ADDED
Binary file (4.1 kB). View file
 
images/dummy_fsc.img ADDED
Binary file (4.1 kB). View file
 
images/dummy_modemst.img ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2daeb1f36095b44b318410b3f4e8b5d989dcc7bb023d1426c492dab0a3053e74
3
+ size 8388608
images/elf_path.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ courbet-symbols-bp-V14.0.4.0.TKQMIXM-a1214f2d9a.tgz
2
+
3
+ Please visit https://corgi.pt.miui.com/next/pangu/release/download?type=7&stage=all&componentType=all to download the file.
images/gpt_backup0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9e525b50c4a89b04b85ed99ca88e6a34aecbf9a3710e2f6347d5fb659e9f93f
3
+ size 20480
images/gpt_backup1.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fa8bbad6e576b7389b1f1cf2d246974dc247b6e55511cf669363817c79daf68
3
+ size 20480
images/gpt_backup2.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb802e3b12e53a7f04816b6b5ce3382dab96ab5dd8f9f402aa68965fadf8d4eb
3
+ size 20480
images/gpt_backup3.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0fa7e3c8ec17c689f3faf00404ec90d8c2cc32f41b14d3de06ed666d363da7c
3
+ size 20480
images/gpt_backup4.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f49c806be12d26b8773d8aa00760e2a23446f6ce1021233b8d1fb29cb4d3ff04
3
+ size 20480
images/gpt_backup5.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20887ddbf48a6f387c52066a44d32e674d9d087c3553531411d1f46fd6a20360
3
+ size 20480
images/gpt_both0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff65b2bc32c74fb5660ed04691b465d931e76bb447c4b2ebb486255f5717a534
3
+ size 45056
images/gpt_both1.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba98bc0e3bbc6dc726873e060e1765c065bc049a0c25ffe2aa8ce874a103418e
3
+ size 45056
images/gpt_both2.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e0e260c6d88244abf694bdc12cb3117ebff072e73da4a7a11d308aa690ba1b8
3
+ size 45056
images/gpt_both3.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc9f30aef0b44e0ff3a789d506c3df9516f6181196172060d86ffdb2201f4287
3
+ size 45056
images/gpt_both4.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f394ca63751cb7bbcda1ec40774193f7fc751319cc271f062c7c2480667fc640
3
+ size 45056
images/gpt_both5.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bac104b3c3c4b98077ae78bf71bb2b2410c40a5dc630290bda3dd30976ffe12
3
+ size 45056
images/gpt_empty0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:296ad8f9dac8ae490e27fc296e68de9183a83efd638e4f05404c3de700e4cc05
3
+ size 24576
images/gpt_empty1.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:296ad8f9dac8ae490e27fc296e68de9183a83efd638e4f05404c3de700e4cc05
3
+ size 24576
images/gpt_empty2.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:296ad8f9dac8ae490e27fc296e68de9183a83efd638e4f05404c3de700e4cc05
3
+ size 24576
images/gpt_empty3.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:296ad8f9dac8ae490e27fc296e68de9183a83efd638e4f05404c3de700e4cc05
3
+ size 24576
images/gpt_empty4.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:296ad8f9dac8ae490e27fc296e68de9183a83efd638e4f05404c3de700e4cc05
3
+ size 24576