ozip2zip icon indicating copy to clipboard operation
ozip2zip copied to clipboard

possible to re-encrypt the zip to ozip again, after applying changes...

Open jenswes opened this issue 6 years ago • 6 comments

Hi, Thanks for that :-)

would it possible to re-encrypt the zip to ozip again, after applying changes... to try if it would flash?

I decrypt successfull same Oppo R11st and Oppo R11s files.... thanks, jens

jenswes avatar May 28 '18 08:05 jenswes

In my opinion, it is useless because the original zip file is signed, any modification will break the validation.

But you can have a try, I do not own any OPPO devices.

sabpprook avatar May 29 '18 13:05 sabpprook

Yes, but the R11s and the R11st are signed with same key (the SHA1-Digest from logo.img is the same in both manifest.mf) this way i can swap the modem.img to convert the china version to international (this already works with msmdownloadtool, but breaks the modem part)

according to that gist

https://gist.github.com/wfjsw/7c8763dfd543b49b2a3ebf089acc83b0

the encryption part

From offset:00000000 , for every offset+:00004010 , the following 16 bytes is encrypted by AES-128-ECB

would cause a lot of headache if i need to implement that in a schell script with dd and openssl :-(

but the header part is easy:

dd if=CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip bs=4176 count=1 of=CPH1719EX_11_OTA_0130_all_header.txt

cat CPH1719EX_11_OTA_0130_all_header.txt OPPOENCRYPT!\00\00\00\002371314591\00\00\00\00\00\0095e94d2a7c972534f895eef6419484067e9b9eda\00\00\00\00\00\00\00\00ota-id=CPH1719EX_11.A.13_0130_201803281228 ota-required-cache=0 ota-type=BLOCK ota_version=CPH1719EX_11.A.13_0130_201803281228 patch_type=1 post-timestamp=1522212897 pre-device=CPH1719 version_name=CPH1719EX_11_A.13_180328 wipe=0 .........

ls -l CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip -rw-rw-r-- 1 jens jens 2371314591 Mai 29 22:48 CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip

size 2371314591 ist as in Header ..\002371314591\00..

and the sh1 checksum as well sha1sum CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip

95e94d2a7c972534f895eef6419484067e9b9eda CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip

it would be great if you could add the feature to encrypt into a second python script like zip2ozip.py

thanks, jens

jenswes avatar Jun 03 '18 09:06 jenswes

Do you have detailed tutorials and tools? I hope you can help me.

zhixiang520 avatar Sep 14 '18 01:09 zhixiang520

how can i use it? i have an ozip file.

DineshKumarToppo avatar Jun 26 '19 14:06 DineshKumarToppo

can i use on Realme 5 Pro?

FosterG4 avatar Jan 06 '20 08:01 FosterG4

Yes, but the R11s and the R11st are signed with same key (the SHA1-Digest from logo.img is the same in both manifest.mf) this way i can swap the modem.img to convert the china version to international (this already works with msmdownloadtool, but breaks the modem part)

according to that gist

https://gist.github.com/wfjsw/7c8763dfd543b49b2a3ebf089acc83b0

the encryption part

From offset:00000000 , for every offset+:00004010 , the following 16 bytes is encrypted by AES-128-ECB

would cause a lot of headache if i need to implement that in a schell script with dd and openssl :-(

but the header part is easy:

dd if=CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip bs=4176 count=1 of=CPH1719EX_11_OTA_0130_all_header.txt

cat CPH1719EX_11_OTA_0130_all_header.txt OPPOENCRYPT!\00\00\00\002371314591\00\00\00\00\00\0095e94d2a7c972534f895eef6419484067e9b9eda\00\00\00\00\00\00\00\00ota-id=CPH1719EX_11.A.13_0130_201803281228 ota-required-cache=0 ota-type=BLOCK ota_version=CPH1719EX_11.A.13_0130_201803281228 patch_type=1 post-timestamp=1522212897 pre-device=CPH1719 version_name=CPH1719EX_11_A.13_180328 wipe=0 .........

ls -l CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip -rw-rw-r-- 1 jens jens 2371314591 Mai 29 22:48 CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip

size 2371314591 ist as in Header ..\002371314591\00..

and the sh1 checksum as well sha1sum CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip

95e94d2a7c972534f895eef6419484067e9b9eda CPH1719EX_11_OTA_0130_all_UAKEHQT49J2I.ozip.zip

it would be great if you could add the feature to encrypt into a second python script like zip2ozip.py

thanks, jens Are there any third ROM for r11s?

kwaiching avatar Jan 12 '20 13:01 kwaiching