[Help] Changes to /system won't stick, even after mounting as rw - General Questions and Answers

I've posted about this on StackExchange here (http://android.stackexchange.com/q/157846/126804) but it seems no one can/bothers to answer it. More details are available in the link.
I'm currently trying to convert some user apps into system apps. I've successfully moved the apps into /system/app by making a NAND image and mounting it on Linux, but it throws an error when I try to launch those apps (ClassNotFoundException, something about missing dex). I've already set the permissions the same as the other apps inside /system/app.
Another thing that I've noticed is that I can make any change to /system (copying files, editing, renaming, etc.), but everything gets wiped after a reboot. The same happens with another partition named /custpack (this is what the OEM uses to fill the phone with boatware). I've also tried to place the apps there, but same thing.
How can I debug this?

Related

Backing up apps / data (plus archiving/restore idea)

Ok, even though I have market and browser cache being saved to my sdcard, I still occasionally run into space issues due to the small /data partition. Prior to removing apps, I decided to back up my apps and data.
I have backed up my data partition using:
busybox tar -cvf /sdcard/data_backup_20081206.tar /data
After saving a copy to my computer via USB, I did MD5 checksum checks to make sure no corruption during the copy. I still need to do tests to see if I ever have corruption based on the thread in this forum.
* Anyone else making backups using other methods (rsync, etc.)?
--------------------------------------
This got me thinking to some other phone OS's that don't really run apps from SDCARDS, but rather store them and copy them to the phone prior to running them.
I would think that we could (with root access) write an app that moves files from the /data folders to a /sdcard/dataarchive folder, when you wanted to archive an app you don't use much and wanted to save space. Then the Archiver app could restore the files when you eventually wanted to run the app.
* Is there an easy way to see what files are used by each app? Someone mentioned a manifest file at one point.
For example, it looks like neocore is at minimum using:
/data/dalvik-cache/[email protected]@[email protected]
/data/app/com.qualcomm.qx.neocore.apk
/data/data/com.qualcomm.qx.neocore
* Is there a thread someone could point me to that better explains the whole APK packaging and storage of applications and their data?
** Is the structure usually just as above, except just replacing com.qualcomm.qx.neocore with the proper app name?
** When do things get saved to app-private?
O' great community... thanks for your help.
-oldsk00lz
i was looking for a way to synch my /Music and my /Pictures so I came across this blog. im mounting the g1's sdcard on a linux machine in this scenario
http://philnelson.name/tag/rsync/
heres my script that i use. hope this helps a little.
Code:
#!/bin/bash
echo "Syncing /Music /media/FC30-3DA9/Music for updates to /media/E0E4-AA14................................................................."
rsync -rvv /media/FC30-3DA9/Music /media/E0E4-AA14
echo "Syncing /Music /media/E0E4-AA14 for updates to /media/FC30-3DA9/Music................................................................."
rsync -rvv /media/E0E4-AA14/Music /media/FC30-3DA
echo "Syncing /Music /media/E0E4-AA14 for updates to /media/FC30-3DA9/Music................................................................."
rsync -rvv /media/E0E4-AA14/dcim /media/FC30-3DA9/Pictures/g1Cam

Fix permissions???

