[How To] Create a custom firmware for SmartQ Ten3 T15 - Android Software Development

These are the steps explaining you how to create a custom firmware based on the SmartQ firmware releases.
Warning : Creating a firmware and changing the files may cause your device to stop working, I won't be held responsible for any damage caused by this.
Creating a firmware file is actually very easy, not much is involved and nothing more than some basic software is required to create the files. If you don't understand the steps below than maybe you shouldn't fiddle around with this and wait for other members to create these.
There is nothing explained here about the flashing itself, as I will create a seperate How-To about that with pictures explaining the steps of the recovery.
Also there is nothing explained about kernel building itself, I have no clue how to do that and I'll leave that up to SmartQ.
Use the instructions below to make your own Firmware file with the software you want in it and make all configuration changes you want.
1. If you haven't already download the latest official firmware from SmartQ.
2. Extract the zip file. You then have 2 files, a Chinese .txt file with the release notes. And a file called "SmartQT15".
3. Rename the file "SmartQT15" to "SmartQT15.zip". Accept any warning about making the file useless, as in fact you are making it useful.
4. Extract the zip file. Then you end up with 4 new folders :
"boot" - This will be the files required for booting the OS. And possibly the recovery.
"data" - The user apps and data are in this folder.
"META-INF" - The certificate SmartQ used is in this folder and also the update script that manages the update process.
"system" - The actual Android OS.Stay clear of the boot folder, unless you are 100% sure about what you are doing, this may cause a bricked device without the possibility to reflash.
Add apps to the app subfolder in the data folder. Make sure if you do add apps to set the permissions in the update script file and make changes accordingly. The data-extra.tar file is extracted during the update process.
In the "META-INF\com\google\android" folder you can find the updater-script file, you can edit this with Notepad++. This file tells the CWM based recovery what to do and in this file the permissions are set for apps. Also is it required to edit this if you want to create a pre-rooted firmware.
Be carefull what to change in the system folder it can cause your OS not to boot, but it should be no problem to revert back to another build that did work previously as you didn't touch the boot folder and the recovery should work normally.
Once you have made all the changes you wanted to do. You follow the steps back.
5. zip the 4 folders backup using Winzip or WinRAR, whatever suits you best (You can use compression, I tried out Fast, Normal, Good compression in WinRAR and the firmware flashed without problems). Make sure you have the 4 folders in the "root" of your zip file. Use for filename "SmartQT15.zip"
6. Rename the "SmartQT15.zip" file to "SmartQT15" and accept any warning again about changing the extension of your file.
You have now created a flashable firmware file for the SmartQ Ten3 T15.
Copy his file to the root of an empty microSD card and follow my How-To about flashing Custom Firmwares.
Don't use the guide to flash original SmartQ firmwares as this won't work, by changing the firmware package you break the firmware signature and the recovery will check for this during flashing.
Signature checking can be disabled though in the recovery as I will explain in the new How-To.
If you have any questions feel free to post below and I'll do my best to answer them, all the above is based on my experience and from what I could find out on the Internet.

Related

How to make update.zip from boot.img, system.img, data.img (the nandroid backup)

