Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Aug 9, 2023
1 parent 3dce30e commit f2364b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 11 additions & 0 deletions zip-content/inc/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ display_info()
ui_msg "Priv-app path: ${PRIVAPP_PATH:?}"
ui_msg_empty_line
ui_msg "Android root ENV: ${ANDROID_ROOT:-}"
ui_msg "Fake signature: ${FAKE_SIGN}"
ui_msg "$(write_separator_line "${#MODULE_NAME}" '-' || true)"
}

initialize()
Expand Down Expand Up @@ -708,6 +710,15 @@ initialize()
ui_error 'The priv-app folder does NOT exist'
fi

FAKE_SIGN=false
zip_extract_file "${SYS_PATH}/framework/framework-res.apk" 'AndroidManifest.xml' "${TMP_PATH}/framework-res"
XML_MANIFEST="${TMP_PATH}/framework-res/AndroidManifest.xml"
# Detect the presence of the fake signature permission
# Note: It won't detect it if signature spoofing doesn't require a permission, but it is still fine for our case
if search_ascii_string_as_utf16_in_file 'android.permission.FAKE_PACKAGE_SIGNATURE' "${XML_MANIFEST}"; then
FAKE_SIGN=true
fi

unset LAST_MOUNTPOINT
}

Expand Down
12 changes: 0 additions & 12 deletions zip-content/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

TMP_PATH="${2:?}"

FAKE_SIGN=false

### FUNCTIONS ###

# shellcheck source=SCRIPTDIR/../inc/common-functions.sh
Expand All @@ -30,16 +28,6 @@ fi

# Display info
display_info

zip_extract_file "${SYS_PATH}/framework/framework-res.apk" 'AndroidManifest.xml' "${TMP_PATH}/framework-res"
XML_MANIFEST="${TMP_PATH}/framework-res/AndroidManifest.xml"
# Detect the presence of the fake signature permission
# Note: It won't detect it if signature spoofing doesn't require a permission, but it is still fine for our case
if search_ascii_string_as_utf16_in_file 'android.permission.FAKE_PACKAGE_SIGNATURE' "${XML_MANIFEST}"; then
FAKE_SIGN=true
fi
ui_msg "Fake signature: ${FAKE_SIGN}"
ui_msg "$(write_separator_line "${#MODULE_NAME}" '-' || true)"
ui_msg_empty_line

if test "${IS_INSTALLATION:?}" = 'true'; then
Expand Down

0 comments on commit f2364b2

Please sign in to comment.