I see this in the theme and development section at times...but have no idea what it means and how to use it correctly if you will.
Everything I found gave smartass answers, so hoping to get some straight answers here.
It does exactly what it says... Repairs permissions. You're supposed to do it whenever you modify the Android System. It repairs file permissions to access what they need to access.
In Android, each app runs as its own UID (user ID) just like multiple people would have their own UID on a big UNIX system. The reasoning is the same, to prevent apps (people) from messing with each other's data. The data for each app has to be 'owned' by the UID the app runs as, and additionally the app itself (.apk file) has to be that same UID. Unlike big UNIX systems, these IDs are stored in the packages.xml file in /data/system. This file, in addition to storing UIDs, stores the android permissions of each program as described in its manifest (permissions like writing to the sdcard, monitoring phone state, turning wifi on and off, accessing bluetooth, etc). If the file is damaged, deleted, or otherwise unreadable, it is regenerated. The app UIDs are assigned initially in the order you install them (10001, 10002, etc.). When the packages.xml regenerates, it grabs the Android permissions from the .apks but doesn't know what the old UIDs were. That's where fix_permissions comes in. Whether run from recovery or a booted system, fix_permissions reads through the packages.xml file and performs a chown/chmod command (which changes owner/change read-write-execute permissions) on each .apk and the data directory for it. It doesn't fix Android permissions (e.g. if phone.apk lost the ability to make calls, fix_permissions wouldn't help)
To execute the fix_permissions script from your G2x:
Open the "Terminal" app from the application drawer type
Code:
su
fix_permissions
In ADB
Code:
adb shell fix_permissions
You can also do it as an option in CWM and when booted into recovery mode.
So basically you want to do it whenever you're flashing something in CWM?
Not really, unless you get a random FCs when trying to access your apps. But it's good practice I guess.

[Q] EEE - how to dump everything?

I don't know if ADB is even the best tool to do this, but I want to be able to copy the entire file system off the EEE pad onto a pc. I want everything, starting from the "/" root directory. I want the entire file system and all files copied over so I can work with them on the pc.
I have root (verified by # when entering adb shell and various root apps successfully running.)
My thought was to do "adb pull /" from a dos shell (running windows 7), but not everything copies over. I get lots of messages about "skipping special file", I dont get the /data/data directory, etc etc.
Is there a tool or some way to copy over the entire file system starting from "/" ?
Thank you.
Nvflash will let you download the APP partition which is the system folder. It's an ext4 filesystem that you can mount and poke around.
USP is the data partition.
Be careful not to format your TF!
Clockwork mod will backup the system.img and you can either mount or unyaffs this. I forget which one. Same for data.img
sent from my cyanogen(mod) vision
Is the data.img same as the USP partition? Is the system.img same as the APP partition?
which I can then mount and explore?
I don't want to edit anything, I only want to examine.
In particular, I want to take a snapshot of all the files and filesystem (directory structures, files, etc) before an app is run. After the app is run and exited, I want to take another snapshot and look at what has changed. If there are new files created, existing files edited, etc. I want to search for strings (grep), etc.
I was hoping I could copy all the files to do this, but perhaps there is another way like one of those you suggested (nvlash, clockwordmod, ??)
Thank you.
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
sent from my cyanogen(mod) vision
gee one said:
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
Click to expand...
Click to collapse
Expert or not, I really appreciate your advice.
I took your initial suggestion to be to use NVflash and/or clockworkmod to make backups of the device. It seems from some other threads I've read that the tablet drive consists of up to 15 or 16 partitions, two of which are USP and APP.
So conceivably I could back those up "before", and mount the backup images somewhere to look at, preferably on a pc.
Then, I could install and run the app in question, and use NvFlash and/or CWM again to make backup images, and look at them for comparison.
On another note, I tried installing busybox and running cp to move, for example, /data to the external SD card, but I think I need a bigger SD card.
I wonder if
busybox cp / /Removable/MicroSD/targetdirectory
would work to copy everything?
The danger with that is that some directories and files are virtual- /proc and I think /var are virtual directories. Files like dev/null dev/zero would be problematic!
You might want to do specific parts, such as /data, or even /data/data/your.app's.java.name.here
You could use "find ." and write a script to pull everything with adb, but it would take forever, so it might not be a true snapshot.
Have you looked at the ddms or some of the other tools in the android SDK?
Sorry to confuse. By snapshot I did not mean screenshot. I meant just a record of the state of the device at that point in time. Meaning, all the files before the app was run. Then all the files (any new ones, changes to existing ones, any deleted) AFTER the app was run. I want to look at what has changed.
Still, thanks for the ddms idea. I have to look at any other tools in the adb environment that could be useful.

Cannot delete files or folders within /data/data/

Setup: CROMI 3.4.7 with Data2SD
I am having issues deleting folders and files within the /data/data/ portion of my file structure. I have tried with both th File Manager HD and ES File Explorer but I keep getting messages saying that I am unable to delete those folders and files.
The reason I am trying to delete this is because I was unable to install certain apps, and continually got an error message during installation that said:
Unknown error code during application install: "-24"
From searching forums, I found that the issue is that previous installations (I guess I forgot to do a factory reset before reflashing a ROM) left certain system folders and files for certain applications, which prevented a fresh installation from taking place. Other users have resolved this issue by deleting the relevant files in the /data/data/ section of their tablet.
I have circumvented the issue by renaming those folders (which for some reason works), but still cannot delete those renamed folders. I've tried messing with the permissions, but still no luck.
Any ideas?
Possibly an ownership problem?
Boot into recovery, plug in the USB cable, go into adb shell. Make sure that /data is mounted. Then do something like:
cd /data/data
chown -R media_rw.media_rw *
Might wanna backup first...
danger-rat said:
cd /data/data
chown -R media_rw.media_rw *
Click to expand...
Click to collapse
Don't do that if you want any apps to work afterwards.
Eeeeek, good catch!
I was thinking data/media.
You could do this just for the specific folders you want to delete, but not all...

[Tutorial] Install problematic APKs in /system (or /preload)

You may have tried to move some APKs to /system/app/ and end up with continuous crashes, usually resulting in abandoning your plan to save some otherwise wasted space (or preventing to accidentally uninstall all keyboards...)
This is often said to be a permissions issue, yet that's not enough for some packages: those with external libraries.
Copy the APK to /system/app/, then `chmod 644` it as usual.
You can also install to /preload and symlink to system
On your computer (easier but not required), open the APK (as a renamed ZIP).
Go to ./lib/{architecture}/, where on the Ace2 this is lib/armeabi-v7a.
Extract all the (.so) files here and put them in /system/lib.
There's no step 5!
Ryccardo said:
You may have tried to move some APKs to /system/app/ and end up with continuous crashes, usually resulting in abandoning your plan to save some otherwise wasted space (or preventing to accidentally uninstall all keyboards...)
This is often said to be a permissions issue, yet that's not enough for some packages: those with external libraries.
Copy the APK to /system/app/, then `chmod 644` it as usual.
You can also install to /preload and symlink to system
On your computer (easier but not required), open the APK (as a renamed ZIP).
Go to ./lib/{architecture}/, where on the Ace2 this is lib/armeabi-v7a.
Extract all the (.so) files here and put them in /system/lib.
There's no step 5!
Click to expand...
Click to collapse
Thank you very much :good:
All of the above is still true if you want to package apps in CWM format, but people who just are tight on /data (and don't want to repartition) can just use the convert to system app in Link2SD, which now actually works on apps with libraries

Categories

Resources