[Q] Trying to replace a system apk - Galaxy S II Q&A, Help & Troubleshooting

Hi,
I'm attempting to replace Email.apk on my miui rom. This is the method I am using:
Code:
adb push Email.apk /sdcard/
adb shell
su
rm /system/app/Email.apk
rm /system/app/Email.odex
mount -o rw,remount /dev/block/mmcblk0p9 /system
cp /sdcard/Email.apk /system/app
reboot
When the phone has rebooted, my changes do not take affect. To check, I pulled the /system/app/Email.apk back, and found it to be the original version.
Can anyone tell me what I'm doing wrong here?
Thanks,

Have figured this out...
adb appears to send some kind of cached version over. Renaming the file before transferring forced adb to use the correct file, and all is well.

jimhaddon said:
Have figured this out...
adb appears to send some kind of cached version over. Renaming the file before transferring forced adb to use the correct file, and all is well.
Click to expand...
Click to collapse
How? I like to know too, guide step by step....thanks

You mean renaming the original file first to any name then copy the moded file with the original name ?
If that what u mean , so I better to delete the original one first then but enstead my moded file . Is that right ?
Sent from my GT-I9100 using XDA App

Just use something like root explorer, no need for adb...

Joey2o11 said:
Just use something like root explorer, no need for adb...
Click to expand...
Click to collapse
I tried to use root explorer to change phone.apk, it didnt work.. i changed the file but it kept on crashing all the time ...
Sent from my GT-I9100 using XDA App

hielo_te said:
I tried to use root explorer to change phone.apk, it didnt work.. i changed the file but it kept on crashing all the time ...
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
You'll get lots of FCs until you reboot the phone then it should be fine.

Related

[Q] Rooted or not?

Hi, I rooted my Vribrant, both ways (manually and with one click root). I installed terminal emulator. I tried the su command to check if I am root. The # appears normally. However I tried deleting a file with Root explorer, inside the system folder, and when I get back it's still there. I also tried deleting it manually from Terminal EMulator with these commands:
su
cd system/apps
rm Swype.apk
and I get this:
rm failed for Swype.apk, Read-only file system
I also tried:
su rm Swype.apk
and this is returned:
Permission denied.....
I also tried the exact same thing from adb shell (which I had to allow in superuser permissions program), but it gave me the exact same results. What's wrong? Am I doing something wrong? Thanks
In root explorer, try hitting the r/w button at the top and see if that works.
Sent from my SGH-T959 using XDA App
I know about the button. The strange thing is that inside system folder it grands me r/w permissions, and no matter how many times a press the r/o button it doesn't change. Still gives the results I said. However, besides root Explorer what's wrong with terminal emulator and adb?
I'm not 100% sure how to mount as root in adb. I wish I knew myself heh.
Did any of those root methods install the superuser app?
Sent from my SGH-T959 using XDA App
Terminal Emulator should return a "#" after typing "su"
Sent from my SGH-T959 using Tapatalk
From a terminal write
adb root. (will give root)
adb remount. (will remount system as r/w)
adb shell cp /system/app/swype.apk /system/app/swype.apk.bak
Adb shell rm /system/app/swype.apk
This link is what i used to use to gain rw permissions
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
Alternatively from terminal on the phone type
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Assuming your sys partition is mntblock3
Sent from Conical. 07
rbirg said:
I'm not 100% sure how to mount as root in adb. I wish I knew myself heh.
Did any of those root methods install the superuser app?
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
Yes both methods installed the "Superuser Permission" app.
I7oobie said:
Terminal Emulator should return a "#" after typing "su"
Sent from my SGH-T959 using Tapatalk
Click to expand...
Click to collapse
It does normally.
linuxmotion said:
From a terminal write
adb root. (will give root)
adb remount. (will remount system as r/w)
adb shell cp /system/app/swype.apk /system/app/swype.apk.bak
Adb shell rm /system/app/swype.apk
This link is what i used to use to gain rw permissions
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
Alternatively from terminal on the phone type
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Assuming your sys partition is mntblock3
Sent from Conical. 07
Click to expand...
Click to collapse
I tried the first method but it didn't work. When I entered adb root, it said "adbd cannot run as root in production builds". I searched a bit and found that I must have a rooted kernel for this to work. (I guess it's different from the root method I tried in "how to root vibrant").
Anyway the second way worked, where i replaced mntblock3 with stl9 for my phone. I tried the rm command and it worked! However as soon as I exited terminal, I couldn't delete other files. I had to retype the command. I can't do this everytime I need access in System folder. Why is this happenning? Does this have something to do with the fact that root explorer cannot change r/w to r/o mode while in system folder?
what if you open Superuser
Click on Root Explorer.
Click on Forget.
Open Root Explorer and grant Root Access and check to remember it.
work now?
Moved to Q&A, please post in the correct section.
s15274n said:
what if you open Superuser
Click on Root Explorer.
Click on Forget.
Open Root Explorer and grant Root Access and check to remember it.
work now?
Click to expand...
Click to collapse
No it didn't work. I also installed the latest version of SuperUser 2.3.6.1. But without a difference unfortunately.
What works for me, is installing sgs tools, and whenever I want to do write operations on system folder, run the appropriate script from sgs and then use root explorer......
Although I think there's something wrong? Why doesn't the mount r/w button work in root explorer, and why do I have to remount the file system through SGS tools, every time for it to work?
makes no sense to me either. Have you uninstalled RE and the installed it back granting root once reinstalled?
Yes several times.....
I am giving up. I just have to go through the whole process every time. I found some other people having this issue. I am on stock JI6 firmware. Maybe when I read a little bit more I will flash a custom rom.
Download and install Super Manager. Pretty handy program to use for Root users.
I'm not sure what the issue is,but mine does it too. I'm running the "unofficial" froyo JK2 build,flashed via ODIN,and I'm having the same issues. root works,root file explorer is stuck in rw,won't let me switch to ro,and it can't do anything to files in / or /system. manually remounting it from terminal or sgs tools works.
msnuser111 said:
I'm not sure what the issue is,but mine does it too. I'm running the "unofficial" froyo JK2 build,flashed via ODIN,and I'm having the same issues. root works,root file explorer is stuck in rw,won't let me switch to ro,and it can't do anything to files in / or /system. manually remounting it from terminal or sgs tools works.
Click to expand...
Click to collapse
At least I am not the only one with this problem.... haha
I forgot to mention that I use Root Explorer version 2.12.2
When I try a custom Rom I will post the results....
^ why not get the update, .4 is the most recent build. Do you have an illegal copy?
It's not only root explorer. It happens with other file explorers too like android mate and super manager... Inside system folder whatever, I do doesn't happen unless I unmount and remount like before

