yashsingh1/xdaforums huggingface dataset:
[Android] nkk71:
If you're using 3.5.2RC2, once you provide the needed file, the tool will actually let you upload a new keyfile automatically for everyone else to be able to use it too ;)
[Android] ziand:
Guys, thanks again for your huge work. Yes, I use last 3.5.2RC2 and it works perfectly. I have informed to whom it is maybe really interesting that there aren't any keys for that kind of RUU. I never mind because I personally do not need... not big thing to worry about.
[Android] nkk71:
From the OP:
[Android] Kisakuku:
He has neither the Chinese HTC 10 Lifestyle nor access to OTAs for it.
[Android] nkk71:
That's also not relevant to this thread. Can we get back on topic please.
[Android] Captain_Throwback:
This conversation was tiresome, so I provided a compatible keyfile myself. So now no one can complain that it won't decrypt.
[Android] nio.mchild:
Hi, please would you upload the key for the new firmware 2PZFIMG_OCEAN_NOTE_DUGL_N70_SENSE80GP_HTC_India_SEA_1.62.400.1_Radio_1.0.U010051c@70502_53.34_release_503372_signed_2_4.zip for the HTC U Ultra. Thank's
[Android] nkk71:
You mean the one currently available does not work?
[Android] nio.mchild:
No mate..... or meavy i did something wrong...would you try for me please ??
[Android] nkk71:
Well, that *link* isn't really a link, it takes me about 3hours+ to download these things, I also don't see the output log from tool anywhere attached.
[Android] nio.mchild:
Sorry, is true !, i can not post any link in the forum until have 10 usefull posts...how can send the link ?
[Android] nkk71:
By adding spaces to it :p

Anyway, I don't know if I'll even download it, and certainly not if I don't see the output of the tool first.
[Android] Captain_Throwback:
If [MENTION=8309788]nio.mchild[/MENTION] supplies a link, I'll download it and check it out.
[Android] nkk71:
Found it here (instead of that other site): https://www.androidfilehost.com/?fid=817550096634776282

Would take me hours to download, thanks Cap
[Android] nio.mchild:
It's already done, thank's everyone, i had error while write the sintax in powershell, i confirm the keys are posted work perfect !

Sorry my porr english :o
[Android] nkk71:
And then people wonder why the OP asks for the log :eek:
[Android] OPben:
Not working

The Thing Just closes anytime i try to execute a code
[Android] nkk71:
Interesting
[Android] OPben:
Yeah...Or please help,how i'm i supposed to go about it?
[Android] Captain_Throwback:
Follow the instructions in the first post (including all information on logging).
[Android] OPben:
Damaged img and zip files

It worked Captain throwback,but I've tried to flash flash my HTC m7 one rom,tells me the zip and img files are damaged..???
[Android] Captain_Throwback:
That's outside the purview of this thread. If you were able to decrypt the RUU, then this tool has done its job. If you're having issues with flashing, search your device forum for info or post a Q&A thread there. And if you expect anyone to be able to help, provide some details and command prompt output. The more information you provide, the better. And you can even mention [MENTION=2605798]nkk71[/MENTION] - I'm sure he'd be willing to help you ;).
[Android] OPben:
Cool..Thanks alot,i will..???
[Android] Captain_Throwback:
So [MENTION=2605798]nkk71[/MENTION] has been busy working on something for me - an arm64 version of the tool! I created a Magisk module out of it and so far it works okay (though it's not perfect yet).

No ETA, if it gets released at all, lol. I'm just amazed he was able to get it working, tbh.
[Android] nkk71:
Hey, this was a 'get well soon' kind of thing ;)
[Android] Captain_Throwback:
So everyone, [MENTION=2605798]nkk71[/MENTION] has a fully working arm64 decrypt tool now and we were wondering if anyone thinks it's worth having an Android app for? That would probably be the easiest way to deploy it, and it wouldn't even require root access. There's only one problem - neither of us is really interested in building an Android app. I have no experience with it at all, and he has minimal experience with it and even less of a desire, lol.

