Continuously frustrated with attempting to DEV anything on my OSX - Android Q&A, Help & Troubleshooting

I have spent over an hour trying to get an update someone else already created that removes sense(to work on a recent ICS leak for the amaze 4g)- all I should need to do is modify the updater-script. I opened and edited with gedit, I've checked everything about it and can't find a reason why I get installation aborted- critical error. The recovery log doesn't give me any detail(I am using 4ext), and I'm sure there is something minor I am missing that is keeping me from such a SIMPLE thing..
*Some of this is a rant to explain that I have done PLENTY of searching, if you can take a look at the file and see if you know what I'm doing wrong it is appreciated.
Before I asked this I have searched everything I could find on doing this- I made sure any hidden osx files in the directory were deleted before compressing, made changes with gedit that should maintain the file type, I signed the file with dxixda's kitchen(I do get an error: ls: illegal option -- X - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...] but everything I've found makes me think this shouldn't be a problem- and if it is I don't even know what is wrong with the kitchen or my file).
As I said, this is a last resort, I've also had problems deodexing and it seems like everything else I've tried to do on my mac lately.. GOING CRAZY. If I don't figure out what keeps screwing things up I'm gonna do a complete new install of OSX- I'm thinking maybe there is something wrong..
/Rant*
Thanks in advance if anyone can point out what I'm doing wrong, I am beyond frustrated! In the end I am trying to develop a zip to remove sense and htc apps that can be replaced by aosp ics apps, and maybe a tiny bit of theming if I integrate all of this into a rom- so I'm dying that i can't even get the first part of this accomplished(as I have in the past!)

Script.sh
Code:
#!/sbin/sh
RDD="/data/app"
RDATA="com.twitter.android-1.apk
com.htc.FMRadioWidget.apk
com.htc.FriendStreamWidget.apk
com.htc.MusicWidget.apk
com.htc.NewsReaderWidget.apk
com.htc.StockWidget.apk
com.htc.TwitterWidget.apk
com.htc.WeatherWidget.apk
HtcAddProgramWidget.apk
htcbookmarkwidget.apk
HtcCalculatorWidget.apk
htccalendarwidgets.apk
HtcClockWidget.apk
htccontactwidgets.apk
HtcCopyright.apk
HtcFootprintsWidget.apk
htcmailwidgets.apk
htcmsgwidgets.apk
HtcPhotoWidget.apk
HtcProfilesWidget.apk
HtcRingtoneWidget.apk
htcsettingwidgets.apk
HtcSyncwidget.apk
HtcWeatherWallpaper.apk
PluginManager.apk
Rosie.apk
WidgetDownloadManager.apk"
RSS="/system/app"
RSYS="com.twitter.android-1.apk
com.htc.FMRadioWidget.apk
com.htc.FriendStream3DWidget.apk
com.htc.MusicWidget.apk
com.htc.Twitter3DWidget.apk
com.htc.Weather3DWidget.apk
htcbookmarkwidget3d.apk
HtcCalculatorWidget.apk
htccalendarwidgets3d.apk
HtcClock3DWidget.apk
htccontactwidgets3D.apk
htcmailwidgets3d.apk
HtcPhotoWidget.apk
HtcProfileWidget.apk
HtcRingtoneWidget.apk
htcsettingwidgets.apk
Sync3Dwidget.apk
HtcWeatherWallpaper.apk
PluginManager.apk
Rosie.apk"
for x in $RDATA; do
rm -f $RDD/$x
done
for x in $RSYS do
rm -f $RSS/$x
done
exit 0
updater script
Code:
format("MTD", "cache");
mount("MTD", "system", "/system");
mount("MTD", "userdata", "/data");
show_progress(1, 15);
package_extract_file("script.sh", "/tmp/script.sh");
set_perm(0, 0, 0777, "/tmp/script.sh");
run_program("/tmp/script.sh", "");
delete_recursive("/data/dalvik-cache");
unmount("/userdata");
unmount("/system");

Related

[Q] Can't flash Modded Update.zip

