[Android Software/Hacking General [Developers Only]] haoyangw:
My thoughts and guesses

Indeed it has something to do with SELinux for sure, there was once I was on this ROM where Seeder failed initially, but works again after setting SELinux to Permissive. But I think there's some other security features in newer Android ROMs that prevent Seeder from working, now I'm on a newer Android ROM and Seeder doesn't work even with SELinux set to Permissive :( The way Seeder requests for root permission and also detect whether rngd binary is running no longer works in newer Android ROMs with tighter security. I decided to try fixing these 2 issues myself, so I decompiled Seeder v2.0.0 apk and checked the code responsible for the above 2 things(I'm sorry about having to use the unorthodox way of decompiling apps).

The code for checking for root

I found the code responsible for requesting root and tried the commands in Terminal Emulator.

if [ \"$UID\" != \"1\"; then exit 1; fi

It no longer works :(

The solution

So I went to ChainFire's website to read up on how to check and request for root permission(he has an updated guide 'How to SU' on many root related operations like checking for root), and derived my own command for checking whether root is available and granted:

id | grep uid=0

For this command, only if root is available and granted, the command will return '0'. Otherwise, if the 'id' binary does not exist, root is not granted/available, or some other problem occurred, the command will return other return codes. So to check for root, I'll execute the above command and then check if the return code is 0(meaning root granted).

The code for checking if rngd binary is running/started successfully

I then found the code responsible for checking if rngd binary is running after you press the 'On/Off' button. This time it isn't shell commands anymore, but Java code, so I'll explain it in words. Basically the app(not running as root) reads '/data/rngd.pid', which is a file generated by the rngd binary that contains its PID, and then reads another file, '/proc/<PID>/cmdline'(<PID> is the PID number read from '/data/rngd.pid'), which states where exactly the binary that is running in the process is. Lastly there is code to check that the binary running in the process is the rngd binary of the Seeder app, so as to verify that rngd is running successfully.

The problem

This time I cannot run the commands in Terminal Emulator to see what is wrong(because it's not shell commands), but I kind of know what is wrong here. I suspect that Problem #1 is in newer versions of Android(especially with SELinux set to Enforcing) apps that are not running as root can no longer read files in the /data folder freely(except in its own app direcetory). Problem #2 I suspect is for the same reasons as above, Android no longer allows apps not running as root to read the cmdline file of processes. I cannot figure out why on some ROMs the Seeder app still works while on others it doesn't(maybe different ROMs have slightly different levels of security?), but I have found a solution.

The solution

There is a shell equivalent of the Java commands for reading files, 'cat', which returns the contents of a file. So I derived the following combined shell command to read '/data/rngd.pid' and /proc/<PID>/cmdline, and then check if it is the rngd binary from the Seeder app running in it:

cat /proc/`cat /data/rngd.pid`/cmdline | grep /data/data/com.lcis.seeder/rngd

I ran this command as root, and wrapped Java code around it to check that the return code from the command is '0'(which means positive/verified for all the checks). It works as intended

Product

I baksmali-ed the Seeder V2.0.0 apk(again I do apologise for resorting to this) and did some smali edits to replace the old commands/code with the new ones that work as intended, then recompiled it with smali. I installed the updated app and can verify that it works properly on XenonHD(based on LineageOS 14.1) Nougat Android 7.1.2, build date June 5 2017. If you want the updated app, go to the post below.

Thanks for reading this (slightly unnecessarily) detailed post about the problems with Seeder in newer Android versions.