[TOOL] PRFCreator - easily create pre-rooted firmwares

Search This thread

zxz0O0

Senior Member
Apr 18, 2011
1,533
5,169
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.

j5yxp3.jpg


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,533
5,169
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://xdaforums.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
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
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,533
5,169
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
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
377
216
Aveiro
Nexus 7 (2013)
Sony Xperia XZ
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
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,533
5,169
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

Social Contributor
Aug 10, 2012
2,088
6,114
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:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 422
    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.

    j5yxp3.jpg


    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
    92
    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://xdaforums.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).
    25
    Updated PRFCreator to v1.0 :fingers-crossed:

    The system partition on some newer devices are 5GB. This is too much for a zip file. Google or the recovery menu devs do not plan to add support for zip64 so I had to search a solution.
    The new method using my tool called sinflash will flash sin files directly on the phone. PRFCreator will simply pack all the sin files together. That means the pre-rooted firmwares are smaller and faster created.

    However you can still use the old method (which extracts the sin files to images on the computer) by checking the Legacy mode checkbox.
    15
    Released new version v1.1 :cowboy:

    Major changes:
    • Users can now add APK files to Extra Files and specify if they should be installed to system or data partition
    • Fixed a bug where SuperSU was not installed when system partition was mounted before flashing the firmware
    • sinflash now supports compression which reduces the size of the firmware (most recovery menus only support flashable zips up to 2GB)
    • Add system image at the end of the zip which will speed up generation significantly (Idea by _SIL_)
    11
    Well, I have a fully working zip for my C6903, I'm running it now.

    The first time I didn't include recovery and you don't get full root.
    Apps can ask for root access, but the system folders will not mount, and you cannot write to them.

    For anyone wanting Stock 5.0.2 Lollipop on their C6903 with full root, and recovery :-

    It will leave you on stock C6903 Lollipop 5.0.2. Customized UK firmware, with active customization 1276-0875_R2D

    Be aware this is for the C6903 only.

    It will also give you full root access, including system folders which are mountable and writable, plus NUT's Z1 Dual Recovery which can be accessed from the boot screen by pressing volume up or down, depending on which recovery you prefer, or from the 'NDR Utils' app which is also installed during this process.

    You will need to download this pre made zip file, which is currently named flashable.zip

    Download this zip file --> https://mega.co.nz/#!qlAETCqJ!Ln4c0MncBq2XPA37gFWeY3VZVz77qk8iJMDiFbjQ3jI

    Copy that zip file to your SD card, and put it in a folder called something like 'Pre rooted 5.0.2' or whatever you prefer, or change the name of the zip file if you wish.

    Boot to recovery.

    In recovery wipe:

    System
    Data
    Cache
    Dalvik Cache

    You do not need to wipe your internal memory.

    Install the flashable.zip

    Reboot system

    That's it!!

    ---------- Post added at 02:16 PM ---------- Previous post was at 01:47 PM ----------

    Creating your own working zip file.

    Ok, so where do we start? With a stock ftf file, right?

    If you have a completely stock .ftf file you are happy with, and wish to use, then you don't need to follow the steps below. You can go straight to using PRF Creator, although you may find the intermediate steps interesting.

    For those of you who are looking for the most recent firmware for your specific model, region, branding, etc. then there is a nice little program called XperiFirm.

    You can download, and read about the latest version from here --> http://forum.xda-dev...loader-t2834142

    Don't forget to say thanks.

    This is the one i have used. It is version 4.5.1
    Download XperiFirm --> https://mega.co.nz/#!XlAzCRQD!Sn6KHt7-FobB5cCEojQ8kSYIXuc10XDHnKvejZk2dsQ

    Once you have downloaded it, run the program and you will see the following screen

    01%20-%20Select%20firmware.png


    Select your phone, and then model in the left hand list, and XperiFirm will display all available options in the middle pane.
    Choose the region, and branding you are looking for.

    As you can see, I have already selected Xperia Z1 > C6903 > Customized UK.

    In the right hand list, XperiFirm will then display the available downloads.

    In my case, it shows both the 14.4.A.0.157 Kitkat 4.4.4 firmware, and the 14.5.A.0.242 Lollipop 5.0.2 firmware.

    Well, I wanted Lollipop so I clicked on the top one, 14.5.A.0.242

    Whatever you choose, will display a download window, like this

    02%20-%20No%20unpack.png


    Make sure you untick 'Unpack automatically' as it is ticked by default.

    Now click 'Download'

    Navigate to where you want to save, and once it has finished, you will see another prompt like so

    03%20-%20No%20unpack%20confirm.png


    Click 'No' and exit the program.

    You now have the stock version of whichever firmware you wanted, as a base to create your stock rom, rooted, with Dual Recovery.

    When you look at where you downloaded the firmware, you will not see a .ftf file. You will see a number of files, usually four, that begin with 'FILE' and some numbers. This is totally fine, and is how Sony store their firmwares. XperiFirm is downloading the source files directly from Sony's servers.

    So now we have our firmware, just not in .ftf format.

    What we need to do now is decrypt our 'FILE's and create out own .ftf

    To do this, you will need Flashtool, and preferably the latest version.

    You can read about, and download Flashtool from here --> www.flashtool.net

    I used version 0.9.18.4 --> https://mega.co.nz/#!OhQC2DyT!FTGosP5IFJEUaktkhU6KggifNC79Xp782-1PGKcgsIY

    Run Flashtool and when it has synced, in the menu bar, at the top, click on Tools > Bundles > FILESET Decrypt.

    Select your Source Folder and you will see the FILEs appear in the list below, like so

    01%20-%20Select%20and%20convert.png


    Select them all, and click the right arrow in the middle to move them all across.

    Click on 'Convert' and Flastool will begin converting the FILEs, like so

    02-%20Decrypting%20files.png


    Once Flashtool has converted the files, you will see the following

    03-%20Choosing.png


    Double click in the greyed out space next to 'Device' and choose your Device

    In 'Branding' type which branding you are using, e.g. 'Customized UK'

    In 'Version' type which version you are creating, e.g. '1276-0875_14.5.A.0.242_R2D'

    In the section underneath, move everything across to the right by selecting the item, and clicking the right arrow in the middle, but leave the two files marked with 'TA', like so.

    04-%20Chosen.png


    Now click on 'Create'

    Your .ftf file will be created, and placed in the Flashtool > Firmwares folder.

    That's it. You now have a completely stock .ftf file of your chosen firmware, ready for the next step, which, incidentally, you could flash as is if you wished to revert to a complete stock setup, without root or recovery.

    Following the next step will create a rom which is stock, rooted, with Dual Recovery, as a zip file that can be flashed from an already existing recovery.

    Creating your stock, fully rooted rom, with Dual Recovery using PRF Creator

    Ok, so we've got our stock .ftf, so what else are we going to need?

    You will need the latest version of SuperSU, which can be dowloaded here --> https://download.cha....eu/696/SuperSU
    I have version 2.46 --> https://mega.co.nz/#!q9RSXYYQ!OLdWhoBlWR_dSYKcEW4E0mRJFL-XskZHPx-sOdOY0VU

    You will need the latest flashable zip version of NUT's Z1 Dual Recovery.
    It can be downloaded direct from NUT's download page, here --> http://nut.xperia-files.com/
    Make sure you download the flashable zip version, NOT the installer version
    I use Z1-lockeddualrecovery2.8.15-RELEASE.flashable.zip --> https://mega.co.nz/#!vl4kjRCL!vwO63HbKUkUlVIowXp7WAjEZG_XFutJkm9IBnJrCLrA

    Now you have all the parts to make your own rom, you will need to put them all together, and that is where PRF Creator comes in.

    You can read about, and download the latest version of PRF Creator here --> http://forum.xda-dev...te-pre-t2859904 - which is where we are lol
    I use version 0.8 --> https://mega.co.nz/#!L0ZHDDqC!mPxJL32zPkIf12YZshApIdNVV8JNRcHnmgjIPRaC7-Q
    Download and extract the zip.

    Run PRF Creator.

    You will see here, I have already selected my options

    01-%20Select%20options.png


    Use the three dots beside each of the top three sections to browse for your .ftf file, your SuperSU zip, and your recovery zip.

    Tick the four boxes under 'Include' on the right hand side, for Kernel, FOTAKernel, Modem, and LTALabel.
    Do not tick 'Sign zip'

    Click on 'Create' and let PRF Creator do it's thing.

    Your screens should progress as follows

    02%20-%20Create.png


    03%20-%20Step%204.png


    04%20-%20Step%205.png


    Here you can see SuperSU being added to the rom

    05%20-%20Step%206%20Add%20SU.png


    And here, the Dual Recovery

    06%20-%20Step%207%20Add%20Z1%20DR.png


    And finally,

    07%20-%20Finished.png


    And there you have it. Close the program by clicking the cross in the top right corner.

    You will now find in your PRF Creator folder, a flashble zip file called, well, 'flashable.zip'

    All you need to do now, is flash it.

    Copy the zip file, from the PRF Creator folder, to your SD card, and put it in a folder called something like 'Pre rooted 5.0.2' or whatever you prefer, or change the name of the zip file if you wish.

    Boot to recovery.

    In recovery wipe:

    System
    Data
    Cache
    Dalvik Cache

    You do not need to wipe your internal memory.

    Install the flashable.zip

    Reboot system

    That's it!

    Hopefully you are now enjoying your pre-rooted choice of firmware, with Dual Recovery.

    If you have any problems, I don't want to know . . . lol just kidding :laugh:
    I'll always try and help if I can.

    I'd just like to say thank you to all the people who make this kind of thing possible. There's too many to list, but I've linked to the respective works that I've used in writing this guide, so anyone reading this, if you find it useful, please say thank you to the person involved too.

    Here are a few screenshots, just so you can see.

    Screenshot_2015-05-08-03-07-40.png


    Screenshot_2015-05-08-03-05-31.png


    Screenshot_2015-05-08-03-06-02.png


    Screenshot_2015-05-08-03-06-31.png


    Screenshot_2015-05-08-03-06-57.png


    Screenshot_2015-05-08-03-08-33.png


    Good luck to you all, I hope this helps :good: