Hello all,
I have updated the script further to allow for arguments to be accepted as well as having the script placed in /system/bin. This works pretty much like Titanium Backup except that it's a script and uses a CLI. No pretty GUI . You can backup, restore, and fix app and data permissions from this script. 'fix_permissions' is embedded within this script and it will be install in the /system/bin folder if the startup script does not already find it. The script does not really work like an Apps2SD other than it backs up apps from /data/app and their appropriate data folders from /data/data.
This script can be very useful when switching between ROMs as your app and data can be reinstalled with the script's restore feature.
The script currently looks for APKs to backup from /data/app, /data/app-private, and /mnt/asec.
My first creation of this script was based upon a modified version of Firerat's Apps2SD script so naturally many thanks goes to him. Also the fix_permissions script comes from Koush and the Cyanogen Team.
No EXT partition required! Just download the file and run on an Android device.
STEPS:
1. Put the attached file on your SD card and run. It will install app_backup to /system/bin. From there you can type the following to start the program:
Code:
app_backup
Here's an example of backing up a couple apps with a data backup:
Code:
C:\Users\zlippard\Documents>adb shell
# app_backup
app_backup
Welcome to AppBackup 1.1
OPTIONS
--------------------------------
'b' to backup
'r' to restore
'f' to fix all app permissions
'd' to delete app_backup folder
'x' to reboot
'q' to quit: b
b
Creating app list to /dev/applist.txt...
Done!
[1] sd com.DefiantDev.RocketBunnies
[2] sd com.rovio.angrybirds
[3] sd com.rovio.angrybirdsseasons
[4] sd sts.pl
[5] app android.tether
[6] app com.alfray.timeriffic
[7] app com.androidemu.gbalite
[8] app com.aurorasoftworks.quadrant.ui.standard
[9] app com.batterypoweredgames.lightracer3dbasic
[10] app com.bfs.papertoss
[11] app com.chase.sig.android
[12] app com.chung.compasslevel
[13] app com.citrix.Receiver
[14] app com.facebook.katana
[15] app com.faziklogic.scripter
[16] app com.fede.launcher
[17] app com.forthegamer.android.scheduler
[18] app com.google.android.apps.chrometophone
[19] app com.google.android.apps.googlevoice
[20] app com.google.android.apps.maps
[21] app com.google.android.apps.unveil
[22] app com.google.android.carhome
[23] app com.google.android.gm
[24] app com.google.android.stardroid
[25] app com.google.android.street
[26] app com.google.android.voicesearch
[27] app com.google.android.youtube
[28] app com.google.zxing.client.android
[29] app com.gravitymobile.app.hornbill
[30] app com.icenta.sudoku.ui
[31] app com.intuit.instantreturn
[32] app com.intuit.instantreturn.filing.key
[33] app com.joelapenna.foursquared
[34] app com.koushikdutta.rommanager.license
[35] app com.metago.astro
[36] app com.mhuang.overclocking
[37] app com.mobitv.client.nfl2010
[38] app com.pandora.android
[39] app com.paypal.android.p2pmobile
[40] app com.shazam.android
[41] app com.sirma.mobile.bible.android
[42] app com.southwestairlines.mobile
[43] app com.sporadicsoftware.NetQFree
[44] app com.twitter.android
[45] app com.verizon.ams.companion
[46] app com.verizon.android.wifios
[47] app com.vzw.hss.myverizon
[48] app com.zebdor.android.poolCare
[49] app net.flixster.android
[50] app net.rbgrn.lightracer
[51] app org.connectbot
[52] app org.coolcode.emuroms
[53] app ru.orangesoftware.areminder
Enter app #'s to backup or 'a' for all and press [ENTER].
Or 0 to exit (ex: 1 5 15): 1 3 4
1 3 4
Copy data? ('y' or 'n') y
y
1 of 3] - Backing up com.DefiantDev.RocketBunnies...Done!
2 of 3] - Backing up com.rovio.angrybirdsseasons...Done!
3 of 3] - Backing up sts.pl...Done!
OPTIONS
--------------------------------
'b' to backup
'r' to restore
'f' to fix all app permissions
'd' to delete app_backup folder
'x' to reboot
'q' to quit: q
q
Goodbye!
#
When starting the script, you will be brought to the main menu screen where you can choose to either backup, restore, fix permissions, delete /sdcard/app_backup (this is the storage folder), reboot or quit. The rest is pretty self explanatory...
So far I have tested this script on the DROID and DROID Incredible. The DROID was running Bugless Beast 2.2 and the Inc I've tried ran CM6 and CM7.
UPDATES:
1.4
Added "busybox " before each command call within the app_backup script to make sure busybox commands are being called.
1.3
Fixed issue with backup apps not showing up. Thanks to welcomb for notifying me.
Fixed mounting issue for ro/rw in /system
1.2
Fixed backup feature for phones that use Apps2SD. Thanks to welcomb.
Fixed deletion feature of apps and data.
1.1
Arguments: use -b to auto-run a full backup. -r will auto-run a full restore of all apps in android_app_backup
Apps and data are now stored in /sdcard/android_app_backup.
app_backup script is now automatically installed to /system/bin/app_backup when running the new script. The new script is more of an installer.
Let me know of any bugs!
Much of the credit goes to Firerat for creating the initial apps2sdext script. This is what gave me the idea to continue on with an app backup script. Here's Firerat's latest version of apps2sdext in case you want to see it or don't have an incredible: http://forum.cyanogenmod.com/topic/...mount-issues-i-hope/page__p__24386#entry24386
As the usual goes, I'm not responsible for any mishaps that may occur while using this script or bricked phones, data loss, blah blah blah... So, USE AT YOUR OWN RISK.
The script is attached below. Have fun! Please post any findings, bugs, questions, comments, or updates you would like to see here. Feel free to make any modifications to this script.
NOTE TO SAMSUNG RELAY 4G USERS:
A friend of mine has this phone and was getting the following error when running the .sh script:
Code:
can't create temporary file /sqlite_stmt_journals/mksh.<random>
To remedy this, I remounted the root directory / as read-write,created the folder /sqlite_stmt_journals, ran the .sh script, and afterwards remounted to read-only.
anyone tried this? lots of success of nexus one
For future use...
zebdor44 said:
Hello all,
I have modified my script to be more of an app & data backup utility. This works pretty much like Titanium Backup except that it's a script and uses a CLI. No pretty GUI . You can backup, restore, and fix app and data permissions from this script. 'fix_permissions' is embedded within this script and it will be install in the /system/bin folder if the app_backup.sh script does not already find it. Since this is a complete revision, I have set the version back to 1.0. The script does not really work like an Apps2SD other than it backs up apps from /data/app and their appropriate data folders from /data/data.
This script can be very useful when switching between ROMs as your app and data can be reinstalled with the script's restore feature.
The script currently looks for APKs to backup from /data/app, /data/app-private, and /mnt/asec.
<...>
Click to expand...
Click to collapse
This is SO much easier than Titanium, and I am trying to figure out how to automate backup / restore. My end goal:
Run a Nandroid
Run this script (in Backup mode)
Wipe userdata
Install Rom
Install extras (kernel, Gapps, etc)
Restore apps.
Anyone want this?
If people are interested, I may take a look into this.
Woooow, nice work man =]
I was gonna write something really simple, but you beat me to it! Thanks!
EDIT: ooppps, didn't mean that your script was simple! I meant that you beat me to an app backup script, and yours would blow mine out of the water xD
I'm a bit busy right now (haha, but not too busy to post... ), but does anyone know if this supports restoring apps only? I feel like it probably does, but can anyone confirm?
Again, this looks awesome!
Thanks guys for the comments!! Good to hear you like it
alanthemanofchicago said:
This is SO much easier than Titanium, and I am trying to figure out how to automate backup / restore. My end goal...
Click to expand...
Click to collapse
Let me try making an update.zip that'll run the script. Then you could run the update.zip in recovery mode like CWM or AmonRa.
gmichaelow said:
Woooow, nice work man =]...but does anyone know if this supports restoring apps only? I feel like it probably does, but can anyone confirm?
Click to expand...
Click to collapse
The script will restore apps and their data folders. Basically what it does is it reinstalls the app that you selected to restore and then overwrites the appropriate /data/data folder for that app with the backup.
Automating backups and restores
So it seems it may not be that easy to create an update.zip that will work properly. The script will need to mount /system, /data and /datadata to access the apks and data folders while in recovery. That's not difficult to do but apps on the sdcard under /mnt/asec may prove to be a little more difficult. I made a working update.zip that would run 'app_backup -b' to automate the process but there is no output of script so I have not posted that. The output would be kinda nice to see just so you know how far along the backup process is at.
I may need to dig deeper on the update.zip but for now check out the updates!
Thanks!
After finally getting the script into /system and running it, it doesn't work. I get the output:
Code:
[: not found
[: not found
[: not found
Ok nevermind!
Goodbye!
Using a rooted Samsung Galaxy 3. I'm still very new to custom ROMs, etc.
Hi
I get the following error when trying to backup on my Samsung Galaxy S :
data/system/packages.xml no such file or directory
Nothing to backup
What can i do?
Skele Drew said:
After finally getting the script into /system and running it, it doesn't work. I get the output:
Code:
[: not found
[: not found
[: not found
Ok nevermind!
Goodbye!
Using a rooted Samsung Galaxy 3. I'm still very new to custom ROMs, etc.
Click to expand...
Click to collapse
FadeFx said:
Hi
I get the following error when trying to backup on my Samsung Galaxy S :
data/system/packages.xml no such file or directory
Nothing to backup
What can i do?
Click to expand...
Click to collapse
Hmm... If you have Astro lookup /data/system and see if the packages.xml file exists. Better yet, if you have a terminal emulator or ADB do a
Code:
ls /data/system | grep packages.xml
and see if anything comes up. The Galaxy series should have the same file system structure as any other Android phone... What Android OS are you running?
EDIT: It looks like the Galaxy series is using 2.2... Also if one of you could do a
Code:
su
cd /
find -name packages.xml
find -name packages.list
within a terminal emulator or ADB this should show where the packages files are located. It may take a bit of time to do the search since its looking for it from /.
./dbdata/system/packages.xml
find -name packages.list does search forever it seams...
Ok I might have to update the script to look in that directory for the packages.xml file. Stay tuned! Sorry for the delay in getting back. Been pretty busy.
EDIT: Download Busybox Installer from the market (the free one) and try installing the latest busybox for your samsung phone and then try running the script again. Does the script seem to act any better? I'm thinking the :not found] issue has to do with a bad busybox and the script not finding the right commands it needs to use. Let me know how that turns out.
Remember to nandroid backup before installing the busybox just in case
Busybox version is 1.19.0 but i didn't try the script yet. Will when i come home...
FadeFx said:
Busybox version is 1.19.0 but i didn't try the script yet. Will when i come home...
Click to expand...
Click to collapse
Just curious, any luck with the busybox upgrade?
I've updated the script to version 1.3. Welcomb noticed that there was an issue with bringing up the apps when requesting a backup although I'm not sure if that will fix the issue you had Fade...
Also mounting /system to copy the script over should be fixed .
I've added this to the OP already but for those with a Samsung Relay 4G phone:
A friend of mine has this phone and was getting the following error when running the .sh script:
Code:
can't create temporary file /sqlite_stmt_journals/mksh.<random>
To remedy this, I remounted the root directory / as read-write,created the folder /sqlite_stmt_journals, ran the .sh script, and afterwards remounted to read-only.
Is this still going?
I'm getting "There is nothing to backup" in CM11. I'm on the appropriae line fo the script but I can't figure out what's wrong.
So, this is the only script I found to backup and restore app data.
Needs some changes for newer android OS
Needs a check, as out of the box toybox is used, not busybox
Mount point needs something:
As
Code:
# busybox grep /system /proc/mounts | busybox awk '{print $1}'
/dev/block/bootdevice/by-name/system
/dev/block/bootdevice/by-name/system
It is doubled.
Removing $DEVICE seems to work. I removed $DEVICE from all mount commands:
From:
Code:
$MOUNT -o remount,rw $DEVICE /system
To:
Code:
$MOUNT -o remount,rw /system
backup needs a fix for app list
$EGREP "^< seems to cause issues. I removed ^ and it worked, meaning applist success.
I was able to backup data, but the apks were missing. Maybe because it used to be app.apk now it is base.apk?
restore does not work at the moment
As applist returns empty. Checked /dev/applist.txt and it was empty for some reason.
Also, fix_permissions file not in some devices, /dev/fix_permissions not found.
Some issues:
Code:
{system("busybox cat /data/system/packages.list | busybox grep $2")}
causes errors
Some errors when creating applist, but apps are displayed afterwards. So, might be same issue as above
Code:
Creating app list to /dev/applist.txt...
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
sh: /data/system/packages.list: can't execute: Permission denied
Done!
[1] app a...
[2] app a...
[3] app c...
...
[35] app o...
[36] app o...
[37] app o...
[38] app o...
[39] app o...
[40] app x...
Last thing is that the commands used to generate applist
Code:
$ECHO "Creating app list to /dev/applist.txt..."
$CAT /data/system/packages.xml | $EGREP "<package.*serId" | $GREP -v framework-res.apk | \
$GREP -v com.htc.resources.apk | $SED 's/<package name=\"//' | $SED 's/\" codePath="/ /' | \
$SED 's/\"//g' | $SED -e 's/\/data\/app-private\//private /' | $SED 's/\/data\/app\//app /' | \
$SED 's/\/system\/app\//system /' | $SED 's/\/mnt\/asec\//sd /' | \
$AWK '{if($2 !~ /system/) printf "%10s %s %s",$2,$1,$3"\n"}' | sort | \
$AWK '(++count) {printf "%5s %7s %s %s\n","["count"]",$1,$2,$3} \
{system("$CAT /data/system/packages.list | $GREP $2")}' | $SED 's/\/data\/data\///' | \
$AWK '{printf "%5s %7s %s %s %s\n",$1,$2,$3,$4,$8}' > $applist
causes some errors, even though apps are displayed at the end:
Code:
BusyBox v1.22.1 bionic (2017-04-22 22:10 +0300) multi-call binary.
Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...
Search for PATTERN in FILEs (or stdin)
-H Add 'filename:' prefix
-h Do not add 'filename:' prefix
-n Add 'line_no:' prefix
-l Show only names of files that match
-L Show only names of files that don't match
-c Show only count of matching lines
-o Show only the matching part of line
-q Quiet. Return 0 if PATTERN is found, 1 otherwise
-v Select non-matching lines
-s Suppress open and read errors
-r Recurse
-i Ignore case
-w Match whole words only
-x Match whole lines only
-F PATTERN is a literal (not regexp)
-E PATTERN is an extended regexp
-m N Match up to N times per file
-A N Print N lines of trailing context
-B N Print N lines of leading context
-C N Same as '-A N -B N'
-e PTRN Pattern to match
-f FILE Read pattern from file
cat: write error: Broken pipe
BusyBox v1.22.1 bionic (2017-04-22 22:10 +0300) multi-call binary.
Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...
Search for PATTERN in FILEs (or stdin)
-H Add 'filename:' prefix
-h Do not add 'filename:' prefix
-n Add 'line_no:' prefix
-l Show only names of files that match
-L Show only names of files that don't match
-c Show only count of matching lines
-o Show only the matching part of line
-q Quiet. Return 0 if PATTERN is found, 1 otherwise
-v Select non-matching lines
-s Suppress open and read errors
-r Recurse
-i Ignore case
-w Match whole words only
-x Match whole lines only
-F PATTERN is a literal (not regexp)
-E PATTERN is an extended regexp
-m N Match up to N times per file
-A N Print N lines of trailing context
-B N Print N lines of leading context
-C N Same as '-A N -B N'
-e PTRN Pattern to match
-f FILE Read pattern from file
I've tried rooting my lg 4xhd for a few days but every time I try it it just says:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
DON'T TOUCH THE DEVICE OR UNPLUG WHILE ROOTING!
PUSH FILES
failed to copy 'busybox' to '/data/local/busybox': No such file or direc
failed to copy 'su' to '/data/local/su': No such file or directory
failed to copy 'Superuser.apk' to '/data/local/Superuser.apk': No such f
irectory
- exec '/system/bin/sh' failed: No such file or directory (2) -
read NV size = 4, offset = 0
read NV ret = 4
read NV offset = 0, message = (0)[0]
check_LGE_official: nvdata_buf = , , .
check_LGE_official: enable_root = 1
- exec '/system/bin/sh' failed: No such file or directory (2) -
read NV size = 4, offset = 0
read NV ret = 4
read NV offset = 0, message = (0)[0]
check_LGE_official: nvdata_buf = , , .
check_LGE_official: enable_root = 1
- exec '/system/bin/sh' failed: No such file or directory (2) -
read NV size = 4, offset = 0
read NV ret = 4
read NV offset = 0, message = (0)[0]
check_LGE_official: nvdata_buf = , , .
check_LGE_official: enable_root = 1
- exec '/system/bin/sh' failed: No such file or directory (2) -
read NV size = 4, offset = 0
read NV ret = 4
read NV offset = 0, message = (0)[0]
check_LGE_official: nvdata_buf = , , .
check_LGE_official: enable_root = 1
- exec '/system/bin/sh' failed: No such file or directory (2) -
read NV size = 4, offset = 0
read NV ret = 4
read NV offset = 0, message = (0)[0]
check_LGE_official: nvdata_buf = , , .
check_LGE_official: enable_root = 1
REBOOT
/system/bin/sh: can't create /data/local.prop: Permission denied
AGAIN REBOOT
AGAIN!?
mount: Operation not permitted
mount: Operation not permitted
/system/bin/sh: can't create /system/xbin/busybox: Read-only file system
Unable to chmod /system/xbin/busybox: No such file or directory
/system/bin/sh: /system/xbin/busybox: not found
/system/bin/sh: busybox: not found
/system/bin/sh: busybox: not found
Unable to chown /system/xbin/su: No such file or directory
Unable to chmod /system/xbin/su: No such file or directory
Unable to chmod /system/app/Superuser.apk: No such file or directory
rm failed for /data/local.prop, No such file or directory
rm failed for /data/local/tmp, Permission denied
failed on '/data/local/tmp.bak' - No such file or directory
Now I am not really an expert with complicated stuff but I DID install all the drivers properly. It would be nice if someone could help me in a awnser that I can hopefully understand. Thanks in advance
As the log implies quite clearly, it isn't finding the files to push
Check out you have all required files and that you unpacked everything correctly in proper directories
[Q&A] [DISCONTINUED][CWM][ALL BL][STOCK] ClockWorkMod 6.0.4.6 for Xperia T/TL/TX/V v
Q&A for [DISCONTINUED][CWM][ALL BL][STOCK] ClockWorkMod 6.0.4.6 for Xperia T/TL/TX/V v9
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [DISCONTINUED][CWM][ALL BL][STOCK] ClockWorkMod 6.0.4.6 for Xperia T/TL/TX/V v9. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
Error during the prompt
(Im using v9) When I start the installer, I select "1" for my Xperia T, it goes:
"* daemon not running. starting it now on port 5037 *
* daemon started successfully *"
But thn it just Stops, and it actually doesn't anything. Any suggestion?
I didn't get it was meant for 4.1.2. JB and not 4.3.
I made it, so the post can be closed
adb permission denied
I get this when running the install.sh as root in a terminal :
CWM Installer for Xperia T/TL/TX/V (JB kernels) - v8 by davidmarco
------------------------------------------------------------------
Xperia models supported:
1. T
2. TL
3. TX
4. V
Choose your model (1-4): 1
You have selected Xperia T let's go!
install.sh: line 50: adb/adb: Permission denied
install.sh: line 51: adb/adb: Permission denied
install.sh: line 52: adb/adb: Permission denied
install.sh: line 53: adb/adb: Permission denied
install.sh: line 54: adb/adb: Permission denied
install.sh: line 55: adb/adb: Permission denied
install.sh: line 56: adb/adb: Permission denied
install.sh: line 57: adb/adb: Permission denied
install.sh: line 58: adb/adb: Permission denied
install.sh: line 59: adb/adb: Permission denied
Press enter to finish...
I have root on my phone but locked bootloader. Firmware is 9.1.A.1.145. Can anyone help - what am I doing wrong?
Thanks
r_james_s said:
I get this when running the install.sh as root in a terminal :
CWM Installer for Xperia T/TL/TX/V (JB kernels) - v8 by davidmarco
------------------------------------------------------------------
Xperia models supported:
1. T
2. TL
3. TX
4. V
Choose your model (1-4): 1
You have selected Xperia T let's go!
install.sh: line 50: adb/adb: Permission denied
install.sh: line 51: adb/adb: Permission denied
install.sh: line 52: adb/adb: Permission denied
install.sh: line 53: adb/adb: Permission denied
install.sh: line 54: adb/adb: Permission denied
install.sh: line 55: adb/adb: Permission denied
install.sh: line 56: adb/adb: Permission denied
install.sh: line 57: adb/adb: Permission denied
install.sh: line 58: adb/adb: Permission denied
install.sh: line 59: adb/adb: Permission denied
Press enter to finish...
I have root on my phone but locked bootloader. Firmware is 9.1.A.1.145. Can anyone help - what am I doing wrong?
Thanks
Click to expand...
Click to collapse
"sudo su
sh install.sh"
CWM Installer for Xperia T/TL/TX/V (JB kernels) - v8 by davidmarco
------------------------------------------------------------------
Xperia models supported:
1. T
2. TL
3. TX
4. V
Choose your model (1-4): 1
You have selected Xperia T let's go!
2216 KB/s (63512 bytes in 0.027s)
126 KB/s (5401 bytes in 0.041s)
4931 KB/s (3036672 bytes in 0.601s)
1 KB/s (57 bytes in 0.039s)
3753 KB/s (1085140 bytes in 0.282s)
26 KB/s (1091 bytes in 0.039s)
124+1 records in
124+1 records out
63512 bytes transferred in 0.003 secs (21170666 bytes/sec)
10+1 records in
10+1 records out
5401 bytes transferred in 0.001 secs (5401000 bytes/sec)
5931+0 records in
5931+0 records out
3036672 bytes transferred in 0.130 secs (23359015 bytes/sec)
/system/bin/ric: cannot open for write: Text file busy
2119+1 records in
2119+1 records out
1085140 bytes transferred in 0.043 secs (25235813 bytes/sec)
CWM successfully installed!
error: device not found
Press enter to finish...
Now it says CWM is successfully installed and then the phone immediately reboots (it does this whenever I go anywhere near modifying /system - I suppose as a kind of protection mechanism). Trouble is, I can't seem to enter recovery by pressing Volume Down on the Sony boot screen - the phone just boots as normal.
The line that concerns me is "/system/bin/ric: cannot open for write: Text file busy", implying that the CWM install process didn't entirely complete successfully, and I guess this s what triggers the reboot.
Any suggestions?
r_james_s said:
Now it says CWM is successfully installed and then the phone immediately reboots (it does this whenever I go anywhere near modifying /system - I suppose as a kind of protection mechanism). Trouble is, I can't seem to enter recovery by pressing Volume Down on the Sony boot screen - the phone just boots as normal.
The line that concerns me is "/system/bin/ric: cannot open for write: Text file busy", implying that the CWM install process didn't entirely complete successfully, and I guess this s what triggers the reboot.
Any suggestions?
Click to expand...
Click to collapse
You need to run the fix.
Ran remountrebootfix and tried again. CWM successfully installed!
Hi
NFC does not work on my ASUS Zenfone 8 running AospExtended 9
After enabling NFS the OS will disable it again after a few seconds
In a logcat running while enablinng NFC I see these error messaage:
03-15 16:55:20.905 905 905 D NxpExtns: find found MIFARE_READER_ENABLE=(0x1)
03-15 16:55:20.898 905 905 W [email protected]: type=1400 audit(0.0:488): avc: denied { read write } for name="pn553" dev="tmpfs" ino=3293 scontext=u:r:hal_nfc_default:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=0
03-15 16:55:20.905 905 905 D NxpHal : Entering phNxpNciHal_init_monitor
03-15 16:55:20.905 905 905 D NxpHal : Returning with SUCCESS
03-15 16:55:20.905 905 905 D EseHalClient: EseAdaptation::Initialize: enter
03-15 16:55:20.905 905 905 D EseHalClient: EseAdaptation::InitializeHalDeviceContext: enter
03-15 16:55:20.905 905 905 D EseHalClient: EseAdaptation::InitializeHalDeviceContext: Ignored. Reason : eSE Not Supported
03-15 16:55:20.905 905 905 D EseHalClient: EseAdaptation::Initialize: exit
03-15 16:55:20.905 905 905 D NxpExtns: find found NXP_NFC_DEV_NODE=/dev/pn553
03-15 16:55:20.905 905 905 D NxpTml : Opening port=/dev/pn553
03-15 16:55:20.905 905 905 E NxpTml : _i2c_open() Failed: retval ffffffff
The permissions for /dev/pn553 are
[ root @ ASUS_I006D : ~ ] ls -l /dev/pn553
crw-rw---- 1 nfc nfc 10, 121 1970-01-07 23:20 /dev/pn553
[ root @ ASUS_I006D : ~ ]
I tried adding r/w for other to the permissions for /dev/pn553: in that case the error message is gone but it still does not work.
I also tried to set SELinux to permissive but that also does not fix the error.
The NFC works in the original Android 11 and 12 for the phone so the hardware is okay
Any hints how to fix this issue are welcome
I added two logcats to this message
enable_and_disable_nfc.log - trying to enable the NFS without changing anything
enable_and_disable_nfc_with_added_permissions.log - trying to enable NFS after changing the permissions for /dev/pn553 and setting SELinux to permissive
(search for "NfcService: Enabling NFC" in the logcats attached to this message)
regards
Bernd
Hi
fiy:
I found the reason why NFC is not working in AospExtended 9.0 without gapps (https://downloads.aospextended.com/...xtended-v9.0-I006D-OFFICIAL-20220227-0100.zip)
NFC does not work because the SELinux context for the NFC device /dev/pn553 is wrong . The SELinux context is
Code:
ASUS_I006D:/ # ls -lZ /dev/pn553
crw-rw---- 1 nfc nfc u:object_r:device:s0 10, 121 1970-03-18 01:08 /dev/pn553
but it must be
Code:
ASUS_I006D:/ # ls -lZ /dev/pn553
crw-rw---- 1 nfc nfc u:object_r:nfc_device:s0 10, 121 1970-03-18 01:08 /dev/pn553
ASUS_I006D:/ #
I wrote a little script to correct the SELinux context:
Code:
ASUS_I006D:/ # cat /storage/emulated/0/data/scripts/correct_dev_pn553.sh
#!/system/bin/sh
NFC_DEVICE="/dev/pn553"
echo ""
echo "The SELinux context for \"${NFC_DEVICE}\" is now:"
ls -lZ ${NFC_DEVICE}
echo ""
echo "Correcting the SELinux context for the NFC device \"${NFC_DEVICE}\" ..."
chcon -v u:object_r:nfc_device:s0 ${NFC_DEVICE}
echo ""
echo "The SELinux context for \"${NFC_DEVICE}\" is now:"
ls -lZ ${NFC_DEVICE}
ASUS_I006D:/ #
Example output:
Code:
ASUS_I006D:/ # sh /storage/emulated/0/data/scripts/correct_dev_pn553.sh
The SELinux context for "/dev/pn553" is now:
crw-rw---- 1 nfc nfc u:object_r:device:s0 10, 121 1970-03-18 01:08 /dev/pn553
Correcting the SELinux context for the NFC device "/dev/pn553" ...
chcon '/dev/pn553' to u:object_r:nfc_device:s0
The SELinux context for "/dev/pn553" is now:
crw-rw---- 1 nfc nfc u:object_r:nfc_device:s0 10, 121 1970-03-18 01:08 /dev/pn553
ASUS_I006D:/ #
The script must be executed by the user root.
Unfortunately the dev tree is rebuild after each reboot and therefor the change is not persistent so that the script must be executed after each reboot.
So the next step in my journey is to find out how to automate the execution of the script after a reboot in the Android OS.
regards
Bernd
Update 24.05.2022/bs
For phones running Magisk it is sufficient to copy the script into the directory
/data/adb/service.d/
and make it executable to ensure that it is executed after every reboot of the phone
(see also https://github.com/topjohnwu/Magisk/blob/master/docs/guides.md#boot-scripts)