Skip to content

Commit

Permalink
HACK: granting full permission for apps data (1/2)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hmtheboy154 committed Apr 29, 2022
1 parent 9ed3787 commit 2d47891
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ PRODUCT_PRODUCT_PROPERTIES += \
PRODUCT_COPY_FILES := \
$(if $(wildcard $(PRODUCT_DIR)init.rc),$(PRODUCT_DIR)init.rc:root/init.rc) \
$(if $(wildcard $(PRODUCT_DIR)init.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)init.sh:system/etc/init.sh \
$(if $(wildcard $(PRODUCT_DIR)nodataperm.sh),$(PRODUCT_DIR),$(LOCAL_PATH)/)nodataperm.sh:system/vendor/etc/nodataperm.sh \
$(if $(wildcard $(PRODUCT_DIR)modules.blocklist),$(PRODUCT_DIR),$(LOCAL_PATH)/)modules.blocklist:system/etc/modules.blocklist \
$(if $(wildcard $(PRODUCT_DIR)fstab.$(TARGET_PRODUCT)),$(PRODUCT_DIR)fstab.$(TARGET_PRODUCT),$(LOCAL_PATH)/fstab.x86):root/fstab.$(TARGET_PRODUCT) \
$(if $(wildcard $(PRODUCT_DIR)wpa_supplicant.conf),$(PRODUCT_DIR),$(LOCAL_PATH)/)wpa_supplicant.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant.conf \
Expand Down
4 changes: 4 additions & 0 deletions init.x86.rc
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,7 @@ on property:persist.sys.nativebridge=0

on property:sys.boot_completed=1 && property:vendor.thermal.enable=1
start thermal-daemon

#based on PrimeOS's prime.fix.permission property
on property:persist.sys.nodataperm=1
exec u:r:su:s0 root -- /system/bin/sh /system/vendor/etc/nodataperm.sh
8 changes: 8 additions & 0 deletions nodataperm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/system/bin/sh

chmod 777 -R /sdcard/Android
chmod 777 -R /data/media/0/Android
chmod 777 -R /sdcard/Android/data
chmod 777 -R /data/media/0/Android/obb
chmod 777 -R /mnt/*/*/*/*/Android/data
chmod 777 -R /mnt/*/*/*/*/Android/obb

0 comments on commit 2d47891

Please sign in to comment.