Yes i know the fastboot trick, but can anyone guide me towards making the nandroid backup files into a update.zip that would work?
I'd like to know too ^^.
Me too.
I've successfully scripted the automated creation of a file structure into which the contents of BOOT.IMG, SYSTEM.IMG, DATA.IMG, CACHE.IMG and SD-EXT.IMG are extracted. The script also creates a valid update-script file under ./META-DATA/....
The only issue I have is that I'm using windows so the .IMG files extracted as a yaffs file system, looses the original file permissions. I need someway to recreate the permissions in the update.zip.
Thats all.
Having a way of converting a nandroid backup to an update.zip means you can very easily cook custom roms from a nandroid backup, and port ROMs across phones using a portable .ZIP format.
Maybe dsixda can help
http://forum.xda-developers.com/showthread.php?t=633246
"OR [cook a rom] from a Nandroid backup (under /sdcard/nandroid) [NOT RECOMMENDED]:
Copy the system.img and boot.img files from the backup folder to your kitchen's original_update folder
NOTE: The Nandroid-backup method of cooking is not the best way to cook, because the kitchen may not account for various advanced options that were cooked outside of this kitchen (these options are in the update-script file which was in the original ROM but is not in the backup. The kitchen needs to re-create this file and 'guess' those options). However, it will support Nandroid backups that already have basic features like root, busybox and /data/app functionality. "
You get nandroid backup images by backing up a ROM which was flashed from an update.zip package. What is then the point of recreating that update.zip package?
giant is right with the klitchen by dsixda you can make an update.zip form nandroid very easy
Guys, we're missing the point.
To clarify:
The "point of recreating the ZIP ROM file" are numerous. For example, to create a ROM where the original ROM isnt available, i.e. to create a portable ROM based on an existing set of images in a phone where the phone and/or its sdcard cannot be removed or where we do not wish to remove the card. Simple. But more importantly, the process is a learning and development activity that I want to undertake, its a personal decision, for which support would be welcome.
Secondly, dsixda issues many caveats around cooking ROMs from nadroid backups. It simply doesnt work - I've tried it - thus his caveat is correct and should be observed. Furthermore, his kitchen creates windows based ZIP files. The process is inherently flawed for creating ROMs for linux because the ZIP files contain a windows file structure which does not contain the appropriate linux based file permissions (linux being the O/S base system on android. The restore operation does not work - in stock form - because one looses the critical file permissions, UID and GID that are required in order for the ROM to function correctly, and in some instances from my experience, to even boot up! His update-script attempts to reinstate the appropriate permissions, UID and GIDs, however, and as dsixda admits, the process is not foolproof and does not cover all eventualities, combinations and scenarios. Thus, the issue of permissions, GID and UID remains outstanding.
For these reasons, in my humble view, the issue of permissions is critical in ensuring a successful ROM flash from [linux based] .IMG files. Once this is resolved, the rest of the process is trivial. Indeed, if this one issue could be resolved, then dsixda's kitchen would mature from a useful toolset, to a truly wonderous one-stop solution.
well i don't know what people have tried and got to work or not, but it can eb done and have been done before, one of my sliderom build was done froma nandroid
soo i guess it's up to how much effort you put into it and use the kitchen as a tool, but not only use it, cause then you fail, if you don't do some manual work, nothing 100% automated will ever be a big succes
I have a solution.
I am coding this up as we speak.
My solution will extract the file permission, UID and GID from the .IMG , for each contained file. My script then runs as part of the update-script (i.e. RUN_PROGRAM restore-protection) subsequent to a ROM flash. Thus, the resultant file structure after a ROM update is exactly the same as that contained within the .IMG files.
EDIT:
coding complete.
will test tomorrow on existing phone + sdcard.
The purpose of this exercise is to 'clone' an existing phone software load, as ROM file, that can then be flashed. My script takes all partition images (system, data, cache, sd-ext and so on), creates a ROM that includes functionality that will - when flashing - restore the exact permissions, GID and UID as written in the backup files (.IMG), thus cloning the phone.
I plan to update the script in future so that APK files can be added or removed, and additional low level features such as kernel pre-empting, scheduling and other features can be added --- I think they call this "a kitchen" in Android speak.??
From your description of what you're doing it sounds like you could end up with the simplest and closest to a one click kitchen that allows users with less knowledge to fully backup / restore / clone their phone (rom, personal settings, data and all). A lot of noobs might like this tool big time
Any progess made on this? I have been trying to create a rom for a nandroid backup. When I go to flash it, I get symlink errors and the flash fails.
dazxda said:
I have a solution.
I am coding this up as we speak.
My solution will extract the file permission, UID and GID from the .IMG , for each contained file. My script then runs as part of the update-script (i.e. RUN_PROGRAM restore-protection) subsequent to a ROM flash. Thus, the resultant file structure after a ROM update is exactly the same as that contained within the .IMG files.
EDIT:
coding complete.
will test tomorrow on existing phone + sdcard.
The purpose of this exercise is to 'clone' an existing phone software load, as ROM file, that can then be flashed. My script takes all partition images (system, data, cache, sd-ext and so on), creates a ROM that includes functionality that will - when flashing - restore the exact permissions, GID and UID as written in the backup files (.IMG), thus cloning the phone.
I plan to update the script in future so that APK files can be added or removed, and additional low level features such as kernel pre-empting, scheduling and other features can be added --- I think they call this "a kitchen" in Android speak.??
Click to expand...
Click to collapse
Do you have a link?
dazxda said:
I have a solution.
I am coding this up as we speak.
My solution will extract the file permission, UID and GID from the .IMG , for each contained file. My script then runs as part of the update-script (i.e. RUN_PROGRAM restore-protection) subsequent to a ROM flash. Thus, the resultant file structure after a ROM update is exactly the same as that contained within the .IMG files.
EDIT:
coding complete.
will test tomorrow on existing phone + sdcard.
The purpose of this exercise is to 'clone' an existing phone software load, as ROM file, that can then be flashed. My script takes all partition images (system, data, cache, sd-ext and so on), creates a ROM that includes functionality that will - when flashing - restore the exact permissions, GID and UID as written in the backup files (.IMG), thus cloning the phone.
I plan to update the script in future so that APK files can be added or removed, and additional low level features such as kernel pre-empting, scheduling and other features can be added --- I think they call this "a kitchen" in Android speak.??
Click to expand...
Click to collapse
Hi, could yo share your script? I'm also working on something similar, and could use a bit of help
OMG this is exactly what I need.. I read all the way to the end and then ARRGGGGGG.. no more responses in months. Have you made this script yet? If no .. does anyone else have instructions on taking a nandroid backup and creating an IMG or ?
My personal reasons.. I have a Craig CMP741E tablet that is stuck in the android logo screen after attempting the factory update.. the one that crashes EVERY1's tablet. And there is no working way that I have found to fix it. No custom roms or factory roms that can be flashed without FIRST having the tablet ON and turn on USB Debugging or already have CWM installed. So I cannot use ADB or any other method I can find to do this.
I have a buddy with the same tablet that is rooted and has GAPPS and everything on it. He gave me a copy of his nandroid backup but now I cannot find anything I can actually do with it. If I can turn it into an Update.zip or IMG I can simply put on SD Card.. restart and cross my fingers.
lilc420 said:
OMG this is exactly what I need.. I read all the way to the end and then ARRGGGGGG.. no more responses in months. Have you made this script yet? If no .. does anyone else have instructions on taking a nandroid backup and creating an IMG or ?
My personal reasons.. I have a Craig CMP741E tablet that is stuck in the android logo screen after attempting the factory update.. the one that crashes EVERY1's tablet. And there is no working way that I have found to fix it. No custom roms or factory roms that can be flashed without FIRST having the tablet ON and turn on USB Debugging or already have CWM installed. So I cannot use ADB or any other method I can find to do this.
I have a buddy with the same tablet that is rooted and has GAPPS and everything on it. He gave me a copy of his nandroid backup but now I cannot find anything I can actually do with it. If I can turn it into an Update.zip or IMG I can simply put on SD Card.. restart and cross my fingers.
Click to expand...
Click to collapse
Can you access the tablet's fastboot mode? Turn the tablet fully off, then hold the Menu button and the Power button. I don't have your tablet, but it's a standard boot mode.
Make sure you have the tablet connected to the PC. You should see it pop up in the Device Manager, or by doing "fastboot devices" from a command prompt.
If you can get there, you may be able to flash a recovery image.
Hi, does anybody knows if there is a response for this post??, i am looking for a method to convert the images files that are included in a rom stock (for using with sp flash tool) to an update.zip file. I have no way to use sp flash tool because my tablet has a hardware problem with microusb port and the only way is flashing a new rom via microSD card with an update.zip..
Maybe the solution is in another thread, please be kind and give me a link or at least give me some suggestions where to look for.

