[Android Software/Hacking General [Developers Only]] idcrisis:
Even though it's probably reading from /dev/random, since it now links to /dev/urandom the reported entropy is probably the urandom value. Even if you make rngd read from urandom and write to random.fake, the system entropy available increases and flatlines at 4096 ( tested on multilple devices).

root@android:/etc # sysctl -a 2>/dev/null| grep -i random

kernel.random.poolsize = 4096

kernel.random.entropy_avail = 4096

kernel.random.read_wakeup_threshold = 1333

kernel.random.write_wakeup_threshold = 4096

kernel.random.boot_id = 3f663677-fadb-43cb-ada6-38055ac85319

kernel.random.uuid = 7bbe578f-ba65-44ce-b712-60cd54ff5c98

kernel.randomize_va_space = 2

And even a thousand entropy extractions do not budge it:

root@android:/etc # i=1; time while [ $i -le 1000 ]; do dd if=/dev/random count=4 bs=1 2>/dev/null | od -t d ; i=$(( $i + 1 )); done

root@android:/etc # sysctl -a 2>/dev/null| grep -i random

With rngd feeding random.fake every 30 seconds and wakeup threshold parameters set:

...

0000004

0000000 603503916

0000004

0000000 290545071

0000004

0000000 1013303325

0000004

0000000 -841198880

0000004

0m7.59s real 0m0.14s user 0m1.07s system

root@android:/etc # sysctl -a 2>/dev/null| grep -i random

kernel.random.poolsize = 4096

kernel.random.entropy_avail = 4096

kernel.random.read_wakeup_threshold = 1333

kernel.random.write_wakeup_threshold = 4096

kernel.random.boot_id = 3f663677-fadb-43cb-ada6-38055ac85319

kernel.random.uuid = 46ba109d-6cae-4190-8644-8ff5c23a3347

kernel.randomize_va_space = 2

With rngd stopped but wakeup threshold parameters set only it does fall to the 3585 mark:

0000004

0000000 815406837

0000004

0000000 -1262486870

0000004

0000000 -1158503135

0000004

0000000 -1295312115

0000004

0000000 -839947554

0000004

0m8.87s real 0m0.15s user 0m1.14s system

root@android:/etc # sysctl -a 2>/dev/null| grep -i random

kernel.random.poolsize = 4096

kernel.random.entropy_avail = 3585

kernel.random.read_wakeup_threshold = 1333

kernel.random.write_wakeup_threshold = 4096

kernel.random.boot_id = 3f663677-fadb-43cb-ada6-38055ac85319

kernel.random.uuid = 76a28009-e939-4be7-98b4-634fb0e11759

kernel.randomize_va_space = 2

This can also be seen in the GUI of any app showing realtime values of available entropy.

Also this command does hang as expected and has to be broken after a few ( < 5 ) generated numbers with stock /dev/random and kernel parameters and no rngd. This is due to the expected entropy depletion and blocking device and entropy available shows under 50:

i + 1 )); done <

0000000 -91390521

0000004

0000000 872735077

0000004

0000000 1904929066

0000004

0000000 1813612354

0000004

^C

130|root@android:/ # sysctl -a 2>/dev/null | grep -i random

kernel.random.poolsize = 4096

kernel.random.entropy_avail = 45

kernel.random.read_wakeup_threshold = 64

kernel.random.write_wakeup_threshold = 128

kernel.random.boot_id = 5fbab7d8-5254-4865-9342-5bfe51f9b8a5

kernel.random.uuid = 4b56afb8-ee70-4a69-941a-a849064f6d9a

kernel.randomize_va_space = 2

root@android:/ #

One option is to make /dev/random a hard link to /dev/urandom during creation itself ( as opposed to deleting it later ). That will required kernel source code change perhaps. Because what seems like some references to the /dev/random device may still exist in the kernel memory space or something. Something similar to this but not visible to lsof as it's a kernel pointer:

root@android:/etc # lsof | grep -i random | grep -v urandom

rngd 28740 root 4 ??? ??? ??? ??? /dev/random.fake (deleted)

Also of note is that if you disable CrossBreeder and keep only Seeder enabled, then entropy values fluctuate between ~2000 and 4096 every 2 seconds under normal load as it feeds the random device and ~500 and 4096 under the dd entropy depletion test above, perhaps slightly more undesirable than flatlining at 4096.