Related
As Clockwork's latest recovery has removed support for Amend, certain flashable files have been broken. An example of this, is the Market 2.2.7 ZIP from here: http://forum.xda-developers.com/showthread.php?p=10024525
I figured I should take an existing Edify script as a basis to upgrade with, so I grabbed GApps 2010-12-28 from Lithid's EVO CM7 compile thread here: http://forum.xda-developers.com/showthread.php?t=886294
So looking at the structure of the files, I am confused about certain files.
Under directory: META-INF
CERT.RSA
CERT.SF
MANIFEST.MF
How are these files created and what are they used for? It looks like they were created by SignApk, which I discovered some documentation on from here: http://www.londatiga.net/it/how-to-sign-apk-zip-files/
Another odd file is update-binary located under META-INF/com/google/android, which does not exist on the Amend ZIP. Is this used to introduce special commands like a library to reference?
Comparing the two update-script files
gb-gapps-hdpi-20100128 said:
ui_print("Installing Google Apps..");
mount("MTD", "system", "/system");
mount("MTD", "userdata", "/data");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print("Installation complete!");
unmount("/data");
unmount("/system");
Click to expand...
Click to collapse
market_2.2.7_signed_12272010 said:
assert compatible_with("0.2") == "true"
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
set_perm_recursive 0 0 0755 0644 SYSTEM:lib
show_progress 0.1 10
Click to expand...
Click to collapse
So here is my attempt at updating the script:
As I am only pushing /system files, I only need that mount command. I am confused about permissions, should I be using the same 4 values from the Market 2.2.7 or the GApps package? Considering they both include Market.APK, I am confused why they would be different.
ui_print("Edify port of Amend Market ZIP, will it work?");
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print("Installation successful!");
unmount("/system");
Click to expand...
Click to collapse
Since I modified the update-script file, I assume I need to use SignApk to generate the ZIP file to have the correct hash values.
Lastly: Can Edify push files to the SDCard similar to 'adb push'?
jerseymonkey said:
I am confused about permissions, should I be using the same 4 values from the Market 2.2.7 or the GApps package? Considering they both include Market.APK, I am confused why they would be different.
Click to expand...
Click to collapse
Here's some permissions info
// Read and write for owner, nothing for everybody else
chmod("/somedir/somefile", 0600);
// Read and write for owner, read for everybody else
chmod("/somedir/somefile", 0644);
// Everything for owner, read and execute for others
chmod("/somedir/somefile", 0755);
// Everything for owner, read and execute for owner's group
chmod("/somedir/somefile", 0750);
Click to expand...
Click to collapse
What's the difference between 0755 and 0771? 0771 gives the owner and the owners group read, write, and execute while anyone else can only read. Unless you create new users they will behave the same.
What's the difference between 0 and 1000? 1000 Sets the sticky bit which keeps the program in memory after it runs so it will start more quickly next time. Personally, I would set it at 0 so it doesn't sit in memory when I don't want it to.
Amend:
Code:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
set_perm_recursive 0 0 0755 0644 SYSTEM:lib
Edify:
Code:
set_perm_recursive(0, 0, 0775, 0644, "/system/app");
set_perm_recursive(0, 0, 0775, 0644, "/system/lib");
Might also need to change "MTD" to "BML", as in:
Code:
mount("BML", "system", "/system");
(according to the leaked DK28's updater-script)
I think HTC (EVO) uses MTD.
Someone who knows, please verify this.
=]
DiGi760 said:
Here's some permissions info
Click to expand...
Click to collapse
nubecoder said:
Amend:
Might also need to change "MTD" to "BML", as in:
Code:
mount("BML", "system", "/system");
(according to the leaked DK28's updater-script)
I think HTC (EVO) uses MTD.
Someone who knows, please verify this.
=]
Click to expand...
Click to collapse
Thank you both for the permissions information. I just realized the latest GApps doesn't even include that command.
I tinkered with SignAPK today and managed to create/flash the zip without issue.
Also, the EVO works fine with MTD, did not test BML.
Lastly: Anyone know what update-binary is for? I assume it is used similar to a library as the script did not work without its presence.
How does one run another script from within the updater-script?
Previously it was:
run_program PACKAGE:check_data_app
What about Edify?
droidzone said:
How does one run another script from within the updater-script?
Previously it was:
run_program PACKAGE:check_data_app
What about Edify?
Click to expand...
Click to collapse
Here or here.
from:
Code:
run_program PACKAGE:check_data_app
to:
Code:
run_program("check_data_app");
nubecoder said:
Here or here.
from:
Code:
run_program PACKAGE:check_data_app
to:
Code:
run_program("check_data_app");
Click to expand...
Click to collapse
Thanks a lot..Those links were very useful...Never turned up in my search..
I forgot one.
nubecoder said:
I forgot one.
Click to expand...
Click to collapse
Wow..The last reference was the best! Thanks a lot!
nubecoder said:
I forgot one.
Click to expand...
Click to collapse
thanks for the info. i wanna update some of my own flashable zips but where do i get the update-binary? and i cant seem to find the notes on mtd u were talking about.
MrDevil said:
thanks for the info. i wanna update some of my own flashable zips but where do i get the update-binary? and i cant seem to find the notes on mtd u were talking about.
Click to expand...
Click to collapse
You can download any other Edify script and use it from that.
The dsixda kitchen generates it automatically when you convert the update-script.
MrDevil said:
thanks for the info. i wanna update some of my own flashable zips but where do i get the update-binary? and i cant seem to find the notes on mtd u were talking about.
Click to expand...
Click to collapse
As stated already, just use an update-binary that you can find in another zip (or use the one that comes with my amend2edify app, I think I used the one that came with the leaked DK28 Froyo update zip).
Also, if I'm not mistaken, if you are using CyanogenMod, I believe there is a different update-binary that must be used (someone confirm this please).
The notes about MTD is simply that the Epic uses BML in place of MTD, the notes are in orange up near the top of the post.
NOTE: I also compared this info with the leaked DK28 FROYO updater-script, it seems that for the samsung phones BML is used in place of MTD.
Click to expand...
Click to collapse
Here is a reference to MTD.
I haven't found anything about BML as of yet, maybe Samsung has some hidden docs somewhere...
=]
Thanks guys.
@nubecoder: yup I'm using cm will try out and post results.
Sent via homing pigeons
nubecoder said:
I forgot one.
Click to expand...
Click to collapse
Do you know the syntax of if,elif commands to be run from updater?
this might help I have not tried it yet just found it.
Sent from my unrEVOked using xda app
droidzone said:
Do you know the syntax of if,elif commands to be run from updater?
Click to expand...
Click to collapse
This might help, but it is a bit cryptic to me. I would use an assert if possible (since I've seen the syntax for them).
roscoenr said:
this might help I have not tried it yet just found it.
Click to expand...
Click to collapse
That was written with the Epic 4G in mind, I will be making some changes to it (tonight?) to attempt to be more friendly for more phones.
I did design it to be editable so if you know what to change, you can change it before saving.
=]
nubecoder said:
This might help, but it is a bit cryptic to me. I would use an assert if possible (since I've seen the syntax for them).
That was written with the Epic 4G in mind, I will be making some changes to it (tonight?) to attempt to be more friendly for more phones.
I did design it to be editable so if you know what to change, you can change it before saving.
=]
Click to expand...
Click to collapse
Indeed, this is the best resource I've seen so far
http://forum.xda-developers.com/showpost.php?p=10316302&postcount=102
I am calling run_program to run 'test.sh' from my updater-script. 'test.sh' has some output that is echoed but it doesn't show up on the output when i run my update.zip. Is there a way to show the output of a script that's called in run_program?
Thanks
zebdor44 said:
Is there a way to show the output of a script that's called in run_program?
Click to expand...
Click to collapse
To my knowledge there is not, but you could make the script output to a file, not the same, but might help.?...
=]
im trying to make one for this:
http://forum.xda-developers.com/showthread.php?t=2078587
I followed this tutorial:
http://forum.xda-developers.com/showthread.php?t=1721680
I attached what I've done.. I dont understand why it doesn't do anything
Google 'how to make cwm flashable zip' and get this: http://forum.xda-developers.com/showthread.php?t=1721680
cschmitt said:
Google 'how to make cwm flashable zip' and get this: http://forum.xda-developers.com/showthread.php?t=1721680
Click to expand...
Click to collapse
oh thanks
Its scary you have a mod topic but couldn't Google for an answer...
Sent from my SAMSUNG-SGH-T989 using xda app-developers app
PJcastaldo said:
Its scary you have a mod topic but couldn't Google for an answer...
Sent from my SAMSUNG-SGH-T989 using xda app-developers app
Click to expand...
Click to collapse
because i tried a tutorial and it didn't work.. so I was hoping someone could just help me out but the link that was posted was different and much more straight forward however that too did not work
The problem would be that on Skyrocket the /system partition is mmcblk0p24 not mmcblk0p2.
Damn lucky you didn't brick when flashing this, because mmcblk0p2 in one of the secondary bootloaders!
Code:
run_program("/sbin/mount", "/dev/block/mmcblk0p2", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/unmount", "/dev/block/mmcblk0p2", "/system");
ui_print("Enjoy! ALL OF YOU WATER HAS BEEN EVAPORATED!!!!");
ui_print("Project Evaporation By Guitarboarder28");
A safer method for mounting system is to mount it using the generic partition name, which is more cross-device independent because you aren't mounting a specific block device (mmcblk0p24 isn't the /system partition on every device.)
You also might need to set the correct permission on system apps or other executables in the package.
Code:
ui_print("Flash something...");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Done!");
cschmitt said:
The problem would be that on Skyrocket the /system partition is mmcblk0p24 not mmcblk0p2.
Damn lucky you didn't brick when flashing this, because mmcblk0p2 in one of the secondary bootloaders!
Code:
run_program("/sbin/mount", "/dev/block/mmcblk0p2", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/unmount", "/dev/block/mmcblk0p2", "/system");
ui_print("Enjoy! ALL OF YOU WATER HAS BEEN EVAPORATED!!!!");
ui_print("Project Evaporation By Guitarboarder28");
Click to expand...
Click to collapse
oh boy lol that would have sucked. Thank you for the help
So this should work right?
when I try to flash it immediately fails
Guitarboarder28 said:
So this should work right?
when I try to flash it immediately fails
Click to expand...
Click to collapse
seccontacts.apk cant be a folder, you r trying to inject something into an apk, but your method is wrong, the apk should be already modded and added to the zip with the correct paths setup in the zip and the updater script.
just add the ogg file in the apk, add the apk in the zip into the system/app folder
so did you ever finish the zip?
I am triying to do my script for putting in data the apps so the paid apps you have you can unistall and update from market when ever you want.
Structure:
data
META_INF
In data it the APK with i want to test.
META-INF is the updater-script i do to made it work:
Code:
ui_print("Starting Script....");
ui_print("Installing APK....");
ui_print("Allmost done....");
mount("ext4", "EMMC", "/dev/block/mmcblk0p35", "/data");
package_extract_dir("data", "/data/");
unmount("/data");
ui_print("Script made by werty100....");
ui_print("Thanks for using it...");
Now its wokrs but it doesnt install the app how can I do
A lot of thanks
Working
Know I have cheked it and its works, it was becouse the structure.
Hello
I'm in a bit of trouble because TWRP won't restore my backups. It fails during 65% of the /data partition. There are two separate backups from September and November and none of them work. MD5 Hashes check out OK though
The problem is I need to get the apps and their settings back. There are some important things on there.
I've already unpacked the data.ext4.win000 file using cygwin and found out that there is an app that has cached over 300,000 files which I don't need. Maybe that could be part of the problem, maybe not, I can't figure it out since I don't get any error other than "failed"
What I would like to try next is zip the unpacked /data folder containing /data /Fly-On /local and /misc into a flashable .zip and flash it using adb sidload.
I've found an update-script that could possibly work but currently I am reluctant to use it because I don't see any /misc in there and cygwin did not unpack any folder called "/app"
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0771, "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/data");
package_extract_dir("sdcard", "/sdcard");
run_program("/sbin/busybox", "umount", "/data");
Anyone ever done something like this and willing to share the experience?
Some hints or clues would be greatly appreciated...
I've never seen a line like
package_extract_dir("sdcard", "/sdcard");
before. Should be something like data instead if I'm not mistaken. But I'm not a dev, so somebody else should help here...
Also, wrong section. This belongs to Q&A.
Hey op I'm sorry you've ran into this problem but this might be a really long stretch but you could try to restore the apps and data from the nandroid backup using titanium...
~PsyCl0ne
Sent from my ONEPLUS One using XDA Free mobile app
I've searched and searched for this and can't find any related thread that has solved my problem. So please forgive me if I'm asking this question without having found the answer on my own.
I'm trying to create a flashable zip. The file is clearing-cache-v3.sh and I want it pushed to /system/etc/init.d/clearing-cache-v3.sh. I want to make the file executable after it's pushed to that directory. In the zip file I already have these two folders:
META-INF
system
Within that system folder I placed the file I'm pushing in this zip as /system/etc/init.d/clearing-cache-v3.sh. Below is the updater-script.
Code:
ui_print("");
ui_print("Clear DNS Cache");
show_progress(0.500000, 0);
ui_print("");
ui_print("*******************");
ui_print("*******************");
ui_print("Clearing DNS Cache");
ui_print("*******************");
ui_print("*******************");
run_program("/sbin/mount", "/dev/block/mmcblk0p2", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 06755, "/system/etc/init.d/clearing-cache-v3.sh");
run_program("/system/etc/init.d/clearing-cache-v3.sh");
run_program("/sbin/unmount", "/dev/block/mmcblk0p2", "/system");
ui_print("");
ui_print("All Done!");
show_progress(0.100000, 0);
The problem I'm having is that the file isn't being pushed to /system/etc/init.d. It's just not going there. When I flash this file it doesn't give me an error or anything either. It's just not pushing the file to where it belongs. What am I doing wrong?
You have the placing wrong. You gave meta-inf folder and system folder, inside that system folder in the zip should be /etc/init.d what you have by putting a system folder inside the other system folder is what's wrong.
Sent from my SM-G386T1 using Tapatalk
Blu8 said:
You have the placing wrong. You gave meta-inf folder and system folder, inside that system folder in the zip should be /etc/init.d what you have by putting a system folder inside the other system folder is what's wrong.
Click to expand...
Click to collapse
What do you mean? I have the meta-inf folder and system folder in the zip. Attached is the file that I've been having issues with. Can you expound on what you mean about what I did wrong.
Forget what I said before, the way you worded it confused me. It doesn't flash correctly because you forgot that you have to end the updater script with an empty line.
Sent from my SM-G386T1 using Tapatalk
Blu8 said:
Forget what I said before, the way you worded it confused me. It doesn't flash correctly because you forgot that you have to end the updater script with an empty line.
Sent from my SM-G386T1 using Tapatalk
Click to expand...
Click to collapse
I tried to add a blank line at the end of the updater script and then I saved it, recreated the zip, and flashed and it still made no difference. In fact, if I add a blank line at the end of the file, save it, then reopen the updater-script, that blank line is gone. Why is that?
Could be what you're using to make it. Try something else, but if it is getting rid of that blank line when you save it its not going to work.
Sent from my SM-G386T1 using Tapatalk
Blu8 said:
Could be what you're using to make it. Try something else, but if it is getting rid of that blank line when you save it its not going to work.
Sent from my SM-G386T1 using Tapatalk
Click to expand...
Click to collapse
I just used a different text editor to put the line at the end. This time when I flashed it it said "Error executing updater binary". Prior to this I wasn't getting any errors.
Sorry I really don't know what to tell you, maybe start from scratch?
Sent from my SM-G386T1 using Tapatalk
Blu8 said:
Sorry I really don't know what to tell you, maybe start from scratch?
Sent from my SM-G386T1 using Tapatalk
Click to expand...
Click to collapse
Figured it out. I took the updater-script from another zip file that I've flashed recently that I knew worked and modified that. Below is the final updater script that worked perfectly for me:
Code:
ui_print(" Flashing Google Services fix... ");
ui_print(" ");
show_progress(0.99, 30);
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 0755, "/system/etc/init.d/FixGSv3.sh");
show_progress(1.0, 1);
unmount("/system");
ui_print("----------------------------------------------");
ui_print("| Done!!! |");
ui_print("----------------------------------------------");
ui_print(" ");