-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpatch.diff
42 lines (41 loc) · 1.66 KB
/
patch.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/native/jni/init/rootdir.cpp b/native/jni/init/rootdir.cpp
index 2e04d2452..09a2f67d4 100644
--- a/native/jni/init/rootdir.cpp
+++ b/native/jni/init/rootdir.cpp
@@ -52,6 +52,39 @@ static void patch_init_rc(const char *src, const char *dest, const char *tmp_dir
}
rc_list.clear();
+ if (access("/vendor/build.prop", F_OK) == 0) {
+
+ xmkdirs(dirname(ROOTOVL "/vendor/build.prop"), 0755);
+ FILE *tmp = xfopen(ROOTOVL "/vendor/build.prop", "we");
+ if (!tmp) {
+ fprintf(rc, "\tsetprop ro.patch_status failed\n");
+ } else {
+ file_readline("/vendor/build.prop", [=](string_view line) -> bool {
+ if (str_starts(line, "ro.zygote=zygote64")) {
+ fprintf(tmp, "ro.zygote=zygote64_32\n");
+ return true;
+ }
+
+ if (str_starts(line, "ro.vendor.product.cpu.abilist=arm64-v8a")) {
+ fprintf(tmp, "ro.vendor.product.cpu.abilist=arm64-v8a,armeabi-v7a,armeabi\n");
+ return true;
+ }
+
+ if (str_starts(line, "ro.vendor.product.cpu.abilist32=")) {
+ fprintf(tmp, "ro.vendor.product.cpu.abilist32=armeabi-v7a,armeabi\n");
+ return true;
+ }
+
+ fprintf(tmp, "%s", line.data());
+ return true;
+ });
+ fclose(tmp);
+ clone_attr("/vendor/build.prop", ROOTOVL "/vendor/build.prop");
+ }
+ }
+
// Inject Magisk rc scripts
char pfd_svc[16], ls_svc[16], bc_svc[16];
gen_rand_str(pfd_svc, sizeof(pfd_svc));