yashsingh1/xdaforums huggingface dataset:
[Android Software Development] :
Writing the script isnt a problem. I only suggest to use Notepad++ cause other TextFormatter make some mistakes.
[Android Software Development] Волк:
You're missing the point, why wouldn't I be using Notepad++ if I already know how to write a script and have done so numerous times before. I also ran the commands via terminal emulator and (with the exception of the fact that it couldn't copy some which were in use) it worked fine. Damn CWM. I may just write it as a shell script and have the updater-script invoke the shell script.
[Android Software Development] :
Time ago, CWM didnt flash my scripts.

When i've installed PX-Recovery, the problem is solved!
[Android Software Development] edgie13:
Thank you!
[Android Software Development] :
That's a pleasure! :)
[Android Software Development] aca89:
If I understood this post correctly you can "batch set" permissions for all the apps you want to add to phone. I'm not really clear on how to do it? Can you please explain? Thanks
[Android Software Development] :
With

package_extract_dir("packagedir", "/phonedir");

you extract the files (or the app) to the phone.

With

set_perm(1000, 1000, 0644, "/data/app/[PACKAGE].apk");

You set the permission of the app extracted.

With

set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/PACKAGE_DATA_FOLDER");

You set the permissions of a folder.

Understood, dude? :)
[Android Software Development] aca89:
delete("/data/dalvik-cache/data@app@[PACKAGE].apk@classes.dex");

Ok, and I suppose I should change this line accordingly? How?
[Android Software Development] :
That line'll delete App's apk, data and cache.

If you want to delete Facebook.apk

delete("/data/dalvik-cache/data@com.katana.facebook@Facebook.apk@classes.dex");

You can easily fin the data name in /data/data, the apk's name in /data/app. :)
[Android Software Development] lokeshsaini94:
Root explorer is paid app...

So if you don't want your thread to be called warez then remove its link....

Btw nice guide will try sometime...
[Android Software Development] kuntu:
I was trying to make a script to flash a couple of regularly used apps since i keep moving between roms a lot, on SGS 3 I9300,

But it keeps giving me error while flashing with "Status 0"

I have attached the zip,

View attachment update.zip

Forgot to add, Im using Omega V29 rom with Siyah 1.7rc1 kernel and CWM 5.5 recovery
[Android Software Development] :
The error isn't related to the rom, or kernel, or recovery (sometimes), or phone. However, I'm not at home. Tomorrow I'll return and I'll fix your update.zip
[Android Software Development] kuntu:
Hi m8, any updates?
[Android Software Development] :
Try with that guy! :)

Let me know!
[Android Software Development] kuntu:
No luck, its still giving the same error,

i renamed the file to update.zip, do i need to sign it again or do anything else?
[Android Software Development] :
No, it should work. I'll take a look again...
[Android Software Development] :
Try with that. Let me know!
[Android Software Development] Froggywoggy25:
Okay, I deleted my build.prop of my phone. Is there any way to put it back on using this method? I can get to recovery so I hope I can fix it using this method.

Thanks
[Android Software Development] :
It's a long simplier to make a wipe and reflash your rom.
[Android Software Development] Froggywoggy25:
I would be a very happy person if you were to help me :)

I would like to flash from a SD card if possible. Thanks.
[Android Software Development] :
Give me your rom's link and I'll make a flashable zip for you :)
[Android Software Development] Froggywoggy25:
Use the rom for this tutorial because it is my phone.

http://xdaforums.com/showthread.php?t=1920446

Thanks!

Please make sure this works with default recovery and can bypass the verification thing.
[Android Software Development] :
Obviously I'll do it, but I wanna know which rom are you using... (So, your phone is a Motorola Fire XT?)
[Android Software Development] Froggywoggy25:
Ya that is my phone and the rom is in the tutorial except the tutorial didnt work for me. Does it matter that my phone was rooted when I deleted my file?

Thanks

Ps make sure it works for default recovery and passes verification because every time I try something it always says that.
[Android Software Development] aweosomeabhijeet:
You can't flash any ZIP in fire XT in stock recovery until it is signed by motorola.

