Messed up /data/apk - Help? - Android Q&A, Help & Troubleshooting

The problem:
I rooted my Samsung Galaxy Ace and went exploring the root directory with Root Explorer. I renamed the folder "apk" found in /data to "apk_old", thinking that if everything worked, I could just delete it as it contained a handful of stock apks as well as several apps installed from the market. At the time, I though apks were needed just for installation and that by deleting the folder I would save ~30MB of internal memory. Well, I turns out I was horribly wrong. Several stock apps, such as Youtube or Maps and all market apps that were installed in internal memory have stopped working. In the app drawer, their icons have turned into those default apk icons and their names into com.something.blabla. I was getting crashes every 1-2 minutes from those apps. The widgets on my home screen, such as Google search or Homework 4x2 have also stopped working.
What I've tried:
*renaming the folder back to "apk", obviously. That didn't work, it said something like "execution failed"
*making a copy of the folder - failed
*zipping the folder - failed
*thinking there was a problem with Root Explorer, I installed Total Commander and Solid Explorer hoping I could rename the folder back. Total Commander cannot open the /data folder, while Solid Explorer says the /data folder is empty
*"pulling" all of "/data" with ADB - 0 files pulled.
However, as I was trying to clean up my own mess, things changed a bit. At some point the crashes stopped and all of the "corrupt" apps have simply gone away from the app drawer. While I was unable to do anything with the "apk_old" folder in /data, something changed so that right now I can't even access /data anymore.
So yea, I have a bad feeling that somehow everything inside the /data folder has been wiped, though I sure hope I'm wrong. Anyone have anything to advise?

Oh, and I also noticed that Superuser is gone. I tried re-rooting my phone from this link, it worked the first time I rooted, but not now...
http://forum.xda-developers.com/showthread.php?t=1552792

I don't know exactly what you have in /data/apk I guess is the same I have in /data/app all the installed package.apk
Since your system is compromised I would avoid to use programs from it like Root Explorer to change anything, and for the other programs looks like they don't have root access.
I would try with plain adb: http://forum.xda-developers.com/showthread.php?t=2141817
Once you have your phone connected with adb shell you can go root:
Code:
$ su
to list files and directories in /data
Code:
# ls /data
and then to rename the folder
Code:
# mv /data/apk_old /data/apk
then reboot the phone
good luck

I'm assuming those # signs were suppose to be $'s?, Anyways, what I typed into adb:
1. adb shell
2. $ ls data
What I get:
opendir failed, Permission denied
Another atempt:
1. adb shell
2. $ su
What I get:
su, and after a long pause - Permission denied
eh? So, apparently I can't get root access, what now?

the dficua
Ha, made progress. I installed Superuser through adb and it gave me permission to access data and to rename apk_old back to apk. However, the folder has been wiped of all the apps. Luckily, I have a friend who also has a Galaxy Ace, I'll just copy the folder and paste it into /data, hopefully i'll bring back the default apps.

$ is the normal shell
# is root shell
I forgot to tell you to try that on recovery mode to prevent the calling of SuperUser to grant privilegs, su binary itself should be in /system/xbin
When you restore apps remember also to fix permissions, user and group, it should be something like this:
# chmod 0664 /data/apk/*.apk
# chown system:system /data/apk/*.apk
check the right values in your friend's phone.

Related

[How To] Enable Nvigation world-wide (ownhere/Brut.all MOD)

