Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
Added Dialer data folder access check
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopotediosi committed Nov 12, 2022
1 parent 11e0830 commit 03c891f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions install.sh
Expand Up @@ -21,9 +21,10 @@ print_modname() {
on_install() {
DIALER_PACKAGE="com.google.android.dialer"
DIALER_USER=$(stat -c '%U' "/data/data/$DIALER_PACKAGE/files/")
DIALER_DATA_PATH="/data/data/$DIALER_PACKAGE"
PHENOTYPE_PATH="/data/data/com.google.android.gms/databases/phenotype.db"
PHENOTYPE_CACHE="/data/data/$DIALER_PACKAGE/files/phenotype"
CALLRECORDINGPROMPT="/data/data/$DIALER_PACKAGE/files/callrecordingprompt"
PHENOTYPE_CACHE="$DIALER_DATA_PATH/files/phenotype"
CALLRECORDINGPROMPT="$DIALER_DATA_PATH/files/callrecordingprompt"

ENABLE_CALL_RECORDING_FLAGS="G__enable_call_recording \
CallRecording__enable_call_recording_for_fi \
Expand Down Expand Up @@ -62,8 +63,15 @@ on_install() {
fi

ui_print " - Checking the Phenotype DB existence"
if [ ! -e "$PHENOTYPE_PATH" ]; then
ui_print " - Error > Phenotype Database not found"
if [ ! -f "$PHENOTYPE_PATH" ]; then
ui_print " - Error > Phenotype DB not found"
ui_print " - Exiting..."
abort
fi

ui_print " - Checking access to the Dialer data folder"
if [ ! -d "$DIALER_DATA_PATH" ]; then
ui_print " - Error > Cannot find the $DIALER_DATA_PATH path"
ui_print " - Exiting..."
abort
fi
Expand Down

0 comments on commit 03c891f

Please sign in to comment.