[APK] Seeder 2.0.0 entropy generator to provide significant lag reduction

Search This thread

MajicDroidPirate

Senior Member
Jan 18, 2012
307
89
ASUS ROG Phone 3
You know I gotta say, I know this is made for "older android versions" and aosp roms...but its working wonders on my s7 naught 7.0 with stange5litre which is a touchwiz rom( I believe) with haoyangw mod .(was getting errors without mod.) Anyway thanks a to both of you and I hit thanks on both posts...really appreciate this! I was about to ditch the rom before I found this but now its running sooo smooth!
 
Last edited:

aSadArtist

Member
Jan 30, 2018
16
1
Pretty silly but I had trouble starting this up even with root access and SELinux set to permissive, and was trying a bunch of things until I realised it won't work if the app itself happened to be installed in adoptable storage. Moved it to internal storage and it works properly.
 

Cjoman

Member
Apr 18, 2018
32
6
Same with me did you fix??

---------- Post added at 11:55 PM ---------- Previous post was at 11:50 PM ----------

Thank you!! It works now!!
 

davidzam

Senior Member
Apr 12, 2011
839
113
Mérida
I hope I have not broken any laws or XDA rules, or antagonised anyone because of decompiling and recompiling an app, I honestly did all of this with good intentions and only modified the code that are no longer working. If I have broken any laws/rules please tell me I'll delete this post and the above post. I did NOT inject malicious code or viruses into the app or do this so as for commercial purposes. If you do not trust me because I'm not the original developer(I understand), feel free to edit the app yourself, who knows you might find better solutions :) If you don't mind share your solutions with us here! For details on what is wrong in newer Android versions look here Credits to @lambgx02 for making this amazing app, I am seriously a newbie to Android development and cannot have written something anywhere close to this good. All I have done is update snipplets of his code to work in newer Android versions, I have no part in writing any code in this app. And with all due respect @lambgx02 I also mean no offence in writing/doing all this, I am not calling your app outdated or you a lousy developer, all this is because of updates to Android's security framework which in no way is your fault, and this app is really amazing and useful as many others have said. Thank you so much for this app ^_^
Note: This app is signed with a different signature(because I obviously do not have lambgx02's developer signature) so you will have to uninstall any versions of Seeder that you already have. But don't worry you won't lose anything if you uninstall Seeder and install this, just configure Seeder again to your preferences :)

Does this work under Android marshmallow 6.0.1? I´m looking for something to improve my lagging devise, Im on stock rom 6.0.1 from samsung using adoptable storage, xposed, etc, also on SSD Boost. Using Kernel auditor to chang cpu governor performance (on stock kernel, can´t overclock) there i can se entropy option to internal memory and to external memory (sd), it woukd be posible to manipulate there ir this app ddo that... cand you help me on that reggard? thanks
 

ttocs99

Senior Member
Jan 26, 2011
1,943
297
middlesbrough
Moto Z Play
I hope I have not broken any laws or XDA rules, or antagonised anyone because of decompiling and recompiling an app, I honestly did all of this with good intentions and only modified the code that are no longer working. If I have broken any laws/rules please tell me I'll delete this post and the above post. I did NOT inject malicious code or viruses into the app or do this so as for commercial purposes. If you do not trust me because I'm not the original developer(I understand), feel free to edit the app yourself, who knows you might find better solutions :) If you don't mind share your solutions with us here! For details on what is wrong in newer Android versions look here Credits to @lambgx02 for making this amazing app, I am seriously a newbie to Android development and cannot have written something anywhere close to this good. All I have done is update snipplets of his code to work in newer Android versions, I have no part in writing any code in this app. And with all due respect @lambgx02 I also mean no offence in writing/doing all this, I am not calling your app outdated or you a lousy developer, all this is because of updates to Android's security framework which in no way is your fault, and this app is really amazing and useful as many others have said. Thank you so much for this app ^_^
Note: This app is signed with a different signature(because I obviously do not have lambgx02's developer signature) so you will have to uninstall any versions of Seeder that you already have. But don't worry you won't lose anything if you uninstall Seeder and install this, just configure Seeder again to your preferences :)
Working great on lineage 14.1 galaxy s6 cheers
 

Giowi

Senior Member
Jul 27, 2014
438
104
Seeder doesn't work on Samsung tablet n5120 with Resurrection Remix 7.1.2 Screenshot_20180708-175159.jpeg
 

ciberjack

Member
Jan 14, 2008
16
1
Hy i bought the app on playstore

When i click the button side "enable seeder lago reduction" i have thin message:

Seeder was unable to start the RNG service this happends if tour device is not rooted...
...ceck your super user or binary installation or try restart the device"

What fan i do tu run it?

S6 g925f
The life if phone: stock>CF autoroot>twrp>revolutionremix latest android 8.1>magisk>busybox

No other installed exception VPN,whatsapp, luckypatcher
 

ooonea

Senior Member
Apr 19, 2015
68
21
Siena
Thanks

I hope I have not broken any laws or XDA rules, or antagonised anyone because of decompiling and recompiling an app, I honestly did all of this with good intentions and only modified the code that are no longer working. If I have broken any laws/rules please tell me I'll delete this post and the above post. I did NOT inject malicious code or viruses into the app or do this so as for commercial purposes. If you do not trust me because I'm not the original developer(I understand), feel free to edit the app yourself, who knows you might find better solutions :) If you don't mind share your solutions with us here! For details on what is wrong in newer Android versions look here Credits to @lambgx02 for making this amazing app, I am seriously a newbie to Android development and cannot have written something anywhere close to this good. All I have done is update snipplets of his code to work in newer Android versions, I have no part in writing any code in this app. And with all due respect @lambgx02 I also mean no offence in writing/doing all this, I am not calling your app outdated or you a lousy developer, all this is because of updates to Android's security framework which in no way is your fault, and this app is really amazing and useful as many others have said. Thank you so much for this app ^_^
Note: This app is signed with a different signature(because I obviously do not have lambgx02's developer signature) so you will have to uninstall any versions of Seeder that you already have. But don't worry you won't lose anything if you uninstall Seeder and install this, just configure Seeder again to your preferences :)

Thenk you so much. Now this module works fine on my Xiaomi Redmi 5 Plus by dotOS 2.4 and Magisk 16.7.
 

haoyangw

Senior Member
Seeder doesn't work on Samsung tablet n5120 with Resurrection Remix 7.1.2
Hmm did you try the modded one I posted in the previous page? The one in the OP is not updated, and broke in new versions of Android

---------- Post added at 02:39 PM ---------- Previous post was at 02:37 PM ----------

Hy i bought the app on playstore

When i click the button side "enable seeder lago reduction" i have thin message:

Seeder was unable to start the RNG service this happends if tour device is not rooted...
...ceck your super user or binary installation or try restart the device"

What fan i do tu run it?

S6 g925f
The life if phone: stock>CF autoroot>twrp>revolutionremix latest android 8.1>magisk>busybox

No other installed exception VPN,whatsapp, luckypatcher
Oh unfortunately the one in play store doesn't work in newer versions of Android, try the one I posted a few pages back!
 
  • Like
Reactions: Giowi

Costa02

Senior Member
Apr 3, 2016
414
103
Hmm did you try the modded one I posted in the previous page? The one in the OP is not updated, and broke in new versions of Android

---------- Post added at 02:39 PM ---------- Previous post was at 02:37 PM ----------


Oh unfortunately the one in play store doesn't work in newer versions of Android, try the one I posted a few pages back!
it's working here too
oreo 8.1 aoscp
 
  • Like
Reactions: yyz71

Pyt02

New member
Aug 29, 2018
1
0
The latest Seeder's version doesn't recognize my root (done with Magisk)

Hi everyone, I've got a Samsung Galaxy A5 2017 and when I opened the app after the installation, I received this message:

"Seeder was unable to start the RNG service. This usually happens if your device is not rooted or if Seeder is been denied root privileges. Check your superuser and/or su binary installation, or try restarting your device."

How can I solve it? Thank you very much.

Android Oreo 8.0
 

xlinkprince

Senior Member
Oct 26, 2012
56
2
Hi everyone, I've got a Samsung Galaxy A5 2017 and when I opened the app after the installation, I received this message:

"Seeder was unable to start the RNG service. This usually happens if your device is not rooted or if Seeder is been denied root privileges. Check your superuser and/or su binary installation, or try restarting your device."

How can I solve it? Thank you very much.

Android Oreo 8.0

Same here, using magisk, even permission root already checked....
 

haoyangw

Senior Member
Hmm did the 2 of you above use the apk from below, or the apk in the OP? Also is SELinux Permissive or Enforcing on your devices?

I hope I have not broken any laws or XDA rules, or antagonised anyone because of decompiling and recompiling an app, I honestly did all of this with good intentions and only modified the code that are no longer working. If I have broken any laws/rules please tell me I'll delete this post and the above post. I did NOT inject malicious code or viruses into the app or do this so as for commercial purposes. If you do not trust me because I'm not the original developer(I understand), feel free to edit the app yourself, who knows you might find better solutions :) If you don't mind share your solutions with us here! For details on what is wrong in newer Android versions look here Credits to @lambgx02 for making this amazing app, I am seriously a newbie to Android development and cannot have written something anywhere close to this good. All I have done is update snipplets of his code to work in newer Android versions, I have no part in writing any code in this app. And with all due respect @lambgx02 I also mean no offence in writing/doing all this, I am not calling your app outdated or you a lousy developer, all this is because of updates to Android's security framework which in no way is your fault, and this app is really amazing and useful as many others have said. Thank you so much for this app ^_^
Note: This app is signed with a different signature(because I obviously do not have lambgx02's developer signature) so you will have to uninstall any versions of Seeder that you already have. But don't worry you won't lose anything if you uninstall Seeder and install this, just configure Seeder again to your preferences :)
 
Oct 5, 2016
41
2
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Experimental:

- Try to change SELinux policy rules on Android to allow running Seeder in SELinux "enforcing" mode.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Requires:
-> root permission (Of course, it only works if device is rooted.)
-> busy-box (Probably required, install from playstore)
-> sepolicy-inject (Tool to inject SELinux policies, get it from xda http://forum.xda-developers.com/android/software/setools-android-sepolicy-inject-t2977563 )
-> dmesg, grep, mount, load_policy (May or may not be on your device or installed from busy-box)
-> tasker (For applying SELinux policies on boot, install from playstore)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Get avc:

[email protected]:/ # dmesg | grep 'avc' | grep 'seeder'

[12825.053112] [c1] type=1400 audit(1467559720.620:6554): avc: denied { search } for pid=23738 comm="com.lcis.seeder" name="10899" dev="proc" ino=263544
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:sudaemon:s0 tclass=dir permissive=0

[ 221.284770] [c1] type=1400 audit(1467650701.669:1112): avc: denied { read } for pid=6553 comm="com.lcis.seeder" name="cmdline" dev="proc" ino=42921
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:sudaemon:s0 tclass=file permissive=0

[ 541.577696] [c1] type=1400 audit(1467651021.964:1128): avc: denied { open } for pid=6553 comm="com.lcis.seeder" path="/proc/8520/cmdline" dev="proc" ino=67725
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:sudaemon:s0 tclass=file permissive=0

[ 681.807999] [c1] type=1400 audit(1467651162.194:1141): avc: denied { getattr } for pid=6553 comm="com.lcis.seeder" path="/proc/8860/cmdline" dev="proc" ino=59338
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:sudaemon:s0 tclass=file permissive=0

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#New rules:

[email protected]:/ # su
[email protected]:/ # mount -o 'rw,remount' -t rootfs /
[email protected]:/ # sepolicy-inject -v -s 'untrusted_app' -t 'sudaemon' -c 'dir' -p 'search' -P './sepolicy'
[email protected]:/ # sepolicy-inject -v -s 'untrusted_app' -t 'sudaemon' -c 'file' -p 'read,open,getattr' -P './sepolicy'
[email protected]:/ # load_policy './sepolicy'

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#One line:

[email protected]:/ # su
[email protected]:/ # mount -v -o 'rw,remount' -t rootfs / && sepolicy-inject -v -s 'untrusted_app' -t 'sudaemon' -c 'dir' -p 'search' -P './sepolicy' && sepolicy-inject -v -s 'untrusted_app' -t 'sudaemon' -c 'file' -p 'read,open,getattr' -P './sepolicy' && load_policy './sepolicy'

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Output:

libsepol.policydb_index_others: security: 1 users, 2 roles, 579 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 87 classes, 5356 rules, 0 cond rules
Adding rule: [AV] ALLOWED untrusted_app-->sudaemon (dir) [search]
Success
libsepol.policydb_index_others: security: 1 users, 2 roles, 579 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security: 87 classes, 5357 rules, 0 cond rules
Adding rule: [AV] ALLOWED untrusted_app-->sudaemon (file) [read]
Adding rule: [AV] ALLOWED untrusted_app-->sudaemon (file) [open]
Adding rule: [AV] ALLOWED untrusted_app-->sudaemon (file) [getattr]
Success

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Result:

[email protected]:/ # dmesg | grep 'avc' | grep 'seeder'
--> No ouput, cause there are no more "avc: denied" for Seeder.

[email protected]:/ # getenforce
Enforcing
--> SELinux status is still "enforcing".

[email protected]:/ # ps | grep 'rngd'
root 6740 1 25444 240 hrtimer_na 00039fe4 S /data/data/com.lcis.seeder/rngd
--> "Rngd"-Service seems to be up and running.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Conclusion:

Seeder is running even if SELinux is set to 'enforcing' and does not through any error messages.
The problem is I don't know much about SELinux yet and maybe this solution is a security risk.
For me it looks like every "untrusted_app" is now allowed access these functions.
Maybe I should try to let Seeder run in a different context ("chcon" ?) rather than adding "ALLOWED"'s into "sepolicy" to fix the problem.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Apply on boot:

At this point the changes are not permanent and are restored to default after reboot.
There may be several ways to load SELinux policy rules on boot but I decided to try it with Tasker:

1.) Profile -> Event -> System -> Device Boot
2.) New Task -> Seeder_Policy
3.) Code -> Run Shell -> Command -> *One line from above (without "su"!)*
4.) Use Root -> Enable