This is how i managed to install the Google Maps 5.7.0 ownhere/Brut.all MOD which enables Navigation in countries where originally you cnt use this app. this is a modified version that seamlessly replaces the original app.
i tried to follow the instructions provided in the original thread but i kept facing problems and errors like "Application not installed" when trying to install the app, and "remount failed: no such file or directories", among others.
i also dnt have the Maps app availble in the market in my country, i can only sideload it.
it took me few days of googling to finally make it work on my Galaxy Ace. i'm running a rooted stock 2.2.1
it's simple once you got the right instructions. but as usual, i'm not responsible if your phone just decides to go brain dead on its own
for this you need ROOT access, Superuser, ADB and Titanium Backup
in Titanium Backup, choose Maps and back it up (app+data).
in case things dnt work out, you can always use this backup to restore the original app and data.
in Titanium Backup, choose Maps and wipe data then uninstall.
in Titanium Backup, choose Street View, wipe data and uninstall.
use whatever way to place the maps5.7.0-ownhere.apk file in the root of your sd card.
(i dnt know what's the diffrence between maps5.7.0-ownhere and maps5.7.0-ownhere-testkeyresign. i used the first and it's working fine.)
now connect your phone to your computer and make sure you keep your screen on. that's very important for the next step to work.
launch ADB and enter these commands:
adb shell (in the next line, a $ will appear)
su (when you inter this, Superuser in your phone will prompt you to grant root access. confirm it. a # will appear in the next line)
mount -t rfs -o remount,rw /dev/block/stl9 /system (this will remount your system in Read/Write mode)
cp /sdcard/maps5.7.0-ownhere.apk /system/app/maps5.7.0-ownhere.apk
mount -t rfs -o remount,ro /dev/block/stl9 /system (remount system back in ReadOnly mode)
exit
exit
Maps should appear in your app drawer.
you can now reinstall Street View.
if anything is not clear enough, just ask
I think its more easy to just use root explorer to copy that googlemaps apk to its proper place, because what i understand from that adb command is it copy the googlemaps apk to /system/app folder which could be done in just two or three click with root explorer. Cmiiw
But nevertheless, thanks for this tutorial tho
Sent from your phone
is it working
an0nym0us_ said:
I think its more easy to just use root explorer to copy that googlemaps apk to its proper place, because what i understand from that adb command is it copy the googlemaps apk to /system/app folder which could be done in just two or three click with root explorer. Cmiiw
But nevertheless, thanks for this tutorial tho
Click to expand...
Click to collapse
that was the first thing that came to my mind when installing didnt work. i copied the file with root explorer but the Maps app didnt show up in the app drawer.
i only speak from my own experience, i'm no expert.
thank you for the contrbution
imranaryan said:
is it working
Click to expand...
Click to collapse
it is working on my phone

Issue with the new root script with sdcard

The new script failed for me and from the look of things for other people as well.
In my case a new out of the box Nook Tablet and a fresh sdcard it fails to find the sdcard. it is there of course, its simply a case of not having read or write permisssions on the /mnt/sdcard. It's set as system for owner and group without anyother permissions. The Nook had already created a folders for the sdcard with read write permissions so one could have used one of them for the tests I suppose.
What I did after completing the rooting was to turn on superuser and rerun the creating of Titanium backup directory and pushing the modified device manager files. I also needed to install Titanium.apk.
The commands I used was:
adb shell
$ su
# makdir /sdcard/Titaniumbackup
# chmod 777 /sdcard/Titaniumbackup
# bye
adb push com.bn.devicemanager-1351fc675dac5f1a461a09b769b1b4b6.apk.gz /sdcard/TitaniumBackup/com.bn.devicemanager-1351fc675dac5f1a461a09b769b1b4b6.apk.gz
adb push com.bn.devicemanager-20111222-085657.tar.gz /sdcard/TitaniumBackup/com.bn.devicemanager-20111222-085657.tar.gz
adb push com.bn.devicemanager-20111222-085657.properties /sdcard/TitaniumBackup/com.bn.devicemanager-20111222-085657.properties
adb install Titanium.apk
then using the nook tablet running Titanium.apk and performing the restore of the DeviceManger.
I was hoping this might help someone else out.
makdir is not a command. mkdir.
the sdcard is FAT formatted. you can't chmod it. that's a worthless command.

[Q] 4.0.3 HTC Temp Root Question

Hello everybody,
i have gained root access to my phone via backup/restore method through adb where local.prop is stored in /data/. So when i log onto my phone with adb i have root access. I copied busybox, su and the superuser.apk to the right place and removed the local.prop file again. After a reboot I was hoping to remove some crapware off my phone but to my surprise the binaries i copied vanished from the filesystem. So the phone reverted the changes by itself. I did this process several times copying busybox and su to various places referred to by $PATH, but it´s everytime the same after i reboot. The files are gone.
After the first attempts failed i tried to make changes to my phone while logged in as root. I wanted to uninstall unnecessary packages with "pm uninstall" but that failed also. The command just responds "failed". Even when /system is mounted rw (it remounts itself to ro after a while though). I´ve also made changes to /init.rc but they are also gone after a reboot as other changes i´ve made. Basically i wasn´t able to accomplish anything with root access no matter what i did.
So what i want to know is how this black magic works andy why i cant do anything with root. I know how to achieve real root through htc dev and various other methods.
Thanks for reading!
nasenstueber said:
Hello everybody,
i have gained root access to my phone via backup/restore method through adb where local.prop is stored in /data/. So when i log onto my phone with adb i have root access. I copied busybox, su and the superuser.apk to the right place and removed the local.prop file again. After a reboot I was hoping to remove some crapware off my phone but to my surprise the binaries i copied vanished from the filesystem. So the phone reverted the changes by itself. I did this process several times copying busybox and su to various places referred to by $PATH, but it´s everytime the same after i reboot. The files are gone.
After the first attempts failed i tried to make changes to my phone while logged in as root. I wanted to uninstall unnecessary packages with "pm uninstall" but that failed also. The command just responds "failed". Even when /system is mounted rw (it remounts itself to ro after a while though). I´ve also made changes to /init.rc but they are also gone after a reboot as other changes i´ve made. Basically i wasn´t able to accomplish anything with root access no matter what i did.
So what i want to know is how this black magic works andy why i cant do anything with root. I know how to achieve real root through htc dev and various other methods.
Thanks for reading!
Click to expand...
Click to collapse
is your RECOVERY.img
and beside i dont really think your /system is fully mounted rw
mauricio.valladolid said:
is your RECOVERY.img
and beside i dont really think your /system is fully mounted rw
Click to expand...
Click to collapse
Thanks for the reply. i use mount -o remount,rw /system as mount command to get read/write permission on /system. If there is something more to do please let me know. And if the behavior i ve seen is caused by the recovery.img is there something i can do about it?
nasenstueber said:
Thanks for the reply. i use mount -o remount,rw /system as mount command to get read/write permission on /system. If there is something more to do please let me know. And if the behavior i ve seen is caused by the recovery.img is there something i can do about it?
Click to expand...
Click to collapse
why dont you just install ext4 recovery and flash supersu.zip?
I really dont get it why are you trying to do it the hard way

[Q] [help]how to get system folder permission for hdx7

I just play andorid device a few days, but My hdx7 is a little bricked because i deleted some system app. Now I can log in fire os, have adb, usb connected and internal storge, even i can operate device setting app, but i can't open the other app because i don't have a desktop.
I compare system/app folder with the same folder in the amazon bin, found that the folder lack of scores of app, but the other system folder is the same. So I hope can adb push app folder to the system folder, but the pemission denied. I try to remount or mount, it can't work.
if adb root, then "adbd cannot run as root in production builds.
if adb push apk to the app folder, then “permission denied".
if adb remount, then ”remount failed: Operation not permitted".
and I have try adb shell like that:
# su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system
# exit
it didn't work.
my hdx7 have rooted.
My Questions are:
1. If I could push the app folder to the system folder and reset to factory, is my hdx saved?
2. How to get the system folder rw in the situation?
thx for any prompt, although i am a rookie but i will try my best, i wish the adept can help me and will be enormously grateful. Sorry for my poor english.
It sounds to me that you had lost root.
kschang said:
It sounds to me that you had lost root.
Click to expand...
Click to collapse
So i have tried root again like "http://forum.xda-developers.com/showthread.php?t=2544965" said
But it didn't work, please see the attach, But I don't know why.
Sorry for that i'm rookie to andorid and ask so many questions.
randolphling said:
So i have tried root again like "http://forum.xda-developers.com/showthread.php?t=2544965" said
But it didn't work, please see the attach, But I don't know why.
Sorry for that i'm rookie to andorid and ask so many questions.
Click to expand...
Click to collapse
Hmmm... It says you still have root (the prompt changed after "su")
I personally don't use ADB much. I have Root Explorer (grabbed it legally for free from Amazon ages ago) and Wifi Explorer Pro (same method) so I basically WiFi myself the files I need sideloaded then move them around on the device itself. But if you've lost launcher, you have deeper issues.
Have you tried ADB push any launcher? Or even a download store like 1Mobile or Aptoide?
ADB is basically a Linux shell debug into Android, so you need to learn some Unix shell commands. I'm sure you can find ADB guides with the basic commands, like "ls", "cp", and so on.
You need to check the directory and see if the system/app and other system directories are still there. This is one reason I only play with the copy of ROM I have (see Safestrap Recovery).

[Help]Damaged phone, manual root.

Here's my situation...I had 2 rezounds...One perfectly OK, rooted and Titanium backed up, but my kids poured milk into it...yaay. The 2nd rezound which was my wife's seems to have something physically wrong with it where I can't connect to it with fastboot (but adb works ok when the phone is fully booted), which means I can't dev unlock it, or apply most of the root methods out there...
So I decided to try some other things...
I downloaded the Cydia Impactor...
Drop Su didn't work
but,
start telnetd as root on port 22 did work!
so I then went in and remounted /system as RW
and copied su to /system/bin and the Superuser.apk to /bin/apps.
I then performed a echo ro.kernel.qemu=1 >/data/local.prop.
Now when I reboot, I get the root shell if I adb in to my phone...
But, on the screen only the status bar at the top comes up and if I try to swipe down, I get
"Unfortunately, System UI has stopped".
After this, I went into adb shell and noticed the su was gone from /system/bin...So this time I pushed it to /system/xbin, changed to root owner and chmod'd it to 06755..I removed the local.prop since I think that was causing the problem with the launch screen.
After rebooting, the Rezound had deleteed the su again, but the launcher comes up OK.
So I'm thinking, maybe I need to name the su something else...nope that won't work.
I guess for now I can be happy I can get temp root...
1. Run Cydia Impactor and select start telnetd as root on port 22.
2. copy su to /system/xbin and chmod 06755 /system/xbin/su
3. Run Titanium backup, and allow SU access.
works until phone reboot when su is removed by something.
Any ideas for next steps anyone?
Thanks,
Scott

Categories

Resources