Looking for a tutorial: how to cook a ROM?

I'm looking for a guide which tells how to make a own custom ROM from another one
I mean:
1. How to add/replace/remove apps in /system/app/?
1. a) Do they need to have special permission?
2. How to replace boot screen?
3. How to add custom kernel?
4. How to add Desire lockscreen/flip clock?
5. How to add transparent notofication area?
6. How to add Power menu?
I've been serching forum, but didn't find such tutorial. Would be very thanful to get this knowledge.
I think that will be very useful for maaaany android maniacs
1. Simple delete/copy apks in .zip file using 7-Zip or any other.
2. I belive you need to put bootanimation.zip in /data/local/ folder.
3. Idk
4. For Desire lockscreen you need edited HtcLockScreen.apk; for flip clock - HtcClockWidget.apk
5. Edited /system/framework-res.apk or /system/framework/com.htc.resources.apk. I'm not sure
6. You need edited /system/framework/android.policy.jar
69. Resign your zip file using Auto Sign
Attachment doesn't load, but I know about resigning ROM after everything is done
Ad. 1. As I thought, but do the need special permissions? And I also wonder one thing. Are they installed while flashing? Cuz they need to be in system registry, I think...
I have found this: http://wiki.android.com.pl/wiki/Kon...iana_instalowanych_aplikacji_razem_z_systemem
No any permissions etc.
Found this, too. Thanks.
to add a custom kernel you have to unpack the boot image and edit the ramdisk manually, although i think there is an option in dsixda's kitchen to unpack and repack the boot.img
I've got two more questions:
1. When signing, three files are created in folder META-INF: CERT.RSA, CERT.SF, MANIFEST.SF. But in other packages I see also com/google/android/update-script in META-INF. How to make it? Is it necessary?
2. If I want to make only flashable update file which changes one app or another file, eg. framework-res.apk, I have to create folder structure: system/framework/framework-res.apk, add it to zip archive (no compression?) and sing using Auto-sing. Am I right?
Edit:
Found nice guide there: update-script syntax
tomekk_nt said:
I've got two more questions:
1. When signing, three files are created in folder META-INF: CERT.RSA, CERT.SF, MANIFEST.SF. But in other packages I see also com/google/android/update-script in META-INF. How to make it? Is it necessary?
2. If I want to make only flashable update file which changes one app or another file, eg. framework-res.apk, I have to create folder structure: system/framework/framework-res.apk, add it to zip archive (no compression?) and sing using Auto-sing. Am I right?
Click to expand...
Click to collapse
The most important part of a recovery update zip is the update script. It will tell the recovery what to do. If you want an example of a basic update package, which replaces one file in the /system/framework (although a different one) can found here. Open this and read the META-INF/com/google/android/updater-script (or whatever its called). The syntax is pretty straight forward and I think its easiest to learn from the examples of updater scripts found here on XDA. For the simple case, of only replacing/adding files to the /system partition you can leave the updater script from the above example as is and only change the files under the /system directory in the zip.
Note, that the above example uses the newer upader-script (I hope I am writing this correctly, I am writing from memory) which also has a binary file in the same directory. Some update zips use the older "update-script" lone text script. For these kind of scripts, you can find a guide here.
Personally, I use RA recovery, and for this recovery you need to sign the update zips (last thing you do of course). At least for RA recovery, both the older "update-script" and the newer "updater-script" work fine, so its up to your personal preference which do you prefer.
Thanks. Found a guide you mentioned a couple of minutes ago and read it.
The more I know, the more questions it brings So one more thing. If I'd like to use the newer version of syntax: "updater-script", I need also to put this binary file in this folder. But I create/edit only "updater-script", binary file is the same for all packages, or do I need to edit it, too?
I built a kernel tool long time ago, very easy to use (only for linux)
1: unzip the file, place it where you want it eg your desktop
2: place boot.img in the working directory
3: double-click the menu icon or launch from terminal
4: it creates a new directory named BOOT-EXTRACT,edit what you want in there or change the kernel etc.. and repack it again via the kernel tool
see screenshot. here for those how want the tool >>> http://www.elelinux.se/tools/kernel_tool.zip
Edit: Only for Hero
tomekk_nt said:
Thanks. Found a guide you mentioned a couple of minutes ago and read it.
The more I know, the more questions it brings So one more thing. If I'd like to use the newer version of syntax: "updater-script", I need also to put this binary file in this folder. But I create/edit only "updater-script", binary file is the same for all packages, or do I need to edit it, too?
Click to expand...
Click to collapse
Only the updater-script. The binary is a replacement of the script-interpreter I think, but thats just an assumption.
elelinux said:
I built a kernel tool long time ago, very easy to use (only for linux)
Click to expand...
Click to collapse
And that's a good reason to install newest Ubuntu Thanks!
riemervdzee said:
Only the updater-script. The binary is a replacement of the script-interpreter I think, but thats just an assumption.
Click to expand...
Click to collapse
That's mine assuption, too, but would like to know it for 100%
Edit: I see you use it in your kernel update package. So you write only updater-script and place also update-binary next to it?
LOL, you've got help from every well known hero dev on xda, I'm sure you'll have all the info you need now to start building rom's. Good Luck!
Found an app called Easy Flashable zip Builder on this thread. Will test it soon.
tomekk_nt said:
Found an app called Easy Flashable zip Builder on this thread. Will test it soon.
Click to expand...
Click to collapse
But it is for MS Windows, or saw I wrong ? I have also built a tool to javasign files,but should probably write a manual first,it is easy to use but some dependencies maybe not so easy for a beginner with Linux.
tomekk_nt said:
That's mine assuption, too, but would like to know it for 100%
Edit: I see you use it in your kernel update package. So you write only updater-script and place also update-binary next to it?
Click to expand...
Click to collapse
Correcto

