Make Viper4Android 2.4.0.1 work on Android 6.0 - Honor 5C Guides, News, & Discussion

I had some trouble trying to make Viper4Android v2.4.0.1 work on my Honor 5C running Android 6.0. This could be helpful…
Viper4Android didn't work after installation and reboot, the driver status showing as "abnormal". It seems related to a change in default SELinux policy.
I read that changing globally the SELlinux policy to "permissive" can solve the problem but it may be an extreme solution (SELinux is a security feature to restrict what an application can do, I don't know the potential edge effects).
I found another solution on the web, which consists in patching the SELinux policies at boot, just enough for Viper4Android to work.
If you did not make a systemless installation of SuperSU, open an adb shell and use these commands (courtesy of androiding.how):
Code:
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
chmod 755 50viper.sh
cd /
mount -o ro,remount /system
And reboot.
If you did make a systemless installation of SuperSU, open an adb shell and use this instead:
Code:
su
mount -o rw,remount /su
cd /su/su.d
echo '#! /system/bin/sh' > 50viper.sh
echo '/su/bin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"' >> 50viper.sh
chmod 755 50viper.sh
cd /
mount -o ro,remount /su
exit
And reboot.

Didn't work for me, tried the 2nd method as the first one gave an error at the 3rd step, completed everything, rebooted, still no luck

imrock said:
Didn't work for me, tried the 2nd method as the first one gave an error at the 3rd step, completed everything, rebooted, still no luck
Click to expand...
Click to collapse
I just noticed that in my 2nd block the characters ’ and ” were used instead of ' and ". I'm not a POSIX shell expert but since these are not the same characters it can make a difference.
I've updated the 2nd method, you can give it a try — you can use it "as it is", it will overwrite the previously created file.

This trick didn't work for me.
I ended up installing SELinuxModeChanger and now Viper is rockin' :good:

Related

with su access cannot modify /system

ok i have root access with busybox and su installed yet in terminal editor and adbshell i cannot remount my system as rw does anyone know why
ok update i got around my issue by using root explorer to get rw access on the system but still want to know why i cant do this
Sprint tab
How are you remounting it?
I always have good success with:
Code:
adb shell
su
remount rw /system
that is the exact code i have used and it gives me a not found error
Hmm. Check to see if /system/xbin/remount exists. If not, use Root Explorer to place this script at that location:
Code:
#!/system/bin/sh
#simplify mount rw and mount ro
#scripting wrote by forcystos - SDX - sdx-developers.com
#updated for samsunge epic by joeykrim - SDX - sdx-developers.com
case $1 in
rw)
echo "Remounting /system (/dev/stl9) in read/write mode"
/system/bin/mount -o remount,rw /dev/stl9 /system;;
ro)
echo "Remounting /system (/dev/stl9) in read-only mode"
/system/bin/mount -o remount,ro /dev/stl9 /system;;
*)
echo "usage: remount rw -or- remount ro";;
esac
Remember to change mode to 744 before executing.

For your concideration: Getting around the locked bootloader and missing loop ko

