File tree 4 files changed +20
-8
lines changed
4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 28
28
done
29
29
30
30
pushd magisk
31
- for FILE in module.prop service.sh customize.sh verify.sh
31
+ for FILE in module.prop service.sh customize.sh verify.sh sepolicy.rule
32
32
do
33
33
sumfile $FILE
34
34
done
Original file line number Diff line number Diff line change 51
51
52
52
extract " $ZIPFILE " ' module.prop' " $MODPATH "
53
53
extract " $ZIPFILE " ' service.sh' " $MODPATH "
54
+ extract " $ZIPFILE " ' sepolicy.rule' " $MODPATH "
54
55
55
56
ui_print " - Extracting zygisk libraries"
56
57
if [ " $ARCH " = " arm" ] || [ " $ARCH " = " arm64" ] ; then
Original file line number Diff line number Diff line change
1
+ allow zygote adb_data_file dir { search }
2
+ allow zygote unlabeled file { getattr }
Original file line number Diff line number Diff line change 1
1
#include < cstdlib>
2
2
#include < string>
3
3
#include < android/log.h>
4
- #include < sys/system_properties.h>
4
+ #include < sys/types.h>
5
+ #include < sys/stat.h>
6
+ #include < unistd.h>
5
7
6
8
#include " zygisk.hpp"
7
9
#include " module.h"
8
10
9
11
namespace denylist {
10
12
13
+ #define WHITELIST_FILE " /data/adb/modules/denylist_unmount/whitelist"
14
+
11
15
class DenylistUnmount : public zygisk ::ModuleBase {
12
16
public:
13
17
void onLoad (zygisk::Api *api, JNIEnv *env) override {
@@ -38,12 +42,17 @@ class DenylistUnmount : public zygisk::ModuleBase {
38
42
39
43
40
44
void preSpecialize (std::string process) {
41
- char whitelist[255 ];
42
- __system_property_get (" persist.unmount.white" ,whitelist);
43
-
44
- if (strcmp (whitelist," true" ) == 0 && (api->getFlags () & zygisk::PROCESS_GRANTED_ROOT) == 0 ){
45
- api->setOption (zygisk::FORCE_DENYLIST_UNMOUNT);
46
- } else if ((api->getFlags () & zygisk::PROCESS_ON_DENYLIST) != 0 ) {
45
+ struct stat whitelist;
46
+ bool whitelist_mode = false ;
47
+ uint32_t flags = api->getFlags ();
48
+
49
+ if (stat (WHITELIST_FILE, &whitelist) == 0 ) {
50
+ whitelist_mode = true ;
51
+ LOGD (" Whitelist mode" );
52
+ }
53
+
54
+ if ((flags & zygisk::PROCESS_ON_DENYLIST) != 0 ||
55
+ (whitelist_mode && (flags & zygisk::PROCESS_GRANTED_ROOT) == 0 )) {
47
56
api->setOption (zygisk::FORCE_DENYLIST_UNMOUNT);
48
57
}
49
58
api->setOption (zygisk::DLCLOSE_MODULE_LIBRARY);
You can’t perform that action at this time.
0 commit comments