Do not use std::random_device

Directly read from urandom instead of using std::random_device.
libc++ will use iostream under-the-hood, which brings significant
binary size increase that is not welcomed, especially in magiskinit.
This commit is contained in:
topjohnwu
2019-07-14 21:56:21 -07:00
parent 41045b62dc
commit 52fd508fea
2 changed files with 9 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ static void patch_init_rc(FILE *rc) {
fprintf(rc, "%s", line.data());
return true;
});
char pfd_svc[32], ls_svc[32], bc_svc[32];
char pfd_svc[16], ls_svc[16], bc_svc[16];
gen_rand_str(pfd_svc, sizeof(pfd_svc));
gen_rand_str(ls_svc, sizeof(ls_svc));
gen_rand_str(bc_svc, sizeof(bc_svc));