Related
Hi all, I am trying to use the Scripting Layer for Android to make a simple shell script to disable the stagefright player (the thing that causes the bad sound quality in Froyo) I made some progress, but it doesn't seem to work right. Can someone with knowledge of scripts help me? Here's what I have so far:
echo "Disable Stagefright"
su
setprop media.stagefright.enable-player false
exit
echo "Disabled"
The problem is that it never displays Disabled. It just returns to the terminal and gives # for the root prompt. Anyone know how I can get this to run properly or a better scripting language that I could use and help porting this to that language?
I'm just guessing here, but shouldn't "exit" go after "Disabled"? Otherwise the script terminates before the echo line.
Well you'd think so, but even if I do that, the script actually doesn't exit. That's the main problem, and it still won't echo that last line. Its like I can't exit su and the setprop command never goes through. Its a little annoying, because as far as I can tell, I wrote it the way it should go in the terminal app. Thanks for the input, but unfortunately, it doesn't do anything.
So it seems after typing exit in manually will terminate the script. Also, if I don't specify su, the script runs, but from what I can tell it doesn't actually do the setprop. And there's no echo's in the terminal. It runs and says would you like to exit? If I say no, there is absolutely no messages in the terminal.
su opens a new shell. so your script doesnt finish because it spawned a child process (the new shell) and is waiting for that command to finish before the next ones are run.
what you need to do is SUID that script, remove the su and exit, and run it.
SUID allows any program to be run with SuperUser permissions (read:root).
look up how to set a programs SUID bit, you'll need busybox, more specifically, chmod.
its along the lines of "chmod +s script.sh" but id double check to make sure.
Thanks! I don't understand all of that (really I'm pretty new to scripts), but I'll look into it. Hopefully I can get this figured out. I want to make two scripts to make it easy for people with rooted 2.2 to turn on and off the audio fix with one click. I'll post back if I make any progress.
edit: I just realized how easy what you said is. At least, I think its easy. The only thing I'm not sure of is where the scripts are saved to.
nenn said:
su opens a new shell. so your script doesnt finish because it spawned a child process (the new shell) and is waiting for that command to finish before the next ones are run.
Click to expand...
Click to collapse
Oh yeah, duh.
you can put the script anywhere as long as that directory is in your $PATH or, to make things simpler you can just put it in a directory already in the $PATH variable.
to check where you can put your scripts run this little line of code.
echo $PATH
Click to expand...
Click to collapse
you can add to the $PATH, but im not sure how to do that on the phone, only from a linux standpoint.
What you need to do is easy assuming that middle line "setprop media.stagefright.enable-player false" is the correct command. the script would look like this
setprop media.stagefright.enable-player false
echo "Disabled Stagefright"
Click to expand...
Click to collapse
However this does no sort of checking to see if its already disabled, if it is does it cause a problem to disable it again. doesnt let you enable it, you probably would want this. also doesnt check if the software is installed.
take the quoted text, throw it in a file and set the SUID bit and youre off.
nenn said:
you can put the script anywhere as long as that directory is in your $PATH or, to make things simpler you can just put it in a directory already in the $PATH variable.
to check where you can put your scripts run this little line of code.
you can add to the $PATH, but im not sure how to do that on the phone, only from a linux standpoint.
What you need to do is easy assuming that middle line "setprop media.stagefright.enable-player false" is the correct command. the script would look like this
However this does no sort of checking to see if its already disabled, if it is does it cause a problem to disable it again. doesnt let you enable it, you probably would want this. also doesnt check if the software is installed.
take the quoted text, throw it in a file and set the SUID bit and youre off.
Click to expand...
Click to collapse
Yeah, no idea how to work with the PATH on android. I found out the scripts are in sl4a/scripts on the sdcard. I tried to chmod directly there, but it gave me a "Bad mode" error. Looks like once I get the SUID bit done, I'm good to go.
I know it doesn't have any error handling at this point. I'm not too worried about that at this point. If it disables stagefright, then I can edit my enabling script to work and I'll have a pair of scripts to toggle the sound fix on and off. (since when I turn off stagefright it can have undesired effects on the camcorder and other media apps) Thanks a lot for the help. I'll keep trying to figure out the SUID problem. I'm running windows. I have my linux laptop running, but haven't gotten around to installing the Android sdk on it yet.
I just had an idea. Do you think I can copy the scripts to my linux computer, chmod them, and then copy them back? If that would work, that could be the easier way at this point.
Well, I tried doing the chmod +s on linux and then pushing the files back. Not sure if they kept the SUID though. They run without a problem, but it doesn't show up as changing the property. This is really dumb...
Actually setprop does not need superuser permissions. So you could simply issue the echo commands and the setprop line. Done.
Sent from my PC36100 using XDA App
I tried that first. Didn't work. I'm not sure why setprop isn't working in the shell script. So far I tried without su, with su, and changing the SUID (though I'm not sure if it sticks when its pushed back to Android. It seems like such an easy script. This is really annoying. Also, I'm pretty sure you have to have root to use setprop, at least for the use I'm using. I got the command from here: http://forum.xda-developers.com/showthread.php?t=737111
the suid wont stick when you push the file over. to see if the command is being run proper run the setprop and check its return value, i dont think this will work unless youre in a proper shell. i cant seem to find out the command to check the return value.
if the return value is anything other than 0 (zero) there was a problem.
im off for the day, work is over
Yeah, I didn't think it would stick, but oh well. I can't get the return value, but I've been doing a getprop through adb to see if the property was changed, but it never is. The shell runs, but again, no output, just runs and exits.
superlinkx said:
Yeah, I didn't think it would stick, but oh well. I can't get the return value, but I've been doing a getprop through adb to see if the property was changed, but it never is. The shell runs, but again, no output, just runs and exits.
Click to expand...
Click to collapse
Getprop shows you the value of build.prop. The setprop command does not actually change build.prop but rather changes current session settings. The settings will revert upon reboot. That is why setprop has always been touted as a temporary fix. Try this script:
Code:
echo "Disable Stagefright"
adb shell setprop media.stagefright.enable-player false
echo "Disabled"
Edit: If that does not work, insert "cd .." before you exit command in you original script. That's "cd(space).." without the quotes.
Sent from my PC36100 using XDA App
sombdy said:
Getprop shows you the value of build.prop. The setprop command does not actually change build.prop but rather changes current session settings. The settings will revert upon reboot. That is why setprop has always been touted as a temporary fix. Try this script:
Code:
echo "Disable Stagefright"
adb shell setprop media.stagefright.enable-player false
echo "Disabled"
Edit: If that does not work, insert "cd .." before you exit command in you original script. That's "cd(space).." without the quotes.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
Ok, I tried the adb shell method, but that still didn't even temporarily change the build.prop. I know that using setprop is temporary, which is one of the reasons I'm using a script. I know that I can pull build.prop, edit the property and push it back, but then I'd have to put up with undesired effects.
I also tried the cd .. method, like so:
Code:
echo "enable stagefright"
su
setprop media.stagefright.enable-player true
cd ..
exit
echo "ENABLED"
(this is my second script that reenables stagefright. I have it turned off right now)
After doing that, I use adb shell from my computer and getprop still shows its false. If I run the command "setprop media.stagefright.enable-player true" from adb shell, it changes properly and shows when I say getprop. I'll probably work on it more tomorrow. Thanks everyone for the suggestions! I appreciate the help, even if it hasn't quite panned out yet.
Anyone else have any ideas? This is so dumb! I know the solution is simple, I just can't think of what it could be.
Is it possible to change it using root or adb please?
Why would you want to?
Nope. Impossible
NeoTechni said:
Why would you want to?
Click to expand...
Click to collapse
just wanted to clone my wife's one for the hands free in the car to avoid having to switch through the menu in the car.
I was unable to locate /pds as per http://pocketnow.com/tweaks-hacks/motorola-atrix-4g-how-to-change-wi-fi-and-bt-mac from http://forum.xda-developers.com/showthread.php?t=992326. I suspect every phone maker puts Bluetooth address where they wish...
However I was able to locate a zero byte bt_mac_addr file with no extension in /proc folder. It is empty both when bluetooth is on and off.
I hope someone more technically skilled than me can figure out if it can be populated to change the bluetooth address succesfully.
Thanks in advance
I looked at the '/proc/bt_mac_addr' file again using root explorer this time and can see my bluetooth mad address in it and could edit the address and change permissions to it but the modifications don't stay saved even after reboot though the root explorer says changes saved successfully. Can someone help me modifying the file please.
I'm on rooted 2.3.3
/proc is a virtual Filesystem provided by the Linux Kernel. The changes you made there won't persist a reboot cause it only gets saved in Ram.
Thank you. Does it mean I need a script of some type? Is it possible to achieve a change some other way? The pocketnow article seems to do it for the motorola phone but by modifying text file in another folder which I cannot find.
I followed the same process as follows using below commands
C:\Program Files\Android\android-sdk\platform-tools>adb push C:\APK\bt_mac_addr /sdcard/download/bt_mac_addr
1 KB/s (18 bytes in 0.015s)
C:\Program Files\Android\android-sdk\platform-tools>adb shell
$ su
su
# cp /sdcard/download/bt_mac_addr /proc/bt_mac_addr
cp /sdcard/download/bt_mac_addr /proc/bt_mac_addr
cp: can't create '/proc/bt_mac_addr': File exists
Is there another file I can change for it maybe?
Thanks again for all the help.
If you really want to do it then you can (On stock rom) use the same trick that is used for adb remount (Put an echo whatever into into /etc/install-recovery.sh)
You need to make sure it runs as root as well
Have a play around.
Installing the insecure adb apk (From Paul Modaco).
and
adding to the end.
/system/xbin/echo 8D:64:22:01:E2:A9 > /proc/bt_mac_addr
looks like it should work.
(If you have an unlocked bootloader then you can just do it from init.semc.rc in the initramfs)
Or you can look at the method (I posted the manual method in the rooting/insecure adb thread).
This presumes that this is actually working (Its possible you might have to restart a service to actually change it).
just make a simple init.d script
Thank you both. I Will look at it when i'm at the pc. A bit scared having never done anything similar. I Appreciate your guidance very much
Sent from my R800i
Thanks again for your previous replies. I tried "/system/xbin/echo 00:01:02:03:04:05 > /proc/bt_mac_addr" using script manager with superuser permissions granted and running in root mode but it gives the following error: "echo: write error: Input/output error". Same problem in gscript unfortunately.
Would you please tell me what this means and kindly suggest what I should do. I have not figured out yet how to do adb insecure or init.d but hope you could suggest the best way after seeing the above error.
Thanks in advance
ps3taker said:
Thanks again for your previous replies. I tried "/system/xbin/echo 00:01:02:03:04:05 > /proc/bt_mac_addr" using script manager with superuser permissions granted and running in root mode but it gives the following error: "echo: write error: Input/output error". Same problem in gscript unfortunately.
Would you please tell me what this means and kindly suggest what I should do.
Thanks in advance
Click to expand...
Click to collapse
You probably have to remount /system writable
Atarii said:
You probably have to remount /system writable
Click to expand...
Click to collapse
Thank you - I tried this but still same error
ps3taker said:
Thank you - I tried this but still same error
Click to expand...
Click to collapse
try this:
Code:
echo "00:01:02:03:04:05" > /proc/bt_mac_addr
DooMLoRD said:
try this:
Code:
echo "00:01:02:03:04:05" > /proc/bt_mac_addr
Click to expand...
Click to collapse
Thanks - I tried this but it still gives the same input/output error unfortunatelly
Besides mounting system as rw via script manager option I also enabled run at boot, run on network change, run as root but still no change before and after reboot.
I hope you could think of something please. Maybe /proc folder needs to be mounted rw but i'm not sure how or if it is not rw already - root explorer has no problem openning it rw straight away...
Thanks again for everybody's help in advance
ps3taker said:
Thanks - I tried this but it still gives the same input/output error unfortunatelly
Besides mounting system as rw via script manager option I also enabled run at boot, run on network change, run as root but still no change before and after reboot.
I hope you could think of something please. Maybe /proc folder needs to be mounted rw but i'm not sure how or if it is not rw already - root explorer has no problem openning it rw straight away...
Thanks again for everybody's help in advance
Click to expand...
Click to collapse
It won't work as that interface is read only
Sent from my R800i using XDA App
Thanks for trying to help.
I wonder if there is another file somewhere. Any idea what Play's equivalent of Motorola's Atrix 4G folder called "/pds" is - as it it seems to work for them: http://pocketnow.com/tweaks-hacks/motorola-atrix-4g-how-to-change-wi-fi-and-bt-mac
Thanks again for all the help - it was exiting to try scripts and other things you pointed me to.
I'm having troubles trying to encrypt the phone. with ICS works fine, but after the JB update from CM, phone encryption just does not work.
by example, if I try to encrypt the phone using the GUI, the android robot logo appears and nothing happens (no reboot, no encryption, no nothing).
Then... if I try to use the followings commands:
Code:
su
vdc cryptfs enablecrypto wipe $qwerty123
or
Code:
su
vdc cryptfs enablecrypto inplace $qwerty123
The result is:
Code:
200 0 -1
I don't know what it means, but there is no phone encryption, nor sdcard encryption.
Working ROMS:
Code:
UCLJ3-ATT-NEW.zip
Not Working ROMS:
Code:
cm-10.2-20130905-UNOFFICIAL-i927.zip
pac_i927_4.3.Build-1_20130908-143850.zip
BTW: $ is added here to avoid someone to use that weak password or to use the wipe method which deletes all your current data.
Thanks in advance.
unmanarc said:
I'm having troubles trying to encrypt the phone. with ICS works fine, but after the JB update from CM, phone encryption just does not work.
by example, if I try to encrypt the phone using the GUI, the android robot logo appears and nothing happens (no reboot, no encryption, no nothing).
Then... if I try to use the followings commands:
Code:
su
vdc cryptfs enablecrypto wipe $qwerty123
or
Code:
su
vdc cryptfs enablecrypto inplace $qwerty123
The result is:
Code:
200 0 -1
I don't know what it means, but there is no phone encryption, nor sdcard encryption.
Working ROMS:
Code:
UCLJ3-ATT-NEW.zip
Not Working ROMS:
Code:
cm-10.2-20130905-UNOFFICIAL-i927.zip
pac_i927_4.3.Build-1_20130908-143850.zip
BTW: $ is added here to avoid someone to use that weak password or to use the wipe method which deletes all your current data.
Thanks in advance.
Click to expand...
Click to collapse
Doing some research, I found this:
http://forum.xda-developers.com/showthread.php?t=1754771
and executing logcat, the footer error appeared even if I resized the partition several mb under the size...
In effect, the CM versions does not come with "setprop vold.post_fs_data_done 1". And...
I tried to repack the boot.img that comes with the .zip, but its pretty hard and tricky....
So, this is a request for change :cyclops:
We need both sha256 in kernel, the setprop, and out of the box encryption for /data and /sdcard :$
should be nice to use something better than aes, something like serpent-xts with 512bit (256bit for serpent) xD
unmanarc said:
Doing some research, I found this:
http://forum.xda-developers.com/showthread.php?t=1754771
and executing logcat, the footer error appeared even if I resized the partition several mb under the size...
In effect, the CM versions does not come with "setprop vold.post_fs_data_done 1". And...
I tried to repack the boot.img that comes with the .zip, but its pretty hard and tricky....
So, this is a request for change :cyclops:
We need both sha256 in kernel, the setprop, and out of the box encryption for /data and /sdcard :$
should be nice to use something better than aes, something like serpent-xts with 512bit (256bit for serpent) xD
Click to expand...
Click to collapse
Thanks.
will test, and include next release.
edit:
AES in the kernel:
zcat /proc/config.gz |grep AES
# CONFIG_SND_MAESTRO3 is not set
CONFIG_CRYPTO_AES=y
edit:
encypt works in http://dualhoki.vim.hu/bubor/dev/10.2/cm-10.2-20130911-UNOFFICIAL-i927.zip
I will put pacman update later.
bubor said:
Thanks.
will test, and include next release.
edit:
AES in the kernel:
zcat /proc/config.gz |grep AES
# CONFIG_SND_MAESTRO3 is not set
CONFIG_CRYPTO_AES=y
edit:
encypt works in LINK
I will put pacman update later.
Click to expand...
Click to collapse
Hi!
Thank you very much for your support and work,
I have a little question, I'm unable to encrypt the phone yet, now the message is little different:
Device is already running encrypted, aborting
Click to expand...
Click to collapse
Looking at source, it comes by:
property_get("ro.crypto.state", encrypted_state, "");
if (strcmp(encrypted_state, "unencrypted")) {
SLOGE("Device is already running encrypted, aborting");
goto error_unencrypted;
}
Click to expand...
Click to collapse
and doing getprop:
[email protected]:/ # getprop ro.crypto.state
getprop ro.crypto.state
[email protected]:/ #
Click to expand...
Click to collapse
I also noticed that init.rc still have commented the line "# setprop vold.post_fs_data_done 1"
^_^ thank you so much again.
unmanarc said:
Hi!
Thank you very much for your support and work,
I have a little question, I'm unable to encrypt the phone yet, now the message is little different:
Looking at source, it comes by:
and doing getprop:
I also noticed that init.rc still have commented the line "# setprop vold.post_fs_data_done 1"
^_^ thank you so much again.
Click to expand...
Click to collapse
Haha!
I tricked the android and completed the encryption process... look:
[email protected]:/ # vdc cryptfs enablecrypto inplace 123456
vdc cryptfs enablecrypto inplace 123456
200 0 -1
[email protected]:/ # setprop ro.crypto.state unencrypted
setprop ro.crypto.state unencrypted
[email protected]:/ # vdc cryptfs enablecrypto inplace 123456
vdc cryptfs enablecrypto inplace 123456
[[email protected] ~]$
Click to expand...
Click to collapse
From this point, the encryption process begin and the "encrypting phone" screen magically appears.
However!!! the boot process is not asking for any password... and If you look into "df" or "mount", /data is now a tmpfs with 128M.
I think we still need for setprop vold.post_fs_data_done 1 on init.rc (remove the #), because, without that setprop, the encryption may never work.
http://source.android.com/devices/tech/encryption/android_crypto_implementation.html
Thank you again.
Regards.
unmanarc said:
Haha!
I tricked the android and completed the encryption process... look:
From this point, the encryption process begin and the "encrypting phone" screen magically appears.
However!!! the boot process is not asking for any password... and If you look into "df" or "mount", /data is now a tmpfs with 128M.
I think we still need for setprop vold.post_fs_data_done 1 on init.rc (remove the #), because, without that setprop, the encryption may never work.
http://source.android.com/devices/tech/encryption/android_crypto_implementation.html
Thank you again.
Regards.
Click to expand...
Click to collapse
no need, there is in device specific section.
Strange, my phone was encypted when I ask mount, it says /dev/dm-0
Tried again, and it works with gui (settings->security .....), I use pin code.
My latest cm 10.2 build, full wipe, without sd card (encypt only data)
bubor said:
no need, there is in device specific section.
Strange, my phone was encypted when I ask mount, it says /dev/dm-0
Tried again, and it works with gui (settings->security .....), I use pin code.
My latest cm 10.2 build, full wipe, without sd card (encypt only data)
Click to expand...
Click to collapse
well, lets see whats happening with my phone
thanks again
you did a great work.
unmanarc said:
well, lets see whats happening with my phone
thanks again
you did a great work.
Click to expand...
Click to collapse
after a day of working, I introduce TWRP with encypt support. http://forum.xda-developers.com/showthread.php?t=2225657
bubor said:
after a day of working, I introduce TWRP with encypt support. http://forum.xda-developers.com/showthread.php?t=2225657
Click to expand...
Click to collapse
You were right. "setprop vold.post_fs_data_done 1" does not make any effect on this... xD I used abootimg to repack the boot.img with that option and still does not work
I tried to reformat the partition using the TWRP with ext4 and the 16kb, but nothing yet.
I'll keep trying
thanks for your support again bro.
unmanarc said:
You were right. "setprop vold.post_fs_data_done 1" does not make any effect on this... xD I used abootimg to repack the boot.img with that option and still does not work
I tried to reformat the partition using the TWRP with ext4 and the 16kb, but nothing yet.
I'll keep trying
thanks for your support again bro.
Click to expand...
Click to collapse
do you have enything logcat?
End of the day, I use encypt header on /efs partition not the last 16k, so you dont need reformat.
bubor said:
do you have enything logcat?
End of the day, I use encypt header on /efs partition not the last 16k, so you dont need reformat.
Click to expand...
Click to collapse
I know, I saw the encryptable on fstab.n1, moreover, at the time I used the setprop ro.crypto.state to trick the OS and encrypt my system, and the /efs/metadata created successfully with essiv-sha256, as we expected.
the logcat says what I expected... when I don't have the encryption, it says: already encrypted, but, checking for this message at the android source code, and doing the getprop, I know that is just because the ro.crypto.state is not set.
-----------
I think the problem has something to do with: int do_mount_all(int nargs, char **args)
that function is the responsible to set the ro.crypto.state...
But, ERROR("fs_mgr_mount_all returned an error\n"); does not appear at my logcat :s, so I don't understand why it does not work :s
lol... I will keep trying =) I love OpenSource =)
unmanarc said:
I know, I saw the encryptable on fstab.n1, moreover, at the time I used the setprop ro.crypto.state to trick the OS and encrypt my system, and the /efs/metadata created successfully with essiv-sha256, as we expected.
the logcat says what I expected... when I don't have the encryption, it says: already encrypted, but, checking for this message at the android source code, and doing the getprop, I know that is just because the ro.crypto.state is not set.
-----------
I think the problem has something to do with: int do_mount_all(int nargs, char **args)
that function is the responsible to set the ro.crypto.state...
But, ERROR("fs_mgr_mount_all returned an error\n"); does not appear at my logcat :s, so I don't understand why it does not work :s
lol... I will keep trying =) I love OpenSource =)
Click to expand...
Click to collapse
maybe remove file from efs?
bubor said:
maybe remove file from efs?
Click to expand...
Click to collapse
I tried. but not
getprop |grep crypt
[ro.crypto.state]: [unencrypted]
if you wanna change boot.img, you can find script/programs here
Dear friends and OGPro users,
I got annoyed by running SELinux permissive for only one app - Viper4Android - so I've started searching for a way to allow it to run under Enforced mode. So far, I have found two ways:
1) changing ROM's sepolicy before building to allow exec permission for mediaserver (which looks like a bad idea),
2) adding live SELinux rule via init.d script
Second way looks a bit better for me, and someone at forums already made a fix, but it's working only if you have SuperSU installed because it needs SuperSU's supolicy binary.
Since lots of us don't use SuperSU, but instead use implemented superuser option, and since supolicy is closed source and only available in SuperSU package, I took some liberty and some of my free time to spend on lots of Google searches to find a way to implement this fix.
Requirements for this are:
- Lollipop ROM and kernel with init.d support
- working init.d
- good will to try it
Basically, this script flashes setools-android with sepolicy-inject binary and simple init.d script which is run at every boot and sets needed rules for mediaserver, allowing V4A to run under SELinux Enforced.
Flashable zip is available in the attachment. Tested and working on my device, running PAC 5.1.
setools-android and sepolicy-inject are open-source software, and credit for those projects goes to:
- xmikos @ github, for creating this tool bundle,
- pasis @ github, for originally porting setools,
- Joshua Brindle @ bitbucket, for creating sepolicy-inject
Thanks! Great work!
Hi There, just wanted to say thanks for your great work, I had to edit the install script to allow it to install on my device (Samsung Galaxy Express GT-I8730 - Running CM-12.1). But it works perfectly! You should share this with the V4A Thread!
Thanks again!
onvsop said:
Hi There, just wanted to say thanks for your great work, I had to edit the install script to allow it to install on my device (Samsung Galaxy Express GT-I8730 - Running CM-12.1). But it works perfectly! You should share this with the V4A Thread!
Thanks again!
Click to expand...
Click to collapse
You're welcome I haven't tested it on other devices so I had to play safe. If it's working for you as it should, I'll fix installer script in few days
hi
will this work on cm12.1
jeevan_500 said:
will this work on cm12.1
Click to expand...
Click to collapse
It should work on any ROM/kernel combination with functional init.d or init.d simulation, like in Kernel Adiutor (just edit the updater-script and remove e980 lines if you're on different device)
For changing SELinux to Permissive mode permanently, run the following commands through Terminal Emulator:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
fmaher said:
For changing SELinux to Permissive mode permanently, run the following commands through Terminal Emulator:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Click to expand...
Click to collapse
Point of this zip is to allow only domains needed for V4A to run as permissive, not whole system. System is still running under enforced, just V4A gets access to tmpfs it needs to work properly.
Hi @ShadySquirrel,
I really like your found solution. I think it's way better than flashing supersu and all the v4a stuff to get it working. However it doesn't seem to work on Android 6. More information is on the screenshot attached. Is it easy to fix this by changing the support range from 15-29 to 15-30 or any other way?
Thanks in advance
pittvandewitt said:
Hi @ShadySquirrel,
I really like your found solution. I think it's way better than flashing supersu and all the v4a stuff to get it working. However it doesn't seem to work on Android 6. More information is on the screenshot attached. Is it easy to fix this by changing the support range from 15-29 to 15-30 or any other way?
Thanks in advance
Click to expand...
Click to collapse
Marshmallow will have to wait until binaries I'm using there are fixed and get support for it, unfortunately... Since I'm not the author of binaries, I can't give you an ETA.
ShadySquirrel said:
Marshmallow will have to wait until binaries I'm using there are fixed and get support for it, unfortunately... Since I'm not the author of binaries, I can't give you an ETA.
Click to expand...
Click to collapse
Yes I understand.. Well, let's wait and see. Thanks for the quick reply.
do i need to reinstall this everytime i update rom?
[email protected] said:
do i need to reinstall this everytime i update rom?
Click to expand...
Click to collapse
Yes.
P.S. This is not necessary for Slim.
Thanks worked great on lollipop.
I hope you will update the thread when you come up with the solution for marshmallow.
Regards.
fmaher said:
For changing SELinux to Permissive mode permanently, run the following commands through Terminal Emulator:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Click to expand...
Click to collapse
Well I'm not sure what I have done wrong here... it revert backs to Enforcing mode everytime after reboot.
I am on CM 13
ShadySquirrel said:
.
Click to expand...
Click to collapse
Can you make it compatible with Nougat?
OsniNO said:
Can you make it compatible with Nougat?
Click to expand...
Click to collapse
No, sorry, I don't have any Nougat running devices to test (I'm still stuck on Lollipop), and I'm not even sure this method will work on N.
ShadySquirrel said:
No, sorry, I don't have any Nougat running devices to test (I'm still stuck on Lollipop), and I'm not even sure this method will work on N.
Click to expand...
Click to collapse
It's maybe just an error in policydb supported version. When I try to run the script manually, i get message "policydb version 30 does not match my version range 15-29". I've attached a screenshot
OsniNO said:
It's maybe just an error in policydb supported version. When I try to run the script manually, i get message "policydb version 30 does not match my version range 15-29". I've attached a screenshot
Click to expand...
Click to collapse
Yeah, 6+ uses newer sepolicy, I'm not sure tools I've used are supporting it yet. I know that SuperSU has it's own policy inject tool, so maybe you can try injecting rules with it and create an init.d script.
Really can't make it work with M/N, I don't have any devices to test
Made a new thread as seems this is demanded option. Some people already checked this and looks like this works. I can't check right now but if you want, please check and post if it works for you.
Restriction is phone number country code based, can be bypassed. Also looks like its developers left setting to disable country checks at all. To do that, you just need to change android setting 'pixel.oslo.allowed_override' to '1' or 'true'.
Connect Pixel 4 with developer mode and execute command in adb shell:
Code:
adb shell setprop pixel.oslo.allowed_override true
or
Code:
adb shell "setprop persist.pixel.oslo.allowed_override true; setprop ctl.restart zygote"
or edit system/build.prop with some app (eg. MagiskHide Props Config)
You need root to do this.
Also there is Xposed Module in xposed manager to do this automatically called "EnableSoliOnPixel4", here's thread about it https://forum.xda-developers.com/pixel-4-xl/themes/success-enable-soli-china-t3994917
Do I need root permission to execute this command via adb? Thanks
Sent from my Google Pixel 2 using XDA Labs
Monazite said:
Do I need root permission to execute this command via adb? Thanks
Sent from my Google Pixel 2 using XDA Labs
Click to expand...
Click to collapse
Yes, without root you can’t edit system props
Eugnis said:
Yes, without root you can’t edit system props
Click to expand...
Click to collapse
getting failed to set property reply. any idea what i'm doing wrong?
Does it mean that I still can use soli in any country even that country doesn't support for it ?
For example, If I traveled to Japan one day, I still can use soli after enable soli by this xposed module ?
Kris
omar5099 said:
getting failed to set property reply. any idea what i'm doing wrong?
Click to expand...
Click to collapse
Looks like ADB not received root rights on phone. To check this use
Code:
adb shell su
if you receive response ' su: not found ' then you should enable root access for adb on phone (with supersu or similar)
Also you can set this prop with MagiskHide Props Config from phone if you used Magisk to root it
Kris Chen said:
Does it mean that I still can use soli in any country even that country doesn't support for it ?
For example, If I traveled to Japan one day, I still can use soli after enable soli by this xposed module ?
Kris
Click to expand...
Click to collapse
Yes, this setting just disable country check at all. So Soli will work worldwide
Eugnis said:
Looks like ADB not received root rights on phone. To check this use
Code:
adb shell su
if you receive response ' su: not found ' then you should enable root access for adb on phone (with supersu or similar)
Also you can set this prop with MagiskHide Props Config from phone if you used Magisk to root it
Click to expand...
Click to collapse
I've obtained root for ADB shell via this command, however none of those 2 original adb lines are working. I'm still getting the failed to set property reply.
Any help appreciated...
Now I gotta root my phone and lose automatic updates just to be able to use it normally. Thanks a lot, Google!! _l_
You will still get automatic updates, you can root your phone, set the persistent property, and remove the root. Should persist across updates.
Bogega said:
I've obtained root for ADB shell via this command, however none of those 2 original adb lines are working. I'm still getting the failed to set property reply.
Any help appreciated...
Click to expand...
Click to collapse
yes same here, any1 got this to work ? thanks
Pixeling said:
You will still get automatic updates, you can root your phone, set the persistent property, and remove the root. Should persist across updates.
Click to expand...
Click to collapse
So if I set the property and then unroot, it will persist even after OTA updates? No need to root again and set it again after every OTA?
aco.falc said:
So if I set the property and then unroot, it will persist even after OTA updates? No need to root again and set it again after every OTA?
Click to expand...
Click to collapse
That's what I suspect since the property lives in /data which is not changed/erased after OTA. I've not tried it myself however that's probably what I will do when I get the phone.
aco.falc said:
So if I set the property and then unroot, it will persist even after OTA updates? No need to root again and set it again after every OTA?
Click to expand...
Click to collapse
Performing some more reading on the subject, there is a possibility that unlocking the bootloader by itself trips safetynet which in turn prevents OTA. I can't know whether this is true for sure, but in this case keeping Magisk root shall hide that and let you download the OTA.
Before applying the OTA you should use magisk to restore the boot.img, let the OTA install, and then let Magisk install itself to the other inactive flash slot where the OTA is. That will make sure that root is kept intact post update and keep hiding that the bootloader is unlocked. Can anyone confirm?
WORKED
hello, i can confirm its working, steps to follow :
when u flash the magisk_patched image the phone wont boot at first, so u have to flash the boot.img then reflash the magisk_patched.
then the phone will boot normally.
after that, download terminal from play store, and type in it : SU , this will ask u for root permissions
then u need to type these 3 commands within the terminal :
setprop pixel.oslo.allowed_override true
setprop persist.pixel.oslo.allowed_override true
setprop ctl.restart zygote
then motion sense will turn on.
enjoy!
if u need detailed steps about the whole thing let me know
sta3b said:
hello, i can confirm its working, steps to follow :
when u flash the magisk_patched image the phone wont boot at first, so u have to flash the boot.img then reflash the magisk_patched.
then the phone will boot normally.
after that, download terminal from play store, and type in it : SU , this will ask u for root permissions
then u need to type these 3 commands within the terminal :
setprop pixel.oslo.allowed_override true
setprop persist.pixel.oslo.allowed_override true
setprop ctl.restart zygote
then motion sense will turn on.
enjoy!
if u need detailed steps about the whole thing let me know
Click to expand...
Click to collapse
Can confirm that typing these commands in terminal did the trick. Used 'Terminal Emulator for Android' app from playstore.
And I skipped first steps (flashing boot.img etc) as I'm already rooted.
Thanks!
Bogega said:
Can confirm that typing these commands in terminal did the trick. Used 'Terminal Emulator for Android' app from playstore.
And I skipped first steps (flashing boot.img etc) as I'm already rooted.
Thanks!
Click to expand...
Click to collapse
It works for me! Thank you!
Do I need to do this all over again when I reboot my phone?
It seems that when rebooting the phone the soli is disabled again, can someone confirm?
Also I read here something about unrooting? can I really root and unroot everytime I want and retain OTA updates?
chris111111 said:
It works for me! Thank you!
Do I need to do this all over again when I reboot my phone?
Click to expand...
Click to collapse
Soli doesn't survive reboots if you're using this method.
There's a magisk module (non Xposed) which solves this though (https://forum.xda-developers.com/pixel-4-xl/themes/enable-soli-contries-magisk-module-t3997035)
wolfgangam31 said:
It seems that when rebooting the phone the soli is disabled again, can someone confirm?
Also I read here something about unrooting? can I really root and unroot everytime I want and retain OTA updates?
Click to expand...
Click to collapse
correct, rebooting the phone will cause SOLI to get disabled, you need to re-enter the commands in the terminal to get it to work again