[FIX] Run Viper4Android in SELinux enforced mode - LG Optimus G Pro

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

Related

Kernel 2.6.32-2.6.25 and initrd update with lot of changes

There are many changes on initrd that affect both 2.6.25 and 2.6.32, so:
When you update you need to apply this.
If someone post something like wifi doesn't work and he/she didn't apply the update i'll find a way to burn his phone remotely!
I fixed the problem of wifi for polaris (now we use the same module, thanks dzo)
The new initrd:
switch to correct version of modules between 2.6.25 and 2.6.32
change the name of the device
probably fix data corruption
2.6.32 kernel has a new parameter for fake sync so you can make all test you want (please post results in this thread)
2.6.25 is unchanged so when you flash you change only the initrd.
Haret users please download initrd from here.
if you have problem with data connection please let me know!
I suggest you to download latest version directly from atools.
To apply update you can use the boot menu or atools (BSE->select data and system partitions-> select intall update-> put install-seq.sh in sdcard/andboot/)
Download page here
changelog:
updated androidupdate.tgz with su fix
For releaser:
Entract the update on your distro
remove the /system/etc/ppp directory
put the ppp file (extract the zip) on /system/etc/
Click to expand...
Click to collapse
Release your new distro.
Thank You l1q1d
Appreciate everything you do!
I am a Vogue user on sdcard sys-date.img (not ext2), I have updated the 'must' and used the haret lzma, and zImage-11-23-10 .32 kernel but still get this:
sh:2 unknown operand
Automode for system
/init: line 319: /bin/losetup: not found
/init: line 319: /bin/e2fsck: not found
[ 24.743286] EXT2-fs: unable to read superblock
mount: mounting /dev/block/loop1 on /system failed: Invalid argument
Failed
Failed to mount /system
try now, when i update busybox some apps are moved in /sbin/
Thank you for the info
l1q1d said:
try now, when i update busybox some apps are moved in /sbin/
Thank you for the info
Click to expand...
Click to collapse
Sorry got the same result with the new 'NEED' updated.
Do you have di problem with atools or when you boot?
Somthing is wrong with download link i get this ::
XML Parsing Error: not well-formed
Location: http://androidhtc.git.sourceforge.net/git/gitweb.cgi?p=androidhtc/kernel-release.git;a=tree
Line Number 23, Column 117:function padLeftStr(input,width,str){var prefix='';width-=input.toString().length;while(width>0){prefix+=str;width--;}
--------------------------------------------------------------------------------------------------
try with another browser...
Yep link is working just fine. Tried it in IE8 and firefox with no issues. Sounds to me like your browser is having a hell of a time trying to parse xml.
Well it seems to work ok for me, wifi still works, and I will experiment with the vsync setting later.
One problem, the superuser app doesn't work anymore, typing su in a terminal gives:
su: unknown user root
and now roguetools won't work either obviously.
Any ideas what could have caused this? Clearing superuser data didn't help.
I would try to remove the superuser apk and reinstall it from the market, but I can't remove it because I don't have root access now!
So does each kernel now have it's own module folder?
Yes every kernel has his own dir
for su problem:
Code:
mount -o remount,rw /system
echo "root::0:0:root:/:/bin/sh" > /etc/passwd
mount -o remount,ro /system
l1q1d said:
Yes every kernel has his own dir
for su problem:
Code:
mount -o remount,rw /system
echo "root::0:0:root:/:/bin/sh" > /etc/passwd
mount -o remount,ro /system
Click to expand...
Click to collapse
Unable to mount error (not root)
can we just make a passwd file and put
root::0:0:root:/:/bin/sh
will that work?
BTW, very nice update
clemsyn said:
Unable to mount error (not root)
can we just make a passwd file and put
root::0:0:root:/:/bin/sh
will that work?
Click to expand...
Click to collapse
That worked I am able to su now, it doesn't open my su app but I can logcat and rogue tools work (after letting it sleep)
clemsyn, how did you do it?
I put "root::0:0:root:/:/bin/sh" in system/etc/passwd in an androidupdate.tar, but it hasn't worked, I still get the same error
l1q1d said:
if you have problem with data connection please let me know!
Click to expand...
Click to collapse
I applied the patch to 3 different rom freshly installed, Clemsyn's latest international, Scoot's CyanogenMod RLS4c and latest fat free froyo.
Wifi is working correctly but I cannot get 3g-gprs data to work.
APN seems correctly configured.
Am I the only one?
No overclock, panel 3, tilt, atools 1.02 and 0.11 (tried both)
Thank you for update,
is there any chance, that this update can fix thiis problem?
http://forum.xda-developers.com/showthread.php?t=844695
I flashed like hell on weekend and wasnt able to load any page with any 2.6.25 build (I tested many FroYos and even one Eclair). Sad is, that other than WiFi, system was fast and stable :-/
With 2.6.32 I was able to randomly load google.com page but very slow (less than 1kb/s) and cant connect with google acc still. On the top of that system wasnt so stable as with 2.6.25.
Its really weird, that I am only one, who have problem with loading pages
Can it also be caused by my radio: 1.65.38.14 (Touch Cruise Polaris POLA100 panel=1)? Its great for WM 6.5.3, but maybe not so great for WiFi on Andorid? Or is there anyone with working WiFI and that radio?
Otherwise, can someone post a link to tested and best radio for Android (I prefer Fat Free FroYo build, if someone tested it)
mmec2 said:
clemsyn, how did you do it?
I put "root::0:0:root:/:/bin/sh" in system/etc/passwd in an androidupdate.tar, but it hasn't worked, I still get the same error
Click to expand...
Click to collapse
dont put quotations "".
Grandelama said:
I applied the patch to 3 different rom freshly installed, Clemsyn's latest international, Scoot's CyanogenMod RLS4c and latest fat free froyo.
Wifi is working correctly but I cannot get 3g-gprs data to work.
APN seems correctly configured.
Am I the only one?
No overclock, panel 3, tilt, atools 1.02 and 0.11 (tried both)
Click to expand...
Click to collapse
You are not alone I am also having issues with mobile data. I'll look into it later on. I believe it's just a PATH issue in the sysinit.rc but I could be wrong.
for data connection try this:
Code:
mount -o remount,rw /system
rm -r /system/etc/ppp
ln -s /smodem /system/etc/ppp
mount -o remount,ro /system
@spellshaper: next time use search button in polaris section!!!! Flash 1.59.46.12 radio.
l1q1d said:
Do you have di problem with atools or when you boot?
Click to expand...
Click to collapse
The problem lies when I boot, it's before the animation starts or after the 'D-PAD press' to get into the options menu for installation, etc.

[Q] How to change Bluetooth MAC Address

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.

[modules] cifs.ko, md4.ko, nls_utf8.ko, stock [4.2 / 4.2.2] 3.4.5-g4e6298b / gaf9c307

I have managed to get CIFS working on stock Nexus 10.
It's quite a bit more problematic on the Nexus 10 than normal.
There are 2 main issues to deal with. Newer versions of the Linux kernel require a UNC variable to be passed to them and the current version of busybox doesn't do this. There is a patch out. I have extracted the patched busybox binary from craigacomez's AOSP Nexus 10 rom.
(Check it out here: http://forum.xda-developers.com/showthread.php?t=1998585 ). Otherwise it should work on the stock mount command if you specify the unc= mount option with the share.
The other issue is the multiuser stuff. If you execute the mount command from inside Terminal Emulator (or a script program) it looks like it mounts ok and you can 'ls' in the directory but it doesn't work for Android apps, they just see an empty directory but if you do it via a 'adb shell' it works fine in Android apps. My theory is ADB is outside of the multiuser stuff. adb actually ships on the device.
1) Unlock bootloader (fastboot oem unlock)
2) Flash recovery adb flash recovery whatever.img
3) Root device (flash CWM-SuperSU-0.98.zip)
4) Install BusyBox (from the market)
5) Copy md4.ko and cifs.ko to device. The files can go anywhere you like. In this example I will just use the root of the sdcard. Some people like them in /system/modules or /system/lib/modules
6) busybox mount -o rw,remount /
7) adb shell
8) Override /system/bin/busybox with the patched version (maybe move it first so it's backed up).
9) insmod /sdcard/md4.ko
10) insmod /sdcard/cifs.ko
11) busybox mount -t cifs -o username=MYUSER,password=MYPASS,unc=\\\\192.168.1.1\\storage //192.168.1.1/storage /data/media/0/cifs/Storage
You will need to manually preform the last 3 commands each time you reboot the device from a adb shell.
NOTE: You can probably get rid of the -o flags completely. In theory the patched version of busybox makes the UNC bit redundant. Possibly you can use the stock busybox with the UNC flag and avoid using the patched one totally. I have just included it to be sure.
Make sure you type 'busybox mount' not 'mount', by default they are different binaries. Otherwise you can remove the /system/bin/mount command and make a new one linking /system/bin/mount to /system/bin/busybox.
Possibly there is some way to get the mount working in the multiuser environment without requiring busybox. If you figure it out please tell ☺
Some threads on the issue:
http://forum.xda-developers.com/showthread.php?p=34397868#post34397868
http://forum.xda-developers.com/showthread.php?t=733490&page=6
http://www.mail-archive.com/[email protected]/msg17650.html
The modules are for 3.4.5-g4e6298b.
EDIT: I added nls_utf8.ko by request
EDIT2: Since adb comes on the device, it is possible to use it to connect to local host:
1) Install cifs modules to /system/lib/modules
2) Install Script Manager from the play store
3) Copy script to device
4) Start SManager
5) Find your script and open it.
6) Tick the su box
7) Hit save
8) Goto home sccreen
9) Add a 'SMShortcuts' widget to your home screen
10) "Add one script shortcut"
11) Choose your script
12) Optionally use this pretty icon ☺
13) Give it a nice name like "Mount Shares"
Here is a shell script...
Code:
#!/system/bin/sh
# Your settings here
USERNAME="USERNAME"
PASSWORD="PASSWORD"
IPADDRESS="192.168.1.1"
SHARE="storage"
MOUNT_POINT="/data/media/0/cifs/Storage"
# If you need to change the mount command edit this
MOUNT_CMD="\
mount -t cifs \
\
-o \
user=$USERNAME,\
password=$PASSWORD,\
unc=\\\\\\\\\\\\\\\\$IPADDRESS\\\\\\\\$SHARE \
\
//$IPADDRESS/$SHARE \
$MOUNT_POINT"
COMMANDS="\
insmod /system/lib/modules/md4.ko; \
insmod /system/lib/modules/nls_utf8.ko; \
insmod /system/lib/modules/cifs.ko; \
$MOUNT_CMD
"
# Starting ADB...
PORT=`getprop service.adb.tcp.port`
setprop service.adb.tcp.port 5555
adb kill-server
adb start-server
stop adbd
start adbd
adb connect localhost
# Make sure we only use the first device (sometimes there is more than one)
SERIAL=`adb devices | head -n2 | tail -n1 | cut -f1`
if [ "$SERIAL" = "" ] ; then
echo "ERROR: Could not find ADB device.";
fi
echo Mounting share via adb...
adb -s $SERIAL shell su root -c "$COMMANDS"
# If you started adb, then stop it here for security:
adb disconnect localhost
stop adbd
setprop service.adb.tcp.port $PORT
start adbd
RESULT=`mount | grep $MOUNT_POINT`
if [ "$RESULT" = "" ] ; then
echo "Mounting failed..."
else
echo "Mounting sucess!"
fi
echo Done... You may close this script window.
EDIT3: Added usbserial.ko, option.ko and usb_wwan.ko
EDIT4: Some users have reported that the need to modify the script to get it working with their version of SU.
EDIT5: I have uploaded modules for 4.2.2, kernel 3.4.5-gaf9c307 but I haven't actually tested them myself (still on 4.2.1). Apparently the adb loophole has also been patched but it is possible to reenable it by putting a RSA key onto the device. Check out this set of instructions here.
EDIT6: I have updated to 4.2.2 on my Nexus 10 and can confirm the new modules work.
You must setup the adbkey or you will get a "device: offline" message. By default adb when adb first runs it tries to create the keys in the $HOME dir which is /data/.android, but the data directory isn't accessible by the 'shell' user.
I got it working simply by setting the HOME variable to /sdcard and restarting the adb server in the script then Android popped up a query (I have update the script above).
IMPORTANT: The Android Media scanner recursively scans folders for media to add the the database so it shows up in programs like Google Music. On large shares this can be a long process and use heaps of battery life. To prevent this add a blank file with the name ".nomedia" to the root of your mount points (or each individual share if you aren't used 1 folder for all your mounts). This will stop music showing up in programs though.
If you find that the device stops responding (the launcher might work but apps fail to load) or you get reboots (often after the previous bug) this is probably due to a bad wifi connection.
Is it posible to make a CWM flash file?
Great
This is great progress, do you know if there is some way I can use the same to mount my usb OTG with ADB shell so that I can read/write to my pen drives from my android apps/file managers?
I have tried using the busybox mount but that didn't work, do I need the modified mount or will none of this help anyway?
alias_neo said:
This is great progress, do you know if there is some way I can use the same to mount my usb OTG with ADB shell so that I can read/write to my pen drives from my android apps/file managers?
I have tried using the busybox mount but that didn't work, do I need the modified mount or will none of this help anyway?
Click to expand...
Click to collapse
Code:
busybox mount -t FSTYPE /dev/block/sda1 MOUNT_LOCATION
Example:
Code:
busybox mount -t vfat /dev/block/sda1 /storage/sdcard0/usbotg
craigacgomez said:
Code:
busybox mount -t FSTYPE /dev/block/sda1 MOUNT_LOCATION
Example:
Code:
busybox mount -t vfat /dev/block/sda1 /storage/sdcard0/usbotg
Click to expand...
Click to collapse
How is this different to what I'm doing already? Mounting this way doesn't work, only the process that mounted it can see the files.
Although I don't have nexus 10, I am having the similar mounting issue on my nexus 7 until I saw this post.
Advise about "adb shell" really helps me resolve the multiuser issue.
Thanks for sharing.
Any chance you could post the nls-utf8.ko for utf8 support?
Thanks!
H3g3m0n said:
1) Unlock bootloader (adb oem unlock)
Click to expand...
Click to collapse
Isn't it fastboot that unlocks the bootloader, and not adb? (unless adb can do it too; I've only heard of fastboot though)
momulah said:
Is it posible to make a CWM flash file?
Click to expand...
Click to collapse
Not a high priority right now as currently you need to do the manual adb shell stuff by hand to get things mounted, a little extra setup work isn't a huge difference.
alias_neo said:
How is this different to what I'm doing already? Mounting this way doesn't work, only the process that mounted it can see the files.
Click to expand...
Click to collapse
Are you mounting in a 'adb shell' or locally in something like terminal emulator? My OTG cable won't be here for a while so I can't really test myself.
weasal said:
Any chance you could post the nls-utf8.ko for utf8 support?
Thanks!
Click to expand...
Click to collapse
Posted, haven't tested it but it seemed to insmod fine.
espionage724 said:
Isn't it fastboot that unlocks the bootloader, and not adb? (unless adb can do it too; I've only heard of fastboot though)
Click to expand...
Click to collapse
Yeh typoed, i'll fix that now.
Currently I'm thinking of ways to hack around the 'adb shell' requirement, as a basic hackish fix would be to make a program that turns on adb wireless, connects to the local device and issues a command. Of course possibly there is a 'proper' way to do mounting. Another lazy way for those with their shares on a Linux system would be a script issue commands to the server via a ssh, getting it to log back into the phone and mount stuff over adb wireless.
alias_neo said:
How is this different to what I'm doing already? Mounting this way doesn't work, only the process that mounted it can see the files.
Click to expand...
Click to collapse
I've been working on getting OTG support natively in my AOSP based custom ROM and I have had some success... check out my ROM for details
H3g3m0n said:
Currently I'm thinking of ways to hack around the 'adb shell' requirement, as a basic hackish fix would be to make a program that turns on adb wireless, connects to the local device and issues a command. Of course possibly there is a 'proper' way to do mounting. Another lazy way for those with their shares on a Linux system would be a script issue commands to the server via a ssh, getting it to log back into the phone and mount stuff over adb wireless.
Click to expand...
Click to collapse
Just wanted to thank H3g3m0n as I was able to successfully mount over adb. Also came up with a workaround to bypass connecting to a PC, grabbed the arm fastboot binary from this thread and installed it on my nexus 7. Used it to connect wireless adb on the 10 and ran the mount commands on the 7.
H3g3m0n said:
Posted, haven't tested it but it seemed to insmod fine.
Click to expand...
Click to collapse
Thanks, I'll give it a try!
You might find my posts #156 and #162 at http://forum.xda-developers.com/showthread.php?t=1781411&page=17 helpful.
Sorry for the noob ? ...
What are the KO's do?
What is the practical use of then.
Sorry I did a little research on then but I could not find an answer in layman terms
Thank you for allowing me to learn.
Sent from my toroplus using xda premium
spdwiz18 said:
Sorry for the noob ? ...
What are the KO's do?
What is the practical use of then.
Sorry I did a little research on then but I could not find an answer in layman terms
Thank you for allowing me to learn.
Sent from my toroplus using xda premium
Click to expand...
Click to collapse
http://en.wikipedia.org/wiki/Loadable_kernel_module
craigacgomez said:
http://en.wikipedia.org/wiki/Loadable_kernel_module
Click to expand...
Click to collapse
That helps allot.... Now i have an understanding of ko's in general. But what specificly do the modules this thread refers to do and the practical use of then. Thanks foot the help.
Sent from my toroplus using xda premium
spdwiz18 said:
That helps allot.... Now i have an understanding of ko's in general. But what specificly do the modules this thread refers to do and the practical use of then. Thanks foot the help.
Sent from my toroplus using xda premium
Click to expand...
Click to collapse
These modules are needed to enable support for CIFS (Windows share) mounts...
spdwiz18 said:
That helps allot.... Now i have an understanding of ko's in general. But what specificly do the modules this thread refers to do and the practical use of then. Thanks foot the help.
Sent from my toroplus using xda premium
Click to expand...
Click to collapse
Basically you can setup a shared folder from a remote computer. It allows you to have files on another system accessible as if it was part of the internal storage in the device.
Just found out that Android ships with the adb binary on the device itself (after crosscompiling it myself :/, oh well the experience was useful).
It should be possible to setup a script to start the adb server, connect to the localhost and execute the mount without too much difficulty.
Ok, added a script and instructions to the front page for simple on tablet mounting.

