yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] yojlik:
Okay I've got a problem and it's bugging the hell out of me trying to fix. I followed the backup script template posted in post 4. I want to restore one file and delete a bunch of others. The files delete just fine but the file I want to restore is never saved.

I'm trying to save the file /sys/module/bcmdhd/parameters/wifi_pm (no extension). This file is a 2 byte file that just has a 0 and a carriage return in it, and in order to enable PM_MAX on wifi that needs to be a 1. I can change the file just fine in ES (but strangely enough ESv3 beta fails to save it). Permissions on the file are 311 which I think is causing the problem. Is the issue that the file can't be written by the script because the Group and Other don't have permission to overwrite it?

Here is the script for reference:

#!/sbin/sh
#
# /system/addon.d/91-cm.sh
# During a CM10 upgrade, this script backs up /system/etc/hosts,
# /system is formatted and reinstalled, then the file is restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
sys/module/bcmdhd/parameters/wifi_pm
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
rm /system/app/Calendar.apk
rm /system/app/CMFileManager.apk
rm /system/app/CMFileManagerThemes.apk
rm /system/app/CMWallpapers.apk
rm /system/app/Email2.apk
rm /system/app/Exchange2.apk
rm /system/app/Galaxy4.apk
rm /system/app/HoloSpiralWallpaper.apk
rm /system/app/LiveWallpapers.apk
rm /system/app/MagicSmokeWallpapers.apk
rm /system/app/NoiseField.apk
rm /system/app/PhaseBeam.apk
rm /system/app/QuickSearchBox.apk
rm /system/app/Trebuchet.apk
rm /system/app/VideoEditor.apk
rm /system/app/VisualizationWallpapers.apk
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
[Samsung Galaxy Nexus] CMNein:
I'm not sure if that file can be saved, although I can't confirm.
[Samsung Galaxy Nexus] yojlik:
I was afraid you were going to say that. :(
[Samsung Galaxy Nexus] CMNein:
I'm just utilizing the basic b/u and rm of system junk. These scripts are capable of a whole ton of stuff, hopefully someone smarter than me can figure it out. On the surface that looks kernel related (?).
[Samsung Galaxy Nexus] yojlik:
The thing that makes me think that it's not going to work because of permissions is the strange behavior the ESv3 Beta exhibits. It simply won't let me do anything with the file at all- can't copy or move it, can't overwrite it, nothing. The beta doesn't have a way to edit permissions the way the current ES does and in the current ES I can edit it no problem (although I don't need to modify permissions to do so). Being that it's read-only by the Group and Other classes though would explain why the script can't do it.

Is it possible to make the script alter the permissions on the file prior to attempting to restore it? If there were a way to do that perhaps it would work.
[Samsung Galaxy Nexus] CMNein:
I want to say "maybe", but that's over my head.
[Samsung Galaxy Nexus] lazer155:
Do you know why I would have a script called 73-gapps-mako.sh in addition to the other 3 that you mentioned in the OP? I did install gapps with a zip since I flashed CM 10.1 but I'm not sure why I need that script when I also have that 70-gapps.sh
[Samsung Galaxy Nexus] cschmitt:
The mako script is for device specific gapp components, in addition to the standard package. Completely normal.
[Samsung Galaxy Nexus] lazer155:
If I want to make a removal script, should I make it separate from my restore script and the other 4 I mentioned? Or should I put it in my new restore script? If it should be separate, what should I name it?

Also does anyone know what the "blacklist" file (I think it is a script) that is also in my addon.d section?
[Samsung Galaxy Nexus] yojlik:
It makes sense just to make a different script so you don't have a situation where the modified script is unique. It doesn't hurt to add it to a preexisting script but why not just do it right from the beginning?
[Samsung Galaxy Nexus] CMNein:
My thinking was the same as mentioned above, I have 1 custom script for my bu and RM.
[Samsung Galaxy Nexus] yojlik:
By the way if anyone was wondering why I couldn't backup that file, it's because it's an exported kernel module parameter and is simply reset on reboot. It isn't an actual file.
[Samsung Galaxy Nexus] AtomicPC:
Thanks for this. Been looking for a way to keep from having to install wallet every nightly. I have it in place and permissions the same as the 50-cm.sh so I hope it works.

EDIT: Reporting back that this worked for me. Thanks again!
[Samsung Galaxy Nexus] pav_87:
thz guy
[Samsung Galaxy Nexus] b.huss2:
Nice, I got to try this out today with a cm10.1 nightly. Worked perfectly. Removed some stuff I've always manually had to remove and kept stuff I always had to add back after an update, but no more :good: . Made the update process truly a non- event.

