Change file permission:/system/etc/bluetooth/audio.config - android

I use a Samsung Dart - SGH-T499 with Android v2.2.2 on it.
Now I need to edit the /system/etc/bluetooth/audio.config file. For that I rooted my phone using the SuperOneClickv2.3.3-ShortFuse. And browsed the file-system using Root Explorer. But I am unable to edit the permission of the audio.config. Could you please help me?

You also need to ensure that the /system directory, as it's a filesystem, is mounted read-write. In the adb shell use -o rw,remount as parameters to the mount command to do this. First you need to determine what ( hardware / physical / logical ) device that particular filesystem is stored on - use the mount command on its own to see the list and select the one which has /system as its mount point.

Can you not issue a
chmod 777 /system/etc/bluetooth/audio.config
...from the adb shell?

Related

Copy folder from Android app to local Windows directory

I'm trying to use the Android Adb Command Prompt to copy a folder inside the app container to a local Windows folder. The device is running Android 5.1.1 and is not rooted.
adb pull or cp aren't working. How can I copy a folder?
The following approaches aren't working:
Approach 1
adb shell
adb pull /data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs C:/temp/test
error: device not found
Inside the shell you can't see to do adb pull. See here.
Approach 2
DDMS can't access the data folder.
Approach 3
adb shell
run-as DroidSample.DroidSample
cp /files/MetroLog/MetroLogs/ C:/temp/test
cp: /files/MetroLog/MetroLogs/: No such file or directory
Approach 4
adb shell
run-as DroidSample.DroidSample
cp /data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs/ C:/temp/test
cp: /data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs is a directory (not copied).
This is also not working.
Approach 5
adb shell
run-as DroidSample.DroidSample
chmod 777 /files/MetroLog/MetroLogs
exit
exit
adb pull /data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs C:/temp/test
adb shell run-as DroidSample.DroidSample
chmod 700 /files/MetroLog/Metrologs
remote object '/data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs' does not exist
So also this isn't working.
Approach 6
adb shell
mkdir /sdcard/tmp
cp /data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs /sdcard/tmp
cp: /data/data/DroidSample.DroidSample/files/MetroLog/MetroLogs: Permission denied
This is also not working.
Approach 7
The only thing which half work is this
adb exec-out run-as DroidSample.DroidSample cat "files/MetroLog/MetroLogs/Log - 20160509.log" > C:/temp/test/test.log
But here I don't get the original file and I also have to know the exact file name. Additionally, that I loose line breaks and I have to do this for each file. Not that what I want.
So I'm running out of ideas. How can I access the internal stored files and copy them over?
You have almost solved the problem. As the storage of this kind is secured, you need to do one additional step. You need to copy the file from secured location to sdcard of the device. And then you can copy it anywhere via usb or android pull. Here are the command sequence I executed successfully.
adb shell
run-as DroidSample.DroidSample
cd shared_prefs
cp DroidSample.DroidSample_preferences.xml /sdcard/DroidSample.DroidSample_preferences.xml
exit
exit
adb pull /sdcard/DroidSample.DroidSample_preferences.xml C:/test/
That's it.
And I really appreciate the way you posted your question. Best of luck.
You're trying to gain read access to /data partition on actual android device. Such thing is not possible without root access, even if the app folder is yours. For the reason that permissions to read /data partition are not granted and cannot be granted, unless you're using an emulator. On emulator, which by default is with admin privileges for developer, you can access the data partition to read and write. On actual device you cannot. Not with adb, not with DDMS.
So basically speaking, anything that requires access to those files under /data is not going to work. Whether you sue cp command or pull command. The moment your kernel reads the beginning of your path which starts with /data/... it says: Oops, no can do.
You are trying to access /data folder of android device which is not accessible in unrooted device.

How to working Android Debug Bridge [duplicate]