New Market app

Any brave souls tried the new Market today?
Yes, I just tried it. It works! and it fixes the button problem in 2.2.6.
I first tried one that did not work, but I've attached the one I did get to work. Just copy into /system/app, rename to Vending.apk, and change permissions.
Enjoy!
Xhorder said:
Yes, I just tried it. It works! and it fixes the button problem in 2.2.6.
I first tried one that did not work, but I've attached the one I did get to work. Just copy into /system/app, rename to Vending.apk, and change permissions.
Enjoy!
Click to expand...
Click to collapse
Would this work ?
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb shell cp /system/app/Vending.apk /system/app/oldVending.apk
adb push Vending.apk /system/app
adb reboot
Or, you can just download and install it like any other apply. It'll install over the old Market no problem. It Indore you that it's a system apply, but works anyway.
Sent from my Nook Color
golfprorm said:
Or, you can just download and install it like any other apply. It'll install over the old Market no problem. It Indore you that it's a system apply, but works anyway.
Sent from my Nook Color
Click to expand...
Click to collapse
that didn't work for me... YMMV of course.
Anyone have the old Market (Vending.apk)? I stupidly replaced it with the above and broke it. Much obliged.
Thibor69 said:
Would this work ?
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb shell cp /system/app/Vending.apk /system/app/oldVending.apk
adb push Vending.apk /system/app
adb reboot
Click to expand...
Click to collapse
Worked for me
I was able to install it via the .apk...
Kept getting error message about cp: not found
Skipped the renaming step and it worked perfect, rejected both drives first and it worked like a charm.
FW 1.0.0 / Launcherpro
Works great! Any updated Gmail success yet?
Sent from my LogicPD Zoom2 using Tapatalk
Just installed it from the APK above. Works great.
Took the plunge... did it from the APK. Works.
The scrolling issue when you had to flip the NC in landscape is gone. But I find it a royal pain to switch between Paid, Free and Just In. For some reason the oval overlay trasfers the click on the app below and I end up opening that instead. I found that switching requires a rather precise click... something to think about Mr. Sergei. Well... maybe not for us free spirits
Thanks, I just installed it and it worked, straight from tapatalk app.
Worked fine for me also.
Via TapaTalk on Nook Tablet
I've downloaded and put it into the system\app folder, renamed and when market opens it just instantly crashes.
ideas anyone? greatly appreciated
EDIT: ROFL! redid the process and rebooted after double checking permissions, works fine now
One thread on the subject is enough: http://forum.xda-developers.com/showthread.php?t=872621

[How To] New Swype betas are installable on the Atrix - Root Required