If someone thinks this is a good idea and wants to make it happen (and has the necessary skills to do so), let us know, and maybe we can work together on an Android app version of the decrypt tool. Otherwise, we can just stick with the versions we currently have.
[Android] 5m4r7ph0n36uru:
It's a great progress you two did with this tool thanks a lot. A decrypt App would maybe be of some help if I'm away due to some traveling I got to do at work, and can't get onto my PC during this time. But up till now it always was enough to just patiently wait until I'm back home and do it on my computer.

I would surely help, but don't have any skills in building Apps either. Would regard it as a nice, but not so necessary, add-on to what you two already did. Just my two cent on this.

Thanks for everything and keep up the good work!
[Android] nkk71:
Since my to-do-lists kinda get lost along the way, I'll just leave it here :angel:

Add date/timestamps

Make sure they're not off by 4 hours for some :eek:

Add 'process took x time'

Confirm arm (not arm64) is fully working... how come :confused: (I was pretty sure a couple of changes were needed for 32bit, hmm)

Fix unzip terminal buffer delay

what else did I forget (edit: shh about the new hosd 'unzip' :P )

If ever a GUI is come into play, better make it look better than :mad:
[Android] Sneakyghost:
I see what you're doing there nkk71... Nice, man! Next step: apply at HTC for a job [emoji23]
[Android] nkk71:
It's the amazing screenshot that gave it a whole new perspective right :p Yeah, can't blame you, that Android Studio is nice to move icons around, it just gave my super talents for GUI based stuff a whole new level [emoji23][emoji23]

You do know that screenshot has zero code behind it, so no matter what you click nothing is gonna happen :D

Of course the positive side to such an app, it never FC, it hardly uses any memory, no battery drain, etc. :victory:
[Android] Captain_Throwback:
I'm just glad the arm version of the tool is fully working now :).

Even used it on my M8 to decrypt an RUU and it worked with no issues. Of course, my version requires Magisk, though ;).
[Android] nkk71:
You mean Magisk in general, or just this part :p

nkk71@ubuntu:~/android/HTC-RUU-Decrypt-Tool$ file */bin/magiskboot
arm64/bin/magiskboot: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
arm/bin/magiskboot: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
linux64/bin/magiskboot: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=5e1455b2cf4a84c785e8d0598234379bd50e4d25, stripped

PS: How's the cake :p (or was that a pie, I don't eat either, so I wouldn't know the difference :o )
[Android] Captain_Throwback:
I meant in general, since I run mine as a module. But you're right; the current version wouldn't run without that handy little tool by [MENTION=4470081]topjohnwu[/MENTION] ;) (at least for devices with unknown keyfiles and an available hosd to extract)
[Android] topjohnwu:
MagiskBoot FTW!!
[Android] nkk71:
Maybe I'll use a different one, then I don't need to call it twice :p
[Android] nkk71:
Rumour has it there's an 3.6.0 RC1 coming out, so I figured I'd double check the to-do, and strike some stuff off
[Android] Captain_Throwback:
Mobile version update!!

I have a working version of the tool as a Magisk module, that should work on any arm-based device. If there is interest, I will upload it. Otherwise, I'll just keep using it myself :). Comes in handy for extracting RUUs and flashable zips on the go. The mobile version uses [MENTION=4470081]topjohnwu[/MENTION]'s magiskboot for manual extraction of hosd if there is no known decryption key. Also a full version of the unzip binary is included, so if you have busybox installed and the unzip applet it includes, you'll need to delete that applet so the tool uses the correct, fully functional version. The busybox version is a bit stripped down. Also, while this version allows you to run the tool from anywhere, you'll need to have the RUU file on internal storage to avoid permission errors. One way around this (which is what I'm using) is using a Magisk module that bind mounts external SD card folders to internal storage, so the device thinks you're on internal even though you're not ;).

Other than those caveats, the tool seems to work well. I typically let the process run in the background while multitasking, and the entire extraction and decryption process takes about 25 minutes on my U11.

So let me know if I should post. Thanks again [MENTION=2605798]nkk71[/MENTION] for all his hard work on this and figuring out makefiles and how to cross-compile all the things :).

