[TOOL] PRFCreator - easily create pre-rooted firmwares

zxz0O0

Senior Member
Apr 18, 2011
1,534
5,156
0
Introducing my new tool called PRFCreator. With this tool, anyone can easily create a pre-rooted firmware.

What is a pre-rooted firmware
A pre-rooted firmware is a firmware, which already includes root. This is for example important if you want to update the firmware to a version, where there is no public root exploit. To flash a pre-rooted firmware, you need a recovery menu. An unlocked bootloader is not required.

How does the tool work
The tool should be self-explanatory. SuperSU zip can be downloaded from here. [NUT]'s dualrecovery (*.flashable.zip) can be downloaded from here. Recovery is optional and if your device is not supported by dualrecovery, you can use any recovery (just has to be a flashable zip).
Depending on the firmware size and your computer speed, generating a pre-rooted firmware can take up to 7 minutes. The pre-rooted firmware will be created in the directory of the executable and called flashable-prerooted.zip.



The order for the extra files is
  1. Extra flashable
    • In the order you added it initially in the GUI
  2. APKs

TWRP is recommended for flashing!

Note: If you do not include the kernel in the pre-rooted firmware, it's recommended to flash it afterwards with flashtool (check "system" under Exclude).
Note2: I am not responsible for any damage done to your device or if you end in a bootloop.

