-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[utilities] Add operation to reset aliendalvik. JB#24058
Stop alien, remove the /home/.android directory (saving any packaged apks to be reinstalled afterwards), then restart it. Re-install any store packaged apks. If alien has been uninstalled but /home/.android is still present, then this option can be used to remove all that residual data. Also removed obsolete tracker reset service workaround that hasn't been used for a long time.
- Loading branch information
Showing
9 changed files
with
102 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import QtQuick 2.0 | ||
import Sailfish.Silica 1.0 | ||
import Sailfish.Utilities 1.0 | ||
|
||
ActionItem { | ||
visible: UtilTools.dirExists("/home/.android") | ||
//% "Android™ App Support" | ||
title: qsTrId("sailfish-tools-he-android_app_support") | ||
//% "Reset" | ||
actionName: qsTrId("sailfish-tools-bt-reset") | ||
//% "Completely reset Android App support, removing " | ||
//% "all settings, apps and app data. Android data in " | ||
//% "your home directory will not be removed, and any " | ||
//% "Android apps installed from the Jolla store will " | ||
//% "be reinstalled. You can also use this utility to clean " | ||
//% "your Android data from your device after uninstalling " | ||
//% "Android App Support. | ||
description: qsTrId("sailfish-utilities-me-clean_aas_desc") | ||
//% "Resetting Android™ App Support" | ||
remorseText: qsTrId("sailfish-utilities-me-clean_aas_remorse") | ||
deviceLockRequired: false | ||
|
||
function action(on_reply, on_error) { | ||
UtilTools.resetAliendalvik(on_reply, on_error) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
|
||
# Stop aliendalvik if running | ||
if systemctl is-active --quiet aliendalvik | ||
systemctl stop aliendalvik || : | ||
fi | ||
if systemctl is-active --quiet apkd | ||
systemctl stop apkd || : | ||
fi | ||
|
||
# Remove all launchers | ||
rm -f /home/*/.local/share/applications/apkd_launcher_*.desktop || : | ||
rm -f /home/*/.local/share/applications/apkd_handler_*.desktop || : | ||
update-desktop-database | ||
|
||
if [ -f /opt/alien/system.img ]; then | ||
# If alien installed, wipe /data, but keep any apps from the store | ||
if [ -d /home/.android/data/aas-staging/app/packaged ]; then | ||
# alien8 | ||
mv /home/.android/data/aas-staging/app/packaged /home/.android | ||
rm -rf /home/.android/data | ||
mkdir -p /home/.android/data/aas-staging/app/ | ||
mv /home/.android/packaged /home/.android/data/aas-staging/app/ | ||
elif [ -d /home/.android/data/app/packaged ]; then | ||
# alien4 | ||
systemctl stop alien-settings | ||
mv /home/.android/data/app/packaged /home/.android | ||
rm -rf /home/.android/data | ||
mkdir -p /home/.android/data/app/ | ||
mv /home/.android/packaged /home/.android/data/app/ | ||
/usr/bin/add-oneshot --now alien-create-build-prop | ||
systemctl-user start alien-pre-start.service | ||
else | ||
# neither packaged dir is available, cleanup anyway | ||
rm -rf /home/.android/data | ||
fi | ||
|
||
# Start aliendalvik | ||
systemctl start apkd | ||
systemctl start aliendalvik | ||
|
||
sleep 5 | ||
for apk in /home/.android/data/app/packaged/*.apk; do | ||
/usr/bin/apkd-harbour-rpm-post $apk | ||
done | ||
for apk in /home/.android/data/aas-staging/app/packaged/*.apk; do | ||
/usr/bin/apkd-harbour-rpm-post $apk | ||
done | ||
else | ||
# Just cleanup all data | ||
rm -rf /home/.android | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.