This phone has a locked bootloader so no custom recovery or rom too.

The only way is through RSD lite
[Android Software Development] Froggywoggy25:
Can you make it so it is signed by motorola?
[Android Software Development] :
Nope. You've to install a custom rom. This tutorial is done for ClockWorkMod recovery so you need a custom rom with CWM or based recoveries.
[Android Software Development] Froggywoggy25:
So basically its impossible because I cant turn on my phone?
[Android Software Development] :
It's different because CWM recovery has different rules, it's hacked. So that packages will not work on a stock recovery (Motorola, Samsung, Huawei, etc try to protect the systm as they builded it. They don't want custom and hacked versions). So install a custom rom with hacked recovery and I'll help you! :)
[Android Software Development] Froggywoggy25:
Okay This is an edit and I am going to go over my complete situation for you so you can understand what is happening. Over the summer I was at my Grandmas house with my cousins and we were playing Minecraft on the iPod and iPad. I knew that they had it in the Android market and tried to get it. No luck because it was not compatible with my device. I read up on a tutorial to get any app in the store and that was to change the build.prop settings to nexus x or something so I could get it. I rooted my phone and tried it but it screwed up my keyboard and an error occured on screen. So I went into this program I had and completely deleted the file(build.prop, still have a back up though). I tried to turn on the phone but it was stuck in a boot loop :(.

Things I have tried so far:

1. Plugging it into my computer (wont show up)

2. Clearing my memory and cache in recovery mode (still wont turn on)

3. ADB (wont show up, not even in recovery mode)

4. The tutorial I showed you with the ROM (Was able to get into the flash mode but MSM Flash 7227 wont install correctly for some reason (have updated drivers))

5. Cant use ODIN because my phone cant go into download mode

6. Using recovery to update the file (obviously didnt work :P)

I dont think I left anything else out and am looking for a solution. I also have default recovery which may be an issue.

Thanks a lot for reading

FroggyWoggy25
[Android Software Development] :
Nope, you also have recovery which maybe could CAUSS an issue.

However, that's strange: do you know if your stock recovery reads Edify scripts?
[Android Software Development] Froggywoggy25:
I have no clue what an edify script is so unfourtuantly I cant help you.

Is there a way for me to get this phone to appear on the computer because I enabled USB debugging to root it.
[Android Software Development] :
I don't know. On CWM you can use adb commands also in recovery... try and let me know! :)
[Android Software Development] Froggywoggy25:
I made a thread here for my phone

xdaforums.com/showthread.php?t=1986560
[Android Software Development] TylerDurben:
Plz delete :)
[Android Software Development] da-pharoah:
Thanks for the guide.
[Android Software Development] hawaiideveloper:
Looking to start a new ROM for the Galaxy note II

I saw the dsixda's Android Kitchen

Should I start there or with your write up?
[Android Software Development] :
It's your choice:

- DSIXDA's kitchen is useful, rapid and simple

- Using my guide, is a way to learn how flashable packages work, how can you build them.

Again, it's your choice! :)
[Android Software Development] blackspp:
Hi guys, maybe you can help.