P.S. Almost forgot - keyfiles get downloaded to /sdcard/RUU_Decrypt_Tool/keyfiles so that root folder is probably a good place to make your working folder ;)

P.P.S. In case you were wondering whether the tool needs to be run as root, it doesn't ;).
[Android] nkk71:
Going forward, that is most likely the way all versions will continue (unless topjohnwy objects), I can confirm the linux version works just as well, haven't tried windows yet.

But I see no point in any of the other methods available... There's no point in reinventing the wheel ;)

I'll fix the *conflict* in RC2, sorry, forgot about that completely :o

Well, if you cannot break it, who can :D

No idea, they said U11 would be available "next week"... they've said it for 2 weeks now :(

I think we're currently forced with that, since I don't Java, I dunno how all that works :angel:
[Android] 5m4r7ph0n36uru:
[MENTION=1162986]Captain_Throwback[/MENTION] nice process you did. I'd very well like to use your module. Using folder mount module currently as well and think the decrypt one would come in handy to me, as I'm traveling a lot for my employee and don't want to take my notebook all the time. This said if you don't mind sharing it I'd be very happy.
[Android] lijiwe24:
0PE6_keyfile_1.30.1405.3.bin upload

0PE6_keyfile_1.30.1405.3.bin
[Android] Captain_Throwback:
Just use the tool to upload it to the repo...no reason to post keyfiles here anymore.
[Android] nkk71:
Thanks but we already have that one:

514c689ba4dcb817742ff2f532d19057 *0PE6_keyfile_1.51.401.5.bin

514c689ba4dcb817742ff2f532d19057 *0PE6_keyfile_1.30.1405.3.bin

The tool would have downloaded the 1.51.401.5 keyfile, and decrypted just fine, and would have mentioned if it's new or not ;)
[Android] Captain_Throwback:
Check the Downloads tab ;)
[Android] nkk71:
3.6.0RC1 is out for Windows (both 64 and 32bit builds), as well as Linux64 build, in addition to Captain_Throwback's Android-arm-Magisk version.

Out of curiosity, is anybody really interested in 32bit builds?

(I do remember it used break *somewhere*, for certain RUUs, that's one of the main reasons I decided not to add 32bit builds, so if it breaks, lemme know).

I'll fix the OP over the weekend I hope. (Changelog with "see notes" ... and no notes, smh :rolleyes: )

PS: Credits will be updated as well, thanks to [MENTION=4544860]osm0sis[/MENTION] for mentioning that [MENTION=4470081]topjohnwu[/MENTION] magiskboot might be better suited for this tool

PPS: the Windows version of magiskboot will not repack a boot.img correctly (that is of beyond the scope of this particular tool)

EDIT: I've also added a poll, if you feel like checking which platforms you are interested in. In the case of *other* feel free to mention them in a post and why ;)
[Android] nkk71:
OPs have been updated.

By the way, yesterday we had 39 unique keyfiles, today we have 40... so I take it the upload part works just fine too, and thanks to whomever uploaded it :)
[Android] roirraW "edor" ehT:
Holy crap this v3.6.0 RC1 was fast to create a 2PS6IMG.zip on Windows 10 x64!!!

Thanks!
[Android] xunholyx:
I guess I should update from my 3.1
[Android] nkk71:
3.1 :eek:

Most certainly you should update, just cause I tagged it RC1 doesn't mean it's not stable and fully functional ;)
[Android] Black-FR:
You know him... he always needs some while, till he updates. :D
[Android] nkk71:
But iirc, he's always "on the latest stuff" (you know what I mean) :p
[Android] nkk71:
Regarding the dual rom_xx.zip's you're correct, I was aware of them, but never added the necessary code to the tool primarily because those haven't been seen in a long time, I think the last one I've seen was an early US T-Mobile RUU for the M7.

There were also inconsistencies between which one is *primary* rom_xx.zip and which one is just a *preupdate* rom_xx.zip, but I'll see if I'll add support for those, didn't really think it's a priority as these devices have become eol.

As for the first one, I just downloaded it (luckily Captain_Throwback found an AFH link), but can you give me an alternate link for the RUU_EVITARE_UL_JB_50_S_Cingula, 4shared isn't a good place for me to download from.

The system.img is not corrupt per se, but it is a sparse format file. For single system.img files, I wasn't aware the HTC ever had them in that format, so I just need to update the code for it, no big deal

I'll wait for you to upload the other RUU somewhere, before pushing any updates.
[Android] santod040:
I was able to Decrypt this one, with an extra step or two: (think outside the box) :)

RUU_EVITARE_UL_JB_50_S_Cingular_US_2.15.502.1_Radio_2.21.5517.15_18.27.11.35L_release_341689_signed_0220.exe

Run Decryption Tool on RUU

It will extract rom_01.zip and rom_02.zip

Place rom_01.zip into RUU file location for decrypting

Run Decryptrion Tool on rom_01.zip

Take hboot_1.73.0000_20131009.img from /OUT_PM63_2.15.502.1/firmware folder and place in Keyfiles folder

Now place rom_02.zip into RUU file location for decrypting

Use keyfile flag and run Decryption Tool on rom_02.zip

PROFIT!!!
[Android] nkk71:
[MENTION=6008625]MrGreg1[/MENTION]

and attached is the updated log with support for the single sparse system.img, passed the e2fsck now ;)

Did notice a bug though, when run with command line options, it's running in offline mode, oops :eek::rolleyes:
[Android] nkk71:
Nice :good:

BTW, one of the reasons the multi rom_nn.zip was never implemented because in some RUUs rom_01.zip was the preupdate zip and rom_02.zip the *real* RUU, but on others it was the other way around.

Anyway, I'll see what to do with it :)

Thanks for the full filename ;)
[Android] santod040:
No problem.

Thanks for your continued work and support on this awesome utility and thanks for the explanation.

I figured that was the case, as I've seen it set up both ways myself in years past.
[Android] MrGreg1:
Hi Santod040,

Thanks for your reply. I tried your method. It does manage to get all of the img's extracted. However the e2fsck still fails due to the lack of sparse file support. However nkk71 has already added support for this as you can see from a previous post. In addition repackaging does not occur.

---------- Post added at 12:48 PM ---------- Previous post was at 12:39 PM ----------

Hi nkk71,

Thanks for the speedy reply. Thanks for adding the sparse file support. As for the primary/preupdate problem, this RUU has firmware files in rom_01.zip and the system image in rom_02.zip. If they are sometimes reversed, I would think that a simple file size check should suffice. Obviously the smaller would be firmware files and the larger the system image. It looks like you have already found the RUU files but I have uploaded them to my google drive just in case. Thanks again for your hard work and support...

drive.google.com/file/d/0B5zy4iQ3W2S2S00zWFBLYk0xT0U/view?usp=sharing

drive.google.com/file/d/0B5zy4iQ3W2S2SUhZMm1JclFqZlE/view?usp=sharing
[Android] nkk71:
oops too late :p