I modded a flashable zip and now it won't let me flash it.
When I try to flash I get
E:Error in /tmp/sideload/package.zip
(Status 6)
I have edited the update script, and don't know how to edit the update binary if that could be it. I am able to flash other zips though. I've tried removing things and adding things. The funny part is that another modded update zip I made a few days ago worked perfectly fine. Any ideas guys? What does Status 6 mean? Why does it give me the tmp/sideload/package.zip thing? Do I need to go back to factory (PLEASE SAY I DONT )
EDIT: I think it was just that zip.
According to AssassinsLament, the issue is probably your update-binary file (assuming you're already using edify: updater-script), which you can compile in AOSP or use the version AssassinsLament provides as the latest attached in his post here:
http://forum.xda-developers.com/showpost.php?p=16409219&postcount=24
also, you can get a more detailed log in recovery, cat /tmp/recovery.log and pastebin that. with the more detailed recovery log, we will be able to determine more precisely the issue you're experiencing, but as a general solution, updating the update-binary file *should* work. if not, pastebin your /tmp/recovery.log.
hope that helps!
joeykrim said:
According to AssassinsLament, the issue is probably your update-binary file (assuming you're already using edify: updater-script), which you can compile in AOSP or use the version AssassinsLament provides as the latest attached in his post here:
http://forum.xda-developers.com/showpost.php?p=16409219&postcount=24
also, you can get a more detailed log in recovery, cat /tmp/recovery.log and pastebin that. with the more detailed recovery log, we will be able to determine more precisely the issue you're experiencing, but as a general solution, updating the update-binary file *should* work. if not, pastebin your /tmp/recovery.log.
hope that helps!
Click to expand...
Click to collapse
Thanks! That's exactly it!, I wasn't touching the update binary (i dont know how).
EDIT: So how exactly do I update the binary? Or do I just copy the one from assassinlaments post into the update zip.
What are you trying to flash?
il Duce said:
What are you trying to flash?
Click to expand...
Click to collapse
Modded framework, sysui and a few other apks to the system partition.
Sent from my PG86100 using Tapatalk
fowenati said:
Modded framework, sysui and a few other apks to the system partition.
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
Make sure you're not using Wordpad or anything like that to edit the updater-script. You need to use something that encodes the file with Unix encoding. Also, it shouldn't be the update-binary, you would get a sideload error. Check to make sure you're not missing a "," or ";" or little things like that somewhere. Also, if you open the file /cache/recovery/last_log when you reboot (or I think there is a /cache/recovery/recovery.log while you're in recovery [just cat that file]) it will tell you what the error is and the line location of any errors in your updater-script
-viperboy- said:
Make sure you're not using Wordpad or anything like that to edit the updater-script. You need to use something that encodes the file with Unix encoding. Also, it shouldn't be the update-binary, you would get a sideload error. Check to make sure you're not missing a "," or ";" or little things like that somewhere. Also, if you open the file /cache/recovery/last_log when you reboot (or I think there is a /cache/recovery/recovery.log while you're in recovery [just cat that file]) it will tell you what the error is and the line location of any errors in your updater-script
Click to expand...
Click to collapse
Yeah I made sure it was in UTF 8, (using text wrangler). I'm gonna check the log right now.
fowenati said:
Yeah I made sure it was in UTF 8, (using text wrangler). I'm gonna check the log right now.
Click to expand...
Click to collapse
Send me your .zip too if you want and I will take a look at it in the morning!
-viperboy- said:
Send me your .zip too if you want and I will take a look at it in the morning!
Click to expand...
Click to collapse
Alright! Here it is!
This one doesnt give me a tmp/sideload/package.zip error, but when it finshes installing it doesn't really install. It wont give an error, but nothing happens.
http://dev-host.org/65j7ve7q0a2f/SupraMOD.zip
fowenati said:
Alright! Here it is!
This one doesnt give me a tmp/sideload/package.zip error, but when it finshes installing it doesn't really install. It wont give an error, but nothing happens.
http://dev-host.org/65j7ve7q0a2f/SupraMOD.zip
Click to expand...
Click to collapse
A few things... you don't even have an updater-binary. You NEED to have that. For the updater-script, you have:
Code:
ui_print("SupraROM v1.2.1 Upgrade-Beta");
show_progress(0.1, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
show_progress(0.2, 0);package_extract_dir("system", "/system");
show_progress(0.3, 0);
unmount("/system");
show_progress(0.4, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
show_progress(0.5, 0);
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Done Flashing");
You are mounting and unmounting twice and trying to extract the same package. Also, show progress is a pain in the ass and I doubt the way you have it shows a progress bar. Do it like this:
Code:
ui_print("SupraROM v1.2.1 Upgrade-Beta");
run_program("/sbin/busybox", "mount", "/system");
ui_print("");
ui_print("Installing files...");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
ui_print("");
ui_print("Done!");
unmount("/system");
And add in this updater-binary...
http://dl.dropbox.com/u/6621763/update-binary.zip
That should take care of it
-viperboy- said:
A few things... you don't even have an updater-binary. You NEED to have that. For the updater-script, you have:
Code:
ui_print("SupraROM v1.2.1 Upgrade-Beta");
show_progress(0.1, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
show_progress(0.2, 0);package_extract_dir("system", "/system");
show_progress(0.3, 0);
unmount("/system");
show_progress(0.4, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
show_progress(0.5, 0);
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Done Flashing");
You are mounting and unmounting twice and trying to extract the same package. Also, show progress is a pain in the ass and I doubt the way you have it shows a progress bar. Do it like this:
Code:
ui_print("SupraROM v1.2.1 Upgrade-Beta");
run_program("/sbin/busybox", "mount", "/system");
ui_print("");
ui_print("Installing files...");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
ui_print("");
ui_print("Done!");
unmount("/system");
And add in this updater-binary...
http://dl.dropbox.com/u/6621763/update-binary.zip
That should take care of it
Click to expand...
Click to collapse
thanks I got it working

[Q] update.zip problems

I'm trying to make a zip to remove the stuff I remove every time and install Titanium Backup, but I keep getting error 6 when I try to flash it. I did sign it, and it was written using Notepad++.
Directory Structure:
data
-app
--com.keramidas.TitaniumBackup-1.apk
--com.keramidas.TitaniumBackupPro-1.apk
META-INF
-com
--google
---android
----update-binary
----updater-script
-CERT.RSA
-CERT.SF
-MANIFEST.MF
updater-script:
show_progress 0.1 0
ui_print(" ===============================================");
ui_print(" | Removing Sense |");
ui_print(" ===============================================");
mount("MTD", "system", "/system");
delete("/system/app/com.htc.FMRRadioWidget.apk");
delete("/system/app/com.htc.FriendStream3DWidget.apk");
delete("/system/app/com.htc.htcmsgwidgets3d.apk");
delete("/system/app/com.htc.MusicWidget.apk");
delete("/system/app/com.htc.Sync3DWidget.apk");
delete("/system/app/com.htc.TrendsdWidget.apk");
delete("/system/app/com.htc.Twitter3DWidget.apk");
delete("/system/app/FusionStockWidget.apk");
delete("/system/app/GenieWidget.apk");
delete("/system/app/HtcAddProgramWidget.apk");
delete("/system/app/HtcAutoRotateWidget.apk");
delete("/system/app/HtcBackgroundDataWidget.apk");
delete("/system/app/htcbookmarkwidget3d.apk");
delete("/system/app/HtcCalculatorWidget.apk");
delete("/system/app/htccalendarwidget3d.apk");
delete("/system/app/HtcClock3DWidget.apk");
delete("/system/app/htccontactwidgets3D.apk");
delete("/system/app/HtcDataRoamingWidget.apk");
delete("/system/app/HtcDataStripWidget.apk");
delete("/system/app/HtcFootprintsWidget3d.apk");
delete("/system/app/HtcGreaderWidget.apk");
delete("/system/app/htcmailwidgets3d.apk");
delete("/system/app/HtcPhotoGridWidget3D.apk");
delete("/system/app/HtcPhotoWidget.apk");
delete("/system/app/HtcPowerStripWidget.apk");
delete("/system/app/HtcProfileWidget.apk");
delete("/system/app/HtcRingtoneWidget.apk");
delete("/system/app/HtcScreenBrightnessWidget.apk");
delete("/system/app/HtcScreenTimeoutWidget.apk");
delete("/system/app/htcsettingswidget.apk");
delete("/system/app/HtcWeather3DWidget.apk");
delete("/system/app/Rosie.apk");
delete("/system/app/Stock.apk");
ui_print(" ===============================================");
ui_print(" | Removing Sense Lockscreen |");
ui_print(" ===============================================");
delete("/system/app/com.htc.idlescreen_SN.apk");
delete("/system/app/HtcLockScreen.apk");
delete("/system/app/Idlescreen_Base.apk");
delete("/system/app/idlescreen_photo.apk");
delete("/system/app/idlescreen_shortcut.apk");
delete("/system/app/IdleScreen_Stock.apk");
delete("/system/app/IdleScreen_Weather.apk");.apk");
ui_print(" ===============================================");
ui_print(" | Removing Bloatware |");
ui_print(" ===============================================");
delete("/system/app/AppSharing.apk");
delete("/system/app/BlueSky.apk");
delete("/system/app/Burgundy.apk");
delete("/system/app/DockMode.apk");
delete("/system/app/Flickr.apk");
delete("/system/app/FriendStream.apk");
delete("/system/app/HtcCarPanel.apk");
delete("/system/app/HtcConnectedMedia.apk");
delete("/system/app/HtcFacebook.apk");
delete("/system/app/HtcFMRadio.apk");
delete("/system/app/HtcFootprints.apk");
delete("/system/app/HtcGreader.apk");
delete("/system/app/HTCLivewallpaperStreak.apk");
delete("/system/app/HtcRingtoneTrimmer.apk");
delete("/system/app/HtcTwitter.apk");
delete("/system/app/HtcWeatherWallpaper.apk");
delete("/system/app/MagicSmokeWallpapers.apk");
delete("/system/app/Maps.apk");
delete("/system/app/MyShelf_Widget.apk");
delete("/system/app/Protips.apk");
delete("/system/app/Swype.apk");
delete("/system/app/TaskManager.apk");
delete("/system/app/Twitter.apk");
delete("/system/app/WeatherLiveWallpaper.apk");
delete("/system/app/MyReportAgent.apk");
unmount("/system");
ui_print(" ===============================================");
ui_print(" | Installing Titanium Backup |");
ui_print(" ===============================================");
mount("MTD", "data", "/data");
copy_dir PACKAGE:data DATA:
unmount("/data");
dementio said:
I'm trying to make a zip to remove the stuff I remove every time and install Titanium Backup, but I keep getting error 6 when I try to flash it. I did sign it, and it was written using Notepad++.
Directory Structure:
data
-app
--com.keramidas.TitaniumBackup-1.apk
--com.keramidas.TitaniumBackupPro-1.apk
META-INF
-com
--google
---android
----update-binary
----updater-script
-CERT.RSA
-CERT.SF
-MANIFEST.MF
updater-script:
show_progress 0.1 0
mount("MTD", "system", "/system");
mount("MTD", "data", "/data");
copy_dir PACKAGE:data DATA:
unmount("/data");
Click to expand...
Click to collapse
the script looks like a great method and its wonderful to see people putting together their own scripts.
i'm assuming you wrote that updater-script file and understand the different components. if you don't, please ask and i can provide more detail.
critique: off the top of my head, two things catch my attention.
1) copy_dir command ends with a : instead of a ; and it appears to be the amend command, not the edify version of the command. edify version of the command would be: package_extract_dir("data", "/data");
2) in the latest version of the update-binary, i think it requires 4 args instead of 3 args for the mount command. also our file system is not MTD as supplied in the 3 args version of the mount command given above. edify version for api 3 used by the latest update-binary should be: mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
here is a great post which outlines some of these changes and how to execute commands under edify: [TUT]Edify Installation Script Syntax's
for advanced troubleshooting, when the custom recovery throws an error, like the error 6 you mention above, via adb check out the /tmp/recovery.log file as this will provide detail around the error and usually a line number to narrow down the issue. i usually access the tmp/recovery.log file via adb shell then cat /tmp/recovery.log .
also, if you're interested, i have a php script on my custom EVO 3D stock app custom site which creates a custom removal .zip file to be loaded through recovery. if you create your own, you can see my updater-script syntax and also my update-binary (latest version). feel free to use them as i enjoy giving back to the community!
hope that helps! good luck!
Nice. Thanks
I didn't realize there were different syntaxes for the different versions, when I was researching, I was looking at several different sites.
Sent from my PG86100 using xda premium
dementio said:
Nice. Thanks
I didn't realize there were different syntaxes for the different versions, when I was researching, I was looking at several different sites.
Click to expand...
Click to collapse
Nice. You're definitely on the right path.
Only a few tweaks to the syntax and you should be all set. The two main versions of update(r)-script code are amend and edify. Edify being the latest and most recent version, you'll want to stick with that for the EVO 3D and probably most android devices/custom recovery's going forward.
Hope you post up your script when you're done!
I will once I figure out this line 1 expected eof error
Sent from my PG86100 using xda premium
dementio said:
updater-script:
show_progress 0.1 0
Click to expand...
Click to collapse
dementio said:
I will once I figure out this line 1 expected eof error
Click to expand...
Click to collapse
i'm assuming the line one error is relating to the command you issue on line 1 of the updater-script file you posted above, i.e. no changes have been made to the first line since you posted.
if you refer to the guide i linked to above, it gives a proper example of the show_progress command under edify syntax. the show_progress command quoted in your original post is using amend syntax.
amend syntax: show_progress 0.1 0
edify syntax: show_progress(0.1, 10);
hope that helps!
joeykrim said:
also, if you're interested, i have a php script on my custom EVO 3D stock app custom site which creates a custom removal .zip file to be loaded through recovery. if you create your own, you can see my updater-script syntax and also my update-binary (latest version). feel free to use them as i enjoy giving back to the community!
Click to expand...
Click to collapse
Wow, nice tool, and bookmarked
joeykrim said:
i'm assuming the line one error is relating to the command you issue on line 1 of the updater-script file you posted above, i.e. no changes have been made to the first line since you posted.
if you refer to the guide i linked to above, it gives a proper example of the show_progress command under edify syntax. the show_progress command quoted in your original post is using amend syntax.
amend syntax: show_progress 0.1 0
edify syntax: show_progress(0.1, 10);
hope that helps!
Click to expand...
Click to collapse
I noticed that, but still got the same error, even after I took that line out
dementio said:
I noticed that, but still got the same error, even after I took that line out
Click to expand...
Click to collapse
the only other idea which comes to mind for EOF on first line would be the type of text editor being used as windows and unix text files are setup differently with return/new line characters.
best method on windows is to use notepad++ and make sure under the settings for new files it is set to use unix standard instead of windows.
i prefer editing the file on a unix/linux machine and if in windows, i'd run a VM.
if you wanted to eliminate that possibility, feel free to grab one of my updater-script files which are known to be working correctly and make sure to use a proper text editor which will maintain the file integrity.
hope that helps!
FINALLY, here's the completed script. It completely? removes Sense, the stock lockscreen (I use Hidden Lock), and a bunch of apps that I never use, and installs Titanium Backup Premium so I can restore everything else. The progress bar doesn't actually work, but it runs so quick I don't really care.
Code:
show_progress(0.1, 10);
ui_print(" ===============================================");
ui_print(" | Removing Sense |");
ui_print(" ===============================================");
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/system");
delete("/system/app/com.htc.FMRRadioWidget.apk");
delete("/system/app/com.htc.FriendStream3DWidget.apk");
delete("/system/app/com.htc.htcmsgwidgets3d.apk");
delete("/system/app/com.htc.MusicWidget.apk");
delete("/system/app/com.htc.Sync3DWidget.apk");
delete("/system/app/com.htc.TrendsdWidget.apk");
delete("/system/app/com.htc.Twitter3DWidget.apk");
delete("/system/app/FusionStockWidget.apk");
delete("/system/app/GenieWidget.apk");
delete("/system/app/HtcAddProgramWidget.apk");
delete("/system/app/HtcAutoRotateWidget.apk");
delete("/system/app/HtcBackgroundDataWidget.apk");
delete("/system/app/htcbookmarkwidget3d.apk");
delete("/system/app/HtcCalculatorWidget.apk");
delete("/system/app/htccalendarwidget3d.apk");
delete("/system/app/HtcClock3DWidget.apk");
delete("/system/app/htccontactwidgets3D.apk");
delete("/system/app/HtcDataRoamingWidget.apk");
delete("/system/app/HtcDataStripWidget.apk");
delete("/system/app/HtcFootprintsWidget3d.apk");
delete("/system/app/HtcGreaderWidget.apk");
delete("/system/app/htcmailwidgets3d.apk");
delete("/system/app/HtcPhotoGridWidget3D.apk");
delete("/system/app/HtcPhotoWidget.apk");
delete("/system/app/HtcPowerStripWidget.apk");
delete("/system/app/HtcProfileWidget.apk");
delete("/system/app/HtcRingtoneWidget.apk");
delete("/system/app/HtcScreenBrightnessWidget.apk");
delete("/system/app/HtcScreenTimeoutWidget.apk");
delete("/system/app/htcsettingswidget.apk");
delete("/system/app/HtcWeather3DWidget.apk");
delete("/system/app/Rosie.apk");
delete("/system/app/Stock.apk");
ui_print(" ===============================================");
ui_print(" | Removing Sense Lockscreen |");
ui_print(" ===============================================");
delete("/system/app/com.htc.idlescreen_SN.apk");
delete("/system/app/HtcLockScreen.apk");
delete("/system/app/Idlescreen_Base.apk");
delete("/system/app/idlescreen_photo.apk");
delete("/system/app/idlescreen_shortcut.apk");
delete("/system/app/IdleScreen_Stock.apk");
delete("/system/app/IdleScreen_Weather.apk");
ui_print(" ===============================================");
ui_print(" | Removing Bloatware |");
ui_print(" ===============================================");
delete("/system/app/AppSharing.apk");
delete("/system/app/BlueSky.apk");
delete("/system/app/Burgundy.apk");
delete("/system/app/DockMode.apk");
delete("/system/app/Flickr.apk");
delete("/system/app/FriendStream.apk");
delete("/system/app/HtcCarPanel.apk");
delete("/system/app/HtcConnectedMedia.apk");
delete("/system/app/HtcFacebook.apk");
delete("/system/app/HtcFMRadio.apk");
delete("/system/app/HtcFootprints.apk");
delete("/system/app/HtcGreader.apk");
delete("/system/app/HTCLivewallpaperStreak.apk");
delete("/system/app/HtcRingtoneTrimmer.apk");
delete("/system/app/HtcTwitter.apk");
delete("/system/app/HtcWeatherWallpaper.apk");
delete("/system/app/MagicSmokeWallpapers.apk");
delete("/system/app/Maps.apk");
delete("/system/app/MyReportAgent.apk");
delete("/system/app/MyShelf_Widget.apk");
delete("/system/app/Protips.apk");
delete("/system/app/Swype.apk");
delete("/system/app/TaskManager.apk");
delete("/system/app/Twitter.apk");
delete("/system/app/vtt-sprint.apk");
delete("/system/app/WeatherAgentService.apk");
delete("/system/app/WeatherLiveWallpaper.apk");
delete("/system/app/WeatherProvider.apk");
delete("/system/app/WeatherSyncProvider.apk");
unmount("/system");
ui_print(" ===============================================");
ui_print(" | Installing Titanium Backup |");
ui_print(" ===============================================");
mount("ext3", "EMMC", "/dev/block/mmcblk0p26", "/data");
package_extract_dir("data", "/data");
unmount("/data");

[SOLVED] Help modifying (flashing) theme files.

Alright, I'm wanting to modify the theme of my rom (eclipse 2.0.2 to be exact). I'll explain my steps below, but the problem I'm having is when flashing the update.zip from my SD card during BSR, I get "E: There is a syntax error in the update" and nothing happens.
Here's my steps. I'm using APK manager 4.9, trying to modify Eclipse 2.0.2.
1. I've installed APK Manager and it's running fine.
2. I grab "framework-res.apk" from Eclipse /system/framework directory and place it inside APKManager's "place-apk-here-for-modding" dir.
3. I run APKManager and choose option 9 (Decompile APK)
4. Once decompiled, I edit the files inside APKManager's "project" dir.
5. I then run APKManager and choose option 11 ("Compile APK"). This places "unsignedframework-res.apk" in the "place-apk-here-for-modding" dir.
6. I take this new file, rename it to "framework-res.apk" and place it in a zip file, along with the META-INF. Here is my dir structure inside the .zip:
Code:
/META-INF/com/google/android/update-script
/system/framework/framework-res.apk
7. I place the following code inside "update-script"
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:framework
show_progress 0.1 10
8. I then sign the .zip using "Testsign" (http://forum.xda-developers.com/showthread.php?t=538020)
9. I now place the newly signed .zip onto my sd card.
10. I reboot my phone into BSR, clear cache/dalvik cache, and attempt to install update from zip.
11. After selecting my .zip and starting the update process, I get the syntax error.
Any ideas? What am I doing wrong?
-------------------------
UPDATE
-------------------------
This topic is solved!
To make this even simpler, download Framework Flasher and easily create flashable update.zip files! http://forum.xda-developers.com/showthread.php?p=21113455
The structure of the files must be like the following:
update.zip/system/framework/framework-res.apk
Store file here
update.zip/META-INF/com/google/android/updater-script
Code:
ui_print("Installing...");
show_progress(0.1, 0);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
show_progress(0.2, 0);
show_progress(0.2, 10);
set_perm_recursive(0, 0, 0755, 0644, "/system/framework/framework-res.apk");
ui_print("Done!")
run_program("/sbin/busybox", "umount", "/system");
update.zip/META-INF/com/google/android/update-binary
You will need to pull this from a ROM or Theme .zip
Thanks!
Would this be better off posted in another Droid x2 forum? Or is this the correct forum? I'm still needing help with this. I just can't seem to get it to work for some reason. Thanks again!
Sent from my DROID X2 using XDA App
This is the correct forum. Hopefully one of our fantastic themers decide to poke their head in and answer but to me it sounds like a problem while creating your zip file.
Sent from my DROID X2 using xda premium
Not sure if this is your issue but I'm pretty sure there's an update to APK Manager. I'm also playing around with theming and I believe the version I have is 5.
Yeah I definitely think the problem is due to either the zip sign our the update-script file.
As for updating apk manager, I'll try it, but I read somewhere that apk manager has bugs and to stick with 4.9. I did however update apktool.jar to the latest version.
Sent from my DROID X2 using XDA App
Don't rename the file in step 6. Do option 12 to sighn the apk. That will create sighnedframework-res. Rename that file and put it in your zip.
I use version 5. Think the option is still 12 to sign the file.
EDIT: Sorry I see step 8 where you sign the apk. I missed that. Never used 4.9 myself.
Sent from my DROID X2 using Tapatalk
hedwig34 said:
Don't rename the file in step 6. Do option 12 to sighn the apk. That will create sighnedframework-res. Rename that file and put it in your zip.
I use version 5. Think the option is still 12 to sign the file.
EDIT: Sorry I see step 8 where you sign the apk. I missed that. Never used 4.9 myself.
Sent from my DROID X2 using Tapatalk
Click to expand...
Click to collapse
Thanks for that reply. I've since downloaded APKManager v5 and signed the APK like you said. I signed the .zip as well. However, I still ended up getting the syntax error.
After more research, I learned the differences between update-script and updater-script. So, I've converted to use the newer method (updater-script).
Inside my updater-script:
Code:
show_progress(1.000000, 0);
mount("yaffs2", "MTD", "system", "/system");
set_progress(0.200000);
package_extract_dir("system", "/system");
set_progress(0.400000);
set_perm(0,0,0644,"/system/framework/framework-res.apk");
set_progress(0.500000);
unmount("/system");
set_progress(0.900000);
ui_print("Update complete. FINALLY");
set_progress(1.000000);
I'm no longer getting the syntax error like before, but now, all I see is the following messages:
Code:
Finding update package...
Opening update package...
Installing update...
THEN IT JUST FREEZES. I end up having to remove my battery and reboot my phone.
Why is this so hard for me?
I do believe its your update script it does not look right at all to me but I'm not using same device will have a look later when I get up
sent from my dhd
leith51 said:
I do believe its your update script it does not look right at all to me but I'm not using same device will have a look later when I get up
sent from my dhd
Click to expand...
Click to collapse
Well, after even more research, I've learned some more. I've ditched the UPDATE-SCRIPT idea since updater-script is the preferred method of flashing.
In order to run updater-script, you need the "update-binary" files as well. As far as I know, all this file does is interpret the updater-script so it can be read. So I grabbed update-binary from a theme .zip that was posted on these forums and am using that.
Along with that, here is my modified updater-script
Code:
show_progress(0.200000, 10);
ui_print("Installing...");
mount("MTD", "system", "/system");
show_progress(0.500000, 40);
package_extract_dir("system", "/system");
show_progress(0.100000, 10);
ui_print("Done!");
unmount("/system");
This code seems to be working, but not 100% yet. I was getting status 6 errors until I converted the newline characters from windows to unix. Now that I've done that, I'm getting Status 7 errors.
So that's where I stand now. With a Status 7 error. Below is my updated .zip structure just for clarification:
Code:
/META-INF/com/google/android/(updater-script and update-binary)
/system/framework/(framework-res.apk)
I'm getting close, but not quite there.
i also am trying to figure this out, i hope you figure it out man
try this script
ui_print("Installing...");
show_progress(0.1, 0);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
show_progress(0.2, 0);
show_progress(0.2, 10);
set_perm_recursive(0, 0, 0755, 0644, "/system/framework/framework-res.apk");
ui_print("Done!")
run_program("/sbin/busybox", "umount", "/system");
if this does not work let me know also like i said i dont have the device so are you you sure its mtd and not emmc ?
leith51 said:
try this script
ui_print("Installing...");
show_progress(0.1, 0);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
show_progress(0.2, 0);
show_progress(0.2, 10);
set_perm_recursive(0, 0, 0755, 0644, "/system/framework/framework-res.apk");
ui_print("Done!")
run_program("/sbin/busybox", "umount", "/system");
if this does not work let me know also like i said i dont have the device so are you you sure its mtd and not emmc ?
Click to expand...
Click to collapse
Wow thanks! The busybox method worked flawlessly, no problem.
I'll update my original post in this topic to help whoever is needing help with this. I also created a script that will automate this entire process for you! Check the original post in this topic for all the details.
Thanks to everyone that helped!
Hi community,
Sorry for bumping this old thread but I'm having some issues when trying this stuff, I created the update.zip file but can't flash it.
The error I get with flashboot is
$ fastboot update update.zip
ERROR: could not clear input pipe; result e000404f, ignoring...
ERROR: could not clear output pipe; result e000404f, ignoring....
archive does not contain 'android-info.txt'
error: update package 'update.zip' has no android-info.txt
And
$ adb sideload upload.zip
shows error installation aborted on the device
This is the only thread that I've seen when users are reporting that the operation was successfully accomplished, although my device is different that's why I'm posting here.
Any help or comment is appreciated,
King regards.

Updater-Script Status 7 Error on Flash

Greetings XDA Forums! First time poster due to a very annoying problem I have with my Updater-Script.
Let me provide background knowledge:
I flashed the Sammy Deluxe Operation IVY Rom on my S4. It's essentially a 100% port of the S5 rom. It works better than my expectation and I was mentally blown away. However there was one annoyance. The hardware keys for the Context Menu and App Switcher were changed to emulate the S5 method. I didnt like it because now context menu is inaccessible. I tried doing the trick where I hold down the capacitive button to see if that works, but Im afraid that trick is a hardware coded trick that was only implemented on the S5. Not the S4 where its merely being emulated.
Adding to my state of annoyance, the ROM author wrote on the front page he wont change it back and dont even ask to change it back. Quote, he said this : "Please change it yourself. This is a S5 style ROM and I don’t understand what the problem is to adapt to new changings. If not, there is always the possibility for you to revert to the original softkey layout." I do understand why he would say that. Let me keep going.
I decided to fix it myself by visiting these 2 links
http://forum.xda-developers.com/showthread.php?t=2792460
This forum post shows you how to emulate the S5 Capacitive Context Menu Button on the S4 ( now the app switcher button )
So I did the reverse process of that. I decompiled the framework-res.apk, edited the boolean back to S4 Default ( which is what I want )
also set the key 139 ( Left Side Capacative ) back to Context Menu function. Recompiled the framework-res.apk.
The question is now is how to install my changes.
I made a flashable zip with updater script and everything. I followed this guide here so I can see the basic syntax and have an understanding of it.
http://forum.xda-developers.com/showthread.php?t=2377695
On doing so, the process of deleting the old framework-res.apk and putting the new one in works perfectly. However the command set_perm doesnt after copying the file to the /system/framework folder. During the flash everything else is good, but once it gets to set perm, Status 7 error is spewed by CWM and it says set_perm some changes failed
I double checked my parenthesis, my semi-colons, and my quotations.
I'm sure the problem is within the syntax of set_perm
Here is my code and I will attach it at the bottom as well for any additional help.
Code:
ui_print("framework-res fix by baboomerang");
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(0.150000, 1);
ui_print("Removing old copy of framework-res");
ui_print("Removing old copy of Generic");
delete("/system/framework/framework-res.apk");
delete("/system/usr/keylayout/Generic.kl");
ui_print("Installation...");
show_progress(0.250000, 2);
package_extract_file("/system/framework/framework-res.apk", "/system/framework");
package_extract_file("/system/usr/keylayout/Generic.kl", "/system/usr/keylayout");
ui_print("Patching done");
show_progress(0.476000, 3);
ui_print("Using CHMOD 644 or rw r r");
ui_print("Uploading Stage 1 to diagnose which set perm broken");
set_perm(0,0,0644, "/system/framework/framework-res.apk");
ui_print("Uploading Stage 2 To diagnose which set perm broken");
set_perm(0,0,0644, "/system/usr/keylayout/Generic.kl");
show_progress(0.789000, 4);
ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/system");
show_progress(0.930000, 5);
ui_print("Cleaning Up...");
show_progress(0.999999, 6);
ui_print("Installation done..........");
ui_print("Now your s4 hardware keys should be back to normal");
It works all the way up to the UI PRINT Uploading Stage 1 to diagnose which set perm broken. Then it just stops with status 7 error.
I am finally requesting assistance or guidance on where to fix this problem. or HOW TO to be accurate.
Hello
Copy your apk at the same level of your updater script and try that :
assert(package_extract_file("framework-res.apk", "/system/framework/framework-res.apk"));
Thanks for the help but...
cyrillem28410 said:
Hello
Copy your apk at the same level of your updater script and try that :
assert(package_extract_file("framework-res.apk", "/system/framework/framework-res.apk"));
Click to expand...
Click to collapse
I see the purpose of that line of code you told me to add. Since I see that English isn't your best ( Don't worry, I understand ) I assume your telling me to put that line of yours above my package extract line code.
So like this:
Code:
ui_print("framework-res fix by baboomerang");
ui_print("Mounting system...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(0.150000, 1);
ui_print("Removing old copy of framework-res");
ui_print("Removing old copy of Generic");
delete("/system/framework/framework-res.apk");
delete("/system/usr/keylayout/Generic.kl");
ui_print("Installation...");
show_progress(0.250000, 2);
[B]
[I]package_extract_file("/system/framework/framework-res.apk", "/system/framework");
assert (package_extract_file("framework-res.apk", "/system/framework/framework-res.apk"));
package_extract_file("/system/usr/keylayout/Generic.kl", "/system/usr/keylayout");[/I][/B]
ui_print("Patching done");
show_progress(0.476000, 3);
ui_print("Using CHMOD 644 or rw r r");
ui_print("Uploading Stage 1");
set_perm(0,0,0644, "/system/framework/framework-res.apk");
ui_print("Uploading Stage 2");
set_perm(0,0,0644, "/system/usr/keylayout/Generic.kl");
On doing this I get from cwm:
Code:
-- Installing: /storage/sdcard1/framework-fix
by baboomerang.zip
Finding update package...
Opening update package...
Installing update...
framework-res fix by baboomerang
Mounting system...
Removing old copy of gramework-res
Removing old copy of Generic
Installation...
[I][B]assert failed: package_extract_file("framework
-res.apk", "/system/framework/framework-res.apk")[/B][/I]
E:Error in /storage/sdcard1/framework-fix by b
aboomerang.zip
(Status 7)
Installation aborted.
I get this when the assertion is below/after the original package_extract. I haven't tried the assertion before/above the original package_extract.
Btw thanks, I think Im getting closer.
EDIT: I am closer and got very close. But now I am here.
Code:
ui_print("framework-res fix by baboomerang");
ui_print("Mounting system...");
[I][B]mount("ext4", "EMMC", "/dev/block/mmcblk0p16", "/system");[/B][/I]
show_progress(0.150000, 1);
ui_print("Removing old copy of framework-res");
ui_print("Removing old copy of Generic");
delete("/system/framework/framework-res.apk");
delete("/system/usr/keylayout/Generic.kl");
ui_print("Installation...");
show_progress(0.250000, 2);
[I][B]package_extract_file("system/framework/framework-res.apk", "/system/framework");
package_extract_file("system/user/keylayout/Generic.kl", "/system/usr/keylayout");[/B][/I]
ui_print("Patching done");
show_progress(0.476000, 3);
ui_print("Using CHMOD 644 or rw r r");
ui_print("Uploading Stage 1");
set_perm(0,0,0644, "/system/framework/framework-res.apk");
ui_print("Uploading Stage 2");
set_perm(0,0,0644, "/system/usr/keylayout/Generic.kl");
show_progress(0.789000, 4);
[I][B]assert(package_extract_file("framework-res.apk", "/system/framework/framework-res.apk"),
package_extract_file("Generic.kl", "/system/usr/keylayout"));[/B][/I]
ui_print("Unmounting system...");
unmount("/system");
This fixes my issues. But I now get back to the part of Stage 1. Where it cant set the permissions.
Instead of using this:
Code:
package_extract_file("[I][B]/system[/B][/I]/framework/framework-res.apk", "/system/framework");
package_extract_file("[I][B]/system[/B][/I]/user/keylayout/Generic.kl", "/system/usr/keylayout");
I did this:
Code:
package_extract_file("[I][B]system[/B][/I]/framework/framework-res.apk", "/system/framework");
package_extract_file("[I][B]system[/B][/I]/user/keylayout/Generic.kl", "/system/usr/keylayout");
Reason for that is because I saw in the guide in my first post, their package_extract_file shows "system" since its coming from the zip itself there is no " / " folder behind it. its just the zip itself, meta inf and system folder. Even if that was added, it doesn't make any sense or wouldn't fit the flashable zip standard.
Fixed 100% working
Ok so thanks for the help, I fully fixed my script with a lot of experimenting.
Here's a summary of what I did
I changed
Code:
run_program("/sbin/busybox", "mount", "/system");
to
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p16", "/system");
also added
Code:
package_extract_dir("system", "/system");
before doing this below
Code:
package_extract_file("system/framework/framework-res.apk", "/system/framework");
package_extract_file("system/usr/keylayout/Generic.kl", "/system/usr/keylayout");
Next I used
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system/framework", "/system/usr/keylayout");
to at least in a different way change the permissions of the files directly with no errors. the 0755 sets the framework folder itself of rwx rx rx then 0644 sets all the files inside to rw r r.
Then I continued to use
Code:
set_perm(0, 0, 0644, "/system/usr/keylayout/Generic.kl");
set_perm(0, 0, 0644, "/system/framework/framework-res.apk");
and somehow after all that it worked yay!
Finally, I did
Code:
assert(package_extract_file("system/framework/framework-res.apk", "/system/framework/framework-res.apk"),
package_extract_file("system/usr/keylayout/Generic.kl", "/system/usr/keylayout/Generic.kl"));
so at least the files are forced to be downloaded.
Im keeping this here so future viewers at least see or get an idea on how to fix it like I did. Cheers

How to make a flashable zip

[Guide]How to make a flashable zip SGA S5830[Screenshots step by step]
Rules:
If you do not know what you're doing, try to learn first.
If you understand something, you'll understand more. If you do not understand, try first to understand, search on Google, read, learn.
I just trying to expose something from my experience.
You do not have to follow my advice if you're not sure that what you want to do, is what you can or need to do.
Do it at your own risk.
I am not responsible for what you do with your phone.
-------------------------------------------------------------------------------------------------------------------------------------
When you want to make a custom ROM, you have some choices:
- to change the ROM and load it on the phone,
- or just add changes made, in the phone.
Just add the change is much simpler than load ROM for each change made.
To add just one or more changes, you need a flashable zip.
----------------------------------------------------------------------------------------------------------------------------------------
Flashable zip is an archive with which you can add one or more .apk or one or more files in the operating system of the phone. Using a flashable zip is very easy and can save you time, as you will see from the presentation below.
----------------------------------------------------------------------------------------------------------------------------------------
The presentation is for SGA S5830 and is made in Windows.
You need: 7zip, Notepad ++, a flashable zip for your phone (for SGA S5830 can download the archive below)
----------------------------------------------------------------------------------------------------------------------------------------
Open the archive with 7zip: you have 2 folders
- META-INF
- and app
View attachment 3176575
----------------------------------------------------------------------------------------------------------------------------------
To the address Memo.zip \ app \ - is Memo.apk
The address Memo.zip \ META-INF \ com \ google \ android \ - is update-binary and updater-script
Memo.apk is the application that we want to replace.
View attachment 3176579
updater-script is the script that we need to edit for make the replacement.
View attachment 3176580
-----------------------------------------------------------------------------------------------------------------------------------
Go to Memo.zip\app\ and delete Memo.apk, then add another Memo.apk with Drag and Drop in archive, or other file such as Calculator.apk
If we add another Memo.apk we do not have to edit updater-script, but if we add another .apk, like Calculator.apk, we need to edit updater-script.
------------------------------------------------------------------------------------------------------------------------------------------
Assuming that we replaced the Memo.apk with Calculator.apk we go and we will edit updater-script.
To edit updater-script, this must be opened with Notepad ++.
To open updater-script with Notepad ++ in 7zip, we have to tell to 7zip with what to do editing.
To do this go in 7zip to Tools-> Options-> Editor, looking for Notepad ++ in PC, and add to the Editor.
View attachment 3176584
Now we right click to the updater-script and then Edit.
View attachment 3176585
-----------------------------------------------------------------------------------------------------------------------------
This is the script for editing.
ui_print("Preparing system update");
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
mount("ext4", "EMMC", "/dev/block/stl14", "/cache");
ui_print("Wiping Cache...");
delete_recursive("/cache");
ui_print("Applying Memo theme");
package_extract_dir("app", "/system/app");
run_program("/sbin/busybox", "chown", "root.root", "/system/app/Memo.apk");
run_program("/sbin/busybox", "chmod", "644", "/system/app/Memo.apk");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/cache");
ui_print("Done! Reboot system please!")
In updater-script we have the following lines that I will explain.
This will help you to change the script when you want to make other updates.
‘ -> displays in CWM
ui_print("Preparing system update");
‘-> mount system
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
‘-> mount cache
mount("ext4", "EMMC", "/dev/block/stl14", "/cache");
‘ -> displays in CWM
ui_print("Wiping Cache...");
‘ -> delete cache
delete_recursive("/cache");
‘ -> displays in CWM
ui_print("Applying Memo theme");
‘->where will extract the .apk file
package_extract_dir("app", "/system/app");
‘->run as superuser
run_program("/sbin/busybox", "chown", "root.root", "/system/app/Memo.apk");
‘->granted permissions
run_program("/sbin/busybox", "chmod", "644", "/system/app/Memo.apk");
‘-> umount system
run_program("/sbin/umount", "/system");
‘-> umount cache
run_program("/sbin/umount", "/cache");
‘ -> displays in CWM
ui_print("Done! Reboot system please!")
--------------------------------------------------------------------------------------------------------------------------
To add Calculator.apk in place of Memo.apk, we must do these replacements:
ui_print("Preparing system update");
mount("ext4", "EMMC", "/dev/block/stl12", "/system");
mount("ext4", "EMMC", "/dev/block/stl14", "/cache");
ui_print("Wiping Cache...");
delete_recursive("/cache");
ui_print("Applying Calculator theme");
package_extract_dir("app", "/system/app");
run_program("/sbin/busybox", "chown", "root.root", "/system/app/ Calculator.apk");
run_program("/sbin/busybox", "chmod", "644", "/system/app/ Calculator.apk");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/cache");
ui_print("Done! Reboot system please!")
We replaced in 3 places, Memo with Calculator.
View attachment 3176586
Now save and close the archive.
-------------------------------------------------------------------------------------------------------------------------------------
Put the archive on SD card.
Go to CWM.
Install zip from SD card.
Reboot.
Done!
------------------------------------------------------------------------------------------------------------------------------------------
I hope this will be helpful to you.
Thank you for your attention.
If you find this thread that was helpful for you, please press the button "Thanks".
Thank you.
Credits and Thanks:
XDA community
brijeshep for [AROMA] Ace-i-Sure Plus Pack
SpaceCaker for explanations
And, sorry, I do not remember from where I downloaded the fashable zip, but thank you.
View attachment Memo.zip

Categories

Resources