Skip to content

Commit 2d47891

Browse files
committed
HACK: granting full permission for apps data (1/2)
This is a temporary hack to combat against the apps permission issue on Android 11. Whenever an app is open it will always enable a property (persist.sys.nodataperm) to make it execute a script to grant the data full permissions (777). Keep in my that this is a temporary hack and there should be a better solution like using bind-mounting filesystem. Thanks PrimeOS team for this solution
1 parent 9ed3787 commit 2d47891

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

device.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ PRODUCT_PRODUCT_PROPERTIES += \
4646
PRODUCT_COPY_FILES := \
4747
$(if $(wildcard $(PRODUCT_DIR)init.rc),$(PRODUCT_DIR)init.rc:root/init.rc) \
4848
$(if $(wildcard $(PRODUCT_DIR)init.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.sh:system/etc/init.sh \
49+
$(if $(wildcard $(PRODUCT_DIR)nodataperm.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)nodataperm.sh:system/vendor/etc/nodataperm.sh \
4950
$(if $(wildcard $(PRODUCT_DIR)modules.blocklist),$(PRODUCT_DIR),$(LOCAL_PATH)/)modules.blocklist:system/etc/modules.blocklist \
5051
$(if $(wildcard $(PRODUCT_DIR)fstab.$(TARGET_PRODUCT)),$(PRODUCT_DIR)fstab.$(TARGET_PRODUCT),$(LOCAL_PATH)/fstab.x86):root/fstab.$(TARGET_PRODUCT) \
5152
$(if $(wildcard $(PRODUCT_DIR)wpa_supplicant.conf),$(PRODUCT_DIR),$(LOCAL_PATH)/)wpa_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \

init.x86.rc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,7 @@ on property:persist.sys.nativebridge=0
163163

164164
on property:sys.boot_completed=1 && property:vendor.thermal.enable=1
165165
start thermal-daemon
166+
167+
#based on PrimeOS's prime.fix.permission property
168+
on property:persist.sys.nodataperm=1
169+
exec u:r:su:s0 root -- /system/bin/sh /system/vendor/etc/nodataperm.sh

nodataperm.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/system/bin/sh
2+
3+
chmod 777 -R /sdcard/Android
4+
chmod 777 -R /data/media/0/Android
5+
chmod 777 -R /sdcard/Android/data
6+
chmod 777 -R /data/media/0/Android/obb
7+
chmod 777 -R /mnt/*/*/*/*/Android/data
8+
chmod 777 -R /mnt/*/*/*/*/Android/obb

0 commit comments

Comments
 (0)