Credits
Androxyde - some helpful information about sin files from his flashtool
[NUT] - used his flashable scripts as base
E:V:A - sgdisk utility compiled for arm
dotnetzip developers (note I'm using a slightly modifed version with a bugfix)

Requirements
Microsoft .NET 4.0

Source code
https://github.com/dosomder/PRFCreator

Changelog
  • v1.3
    • Fix a signing bug when PRFCreator was in a folder which included a space (thanks Calystos)
    • Allow multi select for Extra Zip / APK
    • Update sinflash to v0.42 (fix sha256 bug (thanks RoberM) and large zip file handling (thanks Fragmentation))
  • v1.2
    • Fix a signing bug (thanks RyTekk)
    • Fix bug when flashing multiple apps
    • Update lz4 lib and 7zip binaries (thanks tetsuo55) and dotnetzip library
    • Update sinflash binary to v0.4 (supports now also non-msm devices, thanks eoinkennedy for report)
    .
  • v1.1
    • Allow users to add APKs
    • Improved sinflash to allow compression
    • Fix smaller bugs and improve speed
    .
  • v1.0
    • New method using sinflash (sin files are flashed on the phone directly instead of extracting on the computer)
    • New busybox
    .
  • v0.9
    • Compatible with mono
    • New settings file to change temp folder and choose another destination for the pre rooted firmware
    • Work towards new sin format introduced with Z3+
    .
  • v0.8
    • Add the ability to include additional flashable zip files
    • Display information when clicking on version number
    .
  • v0.7
    • Add zip signing option
    • Small fixes in code
    .
  • v0.6 - Nuked (wrong binary uploaded)
    • Prefer to use gpt uuid instead of partition names
    • Add different modem sin names
    • Clean code
    .
  • v0.5
    • Fixed bug with missing dualrecovery
    • Added check if SuperSU and recovery are flashable
    • Added ability to flash modem
    • Support for sin v2
    .
  • v0.4
    • Make dualrecovery zip optional
    • Fix exception if file does not exist in sin
    .
  • v0.3
    • Initial release
 
Last edited:

zxz0O0

Senior Member
Apr 18, 2011
1,534
5,156
0
I have a question!
  • What should I check under 'Include' ?
    • Kernel: Personally I recommend to check kernel. For some firmwares it's important otherwise the phone won't boot.
    • FOTAKernel: This kernel is used for OTA Updates. I recommend to include it.
    • Modem: This is the baseband / modem. Some updates can give you slightly better battery life and signal.
    • LTALabel: This is a partition with regulatory informations. It should not really change the performance of your device. I recommend to include it.
    .
  • Do I need to include a recovery?
    No, recovery is optional. If you do not wish to include recovery you should add this flashable zip under Extra Files to be able to mount system as rw: https://github.com/dosomder/SonyRICDefeat/blob/master/RICDefeat.zip
    Note: If your bootloader is unlocked, this is not needed as RIC will be disabled anyway.
    .
  • Can I edit system.ext4 inside flashable zip?
    Yes, you can edit it on a linux machine. You don't have to change anything else in the flashable zip. See here for more info: http://forum.xda-developers.com/showpost.php?p=55547862&postcount=246
    .
  • What is zip signing?
    For a proper flashable zip, zip signing is used. It generates a hashtable of all the files in the flashable zip to verify its integrity. Note that zip signing might double the process time of generating a flashable zip.
    .
  • Does it wipe my user data?
    .
  • What is extra zip?
    With this feature, you can include additional flashable zip files. An example is to include Xposed directly (you can find the flashable zip in the Xposed apk).
 
Last edited:

funky0308

Inactive Recognized Themer
Aug 27, 2012
7,029
5,681
0
Osijek
This is awesome tool...
Still couldn't find free time to test it but if it's working and I'm sure it is...

This is more then welcome...

Tnx mate...

Sent from my D6503 using Tapatalk
 

nalab1

Senior Member
Oct 17, 2008
661
39
0
Dunstable
Hi,

Thank you.. Looks really good! What do the Kernel, FOTAKernel and LTALabel checkboxes do? Also, will this work with the latest .133 ftf?

Regards,

Alan
 

zxz0O0

Senior Member
Apr 18, 2011
1,534
5,156
0
Hi,

Thank you.. Looks really good! What do the Kernel, FOTAKernel and LTALabel checkboxes do? Also, will this work with the latest .133 ftf?
Regards,

Alan
It will include those in the flashable zip. FOTAKernel and LTALabel are not really important but I thought why not include this feature. Kernel is more important and I recommend to always use the kernel from the firmware you're using.

It should work with all the current ftfs (the tool is built for sin version 3).
 

nalab1

Senior Member
Oct 17, 2008
661
39
0
Dunstable
It will include those in the flashable zip. FOTAKernel and LTALabel are not really important but I thought why not include this feature. Kernel is more important and I recommend to always use the kernel from the firmware you're using.

It should work with all the current ftfs (the tool is built for sin version 3).
Thanks for the reply... What is sin version 3? Also, what are your recommended settings? Tick all boxes or just the Kernel box? What devices/ROMs has it been tested on? Sorry for all of the questions! :laugh:
 
Last edited:

ptmaniac

Senior Member
Jul 17, 2009
372
213
43
Aveiro
i just used the xperifirm tool to get the latest z2 .323 update, then used flashtool to create .tft, then your prfcreator tool to make the flashable zip. everything worked perfectly fine (many thanks to the dev's for all this nice and easy to use tools btw), this .zip rom should now be flashable from twrp (i got a locked and unlockable BL) no matter what i have installed on the phone right?

Thanks for your help, i'm new to sony devices and my z2 is only 20 days old, i'm trying hard not to brick it :p
 

scifan

Senior Member
Dec 7, 2008
1,269
227
0
There was a dev who would create pre-rooted images you could flash on Galaxy S3 phones... that was something very cool!

So, I should be able to flash the zip this creates and have a "pre-rooted" phone image...

I'd half thought you were creating a root-injected FTF file... but this is actually pretty cool as well... (saves the pain that I normally go through to root the image after flashing it... thankful I have an unlocked boot loader...)
 
Last edited:

zxz0O0

Senior Member
Apr 18, 2011
1,534
5,156
0
Thanks for the reply... What is sin version 3? Also, what are your recommended settings? Tick all boxes or just the Kernel box? What devices/ROMs has it been tested on? Sorry for all of the questions! :laugh:
The first byte of a sin file (contents of ftf file, the ftf is just a zip) is the version. Currently Sony uses version 3. Well if I would create a pre-rooted zip for myself I would tick all the boxes. I have tested the tool a handful of times on my Z1C.

i just used the xperifirm tool to get the latest z2 .323 update, then used flashtool to create .tft, then your prfcreator tool to make the flashable zip. everything worked perfectly fine (many thanks to the dev's for all this nice and easy to use tools btw), this .zip rom should now be flashable from twrp (i got a locked and unlockable BL) no matter what i have installed on the phone right?

Thanks for your help, i'm new to sony devices and my z2 is only 20 days old, i'm trying hard not to brick it :p
Good to hear. And yes, that is correct. I still recommend to take a backup in TWRP before flashing it (just to be on the safe side).

There was a dev who would create pre-rooted images you could flash on Galaxy S3 phones... that was something very cool!

So, I should be able to flash the zip this creates and have a "pre-rooted" phone image...

I'd half thought you were creating a root-injected FTF file... but this is actually pretty cool as well... (saves the pain that I normally go through to root the image after flashing it... thankful I have an unlocked boot loader...)
It's actually not possible to create modified FTF as Sony uses RSA2048 signatures. And yeah, the tool is mainly aimed for those on locked bootloader :)
 

linuxct

Recognized Contributor & Social Contributor
Aug 10, 2012
2,072
5,927
113
Sheffield
NICE! I was just waiting for a root method for my Xperia M2 with KitKat.. The only problem is that there's no Dual-Recovery for it... Would be possible to try the T2U Dual-recovery on my M2? :confused: