FORUMS

New Xposed for Lollipop 5.0 Update Fixes Major Bugs

Senior Recognized Developer rovo89 has patched Xposed for Lollipop 5.0 to … more

Download Sony’s new AOSP-like concept for Xperia Z3

Over in our forums, Recognized Contributor Jozinek has posted a very … more

OnePlus 2 vs Moto X Style: Which is The Better Flagship?

Two big industry names have announced their newest flagship phones within the … more

Making Your Own Xposed Modules Is Easier Than You Think

Close to the heart of XDA is the Xposed Framework by Rovo89. Most of … more

[TOOLS] Create unlock.img, fix boot.img, repack update.bin (for aboot

88 posts
Thanks Meter: 69
 
By draxie, Member on 10th March 2015, 06:34 AM
Post Reply Subscribe to Thread Email Thread
The attached archive includes 3 tools for those of you with .3.2.3.2 (or earlier) bootloaders.
Since other tools (and earlier version of these very tools) are available and working well,
this is mostly meant as an entry to an imaginary beauty contest. (JOKING!!!)
  1. cuber.py
    • a generic gmpy2-free reimplementation of @vortox's signature.py
    • use this to generate your unlock.img
  2. cuboot.py (uses cuber.py)
    • a Python-only reimplementation of @vortox's cuber
    • includes fixes to the kernel command-line and the device-tree
    • use this to convert a standard Amazon boot.img (>=.4.x.x)
  3. upHDX (uses cuboot.py)
    • bash script to repack Amazon updates for TWRP
    • could be DANGEROUS, use with care
    • tested on Apollo for both 14.4.5.2 and 14.4.5.3
      • my unit is fully 14.4.5.3 now, except for aboot (which is 3.2.3.2)
    • should work on Thor as well
Those with bootloader .3.2.6 and lower can downgrade to .3.1.0
and upgrade the bootloader to the latest vulnerable version .3.2.3.2.
Those with .3.2.7 and higher appear to be out of luck with forged signatures, but I hear there's progress on rooting .4.5.2.


The python scripts have been tested on the following OS / Python combinations:
  • Windows: 2.7.9 and 3.4.3
  • Linux: 2.7.9 and 3.3.4
  • OSX: 2.6.? (cannot quite remember)

In addition to the tools themselves, I also included "educational" examples
(examples.sh for Linux/OSX, examples.bat for Windows).
These make use of the split.py script, which is otherwise unnecessary.
(The Windows example also shows that simply echoing your manfid/serial
combo to cuber.py -the way one does in Linux/OSX- won't work due to
the carriage-return character introduced by the echo command.
You'll need to handcraft a file matching the '0x%02x%08xn' format...)

Another batch file py..bat is meant as an extra aid for Windows users
to avoid trouble with setting paths and such. You should be able to simply
download and install your preferred Python version.
Open a command shell (cmd.exe), navigate to wherever you extracted the
archives, and type 'py PYTHON-SCRIPT ARGS' to run the Python scripts.
(This handholding intentionally does NOT work for the upHDX script.)

Hopefully, someone will find these simple tools useful.


EDIT: To unlock your bootloader (<=.3.2.3.2), you'll need adb and fastboot.
On Linux, most distributions package these separately. Look for android-tools-{adb,fastboot} or some such.
For Windows, you can get these from the official Android SDK (which is a **large** download,
with a lot more tools you won't need, if you don't already use them, but it's safe).
Alternatively, there's a very legit-looking project here an XDA, with a much smaller
download, fast install, and exactly the tools you need. I haven't used either... (-;

The actual unlock procedure is described here and here.


EDIT#2: I added another script 'cublock.py' to make unlock.img generation super easy both on Windows and Linux.
MD5( tools.zip) = c17fc91344bd3b4b040129a79a39741f

EDIT#3: Fixed issues with older versions of certain tools on Debian 7.
MD5( tools.zip) = 4f93ab667fd61db26c83675ce0bd6d9f

EDIT#4: Fixed a bug when 'cuber.py' is used directly from the command line.
MD5(tools.zip) = 67b4a6d65aa2b0aa3500b122c8a25290Attachment 3210856


XDA:DevDB Information
HDXtools, Tool/Utility for the Amazon Kindle Fire HDX 7" & 8.9"

Contributors
draxie

Version Information
Status: Alpha

Created 2015-03-13
Last Updated 2015-03-13
Attached Files
File Type: zip tools.zip - [Click for QR Code] (5.8 KB, 2098 views)
Last edited by draxie; 2nd April 2015 at 07:46 PM. Reason: bugfix
The Following 13 Users Say Thank You to draxie For This Useful Post: [ View ]
 
 
10th March 2015, 08:21 AM |#2  
Senior Member
Thanks Meter: 10
 
More
Thank for your works.

Can I use upHDX to remove bootloader, recovery from 4.5.3 and flash via TWRP?

Thanks
10th March 2015, 09:07 AM |#3  
OP Member
Thanks Meter: 69
 
More
Quote:
Originally Posted by tuanda82

Thank for your works.

Can I use upHDX to remove bootloader, recovery from 4.5.3 and flash via TWRP?

Thanks

Let's hope so. That's what I did, in any case.

I'm an adventurer; so, I ran './upHDX fw update-kindle-14.4.5.3_user_453011120.bin',
pushed the resulting update-kindle-14.4.5.3_user_453011120-upHDXfw.zip to my HDX 8.9
and installed it with TWRP.

Worked for me, but I cannot provide any guarantees, unfortunately.
It may be wise to omit 'fw', and doublecheck that you're happy with the contents of the
updater-script in the newly generated archive.

AND, -of course- make sure your bootloader version is at most .3.2.3.2!!!
Last edited by draxie; 10th March 2015 at 09:09 AM.
The Following User Says Thank You to draxie For This Useful Post: [ View ]
10th March 2015, 10:06 AM |#4  
Senior Member
Thanks Meter: 10
 
More
Quote:
Originally Posted by draxie

Let's hope so. That's what I did, in any case.

I'm an adventurer; so, I ran './upHDX fw update-kindle-14.4.5.3_user_453011120.bin',
pushed the resulting update-kindle-14.4.5.3_user_453011120-upHDXfw.zip to my HDX 8.9
and installed it with TWRP.

Worked for me, but I cannot provide any guarantees, unfortunately.
It may be wise to omit 'fw', and doublecheck that you're happy with the contents of the
updater-script in the newly generated archive.

AND, -of course- make sure your bootloader version is at most .3.2.3.2!!!

Thanks. But your upHDX scripts is for linux user only. I am on Windows .
If you have time could you upload your xxxx_14.4.5.3_xxxx.zip? Thanks
10th March 2015, 03:36 PM |#5  
Member
Thanks Meter: 21
 
More
Quote:
Originally Posted by draxie

The attached archive includes 3 tools for those of you with .3.2.3.2 (or earlier) bootloaders.
Since other tools (and earlier version of these very tools) are available and working well,
this is mostly meant as an entry to an imaginary beauty contest. (JOKING!!!)

  1. cuber.py
    • a generic gmpy2-free reimplementation of @vortox's signature.py
    • use this to generate your unlock.img
  2. cuboot.py (uses cuber.py)
    • a Python-only reimplementation of @vortox's cuber
    • includes fixes to the kernel command-line and the device-tree
    • use this to convert a standard Amazon boot.img (>=.4.x.x)
  3. upHDX (uses cuboot.py)
    • bash script to repack Amazon updates for TWRP
    • could be DANGEROUS, use with care
    • tested on Apollo for both 14.4.5.2 and 14.4.5.3
      • my unit is fully 14.4.5.3 now, except for aboot (which is 3.2.3.2)
    • should work on Thor as well
Those with bootloader .3.2.6 and lower can downgrade to .3.1.0
and upgrade the bootloader to the latest vulnerable version .3.2.3.2.
Those with .3.2.7 and higher appear to be out of luck with forged signatures, but I hear there's progress on rooting .4.5.2.


The python scripts have been tested on the following OS / Python combinations:
  • Windows: 2.7.9 and 3.4.3
  • Linux: 2.7.9 and 3.3.4
  • OSX: 2.6.? (cannot quite remember)

In addition to the tools themselves, I also included "educational" examples
(examples.sh for Linux/OSX, examples.bat for Windows).
These make use of the split.py script, which is otherwise unnecessary.
(The Windows example also shows that simply echoing your manfid/serial
combo to cuber.py -the way one does in Linux/OSX- won't work due to
the carriage-return character introduced by the echo command.
You'll need to handcraft a file matching the '0x%02x%08x\n' format...)

Another batch file py..bat is meant as an extra aid for Windows users
to avoid trouble with setting paths and such. You should be able to simply
download and install your preferred Python version.
Open a command shell (cmd.exe), navigate to wherever you extracted the
archives, and type 'py PYTHON-SCRIPT ARGS' to run the Python scripts.
(This handholding intentionally does NOT work for the upHDX script.)

Hopefully, someone will find these simple tools useful.


EDIT: To unlock your bootloader (<=.3.2.3.2), you'll need adb and fastboot.
On Linux, most distributions package these separately. Look for android-tools-{adb,fastboot} or some such.
For Windows, you can get these from the official Android SDK (which is a **large** download,
with a lot more tools you won't need, if you don't already use them, but it's safe).
Alternatively, there's a very legit-looking project here an XDA, with a much smaller
download, fast install, and exactly the tools you need. I haven't used either... (-;

The actual unlock procedure is described here and here.


EDIT#2: I added another script 'cublock.py' to make unlock.img generation super easy both on Windows and Linux.
MD5( tools.zip) = c17fc91344bd3b4b040129a79a39741f

Thanks a lot for the good work but id like to let tell you that it will be great if you can explain all the entire work in layman's terms because there would be many people having hundreds of questions and concerns.

Just an advice if you feel worthy... No disrespect intended...
12th March 2015, 02:39 AM |#6  
Member
Thanks Meter: 8
 
More
I would like it in layman terms...

And how to do it on Windows. This seems like confusion for me. I have no idea where to start.
12th March 2015, 06:28 AM |#7  
yujikaido79's Avatar
Senior Member
Flag Hong Kong
Thanks Meter: 20
 
More
I did it all in windows 8.1 64 bit edition.

With help from this post:
http://forum.xda-developers.com/show...4&postcount=67

get Python 2.7 for windows and install it >>https://www.python.org/download/releases/2.7/
btw I installed the 64 bit edition for both

get GMPY2 for Python 2.7 https://code.google.com/p/gmpy/downloads/list

Follow the post for step by step. I encountered some trouble with fast boot driver, I had to remove the driver and install a generic one I selected from windows then I manually installed it. Ran the fast boot command to unlock and I was unlocked. a lot easier than it looks.

Quote:
Originally Posted by Reckerr

I would like it in layman terms...

And how to do it on Windows. This seems like confusion for me. I have no idea where to start.

The Following User Says Thank You to yujikaido79 For This Useful Post: [ View ]
12th March 2015, 11:07 AM |#8  
Member
Thanks Meter: 8
 
More
Appreciate it. Will attempt Saturday after a read through.
12th March 2015, 08:04 PM |#9  
OP Member
Thanks Meter: 69
 
More
Arrow Works on Windows...
Quote:
Originally Posted by tuanda82

Thanks. But your upHDX scripts is for linux user only. I am on Windows .
If you have time could you upload your xxxx_14.4.5.3_xxxx.zip? Thanks

Actually, I tested upHDX in Windows using Cygwin.
I had to select zip and unzip in the Archive group and python in the Python group
in the installer to get all the dependencies in place, and the only issue I faced was a few filename collisions
in the /system/media/audio/ringtones folder (case-sensitivity problem).
Code:
> diff -ru cygwin/ linux/
Only in linux/system/media/audio/ringtones: ANDROMEDA.ogg
Only in linux/system/media/audio/ringtones: CANISMAJOR.ogg
Only in linux/system/media/audio/ringtones: Hydra.ogg
Only in linux/system/media/audio/ringtones: PERSEUS.ogg
Only in linux/system/media/audio/ringtones: URSAMINOR.ogg
These could just be copied from the original update-*.bin after installation.
Last edited by draxie; 12th March 2015 at 08:16 PM.
The Following User Says Thank You to draxie For This Useful Post: [ View ]
12th March 2015, 08:06 PM |#10  
OP Member
Thanks Meter: 69
 
More
Quote:
Originally Posted by Reckerr

I would like it in layman terms...

And how to do it on Windows. This seems like confusion for me. I have no idea where to start.

If you could spell out what you mean by 'it', I might be able to help.
12th March 2015, 08:13 PM |#11  
OP Member
Thanks Meter: 69
 
More
Thumbs down
Quote:
Originally Posted by yujikaido79

I did it all in windows 8.1 64 bit edition.

With help from this post:
http://forum.xda-developers.com/show...4&postcount=67

get Python 2.7 for windows and install it >>https://www.python.org/download/releases/2.7/
btw I installed the 64 bit edition for both

get GMPY2 for Python 2.7 https://code.google.com/p/gmpy/downloads/list

Follow the post for step by step. I encountered some trouble with fast boot driver, I had to remove the driver and install a generic one I selected from windows then I manually installed it. Ran the fast boot command to unlock and I was unlocked. a lot easier than it looks.

Of course, if you want to make it more difficult for yourself,
you can use the older version of my tool as well.
The new one is not limited to Python 2.7, but works on both current Python versions;
and does NOT require GMPY2.

Also, if you are looking to unlock your bootloader, the 'cublock.py' script is your friend.
You just pass in the manfid and serial (separately; no need to fuse them).

Whether you choose to install Python standalone or as part of Cygwin is up to you.
The latter also includes 'bash' and lets you convert the Amazon update to a TWRP-friendly ZIP.
Last edited by draxie; 15th March 2015 at 07:59 PM. Reason: corrected wrong script name (unlock.py -> cublock.py)
The Following 2 Users Say Thank You to draxie For This Useful Post: [ View ]

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes