yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] mrbarker:
My data wiped too

I followed everything precisely on a completely stock Nexus 4 and it wiped my data too.. Not to critical for me since I dont do much with my phone so its not a bother but just for reference for others...
[Nexus 4 General] Remoteconcern:
Well this method will keep your SD card contents, but will wipe your data/data on internal storage. So depends on what you mean by wipe :)
[Nexus 4 General] mrbarker:
My Nexus 4 doesnt have an sd card..
[Nexus 4 General] jipi:
I am sorry for those who have lost data but I did exactly what I have said and preserved all my data without any other manipulation. All my apps are still there, gmail accounts, WiFi passwords, etc... I am not an expert, maybe somebody will be able to explain when data are deleted and when not.
[Nexus 4 General] Noiseboy1176:
For anyone having trouble flashing on a mac, I kept getting a usb_write error when I tried to flash the system.img. Bootloader and radio flashed just fine, but not the actual rom. I got it working in windows and narrowed the problem down to either the version of adb and fastboot I was using ( they came from a zip in another thread called rootnexus4.zip) or the archive app I was using on macOS (The Unarchiver). Hope this helps someone.
[Nexus 4 General] bkitagawa:
Is the root okay?

Thanks
[Nexus 4 General] Noiseboy1176:
Root is fine. Using SuperSU 1.43
[Nexus 4 General] minotauri:
this didnt wipe /data for me either.
[Nexus 4 General] alakyr:
sirry my bad...i used also the -w flag that wipe everything :P
[Nexus 4 General] jipi:
Yes, that was the problem, you didn't follow exactly the process. If you use -w flag it will wipe your data. I am sorry for you.
[Nexus 4 General] jipi:
It is better to download a fresh version of Android SDK (link on the first post) and then upgrade it following the method as described in the link in point 4. It seems that ADB has to be upgraded to work with 4.2.2 because 4.2.2 implemented a new security feature with certificate.

So, if ADB works fine, don't change anything but if it doesn't, upgrade to the newest version. If you don't know how to do it follow the procedure, it is easy.
[Nexus 4 General] Noiseboy1176:
Agreed. That's what I usually do, but was feeling lazy and the version of adb I had works for everything I've tried so far... Unlocking boot loader on 4.2.2, flashing numerous recoveries, radios etc. So I thought it would be fine. Of course, it is possible that my problem was the archive utility I used to extract the ROM and not adb related at all. Either way, I figured ppl should know in case it happens to them.
[Nexus 4 General] omaga:
Must the bootloader be unlocked to do this flash? Have flash many roms with Windows PC but now Im a mac user and never flashed roms with mac and yesterday i tried and didnt get it:p is the an video tutorial on this?:eek:
[Nexus 4 General] alakyr:
wipe all was my intention and btw i do it before your post ;)
[Nexus 4 General] Gorjira:
Would the "fashall.sh" file work as a Flash All option? Just click on that and would it run?
[Nexus 4 General] 屌你卤味:
Should I continue to try ?

I'm using a stock rom, stock kernel, stock radio, with root. Custom Recovery "recovery-cwmtouch-6.0.3.1-mako"

BUT ! I've deleted few apk in /system/app/ ... and I wanna keep all data and setting... Is it OK to Continue ?
[Nexus 4 General] jipi:
The flashall.sh didn't work for me.
[Nexus 4 General] Gorjira:
Alright I kind of figured it wouldn't. Needless to say I figured it out. Fairly easy and I felt like a bada$$ typing these commands on the computer and watching it happen on the phone. First time I've done this manually! Thanks to the OP for this and I'm glad to have ADB on my Mac!
[Nexus 4 General] DomieMic65:
will this guide work for the galaxy nexus???
[Nexus 4 General] sordna:
Most probably yes (especially if you are on the unlocked google edition of the Galaxy Nexus) however you must be careful and download DIFFERENT files for the ROM, recovery, etc, since the links in the OP are specific to the Nexus 4.

However the same adb commands and steps would apply, as long as you get the proper images for your particular phone.
[Nexus 4 General] ShadowOf:
jipi, thank you!!!! I followed your direcions on my Nexus 7 and kept ALL my data intact!!!

I copied your instructions over to a Nexus7 thread, giving you credit: http://xdaforums.com/showthread.php?t=2390286
[Nexus 4 General] sordna:
It would be safer to restore the deleted apk's before you proceed... did you keep a backup of your system partition ?

Anyway, if you try it let us know what happened!
[Nexus 4 General] essfour:
Worked Perfectly

Joined to thank you for this post. Worked flawlessly. Lost no data. Even kept my previous radio (so I can get LTE). So far so good.

*Edit: New radio WAS flashed. No longer have LTE. Will flash an older radio to get it back.
[Nexus 4 General] schewie:
This guide worked perfectly for me. Thank you.
[Nexus 4 General] 94SupraTT:
Worked perfectly! Thanks!
[Nexus 4 General] fredmanwalking:
I followed the steps exactly and my phone ended up with 4.3 but was in a factory state.

I restored from a nandroid backup and tried again, but that time I removed userdata.img from the image ZIP file, as mentioned in an earlier post in the thread. This time my phone upgraded instead. I recommend that the OP be updated to indicate the different behaviors with or without the userdata.img file in the image ZIP.

However, I was oddly missing the sdcard folder (emulated SD card folder that the Nexus 4 has) contents after the upgrade. That was unexpected. Anyone else experienced this? Or does anyone have any ideas why that happened? Thanks

EDIT

I just thought about this some more and I realized that the SD card contents was wiped by my original update attempt, since it is an emulated folder in /data/media I believe. Unfortunately, it appears that my nandroid backup with Clockworkmod recovery did not backup this, since I restored to my 4.2.2 backup and the contents are still missing. I will either need to keep this in mind for the future or find a better nandroid backup method. Luckily, I had copied my pictures from the sdcard folder prior to my first attempt. However, I need to put all my ringtones, notification sounds, etc back on. I'm kind of dismayed why this wasn't part of the backup I took.
[HTC One X] jeyml:
Hello guys,i just wanted to know how to get the error log out of my device? I mean,where can i find it? For the past 4 or 5 weeks my phone randomly restarts and ask me if i want to send the error report to HTC,of course i send it but i wanted to know how to get it myself on my PC.Maybe somebody here knows what is wrong with my device and could help me stop this restarts that my phone has because HTC have no response for me after several emails.I think it's a software problem and not a hardware problem.I keep reading the forum about the hardware malfunctions that other people have but my device has none of the simtoms that the other people have with the hardware faults,so this is posibly just a software problem.

Thank you,and sorry for the long post.
[Sony Ericsson Xperia Neo, Pro] lolsky:
Hi!

I'm making my own ROM and I'm getting these errors :

It's taken from AROMA Changelog.txt.

What could cause that?

------------------------------------------------------------------------------------

It's strange, because selected apps are installing normally...
[Sony Ericsson Xperia Neo, Pro] lolsky:
---SOLVED---

I've added too much this:

One is enough :)

---TO CLOSE---
[XDA-University] KINGbabasula:
Aroma Installer

Folder structure:

Blue = Folders

Black = Files

META-INF

|--com

|..|--google

|.....|--android

|........|--aroma

|........|..|--exec_demo < Little executables to sleep or take a screenshot

|........|..|--fonts < Fonts: There must be a "small.png" for lowercase and a "big.png"

|........|..|--icons < The icons that will be showed if called by the aroma-config

|........|..|--langs < It may contain translations

|........|..|--splash < The splash image/s that are showed at the start as static or animation if called by aroma-config

|........|..|--themes < Can be chosen from the aroma-config

|........|..|--ttf < Fonts

|........|..|--unicode < Chinese and Cyrillic

|........|--aroma-config < File that controls the installation

|........|--update-binary < Executable

|........|--update-binary-installer < Executable

|........|--updater-script < File that controls the installation

|--CERT.RSA < Sign files

|--CERT.SF < Sign files

|--MANIFEST.MF < Sign files

Will come soon...
[XDA-University] KINGbabasula:
Reserved 2
[XDA-University] juzerali:
This is awesome! thanks!
[XDA-University] willverduzco:
Thanks for creating this guide. I've featured on the XDA Portal. :)
[XDA-University] Kurotsuchi:
I am lucky because I really needed help, this may not be so related but I made my Rom using Android Kitchen, but I get the Status 0 ERROR which is related to the '' updater-script '' as described in the original thread

Status 0 might be two things: 1) You used an update-script (Amend format, which is very old) when you should be using an updater-script (Edify format), or the other way around; OR 2) Your updater-script is using the "MTD" partition type when mounting a partition rather than another type such as EMMC (and thus, you need the device defined under the kitchen's /tools/edify_defs folder).

do you have any clue for this buddy ? none of the 2 solutions above worked for me.

Thanks again, and sorry if it's not so related to your thread!
[XDA-University] KINGbabasula:
Please post your updater script here and i will take a look at it

Inviato dal mio GT-I9070 con Tapatalk 2
[XDA-University] chemicalrage:
Extremely HQ thread. Btw a typo in the 9th point. bynaries -> binaries.
[XDA-University] Kurotsuchi:
Thanks for the answer buddy, here it's, ( this is for Galaxy note 8.0 ) my previous phones rom didn't have this problem because it was NOT using

MTD.
[XDA-University] yashade2001:
Thanx for the perfect tuto ;) .
[XDA-University] Dark Wraith:
Problem is with

format("MTD", "system");

mount("MTD", "system", "/system");

Open your ramdisk contents extracted from your kernel. There you should see something like fstab or .fstab. Open those files with notepad++. you will see the path to your system or data..say for xperia s the mount point for the system is dev/block/mmcblk0p12 and format is ext4 so the command becomes format("ext4","EMMC","dev/block/mmcblk0p12") and mount("ext4","EMMC","dev/block/mmcblk0p12)respectively.

Similarly for assert(package_extract_file("boot.img", "/tmp/boot.img").This tells cwm to extract boot.img and load it in /tmp/boot.img which is wrong..again you need to find the mount point of your phone where you need to extract the boot.img...Again taking xperia s as an example. it is

package_extract_file("boot.img", "/dev/block/mmcblk0p3").

Hope that helps
[XDA-University] KINGbabasula:
Yes it's as Dark Wraith said

Inviato dal mio GT-I9070 con Tapatalk 2
[XDA-University] Kurotsuchi:
MANY THANKS BUDDY! really appreciate it,
[XDA-University] dstruct2k:
I seem to remember reading somewhere that you can just replace the update-binary with a shell script in plain text and some recoveries will read it, but I can't seem to find the post. Anyone else know what I'm talking about?

If that's not possible and I've just gone crazy, is there a way to force a reboot into recovery in an Edify script? I'm wanting to fix my bootloader update packages so they automatically reboot back to recovery after install, otherwise the recovery doesn't know the new bootloader version and ROMs still fail on asserts that check it until after a reboot.

EDIT: I just tried using run_program("/sbin/busybox", "reboot", "recovery"); but busybox doesn't understand "reboot recovery" and simply reboots back to the currently installed ROM.
[XDA-University] demkantor:
try this

run_program("/system/xbin/busybox", "reboot recovery");

or

run_program("/system/xbin/busybox", "reboot-recovery");

cant remember but its something like this

EDIT:
[MENTION=812646]dstruct2k[/MENTION]

run_program("/sbin/reboot", "recovery");

is the proper syntax
[XDA-University] dstruct2k:
"/sbin/reboot" does not exist in TWRP, is there another way you can think of? Busybox also does not have a reboot-recovery applet, only "reboot" (which starts Android)
[XDA-University] demkantor:
quick google search

https://github.com/syhost/TWRP_CN/blob/master/twrp-functions.cpp

didnt realize twrp was so different than 4ext recovery and clockwork, as the run_program("/sbin/reboot", "recovery"); works in both of those as i have added them to some of my scripts... Ill look into some more of twrp's handling....
[XDA-University] Monty.728:
How to do this in micromax a57 can u plzz hlp me
[XDA-University] PradeepMurugan:
thanks

good work thanks
[XDA-University] shoey63:
Great guide :thumbup:
[XDA-University] KINGbabasula:
It depends on what you want to flash. A rom, a file or just a script. Please add more informations

;)

;)

Inviato dal mio GT-I9070 con Tapatalk 2
[XDA-University] jaunty:
how to set permissions like this??

I will be glad if you me for changing some permissions in root directory.​

I have attached Screenshot from what i currently have and what permissions i do want to have, if you have knowledge regarding this please guide me.

I need to change these permissions coz after a factory RESET these files get deleted and i get some serious errors of WIFI and IMEI. than again i need to put these files in the ROOT.

this is located in root/data/nvram

​

Thanks in advance.. :)​
[XDA-University] tejasjani55:
How can I know that numbers of permission?

---------- Post added at 10:50 AM ---------- Previous post was at 10:50 AM ----------

Guide to gid uid and permission mode for diff path
[XDA-University] Shaftamle:
I see these 2 a lot. What is the difference? Pro's and Con's? Why use one and not the other? Thanks!

mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");

Vs

run_program("/sbin/busybox", "mount", "/system");

Sent from a Shaftamle Galaxy S4

"Thanks Button" is always appreciated!

http://mycolorscreen.com/Shaftamle/
[XDA-University] insan.waq3y:
Thanks
[XDA-University] FBis251:
Hey, great tutorial. Do you think it'd be a good idea to also add what parameters each function takes? For example unmount will only take one parameter but symlink can take 2 or more. It would be good to see which parameter does what and the number of expected parameters.

Thanks for the writeup!
[XDA-University] brandonsisco:
Anyone know how to reboot-bootloader via an update.zip ?

I have a Lenovo K910 i'm trying to Unbrick, any help is much appreciated.
[XDA-University] PascalA:
Syntax for comments / comment / commenting
[XDA-University] Nikhil:
[MENTION=5093942]KINGbabasula[/MENTION] could you explain about symlink more?

Written in OP isn't enough for my project! :)
[XDA-University] KINGbabasula:
When symlink is executed it creates a file linked to an executable. For example I have a file /bin/sh and I want to call it from somewhere else. I create a symlink of it in /sdcard/sh and if I execute sh in the sdcard folder it will be the same as executing /bin/sh
[XDA-University] Nikhil:
and syntax for that would be

symlink("/bin/sh", "/sdcard/sh");

or vice-versa? i.e.

symlink("/sdcard/sh", "/bin/sh");
[XDA-University] KINGbabasula:
First one
[XDA-University] cryostasis25:
Is it possible to post my updater script here and have it checked if I did it correctly as I just created one but once it finishes it reboots to the recovery and once I just reboot it still automatically goes to the recovery. I really don't know what to do or what line i did incorrectly
[XDA-University] demkantor:
The file structure is off, I'm on mobile right now or I would fix it up for you, but for now have a look here

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

If your still stuck let me know and I'll lend a hand when I'm at a PC

Oh and be careful with the dd commands, its often best not to use these if there is another way as it even a little mistake or a corrupt file can lead to a quick brick, consider the flash raw image busybox command instead for the kernel
[XDA-University] cryostasis25:
Ok will do thanks got dizzy looking at all the lines
[XDA-University] luigi997:
I am making a rom in cwm but I always get the error status 0 , help me fill in the updater script correctly?

This is the updater script made from cygwin:

show_progress(0.1, 0);
format("MTD", "system");
mount("MTD", "system", "/system");
format("MTD", "userdata");
package_extract_dir("system", "/system");
symlink("dumpstate", "/system/bin/dumpcrash");
symlink("debuggerd", "/system/bin/csview");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/touchinput");
symlink("toolbox", "/system/bin/playback");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/etc");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/su");
symlink("/system/xbin/su", "/system/bin/su");
show_progress(0.1, 10);
show_progress(0.2, 0);
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
show_progress(0.2, 10);
unmount("/system");

The rom is for s3 mini
[XDA-University] demkantor:
Status 0 usually means the wrong update-binary is being used, try to extract one from a known working ROM for your device and replace, then try again
[XDA-University] ziaulh.ch:
Hey mate! Thanks for the thread. What about lollipop roms. Things have changed a little as it seems? I see .dat files inside. Can you tell me how make this files and also extract them?

THanks
[XDA-University] millerboy3:
NVM my mistake :P
[XDA-University] johnnyutah22:
I'm having trouble with my updater script for a custom stock 4.4.4 for the HTC M8. Can you take a look at the first part below and see what's going on? When I flash the rom it does not load an OS. I excluded the rest of the update script because it had too many images to post.

unmount("/system");

ui_print("Mounting System");

run_program("/sbin/mount", "-t", "auto", "/system");

ui_print("Mounting Data");

run_program("/sbin/mount", "-t", "auto", "/data");

ui_print("Mounting Cache");

run_program("/sbin/mount", "-t", "auto", "/cache");

