Running scripts in TWRP - Android Q&A, Help & Troubleshooting

Hi guys
just wanted to know if its possible to run scripts within TWRP
i.e i have a script on my /scard, can i make TWRP run it within recovery?
if not are there any ways i can do this? as its important that its done in recovery and not OS.
ive tried looking for flashable zips that i can edit the updater-script but always fails.
i just want to run a script within TWRP using a for statement as it takes too long doing it line by line.
thank you.

Hi,
I was trying to do a similar thing. Did you find a way to do this? I want to automate the running pre-boot.
You can run a script in TWRP. I have used it to remove certain apps from a gapps package. Search the forums for it.

Related

[Q] updater script

as some of you guys may know i am working on a script that will alow users to port almost any rom from skyrocket and tmob sgs2. heres the problem i am running into if push the correct files into the rom before i flash everything runs great. if i use the script that i have now it runs like ass. the problem i think im having is the updater script not installing something or setting the right permissions. heres my question is there any easy way to right a script or even and automative thing i can use to get this working?
any help is greatly appreciated
You're not talking about the updater-script in the CWM zip, right?
I don't have a ton of experience with scripting, but is the script following each step that you would have done manually?
Are you able to compare your script to the Hellraise script to see the differences? In theory, they should be somewhat similar in function, I would think.
The hellraise script for sgs2 will be different since its a program for the computer my script will just be flashed over top of a rom in cwm
Sent from my SAMSUNG-SGH-I717 using XDA

Create flashable zip

I see this has been asked several times. Yet they all seem related to a small package of APKs or the answer is "unzip someone else's and replace what you need".
I have successfully compiled android for nexus 7 and I am able to use fastboot to flash the device. What I would like to be able to do is create an update.zip that can be flashed.
The situation is we have a few hundred Nexus 7s we need to flash and want to simplify the process as much as possible. If could package an update.zip and flash it via fastboot that would be handy as well. Our current setup is to distribute a zip of the out dir from the android build and use a quick script to automate fastboot flashing.
Even if it doesn't really help our situation. How does one go from a compiled android os with the *.img files to an update.zip that can flash the entire device.
halsafar said:
I see this has been asked several times. Yet they all seem related to a small package of APKs or the answer is "unzip someone else's and replace what you need".
I have successfully compiled android for nexus 7 and I am able to use fastboot to flash the device. What I would like to be able to do is create an update.zip that can be flashed.
The situation is we have a few hundred Nexus 7s we need to flash and want to simplify the process as much as possible. If could package an update.zip and flash it via fastboot that would be handy as well. Our current setup is to distribute a zip of the out dir from the android build and use a quick script to automate fastboot flashing.
Even if it doesn't really help our situation. How does one go from a compiled android os with the *.img files to an update.zip that can flash the entire device.
Click to expand...
Click to collapse
Did you build from source? If so just type this command:
Code:
make otapackage
Sent from my HTC PH39100 using Tapatalk 2
Thanks! I tried autocomplete on the source Makefile to see all the possible targets. Well it appears there are so many autocomplete chokes and never returns.
Thanks again.

[Q] How to close the update.zip file the right way

Hi everyone,
I want to eventually create an edited ROM for an Android tablet. (Very simple stuff, really. Removing apks, adding build.prop mods)
I have a working update.zip file, which re-installs the image on the tablet, through stock recovery and the install from sdcard option.
But once I unzip it,
and then zip and even re-sign it (with the tool I found by searching the forum),
the recovery says 'installation aborted', when it is verifying the package.
1. How can I avoid this from happening? I get it that closing the update.zip is done wrong. How can I pass the verification section?
2. It IS possible to push such a .zip through stock recovery, right? I want to avoid CWM and TWRP and make it as simple as possible.
Thanks.
Have you tried making the changes without the unzip-rezip step? Editing the zip contents directly inside the zip (just drag n drop, delete, etc).
dxppxd said:
Have you tried making the changes without the unzip-rezip step? Editing the zip contents directly inside the zip (just drag n drop, delete, etc).
Click to expand...
Click to collapse
I tried this, too.
I only deleted one apk from system/app and later I tried again by deleting the apk and its odex file, too.
In both cases, instead of rejecting the update instanlty, it starts the process and then stops after a few seconds.
IS it possible that there is a filesize checker text inside the image?
(or maybe a propery inside the build.prop or updater-script ?)
Any ideas, anyone?
Still no progress.
I am trying to avoid custom recovery,
(I guess that would involve re-compiling it - which I do not know how to do - or ... just asking so from someone?)
is it possible to push the update.zip through stock recovery?
iraklisvel said:
Still no progress.
I am trying to avoid custom recovery,
(I guess that would involve re-compiling it - which I do not know how to do - or ... just asking so from someone?)
is it possible to push the update.zip through stock recovery?
Click to expand...
Click to collapse
No
Stock recovery doesn't flash custom roms
Get cwm from builder.recovery.com
Press thanks :good: I'd helped :highfive:

