[Q] chmod & chown automatic script code - Java for Android App Development

Hi,
I have rooted my android device using a kernel, but notice the permissions and ownership are not correctly ok. I know using Root explorer tool i could fix them manually or by recovery fix permissions, but i need an automatic script for just few path (see below).
I want to CHMOD 777 and change ownership to root for all the following path upto the database:
/data/data/com.facebook.katana/databases/fb.db
/data/data/com.whatsapp/databases/msgstore.db
So, all the route (except data/data which are system directories), are now chmod 777 and the ownership is ROOT.
any ideas how to do this automatically for the path i want? instead of doing it manually using a file explorer tool?
Any help is appreciate.
Thanks.

What is about that?
Code:
cd <the directory>
find . -exec <the command > \;
---------- Post added at 07:34 PM ---------- Previous post was at 07:31 PM ----------
This will change ALL files in that directory.

Related

[Q] Original Contents of system/xbin?

So I rooted my vibrant and extracted busybox to the xbin folder so I could leave it out of commands, but now I can't remember what was in xbin originally. I need to know because I am writing myself an unrooter script. Now I seem to recall that it was empty, but I am not sure enough to go ahead and blithely rm -r * the contents of xbin.
went to terminal and typed:
$su
#ls system/xbin
ipctool
busybox
su
#
next time post questions in general

nv_data.bin Permission [TUTORIAL] needed

After so many tutorials on Forum for nv_data.bin permission denied, none of them worked for me. Is there any 100% working tutorial.
regards
karabey said:
After so many tutorials on Forum for nv_data.bin permission denied, none of them worked for me. Is there any 100% working tutorial.
regards
Click to expand...
Click to collapse
There's an app called mount system on the market. Install it & ask it mount always as r/w access at boot.
PS : You need to have root access.
Thanks but not worked.. Cant still read the nv_data.bin
Ok have saved now the bml3.bak but there is no Code saved if i try to extract by sgux2.exe
HEX
53534E56A6A7FA1A0709542A1E85E257F98A6F14E2E19CA932EBEC93945930F6D0D9713DF61AB70CA4D57F7F9BCEDD924B888C6AAE9074B9D49D8FEEC8C021A97D4882BEFF922E8B004646464646464646000000000000000000000000000000000000000000000000323332303523
323332303523 = 23205
Any help?
My friend who use the Phone could read the Codes and made an Froyo Update. But after the Update Code were not able to enter. It gave the Error that is wrong.
ProductCode: GT-i9000HKDONE
You can get permission by adb shell or terminal emulator by typing:
su
busybox chown 1001:1001 /efs/nv_data.bin
(reboot)
I tried your method, but I still get permission denied. Here is what I did and the list of the file under /efs:
C:\SDK\tools>adb shell
$ su
su
# busybox chown 1001:1001 /efs/nv_data.bin
busybox chown 1001:1001 /efs/nv_data.bin
# reboot
reboot
C:\SDK\tools>adb shell
$ su
su
# ls -l /efs
ls -l /efs
-rwx------ radio radio 2097152 2010-10-30 04:57 nv_data.bin
drwxrwxrwx radio radio 2010-07-17 09:31 imei
-rwx------ radio radio 32 2010-10-30 04:57 nv_data.bin.md5
#
iScream^ said:
You can get permission by adb shell or terminal emulator by typing:
su
busybox chown 1001:1001 /efs/nv_data.bin
(reboot)
Click to expand...
Click to collapse
lan_baba said:
I tried your method, but I still get permission denied. Here is what I did and the list of the file under /efs:
C:\SDK\tools>adb shell
$ su
su
# busybox chown 1001:1001 /efs/nv_data.bin
busybox chown 1001:1001 /efs/nv_data.bin
# reboot
reboot
C:\SDK\tools>adb shell
$ su
su
# ls -l /efs
ls -l /efs
-rwx------ radio radio 2097152 2010-10-30 04:57 nv_data.bin
drwxrwxrwx radio radio 2010-07-17 09:31 imei
-rwx------ radio radio 32 2010-10-30 04:57 nv_data.bin.md5
#
Click to expand...
Click to collapse
not workinggg.......
Why do you want to read the file?
Have you lost your imei? If so, was the phone sold to you?
Don't bother with the codes. Use the hex edit method to change the lock status to 0:
http://forum.xda-developers.com/showthread.php?t=761045
p.s. you should delete the file you posted... that's some bad security there.

ROM Cooking Permissions Help needed

I am having issues with file permission on su when either I cook a clockwork mod or DFT NAND Rom.
I have verified that su has the following permissions inside the .zip or .img file:
Code:
-rwxr-xr-x
Once flashed to phone when I check the permissions they have been changed to:
Code:
-rwsr-sr-x
SuperUser will crash until I issue the following commands via adb:
Code:
adb shell chmod 4755 /system/bin/su
adb shell chmod 4755 /system/xbin/su
adb reboot
After reboot the permissions are correct wtih:
Code:
-rwxr-xr-x
Anyone have any thoughts or know why this is happening? I am using Ubuntu v10 with the root account.
Thanks
-CMYLXGO

[Q] Running shell scripts on Defy+