Thanks for pointing this out!
[Samsung Galaxy Nexus] lazer155:
I want to have 1 script that is for removing and another for saving some apps. Currently I have 1 called 91-cm.sh that I use to save the apps I want to save. What should I call the second removal script?
[Samsung Galaxy Nexus] CMNein:
Whatever you'd like. 91-RM.sh, etc...
[Samsung Galaxy Nexus] lazer155:
Out of curiosity is there a reason why "cm" is the label after the number? Does it stand for something? (Cyanogenmod?)
[Samsung Galaxy Nexus] b.huss2:
I just called mine 91-cm and 92-cm
[Samsung Galaxy Nexus] lazer155:
Is GoogleCalendarSyncAdapter.apk or CalendarProvider.apk needed for the calendar with the blue icon to work? I prefer the one with the blue icon over the green iconed calendar app.
[Samsung Galaxy Nexus] b.huss2:
Yes don't remove those. I do the same thing. I prefer the Google Calender from the market too.
[Samsung Galaxy Nexus] lazer155:
Got it. How do I remove the green iconed one then? What is its apk file called? I'd like to get rid of it if possible since I really only use the google calendar app from the market.

I also want to remove the email app. To do so would I remove the Email2.apk and Exchange2.apk? I use the gmail app from the market instead.

Post #267 of this thread: http://xdaforums.com/showthread.php?p=36920502#post36920502

is why I thought GoogleCalendarSyncAdapter.apk could be removed since I am not using the green iconed app.
[Samsung Galaxy Nexus] b.huss2:
Calender.apk

And yes those 2 email apps you mentioned can be removed. I also remove those as I only use gmail.
[Samsung Galaxy Nexus] lazer155:
So just to be clear CalendarProvider.apk should be saved, correct? Would you mind providing your uninstall script since it seems we remove a lot of the same apps?
[Samsung Galaxy Nexus] b.huss2:
Sure

http://db.tt/viFNiKwF

http://db.tt/F3OLAwSk

One is the uninstall script and the other is the backup and restore of my Verizon specific stuff.
[Samsung Galaxy Nexus] Lownita:
Just to get this straight: If I wipe /system before flash, nothing will back up since addon.d folder is not there when actually flashing the new nightly, right?
[Samsung Galaxy Nexus] b.huss2:
correct
[Samsung Galaxy Nexus] amgala:
Does anything in the coding need change with the new multi-user file system?
[Samsung Galaxy Nexus] strainhunter:
Maybe this helps

You have to add rm -rf /foldename to the script at the position like i´ve written next:

case "$1" in

backup)

list_files | while read FILE DUMMY; do

backup_file $S/"$FILE"

done

;;

restore)

list_files | while read FILE REPLACEMENT; do

R=""

[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"

[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"

done

rm -rf /system/vendor/pittpatt/

;;

pre-backup)

# Stub

;;

post-backup)

# Stub

;;

pre-restore)

# Stub

INFO:

rm -rf /foldername (e.g rm -rf /system/vendor/pittpatt/ will remove "/system/vendor/pittpatt/" and everything inside)

-r = recursive -f = force

Hope that helps you.

Greetings from Bavaria,

Strainhunter
[Samsung Galaxy Nexus] flakinarist:
Following scenario:

I edited a cfg file. After flashing an updated ROM the file is in its original state again.

The question is:

What to do if I want to backup various lines of a cfg file? I think of searching for a specific text and copy / edit this text.

Maybe it is easier to not backup the lines, but write them into the file after flashing again.

Is this possible?

Thanks :)
[Samsung Galaxy Nexus] nqk:
Thanks for the script. It is very much helpful to me.

But I don't know if the "remove" script takes place before or after the backup script? I am using, too, a HTC Desire - which provides limited space for system partition, and the rom already takes almost all of that space. I normally delete all the things I don't want from the zip prior to flashing. Now I want to try the removal script.

If the removal script is in the same file as the backup script, may be it it wourd run after the "restore" script, then the system space is not enough for restoring? If the removal script is in a separate script, say 00-cleaning.sh, would it clean the rom before the 99-backup.sh takes place?
[Samsung Galaxy Nexus] billyjed:
They run in numerical order.
[Samsung Galaxy Nexus] imfloflo:
Thanks for this useful post.

If you want to remove some of gapps files : http://forums.androidcentral.com/op...e-apks-their-purpose-safe-not-remove-big.html

and http://xdaforums.com/showthread.php?t=1069924
[Samsung Galaxy Nexus] Bejda:
Hello all :)