Running the latest stock ROM on my Note 2 (XXDMB6) without root at the moment as I have to run an app from my company (which doesn't allow root)..

So I have created a simple update script to remove some files before boot.

I signed the zip using both the tut here (yep, it is a simple tut, thanks!) as well as the zip signer app from GPlay but both methods end with:

E:signature verification failed

Linebreaks in the script are OK (I run Linux).

Script attached...

I hope someone can help, been surfing forever and checking out every tut and method I could find.

Has to be some stupid thing I overlook...

Script attached. I added the .txt to allow it to attach here!
[Android Software Development] :
As you are on stock, you haven't changed recovery yet.

Some stock recovery don't allow to use edify scripts and so on, this tutorial. :)
[Android Software Development] blackspp:
Correct, I haven't. But isn't stock supposed to allow flashing of update.zip scripts provided they are properly signed?

I see al lot of folks having success on various phones and builds. Maybe Samsung's latest bootloaders prevent this?
[Android Software Development] :
Maybe, at the moment I cannot tell you anything else. Can't you flash CWM? Another recovery...?
[Android Software Development] blackspp:
I could but I can't cause than that dam-ned corporate mail app won't work anymore. it detects busybox/root and related activities and that means going through a lengthy authorisation process. On my own phone! Bloody corporates!

Anyway, that's why i try to run a house keeping script to avoid rooting again after i flashed a new rom. Which i still do every now and than but like this time I forgot to clean up the media/sounds/ui folder so i have the annoying camera beeps and stuff I need to ditch.
[Android Software Development] geloczigeri:
Thank you for the tutorial!
[Android Software Development] majin:
Hello to everybody.

How can I create an "update.zip" file with (just) a new framework-res.apk inside and how can I make this "update.zip" flashable via "adb sideload" from stock recovery on a not-rooted ROM?

What I can do?

I need to replace the original framework-res.apk with a modified framework-res.apk.

Thank you.
[Android Software Development] 0xmilan:
Basically I have the same question. I have to push build.prop to system with adb sideload. There's no other solution, since regular adb doesn't work for some reason and the phone doesn't have custom recovery, since its bootloader is locked.

I already modified the update.zip, but after I try to sideload it it gives this error: "Installation aborted".

What's the problem? Is there any solution?

This is the updater-script:

ui_print("| Update Started |");
ui_print("| Mounting filesystem |");
mount("MTD", "system", "/system");
ui_print("| Installing build.prop |");
package_extract_dir("system", "/system");
set_perm(1000, 1000, 0644, "/system/build.prop");
unmount("/system");
ui_print("| Update complete |");
[Android Software Development] mohammadmdp:
thanks for the tutorial.

can I do this?

I have two tablets both are the same, one does not have anything inside system/ directory because I accidentally wiped it. and the other one is new and is ok.

now how can I copy the whole OS from new tablet to the old one by this method you mentioned? because I can only enter to stock recovery mode and send a zip file through adb sideload in the bricked tablet.

thanks for your help.
[Android Software Development] :
The simplest way? I think you should download CWM for your tablet and flash it through recovery. Then, download a rom and flash it easily. If you have stock and want it, search for a stock flashable zip! ;)
[Android Software Development] mohammadmdp:
thanks for reply,

my tablet is nonbrand so easy ways are not working, I've tried everything, I can't flash anything because I don't have access to adb shell in recovery mode.

I also tried flashable zip files of both cwm and twrp, but after transferring them with "adb sideload" command, it verifies the package and it says installation aborted.

besides that whatever I push in it with adb push command, after restart it deletes pushed files.

now system directory is empty and I can't push anything inside it because they'll be removed after restart.

so the only way for me is fooling the system with this method and copy all system files through update.zip

how can I do that?

thanks for help.
[Android Software Development] Ticklefish:
So your system partition automatically is wiped when you turn the device on?
[Android Software Development] mohammadmdp:
not only the system partition, everywhere, it's like read-only in recovery mode but I can push files and they are there until I restart it then it automatically undo any changes I've made.
[Android Software Development] :
Which tablet is it? Model name? Manufacturer?
[Android Software Development] mohammadmdp:
unknown manufacturer, it's Pierre Cardin MID Tablet pc702.
[Android Software Development] :
Wow, so there's no way to restore stock firmware?

So strange.

You could try to pull boot.img and system partitions from your working tablet, and then repushing them to the not-working one. Obviously to do it, you need to have adb and the other android tools working on your computer...!
[Android Software Development] mohammadmdp:
well I can send zip files to it with adb sideload command.

but where is boot.img? there is no img file in any directory at all.

I just need a simple script to put in update.zip so it will run and do the job for me automatically.

here is the idea:

I need two scripts, in first one I need a script that copies the whole system and all partitions of the working one and put them in a zip file in mnt/sdcard directory.

then I will copy all those files to a new update.zip,

then I need a script to copy all those files to the not-working one partitions forcefully so it can't wipe them again.

done.

I think there is a mount command that I can use in it to mount the partitions for r/w.