This is my first post here, but I figured I'd share this since doesn't appear to have been done yet.
As I'm sure most of you know the locked bootloader introduces challenges to getting your favo(u)rite flavo(u)r of linux on to the Droid 2.
I expect that you have rooted your phone and have busybox installed/working...
Normally when one wants to do this they get a linux image file and mount it as a loop device and then chroot to it's mounted folder. Because one can create a loop device but can't mount it.
My solution has been a "simple" one but may not have been tried:
Extract the contents of the image on a separate system and then push everything to /data/local/mnt.
For instance I set up a loop device on Ubuntu:
losetup /dev/loop0 /home/usernamehere/distributionnamehere.img
mount -t ext2 /dev/loop0 /home/usernamehere/somemountfoldername​
Then I remove security stuff:
sudo chmod 777 /home/usernamehere/somemountfoldername
sudo adb shell
chmod 777 /data/local/mnt
exit
sudo adb push /home/usernamehere/somemountfoldername /data/local/mnt​
(Wait for the push to happen stop it when you see X11/X11/X11/X11 or remove that symbolic link before pushing. If you stop it you'll have to push the other folders separately)
After it's done the bootubuntu which points to that /data/local/mnt share (or /data/local/ubuntu or /data/local/debian or whatever) should throw a few errors about mounting which is expected because we haven't fixed the fact that loop devices aren't mountable, but since we pushed the files to the 'mount' directory, the script finds it anyways and chroots to the /data/local/mnt and runs /data/local/mnt/bin/bash (or /bin/bash from the chroot point of view.)
This will get you to the root prompt.
I'm still working on getting the bash: groups: message to go away, but I think that is just that I didn't get everything copied initially.
Also I have yet to finish setting up VNC.
Anyway I hope this helps some people out.
I may do a script or more complete instructions later if requested.
Thanks,
Sky Adams
Thanks, I've been stumped by this for awhile. Your method allowed me to push the files but my script still doesn't find it. I'm going to need you to post your bootubuntu script. I have an image from androidclone.com that has vnc setup already, just need to get it to execute.
Confirmed working on rooted Droid X. Used Lakia image from androidclone dot com
1) Partitioned 16GB SD: Shrink to 11.9 GB leaving ~4GB. Then create new ext3 partition in free space
2) mount ext3 partition and create the loop to the image as skrull mentioned above.
3) then just "[email protected]# cp -r pathtoloopiface/* pathto4gbmount/"
4) takes a while but preserves the symlinks to avoid the X11/X11/X11/ issue above. (I think the reason you were having problems with the bash at the end, was an incomplete adb transfer of the /usr folder and probably no /var transfer at all. At least that was the case when I tried.)
5) push and chmod 777 this bootubuntu script to /system/bin:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
mount -t ext3 /dev/block/mmcblk0p2 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
echo " "
echo " "
echo "Ubuntu 10.10 - Laika Edition by Androidclone.com "
echo "Website:http : / /www . androidclone . com"
echo "Email:[email protected] . com"
chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
# the fuser command below allows us to kill all processes using the mount.
# otherwise umount will fail and the vnc session will still be alive.
# if it fails just run the fuser and umount again manualy.
fuser -k $mnt
umount $mnt
6) make sure there is a path to /data/local/mnt on the device and just run 'bootubuntu' from a root shell. you should get: "[email protected]/#:"
7) read the site on androidclone dot com for details on logging into the already running vnc service for a full LXDE session.
8) happy hacking.
D2G
any idea if this could free up the bootloader for the D2G allowing us to modify radio?
No, this will not circumvent the bootloader to load custom kernels. But who cares. many of the things we want, added features etc., can be loaded up in the form of kernel modules. I am not proficient enough to be able to compile my own modules yet but i'm working on a few things.
Radio
Can a kernal module be used to change the radio?
Good share, thank you very much.
ARGH!
I have probably spent 8 to 10 hours trying to get Ubuntu to boot. It seems that I cannot mount the path it wants to mount.
I can as it would seem to do this in shell it self, but still have some errors.
Do you think if I SBF my Droid X then root it - then follow the directions this would work. I am at an end now...and frustrated

[HOWTO] Add init.d to stock ROM + a few other goodies