Does the rm command works for you since system/addon.d/blacklist appeared?
[Samsung Galaxy Nexus] CMNein:
Has been working for me since then without issue. The blacklist targets very specific scripts based on their md5.
[Samsung Galaxy Nexus] R930:
Thanks for the info!
[Samsung Galaxy Nexus] KreNtal:
Thank you for this thread, it's a real useful tip
[Samsung Galaxy Nexus] RaphaDroid:
Hi, I want a script that backs CM Calculator up (that I copied to system/app), deletes non-CM Calculator (that is flashed with the ROM) and restore the CM Calculator back to its place. Is my script all right? Where should I put the rm command?

#!/sbin/sh
#
# /system/addon.d/88-cmCalculator.sh
#
# /system is formatted and reinstalled, then the files are restored.
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
app/Calculator.apk
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE $R"
done
rm /system/app/Calculator.apk
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
[Samsung Galaxy Nexus] KreNtal:
Hi guys, just a question: Anyone know differences between rm and rm -f? Can explain it? Thanks a lot
[Samsung Galaxy Nexus] rafcano:
The -f option means "force". It's used to delete files without any type of questions about the process.

For example, when you try to delete a file in some GNU/Linux-based system like Ubuntu, it asks if you really want to delete this file, and you must answer 'y' or 'n' to continue. If you add the -f option, the file will be deleted without this question.

And if you add the -r option, that means "recursive", it allows to this command to delete directories too, and all the files/directories that it contains inside (i.e., recursively). On the other hand, you must use the rmdir command, and this command only allows to delete empty directories.
[Samsung Galaxy Nexus] kingofcomedy:
How can I add one line to build.prop? I have tried to add this line in the "restore"-part (after "done" of course):

echo "xxx" >> build.prop

but it didn't work?! Moved it to the "post-restore"-part some mins ago and will see if that helps.

Edit: echo "xxx" >> /system/build.prop did work. :)
[Samsung Galaxy Nexus] Mysteryagr:
Can someone help me with making backup script for xperia keyboard?

http://www.mediafire.com/download/7hl3wxl9y2yo2po/Xperia_Keyboard_6.4.A.0.6_API19_emoji.zip

I don't know what should I edit exactly, I may mess the script up.
[Samsung Galaxy Nexus] KreNtal:
So the ROM you're using must support the backup script function so make sure of this.

You have to put the file: "50-cm.sh" in this folder: "/system/addon.d"

You have to replace etc/hosts in the file with the path of the xperia keyboard apk, usually system apps are in

/system/app
[Samsung Galaxy Nexus] jumpers:
try this one, just made it, but i'm not using this keyboard.

http://bass2style.com/XDA/support/50-cm.sh
[Samsung Galaxy Nexus] Mysteryagr:
[MENTION=5254995]KreNtal[/MENTION] [MENTION=3172602]jumpers[/MENTION]

Thanks guys :thumbup:
[Samsung Galaxy Nexus] jumpers:
no problem. ^^
[Samsung Galaxy Nexus] jumpers:
you must remove all "rm" commands, beceause the fonction do it by self, you must only add directories and files.
[Samsung Galaxy Nexus] raulx222:
Hey!

What's the point of the number in the file name? Like from 50-cm.sh file. Is there a specific reason for using numbers in file name?
[Samsung Galaxy Nexus] casouzaj:
It's the execution order of each script.
[Samsung Galaxy Nexus] raulx222:
Thanks! ..and then why CM uses 50?..it's confusing.
[Samsung Galaxy Nexus] casouzaj:
It's simply a number. Round numbers use to come pre-populated so that users can store scripts in-between. If you want a certain script to be executed before another one already stored in the list, just name it beginning with a number smaller than that one. Not necessarily rounded.
[Samsung Galaxy Nexus] kh34d:
Thank you sir for ur good work.

Plz help me with add MOD for walkman from this thread

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

What I can do in detail[emoji22] becoz I'm beginner in this
[Samsung Galaxy Nexus] AndrasLOHF:
For the removal portion of the script will this not install the app on the first flash or does a user need to manually remove the app from the system and then the addon.d script will stop it from reinstalling? I've tried adding apps to be removed from an addon.d script but they were installed anyway. I've attached what I wrote up. Can you give me pointers if it is wrong?
[Samsung Galaxy Nexus] onlyoneaamir:
Can anyone post a script to automatically backup gapps before cm12.1 nightly update

help me out please
[Samsung Galaxy Nexus] jumpers:
gapps already have a backup script in their zips.
[Samsung Galaxy Nexus] Jac.cart:
This script isn't doing anything for some reason. I have set the proper permissions on this script and all the other addon.d scripts are working. Does anyone have an idea as to what could be the problem?