Setting up ViPER4Android under SElinux Enforcing (running Lollipop/Marshmallow)

This thread is particularity aimed at (rooted) variants with locked bootloaders and (unlocked & rooted)V10's running on Marshmallow.
#1 The issue regarding (locked)V10's running on Lollipop has been solved, see post http://forum.xda-developers.com/showpost.php?p=66037561&postcount=12 for details.
#2 The issue regarding (unlocked)V10 running on Marshmallow has been solved, see post http://forum.xda-developers.com/showpost.php?p=67428231&postcount=41 for details
Note: see http://forum.xda-developers.com/showpost.php?p=66063441&postcount=16 for automated script execution instructions (required to permanently run V4A under SElinux enforcing), and also for instructions on how to install V4A.
#1 (un)solved issue(s):
I've successfully installed V4A 2.4.0.1 but I also wanted to modify the system in order for it to properly work on a SElinux enforcing policy.
I've followed these instructions http://forum.xda-developers.com/showpost.php?p=61242973&postcount=18854 :
su
mount -o rw,remount /system
cd /system/su.d
echo '#! /system/bin/sh' > 50viper.sh
echo '/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"' >> 50viper.sh
chown root.root 50viper.sh
chmod 755 50viper.sh
cd /
mount -o ro,remount /system
exit
I skipped the "cd /system/su.d" part as there is no such directory. And skipped the recovery method (locked bloader).
I tried these commands in adb shell and terminal emulator but both methods have failed into mounting the system as rw. When I enter the rw system command there is no error message, but when I try the "echo '#!..." command I get an error that I'm dealing with a Read-Only file system. See printscreen.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I've tried various other mount commands.
Issue has been solved, see post http://forum.xda-developers.com/showpost.php?p=66037561&postcount=12 for details.
#2 Marshmallow (un)solved issue(s):
-When I attempted to install V4a's driver I got the I/O error.
-SElinuxmodechanger app is not able to get root access, even though my phone is properly rooted.
Starts at:http://forum.xda-developers.com/lg-v10/themes-apps/setting-viper4android-t3340343/page4 #32 [/I]
Issue has been solved, see post http://forum.xda-developers.com/showpost.php?p=67428231&postcount=41
Instructions from the Verizon variant, unknown if it will help you or not.
1. Disable namespace separation in SuperSU (Restart Phone)
2. Install SELinux and change mode to Persuasive.
3. Install JRummy Busybox app and install into xbin.
4. Install Viper4Android and grant SU access and click Yes to install drivers.
---------- Post added at 01:09 PM ---------- Previous post was at 01:06 PM ----------
I installed the V4A found on this xda link -> http://forum.xda-developers.com/attachment.php?attachmentid=3685304&d=1458144652
corporal_hades said:
Instructions from the Verizon variant, unknown if it will help you or not.
1. Disable namespace separation in SuperSU (Restart Phone)
2. Install SELinux and change mode to Persuasive.
3. Install JRummy Busybox app and install into xbin.
4. Install Viper4Android and grant SU access and click Yes to install drivers.
---------- Post added at 01:09 PM ---------- Previous post was at 01:06 PM ----------
I installed the V4A found on this xda link -> http://forum.xda-developers.com/attachment.php?attachmentid=3685304&d=1458144652
Click to expand...
Click to collapse
I know how to make it work by switching SElinux off.
What I don't want is to have reduced security for the sake of V4A, that's why I want to be able to leave it on enforcing.
On my nexus 5 I was able to successfully flash the SElinux policy zip on lollipop, so the instructions should work.
Is is possible?
I desperately crave viper on my newly rooted LG V10 but don't want to compromise standard security provided by enforced SElinux.
I hope to hear of a viable workaround...
thanks to any that can help!
Just use one of those run-script-on-startup apps and create a script with the contents of 50viper.sh
U
WillyPillow said:
Just use one of those run-script-on-startup apps and create a script with the contents of 50viper.sh
Click to expand...
Click to collapse
It won't work because it can't mount the system as RW.
But I'll give it a shot with the Smanager app.
elvin421 said:
Is is possible?
I desperately crave viper on my newly rooted LG V10 but don't want to compromise standard security provided by enforced SElinux.
I hope to hear of a viable workaround...
thanks to any that can help!
Click to expand...
Click to collapse
I'll try another approach with a startup script.
But when you run the viper4android proces while in permissive mode and switch back to enforcing mode, viper4android will still be working properly(music must be playing while doing this) .
Vasishtha said:
U
It won't work because it can't mount the system as RW.
But I'll give it a shot with the Smanager app.
Click to expand...
Click to collapse
You don't need to mount it. Basically what you have to do is to execute
Code:
/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };
on boot with an app.
I used to use 3C Toolbox for this purpose but now I don't use V4A anymore.
EDIT: If you skip the "cd" part, you'll be writing into /, which is RO. So your remounting should have succeeded.
BTW, the tutorial you followed was trying to add a script that executes the command above using a method our ROMs don't support anyway.
Hi there. Have one question: V4A installed and it works with playerpro. Tried with poweramp, it shows working, but no difference in listening. Tried already different settings in poweramp. No success. Has someone an idea?
Thx a lot in advance.
Schuertzi
I flashed this on my T mobile variant http://forum.xda-developers.com/nexus-6/themes-apps/viper4android-t2952137
WillyPillow said:
You don't need to mount it. Basically what you have to do is to execute
Code:
/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };
on boot with an app.
I used to use 3C Toolbox for this purpose but now I don't use V4A anymore.
EDIT: If you skip the "cd" part, you'll be writing into /, which is RO. So your remounting should have succeeded.
BTW, the tutorial you followed was trying to add a script that executes the command above using a method our ROMs don't support anyway.
Click to expand...
Click to collapse
It worked
What does that command actually do?
It did trow out an error though, but V4a was still able to proces under enforcing. See the attachment for details.
Gungrave223 said:
I flashed this on my T mobile variant http://forum.xda-developers.com/nexus-6/themes-apps/viper4android-t2952137
Click to expand...
Click to collapse
It tried flashing it with flashfire (I can't install twrp/cmw on my variant), but it didn't install. Does it sound better then stock V4a?
I worked out the error message and my script now works flawlessly.
I used Smanager to load the script on boot. The script was extracted from this flashable file: http://forum.xda-developers.com/showpost.php?p=61242973&postcount=18854
The script only has one command:
#! /system/bin/sh
supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"
See attachment for the script(rename .txt to .sh after you've downloaded it)
Thanks for pointing me in the right direction @WillyPillow.
V4A now runs on SElinux enforcing without a problem.
If you need instructions on how to setup Smanager in order to run the script on boot, let us know(edit: see http://forum.xda-developers.com/showpost.php?p=66063441&postcount=16 for instructions).
schuertzi said:
Hi there. Have one question: V4A installed and it works with playerpro. Tried with poweramp, it shows working, but no difference in listening. Tried already different settings in poweramp. No success. Has someone an idea?
Thx a lot in advance.
Schuertzi
Click to expand...
Click to collapse
Did you remove the deep_buffer lines in /etc/audio_policy.conf ?
Also, @Vasishtha what the command does is basically allow some operations by mediaserver that was blocked previously to do its work.
EDIT: BTW, I'm pretty curious what the error was
Well done!
Would you kindly post a method of how to execute V4A installation from beginning to end?
Much appreciated!
WillyPillow said:
Did you remove the deep_buffer lines in /etc/audio_policy.conf ?
Also, @Vasishtha what the command does is basically allow some operations by mediaserver that was blocked previously to do its work.
EDIT: BTW, I'm pretty curious what the error was
Click to expand...
Click to collapse
Regarding poweramp:
Do you mean these lines? (see attachment)
What does removing them do and does it have any negative consequences?
The error in your command came from the lack of 'sh' before the supolicy term.
elvin421 said:
Well done!
Would you kindly post a method of how to execute V4A installation from beginning to end?
Much appreciated!
Click to expand...
Click to collapse
-For installing V4A read up on this guide: https://docs.google.com/document/d/15e7xv8AADnl0Ckqg8NiuQMTPLSgkIZCS4hU4Q07H7i4/mobilebasic
Ignore the selinux changing steps.
-Once properly installed (and with SElinux enforcing still active) install Smanager (https://play.google.com/store/apps/details?id=os.tools.scriptmanager)
-Download the script file I provided my post: http://forum.xda-developers.com/showpost.php?p=66037561&postcount=12
-open Smanager->browse to the script file(file should be renamed from .txt to .sh)->tap and hold on the file->select "open as..." ->select "script/executable" ->new window appears->enable the 'SU' and 'BOOT' options and select run.
Viper4android's driver status should now be normal(under SElinix enforcing). check it by opening V4a, open the menu and select 'driver status'
Really appreciate you posted this. I'm afraid it likely confirms my fear that all my failed attempts of installing viper through various methods may have corrupted the relevant resources in my system such that your method is not working for me.
Hopefully by tonight I'll have my device wiped & viper running following a clean install as described above. Again, thank you!
elvin421 said:
Really appreciate you posted this. I'm afraid it likely confirms my fear that all my failed attempts of installing viper through various methods may have corrupted the relevant resources in my system such that your method is not working for me.
Hopefully by tonight I'll have my device wiped & viper running following a clean install as described above. Again, thank you!
Click to expand...
Click to collapse
When installing V4A does It tell you that you may have installed the wrong busybox(even if its the official one) or that your device is not properly rooted?
There's an easy way to get around it, just reflash the rooted rom (via the 'Upgrade' option). Once booted, don't update the su binary yet. Reinstall busybox and open V4A and install it. It'll install properly.
Vasishtha said:
Regarding poweramp:
Do you mean these lines? (see attachment)
What does removing them do and does it have any negative consequences?
The error in your command came from the lack of 'sh' before the supolicy term.
Click to expand...
Click to collapse
Well, from what I've known, it's just a bigger audio buffer, and doesn't get along well with V4A. Disabling that without V4A installed somehow makes the Hifi DAC work only for certain files, but is easily resolvable by putting the lines back.
Anyway, you can consider commenting the lines out to see if it works.
Vasishtha said:
When installing V4A does It tell you that you may have installed the wrong busybox(even if its the official one) or that your device is not properly rooted?
There's an easy way to get around it, just reflash the rooted rom (via the 'Upgrade' option). Once booted, don't update the su binary yet. Reinstall busybox and open V4A and install it. It'll install properly.
Click to expand...
Click to collapse
Hey, finally found the time to attempt the redo & everything was going according to plan even down to your message above about reflashing the rooted rom using 'upgrade' as a workaround for the failed busybox message & the driver installed properly. Then I expected that everything was good as driver status indicated that it was normal & fine but when I played audio it was not processing unfortunately. My question as I try to isolate the problem is which busybox you used? The method you pointed to (google drive) suggested 'busybox on rails' which failed for me then I tried steriksons which also failed & then I applied your workaround. I've heard the JRUMMY busybox is the functional one for our device & I'm attempting your reflash workaround to get jrummy busybox & viper driver running. Hopefully this works rendering the question moot but would help if you could let me know which busybox you used. Thanks
**update**
I've attempted 3 different busybox installs & have gotten the v4a driver to install with each (thanks to your workaround) & while driver shows Enabled & Status Normal with Audio Format Supported - Processing remains NO (using each different buysbox) with a variety of audio sources playing.
Any help beyond this point would be hugely appreciated!!

Question about Default.xml file

Hi, quick question about file stated in title - trying to edit few lines in it with no luck, as after reboot there is no changes applied. All permissions as should be, don't know how to bit this one. If someone could help with this one. In previous M8 there was no problem at all with this file, every changes were working like a charm, so I'm puzzled now with 10. Thank You in advance.
Garrett_PL said:
Hi, quick question about file stated in title - trying to edit few lines in it with no luck, as after reboot there is no changes applied. All permissions as should be, don't know how to bit this one. If someone could help with this one. In previous M8 there was no problem at all with this file, every changes were working like a charm, so I'm puzzled now with 10. Thank You in advance.
Click to expand...
Click to collapse
Mount /system as R/W and set SELinux to permissive
If You can elaborate bit more on this one, as I'm setting system as R/W with FX file manager and I flashed Selinux permissive fix from:
https://forum.xda-developers.com/htc-10/help/htc-10-getting-selinux-permissive-t3375317
Still changes are not applied.
Garrett_PL said:
If You can elaborate bit more on this one, as I'm setting system as R/W with FX file manager and I flashed Selinux permissive fix from:
https://forum.xda-developers.com/htc-10/help/htc-10-getting-selinux-permissive-t3375317
Still changes are not applied.
Click to expand...
Click to collapse
I think the attached.zip in that thread isn't working.
These may help.
https://forum.xda-developers.com/showthread.php?t=2524485
http://stackoverflow.com/questions/...or-permissive-mode-in-android-4-4-4-and-above
Cheers andybones, the app from the link that You posted was not supported for few years now and guided by member of xda named Ibuprophen I got to new one called SELinuxToggler which is under this link:
http://forum.xda-developers.com/show....php?t=3574688
But as I was looking for something that will stay after reboot I got into this:
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
and after #getenforce I'm getting permissive output, which is what I wanted. Link to that guide by mobiusm is here:
https://forum.xda-developers.com/g2-mini/general/guide-how-to-set-selinux-to-permissive-t3329439
Now I'll get back into editing that #!$#$ default.xml
Thank You all.

Categories

Resources