now can you please tell me what should I write in the script file?
[Android Software Development] :
I don't think it would work.

In my opinion, it would be easier to pull boot.img and system.img from the working tablet, using adb commands.

Once you have them, you could flash them using fastboot.
[Android Software Development] mohammadmdp:
thanks for answering,

but the problem is that it doesn't have fastboot, and since the flash command is for shell, I can't flash anything, because shell is inside system directory and I wiped it,

but it's worth the shot, I'll try it to see if it works, but I don't know about linux commands yet, once I make it I'll put the tutorial in xda, I just thought if you could help me in linux commands that can do such thing I'd appreciate it, it saves my time on learning linux.

thanks anyway,
[Android Software Development] binoyw:
Thanks mate...gonna try this now...:)
[Android Software Development] Vicolodo:
hello ,

i would like to modify the updater script of a zip to be loaded on recovery from sdcard

my device is a rockchip 3188

i tried with auto-sign but the signed zip is found not valid by my device...

instead the original zip is found valid....

i dont know why...

perhaps because otacert is missing?

in the new zip i removed it...perhaps it is mandatory?

in this case how can i generate it?.

thanks!

please help me...
[Android Software Development] :
If you wanna modify a flashable zip, just open it (NOT extract) and modify your updater-script. When you'll save it, you should get it overwritten into the package ;)
[Android Software Development] Vicolodo:
thanks,

but it will be still valid?

i think the digest of the updater script in the manifest will no more be right...perhaps the digest of the files will no more be checked during installation of the package?
[Android Software Development] :
If you dont extract the package you dont remove/corrupt correct signature that are in. Then modify only the updater-script and it should be working as you wanted! :)
[Android Software Development] Vicolodo:
ok thank you

i will try and let you know...

to be honest, this is only the first try...

then i will have also to substitute the .img files so i will have to rebuild the zip...and sign it...

so i need to know the right signing procedure...
[Android Software Development] Vicolodo:
hello, thanks, i will try this evening...

by the way, i found the valid zip here:

http://androtab.info/clockworkmod/rockchip/rk3188/

http://files.androtab.info/rockchip/rk3066/20130427/RK30GENERIC_CWM.zip

the updater script begins with an assert rk3066, so the update stops at this line...

i would like to change it to assert rk3188

this change should work because this zip is under rk3188 directory...do you agree?

thanks!
[Android Software Development] :
The asserts are used to check if the zip is going to be installed to the right phone. Then you should change it with correct specs of your device. ;)
[Android Software Development] Vicolodo:
YES,

before the real update i would like to change the script to get only the code of my device:

in the script i will put only this statement :

ui_print(getprop("ro.product.device"));

the device name should be rk3188 or rk31sdk

I tried to change the script without extracting it from the zip, as you suggested...

When i double clicked on the script, it was opened with notepad, and when i choosed save, the notepad asked me if i would like to overwrite the script existing in the zip...i confirmed and the script was overwritten...

so i moved the zip on the sdcard and tried the update from recovery...

but it didn't pass the validity check... the recovery saw that something was changed in the zip, and it is was no more valid

I sent an email to the authors of the

http://files.androtab.info/rockchip/rk3066/20130427/RK30GENERIC_CWM.zip

asking them how they signed the zip

this is the only zip i found that is found valid by my device...

i have stock recovery 4.2.01 , but RK30GENERIC_CWM.zip surely is not stock firmware...so these guys were able to create a zip valid for the recovery...i dont know how they make it...

by the way,

my device is the

T-R42 with mainboard B351 V1.1 , cpu RK3188

it is a well known chineese android tv box, with many versions and names

CS918,K-R42,MK888B etc...

(i did the error to flash (with RKBatchTool) a custom firmware for T-R42 (Lewy's V2.0) that was not suitable for my board version, so now it is bricked, no more seen by the pc)

any suggestion? any idea on how they signed the zip?

i read somewhere that winzip must not be used to create the zip, instead may be used 7zip

Thanks!
[Android Software Development] :
Yep some zip tools are not working correctly, but I really don't know which ones, as I'm on Linux since 2-and-half years.

Then, retry with another zip manager, and also I suggest to delete every assert line to not end in an error! Let me know! ;)
[Android Software Development] jerbear294:
Thanks for this tutorial- I'm actually going to use it to get someone out of a bootloop (He deleted a couple system apps and borked his phone, better yet he doesn't have a custom recovery or USB debugging enabled)
[Android Software Development] Vicolodo:
Hello,

