From b2cb2b8b75b8a6a2ebe976ee1bb263209b987604 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 28 Dec 2019 21:27:55 +0800 Subject: [PATCH] Reduce socket name length Some detectors simply ban long abstract sockets --- native/jni/init/rootdir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/jni/init/rootdir.cpp b/native/jni/init/rootdir.cpp index bc323e5ee..af4f59f38 100644 --- a/native/jni/init/rootdir.cpp +++ b/native/jni/init/rootdir.cpp @@ -24,7 +24,7 @@ static void patch_socket_name(const char *path) { mmap_rw(path, buf, size); for (int i = 0; i < size; ++i) { if (memcmp(buf + i, MAIN_SOCKET, sizeof(MAIN_SOCKET)) == 0) { - gen_rand_str(buf + i, sizeof(MAIN_SOCKET)); + gen_rand_str(buf + i, 16); i += sizeof(MAIN_SOCKET); } }