##BACKUPAPPSLINE##ui_print("Backing up apps");

##BACKUPAPPSLINE##package_extract_file("tmp/appbackup.sh", "/tmp/appbackup.sh");

##BACKUPAPPSLINE##set_metadata("/tmp/appbackup.sh", "uid", 0, "gid", 0, "mode", 0777, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");

##BACKUPAPPSLINE##run_program("/tmp/appbackup.sh");

ui_print("Wiping System");

delete_recursive("/system");

##WIPELINE1##ui_print("Wiping Data");

##WIPELINE1##delete_recursive("/data");

##WIPELINE2##ui_print("Wiping Cache");

##WIPELINE2##delete_recursive("/cache");

ui_print("Extracting System");

package_extract_dir("system", "/system");
[XDA-University] Buglol:
Syntax for set_metadata?
[XDA-University] Beshnazzle:
could someone please give me a template and i just add the imformation of my phone into the updater script as everything still makes no sense
[XDA-University] ninja_unmatched:
Can someone place ascii art in the updater-script?

like maybe this or something
[XDA-University] ninja_unmatched:
How would you use package_extract_dir to move/copy a folder from the flashable zip to the internal sdcard during a ROM flash? (Aroma flashable zip)

---------- Post added at 08:43 PM ---------- Previous post was at 08:41 PM ----------

package_extract_dir (" " , "storage/emulated/0"); is my first guess
[XDA-University] demkantor:
That sounds about right, its been a long time since I wrote any aroma scripts but I did add this as an option in a few of my aroma packs

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

Just download this one and have a peek, I always keep my scripts clean so it will be easy for you to find your answer

Let me know if you need a hand

Best of luck!
[XDA-University] Beakhole:
I've been searching and searching but can't figured this one out. Can someone help me wich my updater-script? I'm trying to execute a shell script with this flashable zip but it doesn't execute. I'm not sure how I'm getting it wrong. Here's the code I have:

show_progress(0.99, 30);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 0755, "/system/etc/init.d/FixGSv4.sh");
run_program("/system/etc/init.d/FixGSv4.sh", "sh");
show_progress(1.0, 1);
unmount("/system");

I'm not even sure if that shell script can be executed though. Below are a few lines from that shell script. It disables a ton of Google Play services with the pm command (Package Manager).

#!/system/bin/sh
pm disable com.google.android.gms/.ads.settings.AdsSettingsActivity
pm disable com.google.android.gms/com.google.android.location.places.ui.aliaseditor.AliasEditorActivity

Can pm commands be run from recovery?
[XDA-University] Beat_Slayer:
Your arguments are switched on run_program, and as far as pm commands on recovery I don't think so.
[XDA-University] Beakhole:
Ok, thanks for your help.
[XDA-University] Pupet_Master:
Anyone know a command or a way to make a update.zip that change a line on build.prop

For example, i wish to make one that when i flash it change the lcd dpi
[XDA-University] Beakhole:
You could probably run a sed command to search and replace the text in the build.prop that you need to.
[XDA-University] Pupet_Master:
That could work, in fact i'll try to find a way to incorporate a sed command

I found this topic, i'm trying to analyze this method as well

http://xdaforums.com/showthread.php?t=2664332
[XDA-University] leonardoroza:
Thanks

Enviado de meu Moto G usando Tapatalk
[XDA-University] tbv2005:
Hi,

Did this quite some time ago. Was needed on my Droid 4 to get gsm networks running. It was then done bit better by mentor here on xda and cuxo on the german android-hilfe.de forum.

When remembering correctly it was not possible (at least found no way) to run the sed command directly from the updater script.

What was done is the following:

- Created sh script wirh the sed commands and put into update.zip

- in the updater-script mount system, copy the sh script from update.zip to system, set permissions to the file and then run the script
[XDA-University] Beakhole:
Oh yeah, good idea.
[XDA-University] Zauq:
updater-script for ported ROM

Hi,

I have been trying to figure out how to create update-script for a ported ROM. I have tried just mounting system partition and extracting the same however it gives me bootloop. My question is how to determine update-script looking at the ported ROM. I have also tried "Android kitchen" but the update-script created by the tool gives error 6 which is due to "syntax error" in the script I suppose.

Kindly help me out.
[XDA-University] Primokorn:
How can I rename a file from the updater-script?