Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecaa70e4 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊 Committed by Nishith Khanna
Browse files

script: make uninstall and clear optional

parent 8e689fbb
Loading
Loading
Loading
Loading
+31 −7
Original line number Diff line number Diff line
#!/usr/bin/env bash
#!/bin/bash

adb shell pm uninstall foundation.e.browser
adb shell pm uninstall com.android.webview
adb shell pm uninstall org.chromium.trichromelibrary
DO_UNINSTALL=false
DO_CLEAR=false

adb shell pm clear foundation.e.browser
adb shell pm clear com.android.webview
adb shell pm clear org.chromium.trichromelibrary
while getopts "uc" opt; do
  case $opt in
    u) DO_UNINSTALL=true ;;
    c) DO_CLEAR=true ;;
    *) echo "Usage: $0 [-u] [-c]" >&2
       exit 1 ;;
  esac
done

PACKAGES=(
    "foundation.e.browser"
    "com.android.webview"
    "org.chromium.trichromelibrary"
)

if [ "$DO_UNINSTALL" = true ]; then
    for pkg in "${PACKAGES[@]}"; do
        adb shell pm uninstall "$pkg"
    done
fi

if [ "$DO_CLEAR" = true ]; then
    for pkg in "${PACKAGES[@]}"; do
        adb shell pm clear "$pkg"
    done
fi

adb install -r apks/arm64/TrichromeLibrary.apk
adb install -r apks/arm64/TrichromeWebView.apk
adb install -r apks/arm64/TrichromeChrome.apk

echo "Done."