I am trying to get my android updater-script to selectively change permissions based on filename. I want all files under a certain subdirectory following the naming pattern "A.xy" set to 0755 and all other files set to 0644
So I first set all of them to 0644, then tried to selectively set the rest to 0755 by piping commands using xargs and exec. However, neither of the following commands worked but neither of them gave an error. Does anyone have a better way of doing this, or have an idea why neither of these worked?
run_program("/sbin/busybox", "find", " /data/app", "-name", "A.xy", "-type", "f", "-print0", "|", "/sbin/busybox", "xargs", "-0", "chmod", "0644");
run_program("/sbin/busybox find /data/app -name A.xy -type f -exec chmod 0644 {} \;");
It seems like update-binary doesn't allow piping? It doesn't give an error though.
Any idea how I can set all files of one type to be one permission, and all files of another type to be a different permission?
Thread closed.
Please see the continuation of this topic here: http://forum.xda-developers.com/android/help/edify-question-how-to-pipe-t3509804
Thanks!
Related
When I su in terminal it grants terminal permissions but then when i put in reboot or reboot recovery it says "not permitted"... what gives???
There is a couple of things you can try to figure out what's up:
1) After you typed in su, did your prompt change from a $ to a #?
If so, OK, and if not, su didn't root you. No need to read further without
rooting again.
2) This may only work if busybox is properly installed, but worth a shot:
Type in at #, "which reboot", to find out which possible reboot in the $PATH
order you ran, so it'll return something like /system/bin/reboot, or perhaps
/system/xbin/reboot.
3) Look at the permissions & ownership of reboot returned by which:
ls -l /system/bin/reboot (if that's the one that was executed). If it's not
something like 755 (rwxr-xr-x), then it's not clear it's set right.
Permissions are usually 3 octets like rwx rwx rwx, first owner, next group, next others. In the ls -l /system/bin/reboot in 3) you can see 'owner group' (perhaps 'root system' or something like that on yours). With that info you can figure out if permissions are right. The easiest way to make it work if you're rooted is to set permissions to 755 (anyone can execute regardless of owner) by doing this:
$ su
# chmod 755 /system/bin/reboot (or whereever your reboot is)
Good luck - Hashi
hachamacha said:
There is a couple of things you can try to figure out what's up:
1) After you typed in su, did your prompt change from a $ to a #?
If so, OK, and if not, su didn't root you. No need to read further without
rooting again.
2) This may only work if busybox is properly installed, but worth a shot:
Type in at #, "which reboot", to find out which possible reboot in the $PATH
order you ran, so it'll return something like /system/bin/reboot, or perhaps
/system/xbin/reboot.
3) Look at the permissions & ownership of reboot returned by which:
ls -l /system/bin/reboot (if that's the one that was executed). If it's not
something like 755 (rwxr-xr-x), then it's not clear it's set right.
Permissions are usually 3 octets like rwx rwx rwx, first owner, next group, next others. In the ls -l /system/bin/reboot in 3) you can see 'owner group' (perhaps 'root system' or something like that on yours). With that info you can figure out if permissions are right. The easiest way to make it work if you're rooted is to set permissions to 755 (anyone can execute regardless of owner) by doing this:
$ su
# chmod 755 /system/bin/reboot (or whereever your reboot is)
Good luck - Hashi
Click to expand...
Click to collapse
When I chmod 755, it says unable to chmod system is read only. Before the # sign there is a sh-3.2 (#) is that normal because i didnt see that on any of the videos I watched. I want to put the psfrecovery on my incredible and thats what this is all about but it wont seem to push the recovery to the phone, but it doesnt throw any errors either. ::
When I chmod 755, it says unable to chmod system is read only. Before the # sign there is a sh-3.2 (#) is that normal because i didnt see that on any of the videos I watched. I want to put the psfrecovery on my incredible and thats what this is all about but it wont seem to push the recovery to the phone, but it doesnt throw any errors either
Click to expand...
Click to collapse
Sorry: I skipped a step. You would have to remount /system as read write to do a chmod on something in /system.
The other question (sh-3.2) (#) and while I can't say it 'isn't normal' , I can tell you I've never seen it. (which doesn't mean much).
One thing I wonder about is :: "are you seeing anything or have you seen the superuser.apk app being asked to 'allow' su access the first time you use su in term?" I'm wondering if something has gone wrong with your basic superuser install.
Anyway, about as much as you can try to do with this information is to see if you can remount the /system FS read-write as follows, and then do the chmod again. Here's what I think will work on the dinc:
(from adb or term emulator):
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 755 {whatever the file was}
# ls -l {the file so you can check it's mode}
// if it's ok, then proceed, and if not, not much you can do without re-rooting
// then remount as ro so everything is flushed & flush and synced.
# mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
// then try the command again.
Click to expand...
Click to collapse
So if none of this works, or also gives permission errors, then you might , if you have Rom Manager, try a 'fix permissions'. Normally I wouldn't advise that, because I don't know who uses that or even which files it 'fixes' or if it fixes them. I just figure it's worth a shot.
Bottom line is if you don't have permissions to a lot of things and you're rooted with su and superuser.apk, then something in the install of those things has gone haywire (if you can't repair them , one way being as above).
Best of luck to you - H
hachamacha said:
Sorry: I skipped a step. You would have to remount /system as read write to do a chmod on something in /system.
The other question (sh-3.2) (#) and while I can't say it 'isn't normal' , I can tell you I've never seen it. (which doesn't mean much).
One thing I wonder about is :: "are you seeing anything or have you seen the superuser.apk app being asked to 'allow' su access the first time you use su in term?" I'm wondering if something has gone wrong with your basic superuser install.
Anyway, about as much as you can try to do with this information is to see if you can remount the /system FS read-write as follows, and then do the chmod again. Here's what I think will work on the dinc:
(from adb or term emulator):
So if none of this works, or also gives permission errors, then you might , if you have Rom Manager, try a 'fix permissions'. Normally I wouldn't advise that, because I don't know who uses that or even which files it 'fixes' or if it fixes them. I just figure it's worth a shot.
Bottom line is if you don't have permissions to a lot of things and you're rooted with su and superuser.apk, then something in the install of those things has gone haywire (if you can't repair them , one way being as above).
Best of luck to you - H
Click to expand...
Click to collapse
yeah tried it and it was a no go lol, Skyraider 3.5 is my rom so i am gonna try and switch roms thanks for trying though
Is it possible to backup the SMS app data (all texts/picture messages) on the stock rom (4.1.1 JellyBean) by just copying the data at /data/data/com.android.telephony/ ? And then to restore just copy these back after the reflash or data wipe through adb in CWM?
I'm trying to do this with as little app installs as possible, and also trying to learn where things are stored and in what format, etc.
Just in case anyone else was interested in this, you can do this. You need these files:
/data/data/com.android.providers.telephony/databases/mmssms.db and mmssms.db-journal, and then if you have any pictures in the threads you need to also copy the /data/data/com.android.providers.telephony/app_parts folder as well. Permissions for mmssms.db should be 660 with the owner and group = radio. mmssms.db-journal should have 600 permissions and same group and owner = radio.
dmarmstr said:
Just in case anyone else was interested in this, you can do this. You need these files:
/data/data/com.android.providers.telephony/databases/mmssms.db and mmssms.db-journal, and then if you have any pictures in the threads you need to also copy the /data/data/com.android.providers.telephony/app_parts folder as well. Permissions for mmssms.db should be 660 with the owner and group = radio. mmssms.db-journal should have 600 permissions and same group and owner = radio.
Click to expand...
Click to collapse
I'm pretty sure I followed these directions to a 'T', when I open messenger it's not showing any conversations. I did everything through a script and copied it out to "sdcard", then just copied everything back in when i got done flashing a new rom....pretty straight forward concept, idk....just no dice. I can even view the .db file I restored in sqlite and it looks like everything's legit. what might I be missing?
Did you set permissions and groups correctly? Can you do a screen shot of the adb output?
I have attached a screen shot of what the permissions and group/owner should look like.
Here are the steps that I needed to do to get this to work:
adb push mmssms.db /data/mytemp
adb push mmssms.db-journal /data/mytemp
adb shell
<inside shell now in CWM so you have root>
mv data/mytemp/* data/data/com.android.providers.telephony/databases
chmod 600 data/data/com.android.providers.telephony/databases/mmssms.db-journal
chmod 660 data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
chown radio data/data/com.android.providers.telephony/databases/mmssms.db
chown radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
rm -rf data/mytemp
Also, if you do have app_parts to move, you need to do the same, but the chmod should do this:
chmod 666 data/data/com.android.providers.telephony/app_parts/*
chgrp radio data/data/com.android.providers.telephony/app_parts/*
chown radio data/data/com.android.providers.telephony/app_parts/*
Help
dmarmstr said:
Did you set permissions and groups correctly? Can you do a screen shot of the adb output?
I have attached a screen shot of what the permissions and group/owner should look like.
Here are the steps that I needed to do to get this to work:
adb push mmssms.db /data/mytemp
adb push mmssms.db-journal /data/mytemp
adb shell
<inside shell now in CWM so you have root>
mv data/mytemp/* data/data/com.android.providers.telephony/databases
chmod 600 data/data/com.android.providers.telephony/databases/mmssms.db-journal
chmod 660 data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db
chgrp radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
chown radio data/data/com.android.providers.telephony/databases/mmssms.db
chown radio data/data/com.android.providers.telephony/databases/mmssms.db-journal
rm -rf data/mytemp
Also, if you do have app_parts to move, you need to do the same, but the chmod should do this:
chmod 666 data/data/com.android.providers.telephony/app_parts/*
chgrp radio data/data/com.android.providers.telephony/app_parts/*
chown radio data/data/com.android.providers.telephony/app_parts/*
Click to expand...
Click to collapse
When i do these steps the message app just tells me that it stopped working and needs to quit. Any thoughts?
Hi, I have a quick question. I got this file or whatever as a group thing from a friend. Looks wierd to me since there are regular apps or regular group text msgs that can send pictures to a group of friends. I was told it was just to let me see the pics of him fishing with his buddies and all that other file stuff looks...well fishy to me lol. Is he trying to track me or something?
Can anybody tell me how I can do a chmod on multiple files of the same type? For example, I had this line in my updater-script:
run_program("/sbin/busybox", "chmod", "0660", "/data/data/*/*.xml");
This script will execute just fine, but the files did not have 0660 permissions. Then I tried:
run_program("/system/xbin/busybox", "chmod", "0660", "/data/data/*/*.xml");
I copied recovery.log to /sdcard/(using recovery's report error) and I read the log. I searched for the line(s) related to that problematic line in the updater-script and this is what it says:
run_program: child exited with status 1
about to run program [sbin/busybox] with 4 args
chmod: /data/data/*/*.xml: No such file or directory
Both scripts(before and after I edited it) gave similar errors.
Can anybody tell me what I did wrong/ what is the correct way to do it? Thanks a lot. I hope I don't have to chmod all the files manually.
The T-Mobile One M8 has CarrierIQ.
To remove it you need to be S-off or have a writable booted system. If you haven't made your system writable you can use TWRP's file manager to delete the files.
This also removes HTC logging apps too.
Use a file Manager like Solid Explorer or Root Explorer and go to and delete the following (Make a backup of all if you want to OTA later):
/system/app
QXDM2SD.apk
QXDM2SD.odex
HtcResetNotify.apk
HtcResetNotify.odex
Htcloglevel.apk
Htcloglevel.odex
Smith.apk
Smith.odex
Udove.apk
Udove.odex
/system/priv-app
IQ-tmobile-release-signed.apk
IQ-tmobile-release-signed.odex
IQToggle.signed.apk
IQToggle.signed.odex
MyBreeze.apk
MyBreeze.odex
/system/lib
system/lib/libiq_service_tmobile_2.2.so
/data/data
com.carrieriq.tmobile
com.carrieriq.tmobile.IQToggle
You can use an app like https://play.google.com/store/apps/details?id=com.lookout.carrieriqdetector to check if CarrierIQ is gone (You can use it to check that it's there also).
Viper ROM has it removed
Sent from my HTC One_M8 using Tapatalk
Not everybody wants to flash a custom ROM.
Sent from my HTC One_M8 using Tapatalk
Thank you for posting this, I never knew about carrier iq until now.
Sent from my HTC One_M8 using Tapatalk
What's it for?
Nexus 7
fmedrano1977 said:
What's it for?
Nexus 7
Click to expand...
Click to collapse
http://en.wikipedia.org/wiki/CarrierIQ
Thank You!
SmiLey497 said:
The T-Mobile One M8 has CarrierIQ.
To remove it you need to be S-off or have a writable booted system. If you don't I think you can use TWRP's file manager to delete it.
Use a file Manager like Solid Explorer or Root Explorer and go to and delete the following:
/system/app
QXDM2SD.apk
QXDM2SD.odex
HtcResetNotify.apk
HtcResetNotify.odex
Htcloglevel.apk
Htcloglevel.odex
Smith.apk
Smith.odex
/system/priv-app
IQ-tmobile-release-signed.apk
IQ-tmobile-release-signed.odex
IQToggle.signed.apk
IQToggle.signed.odex
/system/lib
system/lib/libiq_service_tmobile_2.2.so
/data/data
com.carrieriq.tmobile
com.carrieriq.tmobile.IQToggle
You can use an app like https://play.google.com/store/apps/details?id=com.lookout.carrieriqdetector to check if it's gone (You can use it to check that it's there also).
Click to expand...
Click to collapse
Thank you! I was having trouble finding the iq it is much different from the lg g2 as I used system tuner to disable carrier iq and was having trouble doing the same on the m8! thanks again!
Technowhiteboi said:
Thank you! I was having trouble finding the iq it is much different from the lg g2 as I used system tuner to disable carrier iq and was having trouble doing the same on the m8! thanks again!
Click to expand...
Click to collapse
NP
Will this work if I don't remove the .odex files? I don't see the .odex files using solid explorer or fx file explorer root.
Love u smiley.U had a great contribution for the g2 now this.
---------- Post added at 03:34 PM ---------- Previous post was at 03:21 PM ----------
How do u like it m8 from the g2
erapmicks said:
Love u smiley.U had a great contribution for the g2 now this.
---------- Post added at 03:34 PM ---------- Previous post was at 03:21 PM ----------
How do u like it m8 from the g2
Click to expand...
Click to collapse
Been pretty good so far.
Thank you! I didn't have the ODEX files, but following your guide removed carrierIQ from my M8.
Worked for me
SmiLey497 said:
The T-Mobile One M8 has CarrierIQ.
To remove it you need to be S-off or have a writable booted system. If you haven't made your system writable you can use TWRP's file manager to delete the files...
Click to expand...
Click to collapse
Thanks for this guide. I was able to use it to remove CarrierIQ from the 4.4.3 T-Mobile version (used the RUU to get a fresh, stock setup first).
At first I tried just renaming the files (adding a "z" to the front of every name), but the phone still loaded some of the services even though the name was different. I ended up doing a chmod 0000 to all the files to stop them from loading.
I did everything from the TWRP file manager because I wanted to make sure I could reverse all my actions in case it failed to boot up.
Good stuff. Thanks OP!
I found I had to restore the CarrierIQ files in order to take an OTA update. To make it easier, I threw these together in order to enable and disable CarrierIQ easily...
It needs to run as root in a shell on the phone. The mount command makes the system partition writable. You should reboot after this for the changes to take effect (and for the system partition to go back to read only).
I take no responsibility. If you don't know what you are doing, don't use these.
Code:
# Disable CarrierIQ
mount -o rw,remount -t ext4 /dev/block/mmcblk0p45 /system
chmod 000 /system/app/HtcLogLevel.apk
chmod 000 /system/app/HtcLogLevel.odex
chmod 000 /system/app/HtcResetNotify.apk
chmod 000 /system/app/HtcResetNotify.odex
chmod 000 /system/app/QXDM2SD.apk
chmod 000 /system/app/QXDM2SD.odex
chmod 000 /system/app/Smith.apk
chmod 000 /system/app/Smith.odex
chmod 000 /system/app/UDove.apk
chmod 000 /system/app/UDove.odex
chmod 000 /system/priv-app/IQ-tmobile-release-unsigned.signed.apk
chmod 000 /system/priv-app/IQ-tmobile-release-unsigned.signed.odex
chmod 000 /system/priv-app/IQToggle_v1.1.3.signed.apk
chmod 000 /system/priv-app/IQToggle_v1.1.3.signed.odex
chmod 000 /system/priv-app/MyBreeze.apk
chmod 000 /system/priv-app/MyBreeze.odex
chmod 000 /system/lib/libiq_service_tmobile_2.2.so
chmod 000 /data/data/com.carrieriq.tmobile
chmod 000 /data/data/com.carrieriq.tmobile.IQToggle
Code:
# Enable CarrierIQ
mount -o rw,remount -t ext4 /dev/block/mmcblk0p45 /system
chmod 644 /system/app/HtcLogLevel.apk
chmod 644 /system/app/HtcLogLevel.odex
chmod 644 /system/app/HtcResetNotify.apk
chmod 644 /system/app/HtcResetNotify.odex
chmod 644 /system/app/QXDM2SD.apk
chmod 644 /system/app/QXDM2SD.odex
chmod 644 /system/app/Smith.apk
chmod 644 /system/app/Smith.odex
chmod 644 /system/app/UDove.apk
chmod 644 /system/app/UDove.odex
chmod 644 /system/priv-app/IQ-tmobile-release-unsigned.signed.apk
chmod 644 /system/priv-app/IQ-tmobile-release-unsigned.signed.odex
chmod 644 /system/priv-app/IQToggle_v1.1.3.signed.apk
chmod 644 /system/priv-app/IQToggle_v1.1.3.signed.odex
chmod 644 /system/priv-app/MyBreeze.apk
chmod 644 /system/priv-app/MyBreeze.odex
chmod 644 /system/lib/libiq_service_tmobile_2.2.so
chmod 644 /data/data/com.carrieriq.tmobile
chmod 644 /data/data/com.carrieriq.tmobile.IQToggle
So if I had busybox installed, I could run these as shell scripts from a root terminal on the phone? [Obviously I would chmod 744 or 755 them first.]
syntropic said:
So if I had busybox installed, I could run these as shell scripts from a root terminal on the phone? [Obviously I would chmod 744 or 755 them first.]
Click to expand...
Click to collapse
I believe that is correct. I'm pretty sure you will need to be S-off in order to write to the system partition.
I use ADB with a root prompt, so you will need to do a su command at the start if you are using this in a terminal.
FreydNot said:
I believe that is correct. I'm pretty sure you will need to be S-off in order to write to the system partition.
I use ADB with a root prompt, so you will need to do a su command at the start if you are using this in a terminal.
Click to expand...
Click to collapse
I would probably opt for using ADB as well, but it would be nice to set up two shortcuts on the desktop that execute these scripts. Something that would su - && run the script, and then back again.
But thanks a lot for sharing them!
anyone know where I can get these files back so I can apply the OTA updates? thanx
Hey... Strangely, I was about to run a bash script with all the chmod commands above. However, I decided to download a few Play store apps that detect it. Each app said I did not have it installed.
I checked the files in the list above and confirmed they were there. Anyone have any idea why CarrierIQ is not present?
About the only thing I have done outside of this which may affect it is that I had disabled the my-t-mobile app since it has that option to monitor your "experience". Since I wanted to avoid this, I just disabled the app.
Could this app be tied to CarrierIQ's functionality??
And then I found this:
http://support.t-mobile.com/docs/DOC-10849
Which seems to confirm my theory above. Of course, as cool as T-Mobile can be, I don't necessarily trust them.
But still, has anyone used an app that has alerted them to the presence of Carrier IQ, while also opting out of allowing T-Mobile to collect diagnostics (which is in the My T-Mobile or My Account app)?
Please let me know.
I am trying to get my android updater-script to selectively change permissions based on filename. I want all files under a certain subdirectory following the naming pattern "A.xy" set to 0755 and all other files set to 0644
So I first set all of them to 0644, then tried to selectively set the rest to 0755 by piping commands using xargs and exec. However, neither of the following commands worked but neither of them gave an error. Does anyone have a better way of doing this, or have an idea why neither of these worked?
run_program("/sbin/busybox", "find", " /data/app", "-name", "A.xy", "-type", "f", "-print0", "|", "/sbin/busybox", "xargs", "-0", "chmod", "0644");
run_program("/sbin/busybox find /data/app -name A.xy -type f -exec chmod 0644 {} \;");
It seems like update-binary doesn't allow piping? It doesn't give an error though.
Any idea how I can set all files of one type to be one permission, and all files of another type to be a different permission?
ok firstly this is wrong section to ask your questions.
head over this section
http://forum.xda-developers.com/oneplus-3/help
Thread closed.
Please see the continuation of this topic here: http://forum.xda-developers.com/android/help/edify-question-how-to-pipe-t3509804
Thanks!