Push .apk to /system/app/ in HTC HERO - android

I have an HTC HERO and
I need to push my application.apk
to the /system/app/ folder.
I've followed some tuts on rooting the device
and that is fine, but when I try to push my package to the system/app
folder, I get: "permission denied":
$ push /sdcard/myApp.apk /system/app/
push: permission denied
I also try:
$ su
su
# push /sdcard/myApp.apk /system/app/
push: not found
Is this possible in a device that is not a developer intended device?
Thank you all!

Firstly, running push from the device doesn't work as it's not a built-in command. Ideally you would use the copy command cp, but I don't think it's included by default (I've added it to my device via busybox).
Anyway, your problem is that the /system partition is mounted as read-only when the device boots.
But if you have root access to the device, you can remount the partition as read-write:
host$ adb shell
hero$ su
hero# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
hero# cat /sdcard/myApp.adk > /system/app/myApp.adk
hero# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
Alternatively, after doing the remount, you can use adb push from the host as normal.

How I do it:
adb shell
#su
#mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
open a second terminal and use:
adb push myApp.apk /system/app/
in first terminal:
#reboot
What I add more then the others is the reboot - it's a must when doing a remount operation on the Android devices.

Related

Hosts file for Android emulator

I'm trying to setup hosts file for android emulator. I saw this advice:
adb remount
adb push hosts /etc/system/hosts (most tutorials suggest
this file)
adb push hosts /system/etc/hosts (some VM systems seem to
prefer this file instead!, for me this worked)
But when I do adb remount it writes "remount of the / superblock failed: Permission denied". I'm going to adb shell, but it also writes an error.
generic_x86:/ # mount -o remount,rw /system
mount: '/system' not in /proc/mounts
1|generic_x86:/ # mount -o rw,remount,rw /system
mount: '/system' not in /proc/mounts
generic_x86:/ # mount -o remount,ro /system
mount: '/system' not in /proc/mounts
1|generic_x86:/ # whoami
root
I reinstalled Android Studio twice it didn't help. Could anyone help pls?
Usage of -writable-system flag made ADB remount work. Hosts were replaced with the new file.
Launched emulator as:
emulator.exe -writable-system -avd Nexus_5X_API_28_x86
The hosts file is located at a directory that is not allowed to write over a file. So, you should first copy hosts to somewhere else, edit it, and then copy it back.
For example, let's work on the standard emulator:
Run the following command while the emulator is open:
adb devices
This command will show the running emulators. Run the following command to disable the emulator's read-only behaviour:
adb -s emulator-5554 remount
After this step, it should log remount succeeded. Then you should copy the emulator to another directory for editing:
adb -s emulator-5554 pull /system/etc/hosts ~/Desktop/
After this step, it will log about the file transfer's success. Now you can edit the hosts file. After the edit, you should push the file back. First of all, you should reboot the adb:
adb reboot
Emulator will restart itself. After this, you can remount the adb:
adb -s emulator-5554 remount
After the remount, you can push back hosts file:
adb -s emulator-5554 push ~/Desktop/hosts /system/etc/hosts

Can't move file from /sdcard/ to /system/app/ with shell, even with su.

Note: I am running this on a rooted device.
From my application, if I try to move a file from /sdcard/ to /system/app/ it fails. The following shell script does not work:
su
mount -o remount,rw /system
mv /sdcard/file.apk /system/app/file.apk
Whereas the following will work:
su
mount -o remount,rw /system
mv /system/app/file.apk /system/app/file.apk.bak
Why doesn't it work when copying from /sdcard/? (or any other file location I've tried).
I can't see the output from the location I'm running this however if I try from ADB then it gives me an error that the source file was not found even though it definitely exists.
adb root
adb remount
adb push my-app.apk /sdcard/
adb shell
su
cd /sdcard
mv my-app.apk /system/priv-app
cd /system/priv-app
chmod 777 my-app.apk
This worked for me on a rooted device
adb root
adb remount
adb push [local-file.apk] /system/app/file.apk
adb reboot

Push build.prop to /system/build.prop

