Compare commits
6 Commits
android-12
...
android-15
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b07b045d6 | |||
| d9bc1451f2 | |||
| 02fa115417 | |||
| e8ca8eeb40 | |||
| 2b59ccc7af | |||
| b2fe6b6cb5 |
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build a Lawnchair APK from source and place it here as a prebuilt.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./build_prebuilt.sh [path/to/apps_lawnchair]
|
||||||
|
#
|
||||||
|
# If no path is given, looks for apps_lawnchair as a sibling directory.
|
||||||
|
# After running this, the APK still needs to be platform-signed before it
|
||||||
|
# works as a privileged system app in a ROM build:
|
||||||
|
#
|
||||||
|
# apksigner sign \
|
||||||
|
# --key $ANDROID_BUILD_TOP/build/target/product/security/platform.pk8 \
|
||||||
|
# --cert $ANDROID_BUILD_TOP/build/target/product/security/platform.x509.pem \
|
||||||
|
# priv-app/Lawnchair/Lawnchair.apk
|
||||||
|
#
|
||||||
|
# If you're only testing on a rooted device you can push the unsigned APK
|
||||||
|
# directly and use pm to set it as the default launcher.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
SRC_DIR="${1:-$(dirname "$SCRIPT_DIR")/Lawnchair}"
|
||||||
|
|
||||||
|
if [[ ! -f "$SRC_DIR/gradlew" ]]; then
|
||||||
|
echo "ERROR: Lawnchair source not found at: $SRC_DIR"
|
||||||
|
echo "Pass the path as the first argument: $0 /path/to/apps_lawnchair"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "==> Building Lawnchair from $SRC_DIR"
|
||||||
|
cd "$SRC_DIR"
|
||||||
|
./gradlew assembleLawnchairRelease --stacktrace
|
||||||
|
|
||||||
|
APK=$(find . -name "*.apk" -path "*/lawnchair/release/*" | grep -v unsigned | head -1)
|
||||||
|
if [[ -z "$APK" ]]; then
|
||||||
|
# Fallback: any release APK
|
||||||
|
APK=$(find . -name "*.apk" -path "*/release/*" | head -1)
|
||||||
|
fi
|
||||||
|
if [[ -z "$APK" ]]; then
|
||||||
|
echo "ERROR: No release APK found after Gradle build."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEST="$SCRIPT_DIR/priv-app/Lawnchair/Lawnchair.apk"
|
||||||
|
cp "$APK" "$DEST"
|
||||||
|
echo ""
|
||||||
|
echo "==> APK copied to: $DEST"
|
||||||
|
echo ""
|
||||||
|
echo "Next steps for AOSP ROM integration:"
|
||||||
|
echo " 1. Sign with the platform key (see header comment in this script)"
|
||||||
|
echo " 2. Commit the signed APK: git -C '$SCRIPT_DIR' add priv-app/Lawnchair/Lawnchair.apk && git commit"
|
||||||
|
echo " 3. Switch the manifest to prebuilt mode (see android_local_manifest/pawletos.xml)"
|
||||||
|
echo ""
|
||||||
|
echo "For direct device testing (root required):"
|
||||||
|
echo " adb push $DEST /system/priv-app/Lawnchair/Lawnchair.apk"
|
||||||
|
echo " adb shell am force-stop app.lawnchair"
|
||||||
|
echo " adb reboot"
|
||||||
@@ -16,4 +16,25 @@ android_app_import {
|
|||||||
"androidx.window.extensions",
|
"androidx.window.extensions",
|
||||||
"androidx.window.sidecar",
|
"androidx.window.sidecar",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Include this alongside Lawnchair to also replace the QuickStep/recents
|
||||||
|
// launcher (Launcher3QuickStep). Both modules reference the same APK;
|
||||||
|
// the package manager deduplicates at install time.
|
||||||
|
android_app_import {
|
||||||
|
name: "LawnchairQuickStep",
|
||||||
|
apk: "Lawnchair.apk",
|
||||||
|
privileged: true,
|
||||||
|
certificate: "platform",
|
||||||
|
overrides: [
|
||||||
|
"Launcher3QuickStep",
|
||||||
|
],
|
||||||
|
required: [
|
||||||
|
"privapp-permissions-app.lawnchair.xml",
|
||||||
|
"app.lawnchair-hiddenapi-package-whitelist.xml",
|
||||||
|
],
|
||||||
|
optional_uses_libs: [
|
||||||
|
"androidx.window.extensions",
|
||||||
|
"androidx.window.sidecar",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user