I am trying to reach the sqlite database on my device using the procedure described here: How can i see SQLite Database (No emulator)?
However, I keep on getting sqlite3 not found.
I assume I am meant to be entering the commands with the hash (#) sign at the start of the line.
I tried with it and got nothing.
Without it I get the error message.
The sqlite3.exe file is definitely there and in the path.
Do I have to install something?
Some manufacturers deliver the devices without sqlite being installed on them. You can copy the sqlite program though from a emulator to your device if the device has an arm processor.
Start the emulator and use the adb command from the platform-tools in android-sdk
adb pull /system/xbin/sqlite3
Mount the system partition of your device read/write after this tutorial:
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
Use the adb command to copy the sqlite3 file to your device
adb push sqlite3 /system/xbin/
After you reboot your device the sqlite3 command should work.
Edit (copy from linked page - in the case link becomes invalid). The instructions for step 2 are:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
"Replace /dev/block/mtdblock3 & /system with appropriate device path and mount point, as obtained from cat /proc/mounts"
Go to Play store --> search for Titanium Backup & install it
adb shell
su
cp /data/data/com.keramidas.TitaniumBackup/files/sqlite3 /system/xbin/
cd /system/xbin/
chmod 755 sqlite3
adbd reboot (just in case)
Enjoy the result
For those who, like me, couldn't use Sqlite3, I used a workaround for this:
cat srcfile> / mnt / sdcard / dstfile
With this you can put the files into an external .db manager.

how to change permission of DDMS / File Explorer / sdcard?

My sdcard permission is now d---------. How to change the sdcard permission as drwxrwxrwx. I need help. Please give me any one answer. Thanks.
Go to android sdk Manager and cllck edit button on your current emulator.check whether you mention the sdcard memory
commands..
$ adb shell
$ su
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Try this and let me know what happen..
go to Android virtual Device manager->Edit->Hardware->new->sdcard support
You need be root to acheive this. If you need it in emulator grab a rooted emulator , you can find one here.Then you can use the Terminal Emulator for giving permission or if you don't want to write any command just install the rootexplorer app and use it for giving permission.

Android ADB shell commands: Mount host PC folder?

Hope this isn't too much of an amateur/moron question: I'm trying to replace most ringtones and alarms (Dell Streak 5 (2.2.2 rooted)) with a few of my own pet sounds.
For reasons I won't bother you with, I can't use an SD card, so my .ogg replacements need be transferred straight from my PC to their respective default folders under /system/media/audio/ .
ADB push and pull commands don't seem to accept widlcards (which is a pain) but anyway, despite setting the system folder to rw, I get 'permission denied' when I tediously attempt to pull or push files one by one.
But I should be able to rm and cp interactively from ADB's shell # prompt, with simple Unix commands to transfer groups of files between the /system/media/audio folders and my Windows PC. But to do this I presumably need to mount my PC source folder, and I have no idea how to do this.
I'd be grateful for any info or ideas...
You need to have root access on the phone. My advice as a programmer would be to
1) Write a program to do this...
or just do it the easy way haha. Try this (your device must be rooted):
adb shell into your device using $> adb shell
move to the local folder using $> cd /data/local
Now create a directory for your tones with $> mkdir my_tones - this shouldn't require su
Next you must push your .ogg files from your computer to the /data/local/my_tones folder
Now you can become su user with $> su
Now you should be able to copy the files from the /data/local/my_tones directory to where ever it is you would like them.
Hope this helps.

sqlite3: not found

I am trying to reach the sqlite database on my device using the procedure described here: How can i see SQLite Database (No emulator)?
However, I keep on getting sqlite3 not found.
I assume I am meant to be entering the commands with the hash (#) sign at the start of the line.
I tried with it and got nothing.
Without it I get the error message.
The sqlite3.exe file is definitely there and in the path.
Do I have to install something?
Some manufacturers deliver the devices without sqlite being installed on them. You can copy the sqlite program though from a emulator to your device if the device has an arm processor.
Start the emulator and use the adb command from the platform-tools in android-sdk
adb pull /system/xbin/sqlite3
Mount the system partition of your device read/write after this tutorial:
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
Use the adb command to copy the sqlite3 file to your device
adb push sqlite3 /system/xbin/
After you reboot your device the sqlite3 command should work.
Edit (copy from linked page - in the case link becomes invalid). The instructions for step 2 are:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
"Replace /dev/block/mtdblock3 & /system with appropriate device path and mount point, as obtained from cat /proc/mounts"
Go to Play store --> search for Titanium Backup & install it
adb shell
su
cp /data/data/com.keramidas.TitaniumBackup/files/sqlite3 /system/xbin/
cd /system/xbin/
chmod 755 sqlite3
adbd reboot (just in case)
Enjoy the result
For those who, like me, couldn't use Sqlite3, I used a workaround for this:
cat srcfile> / mnt / sdcard / dstfile
With this you can put the files into an external .db manager.

Categories

Resources