[Q] Cube U27GT - Help with Rooting a Stock Rom and can we get a forum?

Dear Admins,
Could we get a forum setup for the Cube U27GT WiFi version? I dug around on the site a bit beforehand but didn't see one, I apologize if I missed it and please direct me there if I did.
I have this tablet and I am doing some initial basic firmware development for it and want a proper place to start putting threads.
Dear Dev Community,
I can't root this bloody thing... At least, not the rom itself. Let me explain...
I can flash the stock rom from Cube and that can be rooted using Kango Root. --Fine...
However, I can't figure out how to replicate this when I make my own rom.
Thus far, here is what I have attempted...
1. Setup dsixda's excellent kitchen on my Ubuntu workstation.
2. Unpack the rom, clean things up, manually put the boot image into the dsixda unpacked working rom folder, run dsixda's root functionality (which add SU binary to xbin and SuperSu apk file to app folder as well as do some things with the boot image file).
3. Rather than using repack with Dsixda (which makes an update.zip image which I can't use because the stock recovery environment on this device can't flash zip update files and I can't for the life of me figure out how to get and or make a working CWM or TWRP recovery image for this unit)...
4. What I do is I run commands in linux to unpack the stock rom to another directory and mount that directory, then clear out a bunch of folders and then manually copy in my files from dsixda's working folder, then repackage up my unpacked stock rom into a new system.img file.
5. Then copy my now modified boot image, system image, and also userdata image (I modify that as well as that is where most all of the chinese bloatware is loaded from) to my SP_Flash_Tool, generate new checksum.ini file and flash normally...
What I get as a result...
1. As long as I am really careful with how I copy files into my new image, the new system flashes okay (if I am not careful, after flash USB storage for some reason has a format error and the system will boot but can't mount USB storage and other odd issues ensue as a result).
2. Assuming everything flashes okay, and no issue with USB storage partition, I have SuperSU installed and when I go to use an app (ES File Explorer or Root Checker) that require's root, I do get the prompt. However none of the root functions actually work and Root Checker tells me I am not rooted.
That is as far as I have got. So as a result, I have a really nice, westernized, cleaned up rom but with no root.
Anyone have any ideas?
This is my first adventure into mod'ing MTK roms so I am sure I am doing all kinds of things wrong . I had a good bit of experience on Rockchip SoC's before this though.
Kind regards and thanks in advance!
Roman
Figured it out!
So I finally did the following rather hackish work-around...
1. Flash stock firmware...
2. Root with Kingo Root
3. Enabled ADB
4. Attach to PC and fire up MTK Droid Tools
5. Take a full backup
6. Modify the system image from the backup and make changes
7. Put that in new firmware flash package
8. Flash new firmware
YAY - Cleaned up rom, modified, with root!
Once I get it all packaged up and uploaded to mtkfirmware.com I will post a link for anyone that wants a cleaned up rom with root!
The only downfall of the above method is that it absolutely requires that the developer have a device on hand because you can't just root the stock image file (at least, I couldn't figure out how... - bleh...
Kind Regards,
Roman
Dear roman,
Thanks for your hard work.
I have a simple question (I think) and if you have the time to reply or -any other android guru- I would be thankful.
My later issue was with a U27GT cube tablet, but I have others, one for each kid, and this is more of general question.
I am reading this and other forums about how to flash tablets from PC. My question is:
Can the flashing process be done from a SD card?
Thanks a lot and regards,
Fernando
SKorea

[Q] Write open recovery script

Hello. I would like to learn how to write open recovery scripts for twrp. I want to make a script that deletes the old backup and then makes a new back up before every flash of any file.
Have you discovered anything interesting since posting this? I'm having trouble getting started too. The scripts do not seem to be running when TWRP starts up.

Categories

Resources