root: chmod 4777 or 4755? - Motorola Droid 3

just wondering which i should do because ive seen both, or if it didnt really matter which. thanks for the help, and a big thanks to everyone that was involved in this achievement!
EDIT: now ive seen 6755 too... whats the permission differences between all of these?
EDIT 2: i did 4755 ill do some more research and change it if i find a reason to, or someone tells me why i need to before hand

if it matters, i used 4755 and its giving me the correct permissions

It "Should" not matter ether way as long as you have the suid bit set along with read rights for owner. The file system will be read-only so what you really need is the ability for the file to run and to run at root privileges.
Looking at other files in the /system/bin directory they are mostly set to 755. So I would go with 4755.

Related

Got a problem here.

My app-private dir (running Apps2SD) became corrupt, a repair ext operation has removed the directory. Now, I can re-create it, but I don't know the proper permissions to CHMOD it, so that it is properly set up.
This also meant I lost my protected apps, which really sucks, but I have backups I can reinstall from.
Who knows what permissions I need to pass to it? I am in recovery mode right now with adb shell.
Thanks
EDIT - got it (hopefully).
chown 1000:1000 app-private
chmod 0771 app-private
seems to have the permissions set right, now to boot up and see if it works right.

UNIX Script Help

Who knows if this is the right sections but, I need some quick help on a shell script to run on my phone. Two questions:
How do I change the following script to search recursively through folders for *.lm and chmod them?
Code:
#!/sbin/sh
for file in /data/app/*.lm ; do
chmod 0644 $file
done
I can't find a switch to search recursively... did I look hard enough?
Second, is there any way that I could find all files in a specified directory (e.g. /test/*.jpg) that were created in timeframe relative to now (e.g. in the last 10 mins)? I want to chmod those too so would need to be able to pass $file.
Now I know the first one's easy so am crossing fingers for a quick reply, thanks in anticipation.
You're trying to make that way harder than necessary.
chmod 0644 /data/app/*.lm
GldRush98 said:
You're trying to make that way harder than necessary.
chmod 0644 /data/app/*.lm
Click to expand...
Click to collapse
I did a poor job of shortening my example above really, it looks stupid upon reflection (I didn't notice that when I first posted it ) chmod is originally part of a larger process that I run on each file in a directory (and want to include subs), I need/want to complete one before I start the next.
The recursive thing is hurting me at the moment though.
Try this, and if the output looks right, change "echo" to "chmod 0644"
Code:
for file in $(find /data/app -iname *.lm); do echo $file; done
fubaya said:
Try this, and if the output looks right, change "echo" to "chmod 0644"
Code:
for file in $(find /data/app -iname *.lm); do echo $file; done
Click to expand...
Click to collapse
Nice, thank you I was not seeing the wood for the trees. I appreciate the fresh perspective.
Well it's not perfect. I tinkered around with it and it doesn't seem to work if you are in the /system/app directory. In fact, "find *.apk" (I used apk since I don't have any lm files) is the only thing that seems to work, and I don't know if it's recursive without testing more. It also doesn't work if you're in the /sdcard or /etc directories and probably others but I gave up testing after those two. Very annoying. I hate busybox and wish someone would port the real gnu tools to Android so we didn't have to use it.
EDIT: To be clear, while it doesn't work as it should, it works perfectly if you "cd /" then do the commands.
Anyway, "find --help" should help with the second part of your question. It looks like "find -mmin 10" may be what you want.
fubaya said:
Well it's not perfect. I tinkered around with it and it doesn't seem to work if you are in the /system/app directory. In fact, "find *.apk" (I used apk since I don't have any lm files) is the only thing that seems to work, and I don't know if it's recursive without testing more. It also doesn't work if you're in the /sdcard or /etc directories and probably others but I gave up testing after those two. Very annoying. I hate busybox and wish someone would port the real gnu tools to Android so we didn't have to use it.
EDIT: To be clear, while it doesn't work as it should, it works perfectly if you "cd /" then do the commands.
Anyway, "find --help" should help with the second part of your question. It looks like "find -mmin 10" may be what you want.
Click to expand...
Click to collapse
Thanks man. I have to agree that whilst busybox is great (and necessary) it seems to have some quirks. I even got the dir wrong in my example, there should only ever be apk's in /data/app - I am searching /data/data/.
I thought I encountered the same as you above last night but I was tired and just stopped... I ran it against /system/ on a fully booted phone and it didn't seem to produce the result I expect but in recovery it did... ? (I changed the sh location as required).
Either way, you've been a great help to move me forward, thanks!

Help with update-script

Hello,
I need help setting up permissions for a certain program so I can have it installed from my custom rom and work correctly. The line I have is: set_perm_recursive 0 0 0755 0755 DATA:data/com.swype.android.inputmethod, but I am having trouble figuring out what numbers to put for the permissions. I would appreciate any help or direction to an answer as all of my searching and trials have ended in a failure.
Thanks,
Rsotbiemrptson
Know UNIX?
http://forum.xda-developers.com/showthread.php?t=524268
Look for chmod and chown documentation on the web, really easy to find and see, what the numbers mean.
And here's a suggestion for better Google usage: write "set_perm_recursive parameters" and look at the 3rd result. You won't even have to click on the link.
I don't know how I missed that, just one of those days. I don't know UNIX but I am slowly learning.
Thanks,
Rsotbiemrptson

Can't run a script

hello I'm trying to run a script but I can't it gives me the errors in screenshot. I run it as root. I'm s-off.
here's the script. (note that I can do this manually with a file explorer)
chmod 777 /sys
chmod 660 /sys/android_camera_awb_cal/awb_cal
cp /sdcard/htcm8awb/awb_cal /sys/android_camera_awb_cal/awb_cal
MaRcIuPT said:
hello I'm trying to run a script but I can't it gives me the erros in screenshot. I run it as root. I'm s-off.
here's the script. (note that I can do this manually with a file explorer)
chmod 777 /sys
chmod 660 /sys/android_camera_awb_cal/awb_cal
cp /sdcard/htcm8awb/awb_cal /sys/android_camera_awb_cal/awb_cal
Click to expand...
Click to collapse
Need some more information, please. First off, do you have an HTC One m7 (Sprint) or an HTC One M8? From your script, it looks like it is made for the M8. This is the thread for the m7 Sprint variant.
MarkBell said:
Need some more information, please. First off, do you have an HTC One m7 (Sprint) or an HTC One M8? From your script, it looks like it is made for the M8. This is the thread for the m7 Sprint variant.
Click to expand...
Click to collapse
I have the m7 international (I believe this section is for m7 any version), I'm only replacing a file with the script.
MaRcIuPT said:
I have the m7 international (I believe this section is for m7 any version), I'm only replacing a file with the script.
Click to expand...
Click to collapse
Did you ever have any luck? Can you try asking the question to the person who wrote the script?
It's quite possible the script is for the m8 since the script names an m8 folder, but I'm not an expert on scripts by any means. @clsA: Do you know what may be going on here?
Do those directories referred to in your screenshot actually exist on your phone?
Also: I was wrong about this being Sprint variant exclusive. My bad on that.
MaRcIuPT said:
hello I'm trying to run a script but I can't it gives me the errors in screenshot. I run it as root. I'm s-off.
here's the script. (note that I can do this manually with a file explorer)
chmod 777 /sys
chmod 660 /sys/android_camera_awb_cal/awb_cal
cp /sdcard/htcm8awb/awb_cal /sys/android_camera_awb_cal/awb_cal
Click to expand...
Click to collapse
Try using SManager to run the script. It might help.
MarkBell said:
Did you ever have any luck? Can you try asking the question to the person who wrote the script?
It's quite possible the script is for the m8 since the script names an m8 folder, but I'm not an expert on scripts by any means. @clsA: Do you know what may be going on here?
Do those directories referred to in your screenshot actually exist on your phone?
Also: I was wrong about this being Sprint variant exclusive. My bad on that.
Click to expand...
Click to collapse
I can rename the folder.... it's simply a folder. the scrip is made for m7. not m8. It does work for some in init.d and some don't.. like me. and I tried to run the script to see why and this is what happens. the folders are there because as I said I can do that step by step in ES explorer, change permissions then replace the file I want.
Atishay Jain said:
Try using SManager to run the script. It might help.
Click to expand...
Click to collapse
with Smanager I get the message is attached. :\
I tried to run a cp command in a terminal (root) and it says the same thing " I/O error" the other steps in script I did successfully in a terminal.
Tried too with 'busybox cp' command and I get " cp: can't create '/sys/android_camera_awb_cal/awb_cal': File exists " so I know the file exists that's why I wan't to replace it xD my head hurts. Searched a lot why I can't copy and no success.
MaRcIuPT said:
I can rename the folder.... it's simply a folder. the scrip is made for m7. not m8. It does work for some in init.d and some don't.. like me. and I tried to run the script to see why and this is what happens. the folders are there because as I said I can do that step by step in ES explorer, change permissions then replace the file I want.
with Smanager I get the message is attached. :\
I tried to run a cp command in a terminal (root) and it says the same thing " I/O error" the other steps in script I did successfully in a terminal.
Tried too with 'busybox cp' command and I get " cp: can't create '/sys/android_camera_awb_cal/awb_cal': File exists " so I know the file exists that's why I wan't to replace it xD my head hurts. Searched a lot why I can't copy and no success.
Click to expand...
Click to collapse
I am not able to get the exact reason for the problem but most such things get solved on updating busybox. Try doing that. Use the tool by jrummy from the market or download the busybox wraithdu installer script from the v6 supercharger thread by zeppelinrox.
MaRcIuPT said:
hello I'm trying to run a script but I can't it gives me the errors in screenshot. I run it as root. I'm s-off.
here's the script. (note that I can do this manually with a file explorer)
chmod 777 /sys
chmod 660 /sys/android_camera_awb_cal/awb_cal
cp /sdcard/htcm8awb/awb_cal /sys/android_camera_awb_cal/awb_cal
Click to expand...
Click to collapse
i would guess you're using Windows Notepad (or similar) to edit/create that script?
you need to use UNIX style EOL delimiters for those commands to work.
EDIT: i've attached an example, the same script (just lists directory contents), looks the same in the Script Runner, once saved with Windows EOL delimiters, gives the first output,
same script with UNIX EOL, gives the second output.
nkk71 said:
i would guess you're using Windows Notepad (or similar) to edit/create that script?
you need to use UNIX style EOL delimiters for those commands to work.
EDIT: i've attached an example, the same script (just lists directory contents), looks the same in the Script Runner, once saved with Windows EOL delimiters, gives the first output,
same script with UNIX EOL, gives the second output.
Click to expand...
Click to collapse
Yes I used the notepad to edit the original. now with your help I did understand and used the notepad++, converted to UNIX EOL and saved as script (sh). No errors now on missing directories but I can't copy/replace the file even with cp -f to force it. I can't understand which command ES explorer uses when I manually copy the file, because it replaces the file successfully.
MaRcIuPT said:
Yes I used the notepad to edit the original. now with your help I did understand and used the notepad++, converted to UNIX EOL and saved as script (sh). No errors now on missing directories but I can't copy/replace the file even with cp -f to force it. I can't understand which command ES explorer uses when I manually copy the file, because it replaces the file successfully.
Click to expand...
Click to collapse
Not sure, but
Are you running the script as root?
And maybe you need file permission to be 666 instead of 660.
Sent from my HTC One using Tapatalk
nkk71 said:
Not sure, but
Are you running the script as root?
And maybe you need file permission to be 666 instead of 660.
Sent from my HTC One using Tapatalk
Click to expand...
Click to collapse
Yeah Always run on root. Tried 666 and 777. Tried with cp, cat, rm first then CP. No success.
Sent from my HTC One using XDA Free mobile app

SuperSU /su/su.d

Hey all,
I have rooted my Nvidia Shield TV, and now i am trying to do some "startup" scripts. Since it does not have init.d i was glad when i saw this directory and read the documentation... however my simple script does not seem to work, or maybe i am getting it wrong...
The directory and the file named 00mytest are both chmod 700
Code:
#!/su/bin/sush
(
echo "test" >> /data/test.txt
)&
but the file does not get created i thought maybe remounting or something but choosing /mnt/sdcard/Download does not work as well
Any help would be appreciated.

Categories

Resources