I already fixed both issues earlier (and that little bug, those are lazy commits, so I'll just upload RC2 a bit later, changelog was already updated in post #2 long ago, all works just fine.

git log:

commit 4b704927d642a1113c5df515579ecda71bc1c5d5
Author: nkk71 <nkk71x@gmail.com>
Date: Tue Sep 5 21:32:23 2017 +0300

Bump version to 3.6.0 RC2

commit 339b8a44b26fa994832abc6a28d6276ce621555c
Author: nkk71 <nkk71x@gmail.com>
Date: Tue Sep 5 21:28:25 2017 +0300

Handle RUU.EXEs containing both rom_01 and rom_02 zips

* "Dual zip" RUU.EXEs usually contain a preupdate rom_nn.zip
which would be signed but not encrypted, and a full ruu
that is likely to be encrypted. The preupdate zip serves to
update hboot with the proper decryption keys, for the second
flash.

TODO:
1- extract android-info.txt from the minor zip
2- extract hboot from the minor zip, and use it to decrypt the
dominant zip automatically, if needed

commit 321fe0b7822daab1a1b24ab1a344a7f6d8b30c49
Author: nkk71 <nkk71x@gmail.com>
Date: Tue Sep 5 21:18:53 2017 +0300

Add support for single sparse system.img

commit 1a7db9d0efd61fb41d965c87d4ba6552c5140764
Author: nkk71 <nkk71x@gmail.com>
Date: Tue Sep 5 21:17:52 2017 +0300

Fix up/download of keyfiles

* When running with cmdline/terminal options the
default is to download and possibly upload new
keyfiles

* If download is not allowed during the simple Y/N
interface do not ask to upload, to avoid duplicates

Extract of decrypt:

Extracting rom.zip from RUU_EVITARE_UL_JB_50_S_Cingular_US_2.15.502.1_Radio_2.21.5517.15_18.27.11.35L_release_341689_signed_0220.exe
Extracting temporary files...
Extracting rom zip files...
Extracting rom_02.zip...done.
Extracting rom_01.zip...done.
Cleaning up...
Done!
Found rom_01.zip + rom_02.zip
rom_02.zip is the dominant zip and will be used for further processing
rom_01.zip is likely the preupdate zip and can be used for hboot extraction if needed
unruu took 19.717 seconds.

Yeah, I know there's a todo, there always is ;)
[Android] nkk71:
Uploaded 3.6.0 RC2 (linux64 and win64 only at the moment), changelog in post #2, enjoy :)​
[Android] MrGreg1:
Thanks nkk71,

Any chance of getting a Windows 32 bit executable? You had one for RC1 but none for RC2. Thanks again...
[Android] nkk71:
Later for RC3, once I have this fixed:

Extracting rom.zip from RUU_EVITARE_UL_JB_50_S_Cingular_US_2.15.502.1_Radio_2.21.5517.15_18.27.11.35L_release_341689_signed_0220.exe
Extracting temporary files...
Extracting rom zip files...
Extracting rom_02.zip...done.
Extracting rom_01.zip...done.
Cleaning up...
Done!
Found rom_01.zip + rom_02.zip
rom_02.zip is the dominant zip and will be used for further processing
Attempting extract of android-info.txt from rom_01.zip...
Archive: rom_01.zip
warning [rom_01.zip]: 256 extra bytes at beginning or within zipfile
(attempting to process anyway)
inflating: android-info.txt
Attempting extract of hboot/hosd from rom_01.zip...
Archive: rom_01.zip
warning [rom_01.zip]: 256 extra bytes at beginning or within zipfile
(attempting to process anyway)
inflating: hboot_1.73.0000_20131009.img
caution: filename not matched: hosd*
unruu took 14.225 seconds.

Information extracted from RUU.EXE:
INFO: RUU modelid: PM6310000
INFO: RUU mainver: 2.15.502.1
Also found hboot_1.73.0000_20131009.img, will use it for keyfile generation

,,,

User supplied hboot / hosd, going to generate...
... assuming hboot...

Attempting to generate keyfile
bruutveal
---------

SUCCESS!rcing key[loop 3]: 1225647/2097408...
Successful bruutveal run, key written to: /home/nkk71/Desktop/HTC_RUU_Decrypt_Tool_3.6.0RC1/OUT/tmp/use_keyfile.bin
bruutveal keyfile has been successfully generated '/home/nkk71/Desktop/HTC_RUU_Decrypt_Tool_3.6.0RC1/OUT/tmp/use_keyfile.bin'
Finished: Successfully found decryption key, copied to 'tmp/use_keyfile.bin'
KeyFinder took 25.285 seconds.
[Android] MrGreg1:
Man this old RUU is causing you allot of work. Sorry about that. I will wait patiently. Thanks for your support...
[Android] nkk71:
Not really, I should have done it a long time ago, and something worth doing should be done properly IMHO.

Also gives me a chance to clean up the rest ;)
[Android] nkk71:
Uploaded 3.6.5 (linux64, win64 and win32), changelog in post #2, enjoy :)​
[Android] MrGreg1:
OK just found you have uploaded the latest release. I have just run both RUU's and they completed successfully. Good job man! I see there are still warnings in 2.15.502.1. I assume you figured out that this is not really a problem.