Theres a new version of the Swype beta that is IMMENSELY better than the preloaded swype that comes with the atrix, it literally fixes all the annoying things of the older Swype versions:
http://beta.swype.com/
Swype 3.x beta works with the method below!
Process:
1) Use Root Explorer/Terminal/ADB to backup and then delete Swype.apk from /system/app and libSwypecore.so from /System/lib
2) Download the installer from https://beta.swype.com/android/get/ (on your phone)
3) Use installer to login and install latest version of swype
After your first phone reboot, if you are experiencing Swype Force closes after installing the latest swype, uninstall swype from your phone and then reinstall it; it should no longer force close after reboot.
If you are still experiencing force crashing after reinstall, try wiping your dalvik cache within CWM. Thanks Dudeman Broguy.
If you want to get in the latest beta, sign up over here. Registrations are open right now, hurry before they close them again!
Thanks to playin4sheezy for figuring this out: post #12
yes, i have been using it all day and it looks and feels great! if you have sideloading enabled, when you start the install it will ask to over write the current one.
graemegb said:
yes, i have been using it all day and it looks and feels great! if you have sideloading enabled, when you start the install it will ask to over write the current one.
Click to expand...
Click to collapse
Im trying to use the installer and it tells me to disable swype, and you cant disable the built in one. Can you pm me the apk?
Yea, I get to the point where it says "Licensing Swype, please wait...." and it doesn't get past that.
You need to go into /system/app and move Swype.apk to a backup folder on /mnt/sdcard
Then go into /system/lib and do the same for libSwypeCore.so
Give it a reboot and then try to install the beta. It worked for me
How did you move the apk, it wont allow me to do so
playin4sheezy said:
You need to go into /system/app and move Swype.apk to a backup folder on /mnt/sdcard
Then go into /system/lib and do the same for libSwypeCore.so
Give it a reboot and then try to install the beta. It worked for me
Click to expand...
Click to collapse
woo nice! thanks that worked for me! no more stupid tip window!
Krshaw18 said:
How did you move the apk, it wont allow me to do so
Click to expand...
Click to collapse
you have to use root explorer (and be rooted) or you could use terminal/adb (still have to be rooted)
Sorry for the noob questions! Move it completely? or make a back up of it? and also any apps out there like root explorer but free ?
I tried the above steps but the libswypecore is still in the system folder when i move it as it is read only...
Krshaw18 said:
Sorry for the noob questions! Move it completely? or make a back up of it? and also any apps out there like root explorer but free ?
Click to expand...
Click to collapse
If youre rooted, root explorer is worth the money. You have to move Swype.apk completely, and make sure its not there after moving or the install wont work.
Make sure if you are in Root Explorer that you click the R/W button at the top to make the system folder Read/Write access. Then long press the files and click move and goto sdcard and make a folder named "whatever you want" then click paste..
Or you could do this using adb with Atrix plugged into the computer:
goto command prompt
type the following:
adb shell
su
mkdir /mnt/sdcard/swype_backup
mount -o rw,remount /dev/block/mmcblk0p12 /system
cp /system/app/Swype.apk /mnt/sdcard/swype_backup
cp /system/lib/libSwypeCore.so /mnt/sdcard/swype_backup
rm /system/app/Swype.apk
rm /system/lib/libSwypeCore.so
Hopefully this gets you going
playin4sheezy said:
Make sure if you are in Root Explorer that you click the R/W button at the top to make the system folder Read/Write access. Then long press the files and click move and goto sdcard and make a folder named "whatever you want" then click paste..
Or you could do this using adb with Atrix plugged into the computer:
goto command prompt
type the following:
adb shell
su
mkdir /mnt/sdcard/swype_backup
mount -o rw,remount /dev/block/mmcblk0p12 /system
cp /system/app/Swype.apk /mnt/sdcard/swype_backup
cp /system/lib/libSwypeCore.so /mnt/sdcard/swype_backup
rm /system/app/Swype.apk
rm /system/lib/libSwypeCore.so
Hopefully this gets you going
Click to expand...
Click to collapse
Thanks a bunch!
Wont let me delete
Sent from my Atrix 4G using XDA App
joshuajoshua said:
Wont let me delete
Sent from my Atrix 4G using XDA App
Click to expand...
Click to collapse
Is your phone rooted? If so, then when you typed su in adb shell(not terminal) did it ask you for superuser permission? If so, then you should make sure and accept it.
If your phone is not rooted, then I don't think your gonna get this working
Sent from my MB860 using XDA App
I didnt need to move/delete libSwypeCore.so and the install worked fine.
andy2na said:
I didnt need to move/delete libSwypeCore.so and the install worked fine.
Click to expand...
Click to collapse
Ok. Be aware that I've had previous issues with swype after few days of use because I didn't remove that file
Sent from my MB860 using XDA App
I would suggest someone testing that you can in fact put it back to the stock setup. Mine somehow got deleted when i first got the phone, and it doesn't come back, factory reset or otherwise.
cegna09 said:
I would suggest someone testing that you can in fact put it back to the stock setup. Mine somehow got deleted when i first got the phone, and it doesn't come back, factory reset or otherwise.
Click to expand...
Click to collapse
i have been messing with swype for the last few days
i can guarentte you that if u installed / mounted a messed up version of swype (WVGA with a language pack in my case), you can just use put the backup stock swype back on /system/app and it'll be fine again
i get an error on sign-in into the installer, says device id dont match. any ideas?
EDIT: I had to log into mySwype and remove my old phone (nexus one) and then now it works!