finally i found the tool that signs correctly all the zips i create

and also the tool that helps to create the zip and the updater script, putting in it all the stuff i want (kernel.img, boot.img, and so on) to make a complete zip to be flashed via recovery menu from SD card, without the need of connection with pc, rkbatchtool, rkandroidtool and so on

It is an XDA thread:

http://xdaforums.com/showthread.php?t=717437

My device find the zips created with these tools valid, so i can do any update i want

I already tried a simple updater scripts that only prints some informations on the screen with ui_print

Now i have only to learn the sintax of the updater script language, and to build the zip with all parts i need to recover my system...

Thanks
[Android Software Development] wlado93:
Hi, I'm trying make updater script for copy four app.apk to /data/app and their data to /data/data

Copy works fine, but I don't know right permissions for /data/data folder :( I tried almost everything I found on internet and XDA, but nothing works... In one case apps found their data, but can't write to them and in other case apps starts like after new installation (without data).

Here is my last script, I proceeded by first post of this thread... With this one apps not see their data...

ui_print(" ");
ui_print(" ");
ui_print("...NECESSARY DATA...");
ui_print(" ");
ui_print("Mounting /data");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Extracting /data");
package_extract_dir("data", "/data");
ui_print("Setting permissions");

set_perm(1000, 1000, 0644, "/data/app/GravityBox.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/com.ceco.gm2.gravitybox");
delete("/data/dalvik-cache/data@app@GravityBox.apk@classes.dex");

set_perm(1000, 1000, 0644, "/data/app/RebootMenu.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/hk.kennethso168.xposed.advancedrebootmenu");
delete("/data/dalvik-cache/data@app@RebootMenu.apk@classes.dex");

set_perm(1000, 1000, 0644, "/data/app/Xposed.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/de.robv.android.xposed.installer");
delete("/data/dalvik-cache/data@app@Xposed.apk@classes.dex");

set_perm(1000, 1000, 0644, "/data/app/SuperSU.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/eu.chainfire.supersu");
delete("/data/dalvik-cache/data@app@SuperSU.apk@classes.dex");

unmount("/data");
ui_print("Unmounting /data");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Installation complete!");

Can someone help me ?
[Android Software Development] :
What kind of issues do you experience using permissions proposed in my first post?
[Android Software Development] wlado93:
Apps not see data which I flashed with ZIP :(
[Android Software Development] :
My thread was opened by testing that tutorial on - as I can remember - a 5.0.2.X CWM.

Which recovery are you using?

Which is the ROM's Android version?
[Android Software Development] wlado93:
Recovery 6XXX and android 4.1.2

But I don't think it's problem of recovery...script works fine, apks are copied, but permissions of data of apps are problem... I don't know right permissions of folders and files in /data/data

Please could you explain what does mean those numbers ?

set_perm([COLOR="Red"]1000, 1000, 0644[/COLOR], .........
set_perm_recursive([COLOR="red"]1000, 1000, 0777, 0777[/COLOR], ........

in first I know that 0644 is permissions for file, but i don't know what are that two 1000

and in second I don'k know what are two 1000 and why there are two 0777 fo set permissions...one is for directory and second for subdirectory or what ?
[Android Software Development] :
Something like this:

set_perm(user, group, mode, file) makes a chmod (in Linux terms) to a FILE.

set_perm_recursive(user, group, mode, directory) makes a chmod to a DIRECTORY, with all its subdirectories.

About the numbers, you can see in the parenthesis the meaning of 1000, 0777 and so on, and if you wanna know why does it needs 1000 or 0777, I suggest you to read this article: http://www.maketecheasier.com/file-permissions-what-does-chmod-777-means .

Ok?