Edit: I'm running cm13

#!/sbin/sh
#
# Script: /system/addon.d/72-ThemeChooser.sh
# This addon.d script backs up ThemeChooser and deletes stock ThemeChooser.apk

. /tmp/backuptool.functions

list_files() {
cat << EOF
priv-app/ThemeChooser/ThemeChooser.apk
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done

;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
[Samsung Galaxy Nexus] aha360:
[MENTION=6222481]Jac.cart[/MENTION] - even I am having the same problem as you are with regards to having non-working addon.d .sh scripts even though the other scripts work - however, this one is the one I am trying to create for Google Camera for Android Nougat as at time of writing, I am using CyanogenMod 14 on my LG G3, in which the common broken feature is the camera, though Google Camera for Nougat works.

Here is the script in question

#!/sbin/sh
#
# Script: /system/addon.d/01-GoogleCameraNougatARM32.sh
# This addon.d script will make the Google Camera (Nougat) app survive a dirty flash :

. /tmp/backuptool.functions

list_files() {
cat <<EOF
priv-app/GoogleCamera/GoogleCamera.apk
priv-app/GoogleCamera/lib/arm/libfilterframework_jni.so
priv-app/GoogleCamera/lib/arm/libgcam.so
priv-app/GoogleCamera/lib/arm/libgcam_swig_jni.so
priv-app/GoogleCamera/lib/arm/libjni_faceutil.so
priv-app/GoogleCamera/lib/arm/libjni_imgutil.so
priv-app/GoogleCamera/lib/arm/libjni_jpegutil.so
priv-app/GoogleCamera/lib/arm/libjni_yuvutil.so
priv-app/GoogleCamera/lib/arm/liblightcycle.so
priv-app/GoogleCamera/lib/arm/libnativehelper_compat_libc++.so
priv-app/GoogleCamera/lib/arm/librefocus.so
priv-app/GoogleCamera/lib/arm/librsjni.so
priv-app/GoogleCamera/lib/arm/libsmartburst-jni.so
priv-app/GoogleCamera/lib/arm/libvision_face_jni.so
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
[Desire Q&A, Help & Troubleshooting] Adam eds:
I have recently discovered unique ROM's for my htc desire however I am very worried about rooting and want to make sure that I have the specific RUU for my device. I've searched a lot and cannot find sufficient information to solidify my choice of RUU and would hate to brick my phone.

Would somebody be able to help me find the RUU for my phone if I provide the specific information?

Andriod version: 2.2.2

Baseband version: 32.48.00.32U_5.11.05.14

Kernel version: 2.6.32.15-gf5a401c

Build Number: 2029.771.3 CL345089

Software number: 2.29.771.3

Display: SLCD

Sorry that I'm being so specific but I read if it isn't the exact original RUU then it could brick my phone

EDIT: RUU_Bravo_Froyo_Telstra_WWE_2.26.841.2_Radio_32.48 .00.32U_5.11.05.14_release_150162_signed.exe

Thats the one I found originally, but it says 2.26.841.2, whereas my phone says its build number is 2.29.771.3
[Desire Q&A, Help & Troubleshooting] bortak:
Doesn't matter. Just make a goldcard before you do anything an you can use whatever RUU you want.
[Desire Q&A, Help & Troubleshooting] Adam eds:
I haven't got a microsd card adapter for my PC so cant make a gold card :/
[Desire Q&A, Help & Troubleshooting] bortak:
You don't need one.
[Desire Q&A, Help & Troubleshooting] Adam eds:
"2. YOU WILL NEED AN SD ADAPTER! This can be a MicroSD to USB that allows you to plug the SD card into your computer’s USB port OR a MicroSD to SD adapter if you have a SD port on your computer."
[Desire Q&A, Help & Troubleshooting] bortak:
My bad, forgot about that, I only remembered the part of plugging your phone in and getting the CID that way.

Well, if you want a goldcard I suggest you get one lol.....
[Desire Q&A, Help & Troubleshooting] Adam eds:
Bump, can noone find the corrct RUU for me?
[Desire Q&A, Help & Troubleshooting] bortak:
Mate it doesn't matter what software number it is, as long as it's for your network. Also, if you're still anal about that you can just use the 2.3 RUU which you can find on my guide, which will still honour HTC warranty.

Also you can make a goldcard any time you want, so if you need a RUU but magically can't find one.. I'm sure you'd be able to get an adapter.
[Android Q&A, Help & Troubleshooting] shad0w1369:
I have a Dapeng A7 mtk6573 Android phone I just purchased. It was supposed to come prerooted but for some reason it did not and the ebay seller wont take it back or exchange it with another one that is rooted like the original item description said he would. So Im not sure where to go from here. I tried Superoneclick and didnt get very far with it. I am still new to the whole rooting process but i managed to root and rom my Evo 4g without bricking it multiple times. I can follow any directions given just need some help to be pointed in the right direction on how to get this one rooted. Can anyone help?
[Android Q&A, Help & Troubleshooting] angelobiz:
hi, sorry fo my english

you must download a russian modded recovery here: ge.tt/5UwovRF/v/02

you must flash it with flash tool,...(see many guide in internet if you no know)

after you must enter in it, you pull power and vol+ together,

and install this file: ge.tt/1ili71F/v/0

after you had disabled verification of signature.

so reboot your phone

Angelo

ps

i.m newbee and no can post link.. added http//
[Android Q&A, Help & Troubleshooting] merlot:
As soon as I have some spare time I'll try to follow this

http://ciphone.fr/blog/blog1.php/rooter-son-gsm-chinois-android

But the SuperOneClick download is detected as virus, so I have downloaded it from xda-developers

Bye
[Android Q&A, Help & Troubleshooting] albkwan:
SuperOneClick does not work on my Dapeng A7. Instead I use adb remount, then adb push superuser.apk into /system/app. This works.

Please note that adb remount does not always work. I have to try a few times. Most of the time, I got success by turning USB debugging on only after I connected the phone and umount USB drive.
[Android Q&A, Help & Troubleshooting] aze2learn:
Dapeng A7 1gb rom custom recovery

I have good news for 1gb Dapeng A7device owner (aka e1108_v73_hjy2a7) who wants to root/backup their phone.

I just finished modding a custom recovery based on 512mb recovery by replacing original boot.img with 1gb boot.img and tested to work fine (credit to linerty for the base of 592zn.com recovery image file)

To use this, please make sure you have 1gb rom via engineer mode by typing *#*#3646633#*#* on dialpad and choose Memory > Nand Flash ... if it states

then this recovery is for you.

Using 512mb recovery on 1gb device will show below error due to missing partition when boot into recovery:

here is Dapeng A7 1gb custom recovery:

http://www.4shared.com/archive/83g2LqtZ/dapeng_a7_1g_rec.html

Dapeng A7 1gb scatter file: http://www.4shared.com/office/XWtNUNVL/MT6573_Android_scatter_dapeng_.html

make sure you download both files :)

Use SP flash tool, load the scatter file, make sure you only tick recovery and choose the img file ... remove battery and usb cable, press download on SP flash tool ... insert battery .. then insert usb cable (you have 15 sec to do this) ... once it finish, remove and reinsert battery, hold Vol up + power to boot into recovery

-------- after booting into the custom recovery -----------

Now you can flash the uniroot2.signed.zip to root it (get it here) or make nandroid backup, flash custom zip etc. (to flash custom zip - eg: custom rom, make sure toggle signature verification to disable 1st)

512mb device (e1108_v73_hjy1) please use the custom recovery as stated here.

Note : It is advisable to make a full factory backup using mobileuncle gscript after rooting your device as stated here : http://xdaforums.com/showthread.php?p=27039072

Disclaimer: please understand that I'm just trying to help and do not take any responsibilities if you brick your device. (mt6573 devices won't easily brick if you have your backup or the right factory firmware - simply run SP flash tool and overwrite for factory firmware or use recovery mode to restore backup)

ps : recovery mode is good until you mistakenly flash preloader/dsp_bl/uboot img file .. other than these 3 files, the phone should be up and working after restore.
[Android Q&A, Help & Troubleshooting] popail73:
Problems with our two DAPENG A7 and mobiles-phones.cn

Problems with our two DAPENG A7

Hello,

(sorry for my english, it's not my first language)

We bought two Dapeng A7 from mobiles-phones.cn last month. both of them failed within a month !! The first one had video bugs and could not take phtos and videos anymore (cost 26€ to return it back)

The second one has no more microphone and needs an earphone to work !!

A friend of mine just received the DAPENG A75 last week and has a flash LED problem.

So, take care with these Dapeng products wich are not reliable (we had a chinese H7300 wich was very good) at all. Don't hesitate talking about chinese phones troubles on this forum, it could be good for someone hesitating to order over there.

Bye
[Android Q&A, Help & Troubleshooting] aze2learn:
DAPENG A7 = MT6573

DAPENG A75 = MT6575

Please do not mix between the models. Btw, have you tried restore to factory/factory reset? maybe it's only a software bug.