I have edited build.prop and now my phone cannot boot. I have pulled build.prop using adb and now I have the correct build.prop file
What I need is to push build.prop using adb.
First try: Read-only file system
when I mount system:
Second try: Permision Denied
what can I do?
Probably because adb push uses the shell user, which does not have write permissions to /system/build.prop. You can, however, push the file to a different location first (e.g. /data/local/tmp/) and then move the file to the right place with the root user (after mounting).
Here are the commands you need to use:
adb push <Path to build.prop>/build.prop /data/local/tmp/
adb shell
su
mount -o rw,remount /system
adb push /data/local/tmp/build.prop /system/build.prop
I tried the following code... it works but i do not know if is the solution because my phone still cannot boot.
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
chmod 777 /system
exit
exit
adb push build.prop /system
please let me know if the following code is correct or not...
adb remount
adb push build.prop /system/
adb shell chmod 644 /system/build.prop
adb reboot
this works for me for Galaxy S6:
cd C:\Users[here the userprofilename]\AppData\Local\Android\sdk\platform-tools>
1.) adb pull /system/build.prop
- this download the file from the phone in the adb folder
- edit the file, then load up to the phone:
2.) adb root
3.) adb root remount rw
4.) adb root chmod 664 /system/build.prop
5.) adb root push ./build.prop /system/build.prop
adb shell
su
mount -o remount,rw /dev/block/st19 /system
chmod 777 /system
exit
exit
push build.prop /system
adb shell
su
chmod 644 /system/build.prop
exit
exit
reboot
that worked for me :)
This is what worked for me:
adb push \build.prop /data/local/tmp/
adb shell
su
rm /system/build.prop
cp /data/local/tmp/build.prop /system
exit
exit
adb reboot
Hope it helps.
Ok lets do it. i found a simple way to by pass root permissions.
If u have a CWM recovery... enter on it and on "mounts and storage" enter and mounts /system/ them your pc will recognize it on adb push and send it to system.
Use your command codes above you write them voilá... your tablet/phone will boot again. if you have a backup of original build.prop

Nexus 5 "sqlite3_enable_load_extension" referenced by "sqlite3"

Background Information:
Nexus 5
Have rooted permission on device
pull sqlite3 from my emulator
ADB pull /system/bin/sqlite3
push this sqlite3 onto my device
ADB push sqlite3 /sdcard/
adb shell
su
move sqlite3 into /system/xbin/ directory
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# dd if=/sdcard/sqlite3 of=/system/xbin/sqlite3
# chmod 777 /system/xbin/sqlite3
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
Keep getting error when I try to use sqlite3. For example:
# sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db
The error I got is:
CANNOT LINK EXECUTABLE: cannot locate symbol "sqlite3_enable_load_extension" referenced by "sqlite3"...
Does anyone know how to get sqlite3 running successfully on Nexus 5 device ? Any help is greatly appreciated.
i had the same problem. I found this Version working for Jelly Bean http://bit.ly/sqlite3-for-jb on my N5 4.4.2.
adb push sqlite3-for-jb /sdcard/sqlite3
adb shell
su
mount -o remount,rw /system
cp /sdcard/sqlite3 /system/xbin/sqlite3
chmod 755 /system/xbin/sqlite3
mount -o remount,ro /system
Simply use "SQlite Installer For Root" from the play shop.

How to replace / uninstall Email application from android emulator

Is there any way to uninstall/replace the inbuilt application in android emulator so that i can install my customized apps for Mail, Contacts, Music etc.
I have downloaded android 2.2 code for Email application and i want to modify certain things and install.
Please let me know if there is any way.
There's no point in replacing the apps in /system while the emulator is running, since the emulator doesn't save /system anyway.
In order to permanently replace apps in /system, one can edit the system.img file. It's quite easy really. As easy as extracting, moving files around, and compressing it back.
http://www.rodneybeede.com/Customize_an_Android_system_img.html
I have done this way:
adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
mount -o remount,rw -t yaffs2 /dev/block/mtdblock1 /data
rm /system/app/MyAppName.apk
rm -rf /data/data/package_name_here/
mount -o remount,ro -t yaffs2 /dev/block/mtdblock0 /system
mount -o remount,ro -t yaffs2 /dev/block/mtdblock1 /data
pm uninstall package_name_here
exit
Take care points:
You have to provide details of your application:
Line number 4: rm /system/app/MyAppName.apk
Line number 5: rm -rf /data/data/package_name_here/
Line number 8: pm uninstall package_name_here
Done
Launch your emulator, then make sure it is connected via adb, by typing:
adb -e devices
Make /system writable, by typing:
adb -e remount
Backup & remove Email.apk:
adb -e pull /system/app/Email.apk
adb -e rm /system/app/Email.apk
Push you own Email.apk:
adb -e push Email.apk /system/app
That's about it.
All i can say is i am also trying to find the solution but you can try an alternative, try uninstalling unnecessary apps by system app remover and now installing a application similar for the same purpose from market and see if it works the same.

Categories

Resources