I have been resisting the urge to flash a custom ROM for a bit, but I really miss having init.d support. So I read a few threads for other phones and rolled my own.
Warnings
I borrowed bits and pieces from various places. If you don't know what init.d is, you probably don't want to do this. If you aren't willing to take responsibility for bricking your tablet, don't do this. Seriously, the risk of bricking is very low, but if you aren't comfortable booting into an adb shell from recovery, maybe this is not for you. Strongly suggest a nandroid backup before you get started so if you totally bork things you can just hit rewind.
Note: The latest CWM may prompt you on a reboot that the ROM may overwrite the bootloader and offer to fix it for you. Don't do that. The init.d hack takes over the bootloader install script, but does not change your bootloader! If you accidentally do let it fix things for you, just rebuild the install-bootloader.sh file. The other steps should be fine.
Prerequisites
First, you need root, busybox, and some sort of terminal (either adb, or some terminal you like using on the tablet).
I have found that I like Busybox Installer (from the market; https://play.google.com/store/apps/details?id=com.jrummy.busybox.installer) but for some reason it doesn't create new symlinks unless you click advanced install.
Let's get to it!
In the shell (don't type # or anything after #):
Code:
su # get root
mount -o remount,rw /system # get access to /system (4.04 seems to mount ro as is usual; seems like the original mounted rw)
which run-parts # if you don't see /system/xbin/run-parts you need to install/reinstall busybox; if it is somewhere else, note it
mkdir /system/etc/init.d
Create a file called sysinit -- we are going to put it in /system/bin. You can edit it in place with vi, mount your tablet and edit it on your computer, or create it on the computer and push it via adb. Whatever.
Here's the file (you do need the # and the things after it in the file!):
Code:
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d
Note that if your run-parts is not in /system/xbin (from the which command) then fix the above to reflect your reality.
In the shell, make it executable
Code:
chmod 755 /system/bin/sysinit
Now go in the init.d directory and create some things you want to run at start up. For example:
Code:
cd /system/etc/init.d
echo '#!/system/bin/sh' >99test # note: you do need the first # in this line but not the 2nd!
echo 'date >>/data/tmp/init.d-log.txt' >>99test
chmod 755 99test
Here's a more practical one (yes, you need the # signs). Name it something like 10diskperf -- don't forget to chmod it.
Code:
#!/system/bin/sh
# Set disk read aheads to 1024
chmod 777 /sys/block/mmcblk0/queue/read_ahead_kb
echo "1024" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 777 /sys/block/mmcblk1/queue/read_ahead_kb
echo "1024" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 777 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "1024" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Or here is one to tweak some TCP parameters (25sysctl):
Code:
#!/system/bin/sh
sysctl -w net.core.rmem_max=524288
sysctl -w net.core.wmem_max=524288
sysctl -w net.ipv4.tcp_rmem=6144 87380 524288
sysctl -w net.ipv4.tcp_wmem=6144 87380 524288
Whatever files you put in, you need to remember to make them executable (chmod 755).
Finally, you need to kick it all off at start up. The hack for that is we are going to create /system/etc/install-recovery.sh which apparently runs on each boot.
Code:
cd /system/etc
echo '#!/system/bin/sh' >install-recovery.sh
echo '/system/bin/sysinit' >>install-recovery.sh
chmod 755 install-recovery.sh
Tips and troubleshooting
If you are too lazy to cut and paste I have the files here (View attachment init.d-support.zip) that you can just move to the right places and change permission. If you are really lazy there is lightly tested install script below.
I like to try running the whole thing before a reboot to see if I get any errors:
Code:
/system/etc/install-recovery.sh
I'd suggest putting the 99test file in first. Verify that you get the expected file in /data/tmp and then reboot and check again. Then you can remove 99test.
Same goes for adding new scripts. Try running them from the shell to see if they throw errors before you reboot!
If you have trouble, see if this looks right:
Code:
ls -ld /system/etc/install-recovery.sh /system/bin/sysinit /system/etc/init.d /system/xbin/run-parts
-rwxr-xr-x root root 39 2012-07-14 10:00 install-recovery.sh
-rwxr-xr-x root root 140 2012-07-14 10:01 sysinit
drwxrwxrwx root root 2012-07-14 10:10 init.d
lrwxrwxrwx root root 2012-07-14 09:55 run-parts -> /system/xbin/busybox
For the brave
The install-init.d zip file (View attachment install-init.d.zip) contains a lightly tested script that SHOULD do the install steps for you.
Send the file to your android to someplace that can execute code (e.g., /system/xbin; I had to use adb to put it on the sdcard and then move it to /systemxbin in the shell since I don't have the adb root kernel installed).
Code:
cd /system/xbin # or wherever you have it
chmod 755 install-init.d
./install-init.d
It performs rude checks to see if init.d exists, and tries to handle moving or missing busybox. It only installs 99test as a script.
Let me know if this works or doesn't work for you.
For the extra brave: There is no reason this should only work on the Samsung. This ought to work on pretty much most stock ROMs as long as they execute install-recovery.sh on start up.
Scripts
What do you put in your init.d? If you post anything cool I'll put it up here in the op.
One that gave me some real gains in I/O performance required a new version of the tune2fs executable. By default, it is part of busybox but the busybox one only has a few simple options. I've included a stand alone version and the script 10disktune here View attachment disktune.zip. Unpack the zip and put the 10disktune in /system/etc/init.d (don't forget to chmod) and put tune2fs in /system/bin (chmod that too). Note that busybox has one in /system/xbin but the script specifically calls out the one in /system/bin.
Here's one that will zipalign your apks on each boot
Code:
#!/system/bin/sh
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk
ZCHECK=$?
if [ $ZCHECK -eq 1 ]; then
zipalign -f 4 $apk /cache/$(basename $apk)
if [ -e /cache/$(basename $apk) ]; then
cp -p -f /cache/$(basename $apk) $apk
rm /cache/$(basename $apk)
fi;
fi;
done;
Fin
Corrections welcome. I considered using exec or . to load some of this into one shell but given that it runs once at startup, I figured it is fine as is.
All files for reference
View attachment init.d-support.zip
View attachment install-init.d.zip
View attachment disktune.zip
Great guide, gonna try it tonight.
Sent from a GNote, hell yeah!
SirRhor said:
Great guide, gonna try it tonight.
Sent from a GNote, hell yeah!
Click to expand...
Click to collapse
I'm curious how it went. If you ran into any issues, let me know so I can update the op. Thanks!
Hmm did anyone get this to work?
wd5gnr said:
Hmm did anyone get this to work?
Click to expand...
Click to collapse
I did it on my Galaxy Nexus.
It works great, I had a bit of problem with the sysinit file, but when I downloaded your zip file and used your sysinit, it worked, so it must be a problem from my side
Thanks for this, I can finally use "Odex Me"
aavan said:
I did it on my Galaxy Nexus.
It works great, I had a bit of problem with the sysinit file, but when I downloaded your zip file and used your sysinit, it worked, so it must be a problem from my side
Thanks for this, I can finally use "Odex Me"
Click to expand...
Click to collapse
Great, just wanted to be sure I hadn't made any typos/errors in the guide.
A lot of init.d files collected here: http://forum.xda-developers.com/showthread.php?t=1227269
Also build.prop things, etc.
Thanks, I use your guide and worksperfect for my RK3066 devices. Very simple to understand all steps and what we are doing to our system, perfect for me. Thanks again dude
Melch1zedeK said:
Thanks, I use your guide and worksperfect for my RK3066 devices. Very simple to understand all steps and what we are doing to our system, perfect for me. Thanks again dude
Click to expand...
Click to collapse
Glad to help!
What is thhe utility of this?
moliverac8 said:
What is thhe utility of this?
Click to expand...
Click to collapse
Init.d is how Linux and many Android (which is kind of Linux, after all) systems manage executing commands on boot up.
The /etc/init.d files run in numerical order as root and you can do things like change system settings, manipulate the file system, etc.
See the init.d section linked below for some ideas.
http://forum.xda-developers.com/showthread.php?t=1227269
Question? what is the difference in this method and running a script?
wd5gnr said:
Init.d is how Linux and many Android (which is kind of Linux, after all) systems manage executing commands on boot up.
The /etc/init.d files run in numerical order as root and you can do things like change system settings, manipulate the file system, etc.
See the init.d section linked below for some ideas.
http://forum.xda-developers.com/showthread.php?t=1227269
Click to expand...
Click to collapse
I use the "swap memory script" and was wondering if it would also work this way with the init.d If so would there be any benefit this way over the current way of running it one way or the other? One drawback I see running the script as is is that I have to wait once the system has fully booted until the script has run and I see the Smanager screen to let me know that my memory has been remounted.
Thanks for the info and the learning process.
Here is the script and the link.
http://forum.xda-developers.com/showthread.php?t=1961097
Code:
sleep 5
mount -o remount,rw /
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
sleep 5
mount -o bind /data/media /mnt/extSdCard
As long as the device is ready to mount at boot time and doesn't get remounted, ought to work. Backup and try it
External memory wasn't ready
wd5gnr said:
As long as the device is ready to mount at boot time and doesn't get remounted, ought to work. Backup and try it
Click to expand...
Click to collapse
Thanks for the guide, but I think that the external memory was not ready to be mounted at that time. it didn't see the card till after boot. It was worth a shot, Reverted back to the script in /data and all worked again,
Note: I didn't find /system/xbin/run-parts however, I did find /system/bin/run-parts and changed the path to reflect that, I don't think this was an issue but I'm not 100% sure.

i9506 I9506XXUCNJ1 - SElinux whatever I try, stays Enforcing

Hello, I have a huge problem with this firmware - but just a particular one. I had tried to go to the 5.0.1 (I9506XXUDOE4) where it worked fine, but I didn't like the UI and the OTG functionality didn't work at all.
I have moved back to the older ROM I was using before, running selinux in enforcing mode with a major problem - not able to write on NTFS formatted devices. Actually, a little problem was also on the Lollipop firmware with the CF AutoRoot but DeHAWK kernel solved it. Therefore I tried to move back on I9506XXUCNJ1 and decided to try this kernel out if it helps - but it didn't.
The SElinux status isn´t even showed up in the "About device" section.
What I tried already:
Paragorn SElinux set to Permissive (see screenshots what it does)
init.d 01selinux script
SELinuxModeChanger (changes back to enforcing when I start it again - actually does nothing)
CODE1:
Code:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "echo 0 > /sys/fs/selinux/enforce" >> /system/su.d/permissive.sh
chmod 755 > /system/su.d/permissive.sh
CODE2:
Code:
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
Please help
A little bump, please help.

SuperSU not autostarting

Hello, I hope someone has seen this before. I am not sure how I managed to break S7, as it was working, initially. I am running PE1 firmware, and factory reset before following the root guide, in the verizon guide forums. But now I have the problem where supersu will not auto start on bootup. I have to connect the usb cable to my pc, and use adb and manually start it. Root and Supersu are loaded. The only thing I have to run is:
C:\adb\adb.exe shell /system/etc/launch_daemonsu.sh
Then disconnect the usb cable, and all is well. Everything seems to be correct. What am I missing? I really do not want to start completely over. I have run the verizon debloat v2 and v8. I had to manually start supersu to flashfire the v8 script. Also in the same guide. All the root checker apps will see that you have root, but they say you are missing a super user app.
C:\adb\adb.exe shell /system/etc/launch_daemonsu.sh
mkdir: '/su': File exists
cp: /cache/stock_boot_*: No such file or directory
cp: bad '/cache/stock_boot_*': No such file or directory
/data/su.img: recovering journal
ext2fs_close2 : fs->write_bitmaps is null
ext2fs_close2 : normal operation, return 0
skipping journal recoverybecause INCOMPAT_RECOVER was clear.
check whether gdt & bitmap free count is vaild
/data/su.img: clean, 25/2048 files, 1399/8192 blocks
ext2fs_close2 : fs->write_bitmaps is null
ext2fs_close2 : normal operation, return 0
mount: No such file or directory
mount: No such file or directory
supolicy v2.74 (ndk:arm64-v8a) - Copyright (C) 2014-2016 - Chainfire
Patching policy ...
(Android M policy compatibility mode)
- Success
<Then disconnect the usb cable, supersu will work fine now.>
C:\adb>adb shell cat /system/etc/init.sec.boot.sh
#!/system/bin/sh
echo "init.sec.boot.sh: start" > /dev/kmsg
# start deferred initcalls
cat /proc/deferred_initcalls
## strace for system_server
#str=""
#while [ "$str" = "" ]; do
# str=`ps | grep system_server`
# sleep 0.1
#done
#
#pid=${str:10:4}
#echo "init.sec.boot.sh: strace -tt -T -o /data/log/strace.txt -p ${pid}" > /dev/kmsg
#strace -tt -T -o /data/log/strace.txt -p ${pid}
/system/etc/launch_daemonsu.sh
/data/s7startup/startupscript.sh
C:\adb>adb shell ls -la /system/etc/launch_daemonsu.sh
-rwx------ root root 4686 2016-07-03 13:32 launch_daemonsu.sh
Thanks again.
Did you push the supersu app to you device?
Is that to say uve got supersu installed but it won't start? If that's so I would check the box for start supersu during bootup. Unless im just completely missing your issue and im sorry if I am.

Categories

Resources