[Q] [q]about rebooting my phone

I delete framework-res apk in system/framework with root explorer,and cannot turn on my phone (s5830)How can I turn on my phone again?(I have a backup up off the apk)
Hei123 said:
I delete framework-res apk in system/framework with root explorer,and cannot turn on my phone (s5830)How can I turn on my phone again?(I have a backup up off the apk)
Click to expand...
Click to collapse
you need is adb and command prompt
adb remount
adb push framework-res.apk /system/framework
optional ones
adb shell chmod 644 /system/framework/framework-res.apk
adb shell chown 0 /system/framework/framework-res.apk
adb shell chgrp 0 /system/framework/framework-res.apk
Just reflash the rom from recovery!
Without wiping data!
Sent from my GT-S5830 using xda premium
well I'm with Amit here. You must have the original ROM's flashable zip file you were currently using?
Simply extract it. Get to PATH_TO_CURRENT_LOCATION\system\framework\framework-res.apk after extracting it. Get the file and push it via adb. Easy as 123.
Reflashing again restores all the system files...? Happened with me... N I use to flash again! Lol Never tried Amits Method
Sent from my GT-S5830 using xda premium
Rushyang said:
well I'm with Amit here. You must have the original ROM's flashable zip file you were currently using?
Simply extract it. Get to PATH_TO_CURRENT_LOCATION\system\framework\framework-res.apk after extracting it. Get the file and push it via adb. Easy as 123.
Click to expand...
Click to collapse
I have only the apk ,and what is adb,and how to push it
Hei123 said:
I have only the apk ,and what is adb,and how to push it
Click to expand...
Click to collapse
!!!! if that the case, just reflash ur rom as stated by pvrx. SOLVED!

Replacing SystemUI.apk in ADB

So I flashed the wrong .zip and now SystemUI.apk is force-closing. Rather than reflash the ROM I'm just going to replace SystemUI.apk using adb (I happen to have the ROM unzipped on my laptop), but want to make sure I have the procedure right.
Reboot to recovery
Then
adb shell
su
rm system/app/SystemUI.apk
exit
And then to push the SystemUI.apk
just
adb push SystemUI.apk system/app/SystemUI.apk
reboot
Do I need to mount system as writable before all of this?
Yes I believe you do
You could put the system.apk into a flashable zip by itself and flash that tho
Less room for error
Sent from my ADR6425LVW using Tapatalk 2
superchilpil said:
Yes I believe you do
You could put the system.apk into a flashable zip by itself and flash that tho
Less room for error
Sent from my ADR6425LVW using Tapatalk 2
Click to expand...
Click to collapse
Thanks.
Now I'm wondering if the permissions will be all mucked up if I just push the file. Is there a way to set permissions in adb?
never mind, got it, chmod 644 system/app/SystemUI.apk
Worked too!
tekhna said:
Thanks.
Now I'm wondering if the permissions will be all mucked up if I just push the file. Is there a way to set permissions in adb?
Click to expand...
Click to collapse
There is, I can't remember the command off the top of my head
Sent from my ADR6425LVW using Tapatalk 2
Adb remount will mount as rrw and you don't have to set permissions the folder already has it. You can also just use a root file explorer app to place it in their
Sent from my ADR6425LVW using XDA
tekhna said:
So I flashed the wrong .zip and now SystemUI.apk is force-closing. Rather than reflash the ROM I'm just going to replace SystemUI.apk using adb (I happen to have the ROM unzipped on my laptop), but want to make sure I have the procedure right.
Reboot to recovery
Then
adb shell
su
rm system/app/SystemUI.apk
exit
And then to push the SystemUI.apk
just
adb push SystemUI.apk system/app/SystemUI.apk
reboot
Do I need to mount system as writable before all of this?
Click to expand...
Click to collapse
hi, i have the same problem. i flashed the wrong zip from here http://forum.xda-developers.com/showthread.php?t=2526039&page=2 and now when i put the usb cable into the pc to backup from nexus root toolkit, it says that driver are not installed, and when i make the test for the drivers systemui crash. so i cant go back to stock rom or restore backup. any ideas? please help me

Categories

Resources