I'm trying to automate some things I do after upgrading nightlies using a shell script. The system seems to execute the shell script (shows messages informing granting of root privileges and successful completion of the script), but the script does not seem to run, ie the changes do not occur. Here's the script if it's of any help :
Code:
#!/system/bin/mksh
# Gain root access
su -
# Replace baseband
rm /system/etc/motorola/bp_nvm_default/*
cp /mnt/sdcard/Download/bp_nvm_default/* /system/etc/motorola/bp_nvm_default/
chown root:root /system/etc/motorola/bp_nvm_default/*
chmod 644 /system/etc/motorola/bp_nvm_default/*
# Make Apex Launcher system app
cp /mnt/sdcard/Download/ApexLauncher.apk /system/app/
chown root:root /system/app/ApexLauncher.apk
chmod 644 /system/app/ApexLauncher.apk
# Move Marimba ringtone to phone
cp /mnt/sdcard/Download/Marimba.ogg /system/media/audio/ringtones/
chown root:root /system/media/audio/ringtones/Marimba.ogg
chmod 644 /system/media/audio/ringtones/Marimba.ogg
I'm amazed there are no replies to this thread.
No one ever tried running a shell script on their rooted phone?
S_xda said:
I'm amazed there are no replies to this thread.
No one ever tried running a shell script on their rooted phone?
Click to expand...
Click to collapse
What did you tried to run the script??, use the terminal or the SManager.
SManager works fine to me
Questions go in the Q&A section

Trouble with activation of voice service after root

Ok, I'm about at my wit's end on this. I'm trying to get Marshmallow with root access activated. I flash the firmware, activate it, verify everything works (i.e. voice calls), root it, then I'm unable to get voice calling back. LTE usually goes as well, but that's easy enough to fix. I've tried "Activate Phone" under Settings, and ##72786# with the dialer over 10 times on many installs without success. Doing a /data reset after root results in the initial setup going through, but no voice service. Importing build.prop from before rooting generally restores LTE but not voice.
Here's my general method:
Use Odin to flash a firmware, having tried with every firmware below. Some are rejected by the bootloader, I suppose attempting Nouget was ill-advised in retrospect, but most work fine:
Code:
07/09/2017 02:35 AM 2,339,073,264 G935PVPS4APK1_SPT4APK1_SPR_Sprint_USA_6.0
.1.zip
07/08/2017 05:23 PM 2,338,378,352 G935PVPU2APH7_G935PSPT2APH7_SPR.zip
07/08/2017 05:44 PM 2,415,317,465 G935PVPU4APL6_G935PSPT4APL6_SPR.zip
07/04/2017 06:02 AM 2,346,196,486 G935UUEU4API3_G935UOYM4API3_TMK.zip
06/29/2017 07:09 PM 2,393,582,382 SPR-G935UUES4AQC1-20170313090738.zip
07/04/2017 09:56 PM 2,333,204,698 SPR-G935UUEU2APEH-20160518091232.zip
07/05/2017 07:12 AM 2,332,915,504 SPR-G935UUEU2APG9-20160823142730.zip
07/05/2017 12:52 PM 2,346,196,486 SPR-G935UUEU4API3-20160909113048.zip
This activates on its own without any trouble. Sometimes I update the Profile/PRL, sometimes not.
Then I install Package Disabler and disable at minimum securitylogagent, but generally anything mentioned by any root guide and anything that looks squirrely to me.
Use Odin to flash g935a.tar
Use root.bat (I've modified it slightly over the various attempts. Mostly because someone put a reboot command in the middle of the script which introduced a race condition to finish the script before the system halted, with unpredictable results.)
Code:
adb wait-for-device
adb shell mount -o rw,remount /system
adb shell mount -o rw,remount rootfs /
adb push SuperSU-v2.74-2.img /data/su.img
adb push launch_daemonsu.sh /system/etc/launch_daemonsu.sh
adb install -r SuperSU-v2.74-2.apk
adb shell pm hide com.LocalFota
adb shell pm hide com.samsung.android.intelligenceservice
adb shell pm hide com.samsung.android.securitylogagent
adb shell pm hide com.samsung.sdm
adb shell pm hide com.samsung.syncservice
adb shell pm hide com.sec.android.diagmonagent
adb shell pm hide com.sec.android.fotaclient
adb shell pm hide com.sec.android.fwupgrade
adb shell pm hide com.sec.fwservice
adb shell pm hide com.ws.dm
adb shell pm hide com.wssyncmldm
adb shell < supersu.cmds
Code:
touch /system/xbin/su
chmod 0755 /system/xbin/su
chcon u:object_r:system_file:s0 /system/xbin/su
chmod 0700 /system/etc/launch_daemonsu.sh
chcon u:object_r:su_exec:s0 /system/etc/launch_daemonsu.sh
if [ `cat /system/etc/init.sec.boot.sh | grep daemonsu >/dev/null 2>&1; echo $?` -ne 0 ]; then
echo '/system/etc/launch_daemonsu.sh' >> /system/etc/init.sec.boot.sh
fi
sync
reboot
Then root works, I switch the CPU governor and modify the three lines of build.prop (or reinstate the pre-root version), and disable securestorage in build.prop as well (wifi password persistence fix). Maybe install xposed if I feel like wasting my time, although it does work perfectly. Upon a reboot LTE generally works, if not I update the APN settings on the older firmwares. Then I try activation, which fixes it if APN settings are disabled. But no voice. After a few attempts I'll reenable everything and try again (+/- a reboot), but it doesn't make a difference.
Any ideas? I seem to be having an unusual amount of trouble with this and I'm not sure why...
Having this exact problem. Dont know what to do
Edit:
Got myself back to stock with help from this thread
https://forum.xda-developers.com/showpost.php?p=76029292&postcount=12
look for the binary 5 google docs links in there if you just want to get back to stock and get text and voice working again

Categories

Resources