DivestOS/fix_permissions.sh
Tad 6e75c0dbd3
Fix boot failure after WebView signature changes
Tested working on:
- 14.1: toroplus
- 15.1: bullhead, hammerhead
- 17.1: clark

This is the same issue which resulted in e61e288b being reverted.
Still unclear why this happens.

Signed-off-by: Tad <tad@spotco.us>
2023-02-03 00:02:44 -05:00

38 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
#Copyright (c) 2020 Divested Computing Group
#License: GPLv3
setStrict() {
if [ -d "$1" ]; then
find "$1" -type d -print0 | xargs -0 chmod -v 0700;
find "$1" -type f -print0 | xargs -0 chmod -v 0600;
fi;
}
setRelaxed() {
if [ -d "$1" ]; then
find "$1" -type d -print0 | xargs -0 chmod -v 0755;
find "$1" -type f -print0 | xargs -0 chmod -v 0644;
fi;
}
chmod -v 600 LICENSE* pending_commit.txt TODO;
setStrict Manifests;
setStrict Misc;
setStrict Patches/Common;
setRelaxed Patches/Common/android_timekeep_sepolicy;
setRelaxed Patches/Common/android_vendor_divested;
setStrict Patches/LineageOS-14.1;
setStrict Patches/LineageOS-15.1;
setStrict Patches/LineageOS-16.0;
setStrict Patches/LineageOS-17.1;
setStrict Patches/Linux; #XXX: move this into the repo
chmod -v 700 Patches/Linux/*.sh;
#PrebuiltApps has its own fix_permissions.sh
#Patches/Wallpapers has its own fix_permissions.sh
setStrict Scripts;
setRelaxed Repos/firmware;
setRelaxed Repos/firmware-empty;
setRelaxed Repos/firmware-19.1;
setRelaxed Repos/DivestOS_WebView/prebuilt;