[Q] How to create an flashable .zip file

Hello all,
I am looking for a good comprehensive guide to creating my own .zip files to flash certain changes I like to make when flashing a rom or just adding files.
Now I have found a few good guides here on XDA but they seem to no longer apply as the update script needs to be in edify and not amend. This is the issue I am having so if anyone can point me to a walk through that explains this type of thing I would appreciate it.
Anyone?
lol, i dont think developers/people-with-knowledge would go into a Q&A sub-forum .
I'm neither on of them, however here is my would-be-successful attempt p) :
1- Make all your modifications and finalize them, the root folder must be /system/ .
2- use apktool to recompile as an apk (apktool b system)
3- sign that .apk.
4- rename extension to zip and violla
theoretically, it should work.
Not shure if this can help you, but i created a zip (original Script is from dungphp) to replace files on my device from CWM:
http://forum.xda-developers.com/showthread.php?t=1241244

[Q] How do I apply this file into my Samsung GalaxyS4 that removes all the bloatware?

I have absolutely no background knowledge of anything in a smartphone so bear with me. My device is rooted though.
Ok you know how Samsung Galaxy S4 came with all those stock apps? I want to be able to delete all of them.
With some simple google searches I found this link:
http://forum.xda-developers.com/showthread.php?t=2307355
I attempted some of these steps but I have absolutely, not even the slightest how to complete those steps that person has outlined.
Here are the steps:
Download the zip file "TrulyClean_v1.6_MEDIUM_SBROWSER" extract it.
1. Use the default script or edit the script after your taste. (see "hidden "tutorial above!)
2. Copy recovery.zip to phone.
3a. For best experience - do a full wipe, install a custom rom and then flash TrulyClean.zip.
3b. Script only removes apps in /system, so you have to uninstall any updated apps manually.
4. Flash in recovery (I use PhilZ Touch) & run script after every time you flash a new rom.
5. Enjoy and tell me what you think!
So I downloaded the zip file and extracted it, there were two files into: META-INF and busybox.
Ok so I put them in a folder on the desktop called recovery.
On step 2 I zip the folder I created, so now it's called recovery.zip
On step 3 I don't know anything beyond that, are there step by step tutorials with pictures that illustrate these steps?
michaelli1991 said:
Ok you know how Samsung Galaxy S4 came with all those stock apps? I want to be able to delete all of them.
Click to expand...
Click to collapse
Hello,
This is ROMCleaner - http://forum.xda-developers.com/showthread.php?t=2348256
It is a simple zip which you flash in recovery and also comes with a ROMCleaner_user.txt which you serves as the list of apps you want to delete.
Very easy to edit and use.
Also,
http://forum.xda-developers.com/showthread.php?t=2507931
This is a great ready-to-flash script you can try if you are a little unsure of editing your own custom list.
michaelli1991 said:
I have absolutely no background knowledge of anything in a smartphone so bear with me. My device is rooted though.
Ok you know how Samsung Galaxy S4 came with all those stock apps? I want to be able to delete all of them.
With some simple google searches I found this link:
http://forum.xda-developers.com/showthread.php?t=2307355
I attempted some of these steps but I have absolutely, not even the slightest how to complete those steps that person has outlined.
Here are the steps:
Download the zip file "TrulyClean_v1.6_MEDIUM_SBROWSER" extract it.
1. Use the default script or edit the script after your taste. (see "hidden "tutorial above!)
2. Copy recovery.zip to phone.
3a. For best experience - do a full wipe, install a custom rom and then flash TrulyClean.zip.
3b. Script only removes apps in /system, so you have to uninstall any updated apps manually.
4. Flash in recovery (I use PhilZ Touch) & run script after every time you flash a new rom.
5. Enjoy and tell me what you think!
So I downloaded the zip file and extracted it, there were two files into: META-INF and busybox.
Ok so I put them in a folder on the desktop called recovery.
On step 2 I zip the folder I created, so now it's called recovery.zip
On step 3 I don't know anything beyond that, are there step by step tutorials with pictures that illustrate these steps?
Click to expand...
Click to collapse
Hi.
U do not need to extract the two files.
U only do this if u want to remove any system apps u don't want to remove in the update script.
Just copy the zip file in yr sdcard and flash in recovery.
That's it.
Cheers.
Wait, if your rooted. Why not just buy (yes buy, it's worth it) Titanium Backup or Rom Manager Pro and freeze, backup, and uninstall the apps you want removed. And then you have a good end user friendly GUI to work with.
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app

Question about creating TWRP flashable file

Hey all, I've looked all over an can't find the answer to this... I have a NAND backup I made using TWRP, however, I had the problem many have had with getting errors when trying to restore it. So I thought I'd try a different way by creating a TWRP flashable file from the NAND files. I have taken the files from the backup and extracted them using CYGWIN. I read a thread here:
https://forum.xda-developers.com/showthread.php?t=2746044
But I'm stuck on a couple of things... First, the part about using the META-INF folder from another ROM... I've checked the files in in the META-INF folder and notice that the updater-script is what loads the files and directories. But none of the META-INF files I have found matches my backup files.
The files I want to flash are the complete system folder, complete data folder and the boot.img file. Is it possibly to flash these with TWRP without the META-INF folder/files? If I have to use the META-INF how do I make sure all the files and folders are flashed?
Would it be better to create an ODIN flashable file and just use Odin to do the flash? If so should I put the system and data folders into one file and then use the boot.img (or would I put the boot.img finle into a tar) in the Bootloader spot in Odin?
Thanks in advance.

Categories

Resources