Now the SELinux policies get applied on boot and Seeder starts even in "enforcing" mode.
Sometimes when Seeder is startet before Tasker did it's stuff then it's required to launch Seeder by hand.
Still looking for a good way to fix that ...

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#My OS:

- Samsung Galaxy Alpha (SM-G850F / SLTE)
- Cyanogenmod 13.0 UNOFFICIAL BETA3 (Android 6.0)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Hi,

Do you have any shortcuts to do this in oneway.

Thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2504
    Hey everyone,

    Version 2.0.0 released!

    This version introduces performance tuning, power management control, and an optional MMC I/O queue extension/timing change.

    For those of you who have seen reboots / black screens that seem to be caused by Seeder, I suspect it may be due to the power management implemented in previous versions. Disabling power management (by unchecking "Suspend RNG service while screen off") may help. In my testing, battery impact was negligible (less than 2% per 24h).

    The performance profiles are Light, Moderate, and Aggressive, and they control how frequently rngd wakes. The default configuration (Light) is unchanged from previous versions. Moderate and Aggressive may impact battery life (slightly), but may also help on devices where the entropy pool is drained quickly and often.

    Last but not least, the "Extend I/O queue" option increases the nr_requests on MMC devices to 1024, and increases the dirty page expiry time, allowing more outstanding writes to accumulate. This may allow the I/O scheduler to make better decisions and combine more writes; some users have reported an improvement under heavy I/O.

    Feedback appreciated!

    ---

    On some (older) versions of Android, the JVM (and other components) often read random data from the blocking /dev/random device. On newer builds, this problem has been solved, yet depletion of the input entropy pool still seems to slow devices.

    So, I cross-compiled rngd, and used it to feed /dev/urandom into /dev/random at 1 second intervals.

    Result? Significant lag reduction (for some people)! :good:

    Note - if you want to try it, you must be running a rooted device, and you only need to install one of the APKs (latest version is best). Then, just open it, and turn it on. The other files (patches / .zips) are intended for recompiling, packaging, and init.d integration. If you uninstall the app, either turn off rngd first (open, and click the on/off button), or reboot afterwards; the UI does not presently kill the daemon on uninstallation.

    For more information on using the .zip flashing method, see Ryuinferno's post here:

    http://forum.xda-developers.com/showpost.php?p=36479461&postcount=1924

    FAQ
    Q: Do I need the .apk or the .zip?
    A: The easiest method is simply installing the latest .apk, attached below. You do not need to use the patch or the .zip file.

    Q: What is the patch for?
    A: The patch file contains the source differences needed to recompile the Seeder version of the rngd binary. You only need it if you want to recompile rngd yourself.

    Q: What is the .zip file for?
    A: The .zip file contains the latest rngd binary. It is intended for ROM builders or those who want to build their own CWMR packages.

    Q: Seeder keeps shutting down! Does this mean I have to restart it?
    A: The Seeder UI is only used to configure and start/stop the RNG service, which runs in the background. The RNG service is not visible from Android, since it is a native Linux process. You can terminate the UI at any time, and the service will continue running.

    Q: Does seeder cause excessive battery drain?
    A: Seeder 1.2.7 introduced an RNG service power-saving mode. The process automatically suspends whenever the screen is off. The code is actually in the rngd native binary, so suspend/resume events happen independently of the UI; you can see it in action by attaching to the running process with strace. This means that battery drain while the screen is off is highly unlikely.

    While the screen is on, the RNG service simply polls a file descriptor every second, and, when needed, injects a small amount of random data into /dev/random (and calls an ioctl). It's unlikely that this would present enough load to trigger a CPU governor state change at 10mhz (let alone 200mhz), so it shouldn't impact battery life. Having said that, I have received sporadic reports that it does reduce battery life on some devices. They may be coincidental (other software installed at the same time), or due to extra device use while testing. Or, they may be real. If you think your battery drain has increased, shoot me a PM!

    Q: How can I see the RNG service Linux process?
    A: In a terminal, type: ps | grep rngd

    Q: How do I uninstall the .apk?
    A: Launch Seeder, and stop the RNG service. Then, uninstall the app as you normally would. Alternatively, uninstall the app, and reboot.

    Q: Is seeding /dev/random with /dev/urandom safe?
    A: Seeding /dev/random with PRNG-derived data does reduce the quality of its random data. However, it's worth noting that nearly all major OSes except Linux do this. Linux is one of the very few to offer a blocking RNG device. And, at least as of ICS, Dalvik doesn't even read /dev/random, so there is little difference anyway.

    Updates
    There has been a lot of controversy about Seeder/rngd. In newer versions of Dalvik, nothing touches /dev/random, and yet many users (including myself) still notice a lag reduction. There are theories ranging from kernel lock contention to UI polling load when crediting the entropy pool to simply kicking the governor. And many who believe it's all placebo. I'm trying my best to figure out what exactly is happening, and others are as well.

    Someone asked how I arrived at the conclusion I did when I started the thread back in November, and I posted this; I think it might be better served here:

    A while back one of the webapps I was hosting on Tomcat (server-side) was experiencing some inexplicable latency and while stracing java I saw it frequently hanging on read()'s from /dev/random. I checked the available entropy, and it was constantly under 250 or so. It was a VM, no HWRNG, so I decided to use rngd to push urandom->random.

    Dropped session creation times under load from 5-10 seconds to less than a second.

    It's worth noting that Linux is one of very few OSes that have a blocking RNG device. Free/OpenBSD, Windows, etc.. essentially only provide urandom. It's generally considered secure, even for long-term crypto keys, so long as the initial seed is big (and random) enough.

    Checked on my device, and saw a few processes grabbing /dev/random. /proc/sys/kernel/random/entropy_avail reporting depleted input pool. Figured it was worth a shot, so I rebuilt rngd for arm (with a few patches, linked on first page), and tried it out. It made a significant difference. Posted it up on this thread, and had a lot of positive feedback. Wanted to get into Android development, so figured.. why not wrap a little UI around it. More positive feedback, so I threw it on the market as well.

    I had no idea it would take off like this and was shocked when I saw it Thursday morning. I'm in the awkward position now of explaining why it seems to work for some people, and not for others, especially given the fact Dalvik doesn't have references to /dev/random as of ICS. Theories abound, but it looks like it might be an issue of polling the UI for input events when the entropy pool drops (which never happens so long as rngd is running).

    I'm doing this as a hobby. I'm a *nix admin by trade, and can only spend time working on this stuff on evenings and weekends, and the last few weeks have been kinda nuts.

    I want to stress to everyone that:

    a) It doesn't work the way I thought it did on later Android builds, but it does reduce latency for me and many others even on these builds,
    b) I'm offering (and always will offer) Seeder for free to everyone on XDA,
    c) Like I say in the market description, if anyone has purchased it and it isn't working, PLEASE email me for a refund (and let me know what device you're on if you're willing).

    I was one of the first to root the Captivate glide (my first Android phone), and submitted the A2DP bitpool patch; I was active in the n900 community. I hope everyone understands that I'm doing my best here!


    I hope the technique proves useful to people, and if there is in fact contention at the kernel level, I hope it's solved so we all benefit.

    Version 2.0.0 attached. No changes.

    Version 2.0.0b1 attached. New performance profile selector, I/O queue extender, and power saving control. Improved root checking.

    Version 1.4.0 attached. Major refactoring. Service control now fully asynchronous.

    Version 1.3.1 attached. No changes from 1.3.1-beta.

    Version 1.3.1-beta released. New root check method during ANR-sensitive code.

    Version 1.3.0 attached. Proper IntentServices for process control, and notification on upgrade / loss of root / autostart failure.

    Version 1.2.9 attached. Yet another update to the upgrade/autostart code.

    Version 1.2.8 attached. Asynchronous startup of rngd during boot; this should solve the remaining autostart problems some users have reported.

    Version 1.2.7 released. This version introduces a much more efficient suspend-on-sleep mode for rngd.

    Version 1.2.6 released. This version reverts the suspend-on-sleep rngd change which may have been contributing to new latency. I'm sorting out a better way of implementing it.

    Version 1.2.5 released. This version should fix the autostart failure some users have seen.

    Version 1.2.4 released. This version implements a progress bar displaying your currently available entropy, as well as automatic rngd restart on upgrade.

    Version 1.2 released. This version implements rngd suspend-on-sleep, and contains minor user interface updates, more robust process and superuser checks, and a new icon (thanks Nathanel!)

    Version 1.1 released. This version uses the release signature, so you will need to uninstall the old XDA version first!

    This version fixes the issue some users were seeing on later Jellybean ROMs, where the UI would misreport the RNG service status.

    Caveats
    • There is a (theoretical) security risk, in that seeding /dev/random with /dev/urandom decreases the quality of the random data. In practice, the odds of this being cryptographically exploited are far lower than the odds of someone attacking the OS itself (a much simpler challenge). It's worth noting that as of ICS, Dalvik uses /dev/urandom exclusively, anyway, and that Linux is one of very few modern operating systems that even offer a blocking RNG device to begin with.
    • Support for rngd suspend-on-sleep was added to Seeder 1.2. It should no longer impact battery life while the device is asleep.
    • There has been a large amount of speculation on why/if this actually improves performance on ICS+ devices. I'm continuing to investigate and will post updates to this thread.

    If you try it, let me know how it goes.

    ROM builders - feel free to integrate this into your ROMs (either the .apk / application, or just the rngd binary called from init.d)!

    If anyone's interested, I've launched a paid app on the Play store for non-xda users. As I add features I'll post the new versions here as a thanks to you guys (and xda community at large for being such a great resource). But if anyone's interested in the market's auto-update feature, just thought I'd mention it. :)

    Cheers! :highfive:
    101
    Seeder v7 (script)

    Before doing anything, please read the first post of this thread to understand how this thing functions!
    Read it here: First post


    First things first I am not the OP but things need to be sorted out...Ok...this thread is starting to get more and more attention, which is good because with more people to test things out, the more feedbacks and the more improvements can be done...however, the thread is now cluttered by tons on unhelpful posts, like "how to use this", "do I need root" etc...useful posts get pushed wayyy behind, until it is hard for people who are really trying to discuss to keep track...so I am here to answer the basic questions:

    Do you need root for the app?:
    Yes

    Can it work on xxx device?:
    Yes, as long as your device is arm based

    Where to download the app?:
    Here: http://forum.xda-developers.com/attachment.php?attachmentid=1640660&d=1358063993
    Or search Play Store for a donate version...
    The other 2 attachments are the rngd binary and a diff patch, which are not really required for end users...

    How do I know that it is working?
    Prior to starting seeder entropy generator through the app (v1.2.4 onwards), the bar below will only show numbers around 100-200++. After you start it, if the bar fills up and the value shoots up to 4000++, then it is working.

    Do I have a risk of bricking my device?
    No because the app won't modify system files at all...anything just uninstall...
    For the zip, it only adds files to your system partition...does not modify any, so if you want to stop using this, you can disable it via the extended menu script...

    It does not do anything/It is placebo/I see no improvements/It is awesome!/Wow!:
    Well, this is not constructive or helpful...NOT AT ALL...keep in mind that this is still a WIP...research and discussions are still going on...if it is not working or you feel no change or a great improvement, please describe more and explain...which a lot of others are already doing so...:)...keep it up!


    Seems that certain people are so bugged by the app...so...for those who prefer to run this via a script and init.d, read on...(the script works the same as the app, but with a few extra features)


    =======================================================================================================================
    UPDATE: Seeder_v7 is out, as suggested by pepoluan, it now detects for qrngd (built in rngd for Qualcomm Snapdragon-based devices), if it is there, then it will not start as rngd may conflict with it...the rngd binary is also using the latest version (it is turned off when screen is off)...users of previous versions can just flash it over...

    INSTALLING
    You need init.d support for this!
    Download and flash:


    How to use this script?:
    After flashing, launch terminal emulator and type
    Code:
    su
    seeder

    You will get a menu like this:
    FBB94.png


    NOTE: There will be NO app after flashing! This only installs the necessary binaries and scripts...


    For those who cannot install via recovery:
    You get a status 0 error -> replace the update-binary in Seeder_v6.zip with one from another zip that works with your device

    OR

    Use the new installation method! :D

    Instructions:
    1. Download Seeder_v7_non-CWM.zip from here:
    2. Extract the zip, you will get a folder named "install"
    3. Place the folder in the root of your sdcard (/sdcard)
    4. Launch terminal emulator, type:
    Code:
    su
    cd /sdcard/install
    sh install.sh
    5. Ignore any error messages (those are only warnings, only happens to current users)
    6. You are done! The script will auto-delete the "install" folder as it is not required anymore...

    Sample output:
    bUDTA.png



    UNINSTALLING:
    And now for the way to clean up Seeder_7:
    Via recovery:
    Flash Seeder_v6&7_Uninstall.zip:

    Via terminal:
    1. Download Seeder_v6&7_Uninstall_non-CWM.zip:
    2. Extract it to the root of your sdcard (/sdcard), you should get a file named uninstall.sh
    3. Launch terminal emulator and type this:
    Code:
    su
    cd /sdcard
    sh uninstall.sh
    4. You are done! Everything gets cleaned up, including uninstall.sh...
    73
    First things first I am not the OP but things need to be sorted out...Ok...this thread is starting to get more and more attention, which is good because with more people to test things out, the more feedbacks and the more improvements can be done...however, the thread is now cluttered by tons on unhelpful posts, like "how to use this", "do I need root" etc...useful posts get pushed wayyy behind, until it is hard for people who are really trying to discuss to keep track...so I am here to answer the basic questions:

    Do you need root for the app?:
    Yes

    Can it work on xxx device?:
    Yes, as long as your device is arm based

    Where to download the app?:
    Here: http://forum.xda-developers.com/attachment.php?attachmentid=1477944&d=1352786461
    Or search Play Store for a donate version...
    The other 2 attachments are the rngd binary and a diff patch, which are not really required for end users...

    How to check whether it is working or not?:
    In terminal emulator, type
    Code:
    watch -n 1 cat /proc/sys/kernel/random/entropy_avail
    You should get values around 3000++ to 4000++...
    Sometimes this command glitches, so if it does not work, please use:
    Code:
    pgrep rngd
    It should return a value...

    Set on boot does not work?:
    It does, just that the app does not show it properly...it is a known bug...to really confirm, use the terminal emulator method above...

    Do I have a risk of bricking my device?
    No because the app won't modify system files at all...anything just uninstall...
    For the zip, it only adds files to your system partition...does not modify any, so if you want to stop using this, you can disable it via the extended menu script...

    It does not do anything/It is placebo/I see no improvements/It is awesome!/Wow!:
    Well, this is not constructive or helpful...NOT AT ALL...keep in mind that this is still a WIP...research and discussions are still going on...if it is not working or you feel no change or a great improvement, please describe more and explain...which a lot of others are already doing so...:)...keep it up!


    For more answers, read this post by my pal pepoluan...:D
    http://forum.xda-developers.com/showpost.php?p=36234571&postcount=444

    Seems that certain people are so bugged by the app...so...for those who prefer to run this via a script and init.d, read on...(the script works the same as the app, but with a few extra features)

    =======================================================================================================================
    UPDATE: Seeder_v6 is out, I improved the detection of whether rngd is running or not (the previous method was not that accurate), and I removed unnecessary lines...previous users can just flash over...

    You need init.d support for this!
    Download and flash:


    How to use this script?:
    After flashing, launch terminal emulator and type
    Code:
    su
    seeder

    You will get a menu like this:
    FBB94.png


    NOTE: There will be NO app after flashing! This only installs the necessary binaries and scripts...


    For those who cannot install via recovery:
    You get a status 0 error -> replace the update-binary in Seeder_v6.zip with one from another zip that works with your device

    OR

    Use the new installation method! :D

    Instructions:
    1. Download Seeder_v6_non-CWM.zip from here: http://www.androidfilehost.com/?fid=9390248398092764098
    2. Extract the zip, you will get a folder named "install"
    3. Place the folder in the root of your sdcard (/sdcard)
    4. Launch terminal emulator, type:
    Code:
    su
    cd /sdcard/install
    sh install.sh
    5. Ignore any error messages (those are only warnings, only happens to current users)
    6. You are done! The script will auto-delete the "install" folder as it is not required anymore...

    Sample output:
    bUDTA.png



    And now for the way to clean up Seeder_v6:
    Via recovery:
    Flash Seeder_v6_Uninstall.zip:

    Via terminal:
    1. Download Seeder_v6_Uninstall_non-CWM.zip:
    2. Extract it to the root of your sdcard (/sdcard), you should get a file named uninstall.sh
    3. Launch terminal emulator and type this:
    Code:
    su
    cd /sdcard
    sh uninstall.sh
    4. You are done! Everything gets cleaned up, including uninstall.sh...

    NOTE: Please link back to this post if you want to answer someone's question or share it elsewhere, so that people can get sufficient info and repeated answers do not have to be posted...thank you...:)
    63
    So I did a bit of digging and a bit of research and a bit of testing.
    I really dunno if the tweak makes that big of an effect but I did discover a nice trick to have a nice fat entropy_avail with zero overhead.

    One of the first pages I skimmed was http://linux.die.net/man/4/random which mentioned at the bottom these other files:
    read_wakeup_threshold contains the number of bits of entropy required for waking up processes that sleep waiting for entropy from /dev/random.
    write_wakeup_threshold contains the number of bits of entropy below which we wake up processes that do a select() or poll() for write access to /dev/random.

    Normally, read_wakeup_threshold is 64 and write_wakeup_threshold is 128

    I also wondered why most users report that their entropy_avail was by default in the 200ish range while mine was always by default over 300.

    I had also found this page at linuxinsight. I had used that site alot when researching Kick Ass Kernelizer's sysctl tweaks.

    So I thought, hey I wonder if I can use sysctl to set good values and low and behold, I looked in my script and I already have settings for both lol:
    Code:
    busybox sysctl -e -w kernel.random.read_wakeup_threshold=128;
    busybox sysctl -e -w kernel.random.write_wakeup_threshold=256;
    As you can see, I had doubled the default values - and that's why my entropy_avail was always over 300.

    So I decided to mess with sysctl a bit.

    Connected the phone to the laptop.
    In one command prompt I watched the entropy_avail with this one liner:
    Code:
    while :; do cat /proc/sys/kernel/random/entropy_avail; sleep 1;done
    In a second command prompt I did the sysctl thing...
    I found that write_wakeup_threshold didn't effect entropy_avail at all.

    But read_wakeup_threshold is a totally different story :cool:

    I did
    Code:
    busybox sysctl -w kernel.random.read_wakeup_threshold=2048
    The entropy_avail just started climbing....

    All the way up to 3600+ and just stayed there. Never went down at all.
    Actually, the more I did stuff with the phone, the faster the level would climb.

    So it would never go down and would never get used.
    I thought well maybe I should lower it so it does get used.
    I kept lowering read_wakeup_threshold until it got down to 1200 and finally entropy_avail dropped to 2400+ and kept climbing until 3600 and then would drop to 2400 immediately and up again and so on...

    I played with different values.
    Setting it to 1000... entropy would go up to 3000 and then drop to 2000 and up to 3000 again....
    Setting to 750.... entropy would go up to 2250 and drop to 1500 and up to 2250 again...

    So the pattern is:
    max entropy_avail=read_wakeup_threshold * 3
    min. entropy_avail=read_wakeup_threshold * 2 (ie. read_wakeup_threshold * 3 - read_wakeup_threshold)

    So it builds up 3 times the read_wakeup_threshold and then when it hits that limit, it drops the value of read_wakeup_threshold.

    If you want to lock it it at the highest possible value (4096), you'd do:
    Code:
    echo 1366 > /proc/sys/kernel/random/read_wakeup_threshold
    Or
    Code:
    busybox sysctl -w kernel.random.read_wakeup_threshold=1366
    You can add either of those to any init.d script.
    However, on my device, it won't go over 3600 so you can test for yourself how high yours will go.
    If all you can get is 3600ish just go with 1200 (ie. 3600/3)

    In Kick Ass Kernelizer I'm gonna make it like so:
    Code:
    busybox sysctl -e -w kernel.random.read_wakeup_threshold=1024;
    busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048;
    That will make it bounce between 3072 max and 2048 min.
    I'm making write_wakeup_threshold twice the amount of read_wakeup_threshold simply because that's what it is by default.

    But hey, maybe I can save battery life if I make it 1280 just so it stays locked in at 3600+ and it doesn't have to keep rebuilding entropy_avail lol

    So conclusion is: since there is a definite pattern on how entropy was being built up to a pre-determined level and dropped to a pre-determined level, it wasn't actually being used. That's just how it's programmed.

    If the setting isn't there to "hold" all the entropy, it just drops/flushes it and force feeding it entropy won't make it not spit it out :p

    So at least I found the setting that will make it hold it in lol

    Maybe somebody would like to give it a try and test to see if it actually saves battery by setting read_wakeup_threshold to 1366.
    62
    Ok, I have a question for the OP:

    I would like to know your through process that led up to the development of this patch. Was this just instinct or did you have a hint? Did you use a profiler of some sort? I'm just incredibly curious how on earth you arrived at the 'problem' before developing your 'solution'!

    A while back one of the webapps I was hosting on Tomcat (server-side) was experiencing some inexplicable latency and while stracing java I saw it frequently hanging on read()'s from /dev/random. I checked the available entropy, and it was constantly under 250 or so. It was a VM, no HWRNG, so I decided to use rngd to push urandom->random.

    Dropped session creation times under load from 5-10 seconds to less than a second.

    It's worth noting that Linux is one of very few OSes that have a blocking RNG device. Free/OpenBSD, Windows, etc.. essentially only provide urandom. It's generally considered secure, even for long-term crypto keys, so long as the initial seed is big (and random) enough.

    Checked on my device, and saw a few processes grabbing /dev/random. /proc/sys/kernel/random/entropy_avail reporting depleted input pool. Figured it was worth a shot, so I rebuilt rngd for arm (with a few patches, linked on first page), and tried it out. It made a significant difference. Posted it up on this thread, and had a lot of positive feedback. Wanted to get into Android development, so figured.. why not wrap a little UI around it. More positive feedback, so I threw it on the market as well.

    I had no idea it would take off like this and was shocked when I saw it Thursday morning. I'm in the awkward position now of explaining why it seems to work for some people, and not for others, especially given the fact Dalvik doesn't have references to /dev/random as of ICS. Theories abound, but it looks like it might be an issue of polling the UI for input events when the entropy pool drops (which never happens so long as rngd is running).

    I'm doing this as a hobby. I'm a *nix admin by trade, and can only spend time working on this stuff on evenings and weekends, and the last few weeks have been kinda nuts.

    I want to stress to everyone that:

    a) It doesn't work the way I thought it did on later Android builds, but it does reduce latency for me and many others even on these builds,
    b) I'm offering (and always will offer) Seeder for free to everyone on XDA,
    c) Like I say in the market description, if anyone has purchased it and it isn't working, PLEASE email me for a refund (and let me know what device you're on if you're willing).

    I was one of the first to root the Captivate glide (my first Android phone), and submitted the A2DP bitpool patch; I was active in the n900 community. I hope everyone understands that I'm doing my best here!