Forgive me for my lack of knowledge but I thought the z option produces a zip that can be flashed. In both cases I find PM63IMG.zip but it is encrypted. So how can this be flashed using TWRP? Thanks for all your hard work...
[Android] Kisakuku:
The RUU zips are flashed in download or RUU mode from SD card or with fastboot.
[Android] xunholyx:
You can't flash a ROM.zip or a firmware.zip with TWRP. You can fastboot flash it in download mode, or use the SD card method to flash it (put that PM63IMG.zip onto you extSD and boot to download mode)
[Android] MrGreg1:
Thanks guys I understand now...
[Android] MrGreg1:
nkk71 this is probably one for you but others please chime in. I am trying to create a separate rom.zip for 1.19.502.1 containing firmware files only. The RUU decrypt process unpackes and places the files in the firmware folder. So I zipped them up into a zip file named firmware_1.19.502.1.zip. Now I am trying to use ruuveal.exe from the bin directory to re-encrypt the zip file. Here are the commands I am using with output.

ruuveal.exe -I --device evitar_ul PM63IMG.zip

ruuveal

-------

encrypted zip info:-

keyindex: 0x0093

chunks: 0x0a

mainver: 1.19.502.1

ruuveal.exe -E -m 1.19.502.1 -k 0x0093 -c 0x0a --device evitar_ul firmware_1.19.502.1.zip out.zip

failed to generate htc aes keys

What am I doing wrong here? Obviously this should be possible because the decryption process for the 1.19.502.1 RUU produces a re-encrypted zip (i.e. PM63IMG.zip). How did you accomplish this?

I would also like to know if the re-encrypted zips that HTC RUU/ROM Decryption Tool produces are digitally signed? Because that is what I think I am missing here.

Thanks for your support...
[Android] nkk71:
First

, the tool doesn't "produce an encrypted and signed zip"

ever

, from usage:

-z, --sdruuzip copy and rename rom.zip for SD-Card flashing
Note: this will create a duplicate if the input is already a rom.zip

It just copies the real unaltered HTC ZIP and renames appropriately.

Second

, you can encrypt (or not) whatever you want, it won't make a single difference... The zip(s) will only flash on S-ON devices if they are

signed

(and I mean HTC signed, not you or me signed), whether or not that zip is encrypted has zero (really zero) influence.

That's why you can flash the *preupdate* zip in that 2.15.502.1 RUU (the smaller rom_0n.zip), because even though it's not encrypted it is HTC signed and therefore flashable on S-ON devices.

Encryption is not the same as HTC signature, the former is an HTC *convenience* or *habit* (though not always, M9 1.xx.xxx.x RUUs were not encrypted at all),

but

the latter, HTC signature is the important part, and that cannot be reproduced.

Third

, the Tool is for decrypting / unpacking / fixing system.img, it's not meant to create unsigned & unencrypted RUUs. Though that may eventually become included as some person would find it useful. (It would only work on S-OFF devices!!)

Finally

, please no more "how to repack" "how to make" our own HTC signed RUUs or firmwares... you can't, or at least I can't.