Skip to content

Commit 7115392

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 844b606 + 1546bf9 commit 7115392

File tree

2 files changed

+25
-46
lines changed

2 files changed

+25
-46
lines changed

README_EN.md

+21-42
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,39 @@
77
[![Downloads](https://img.shields.io/github/downloads/aistra0528/Hail/total.svg)](https://github.com/aistra0528/Hail/releases)
88
[![License](https://img.shields.io/github/license/aistra0528/Hail)](LICENSE)
99

10-
Hail is a free-as-in-freedom software to freeze Android
11-
apps. [GitHub Releases](https://github.com/aistra0528/Hail/releases)
10+
Hail is a free-as-in-freedom software to freeze Android apps. [GitHub Releases](https://github.com/aistra0528/Hail/releases)
1211

1312
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/packages/com.aistra.hail/)
1413

1514
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="32%" /> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="32%" /> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="32%" />
1615

1716
## Freeze
1817

19-
Freeze is a word that describes the action of **blocking (immediately stopping) apps when they are unnecessary (
20-
on-demand
21-
request)** to use the device
22-
in a better way, cut down on the usage of RAM and save power. Users can also unfreeze them to revert to their original
23-
state.
18+
Freeze is a word that describes the action of **blocking (immediately stopping) apps when they are not needed/in-use (on-demand request)** which in turn helps the device to cut down on the usage of RAM and save power. Users can also unfreeze them to revert to their original state.
2419

2520
In general, "freeze" means disable, but also Hail can "freeze" apps by hiding and suspending them.
2621

2722
### Disable
2823

29-
Disabled apps will not be shown in the launcher and will be shown as "Disabled" in the installed apps list. Enable them
30-
to revert the action.
24+
Disabled apps will not be shown in the launcher and will be shown as "Disabled" in the installed apps list. Enable them to revert the action.
3125

3226
### Hide
3327

34-
Hidden apps will not be shown in the launcher and installed apps list. Unhide them to revert the action.
28+
Hidden apps will not be shown in the launcher and in the installed apps list. Unhide them to revert the action.
3529

36-
> While in this state, which is almost like an uninstalled state, the package will be unavailable,
37-
> but the application data and the actual package file will not be removed from the device.
30+
> While in this state, which is almost like an uninstalled state, the package will be unavailable, however, the application data and the actual package file will not be removed from the device.
3831
3932
### Suspend (Android 7.0+)
4033

41-
Suspended apps will have their icons shown in a grayscale in the device's launcher. Unsuspend them to revert the action.
34+
Suspended apps will have their icons shown in grayscale within the device's launcher. Unsuspend them to revert the action.
4235

43-
> While in this state, the application's notifications will be hidden, any of its started activities
44-
> will be stopped and it will not be able to show toasts, dialogs or even play audio. When the user tries
45-
> to launch a suspended app, the system will, instead, show a dialog to the user informing them that
46-
> they cannot use this app while it is suspended.
36+
> While in this state, the application's notifications will be hidden, any of its started activities will be stopped and it will not be able to show toasts, dialogs or even play audio. When the user tries to launch a suspended app, the system will, instead, show a dialog to the user informing them that they cannot use this app while it is suspended.
4737
48-
Suspend only prevents the user from interacting with the app, it does **NOT** prevent the app from running in the
49-
background.
38+
Suspend only prevents the user from interacting with the app, it does **NOT** prevent the app from running in the background.
5039

5140
## Working mode
5241

53-
**Any apps that have been frozen on Hail will need to be unfrozen by the same working mode.**
42+
**Any app that has been frozen on Hail will need to be unfrozen by the same working mode.**
5443

5544
1. For devices supporting wireless debugging (Android 11+) or rooted devices, `Shizuku` is recommended.
5645

@@ -68,7 +57,7 @@ background.
6857

6958
### Device Owner
7059

71-
**You must remove device owner before uninstall**
60+
**You must remove Hail as a device owner before you can uninstall it**
7261

7362
#### Set device owner by adb
7463

@@ -85,8 +74,7 @@ adb shell dpm set-device-owner com.aistra.hail/.receiver.DeviceAdminReceiver
8574
In response, adb prints this message if device owner has been successfully set:
8675

8776
```
88-
Success: Device owner set to package com.aistra.hail
89-
Active admin set to component {com.aistra.hail/com.aistra.hail.receiver.DeviceAdminReceiver}
77+
Success: Device owner set to package com.aistra.hail. Active admin set to component {com.aistra.hail/com.aistra.hail.receiver.DeviceAdminReceiver}
9078
```
9179

9280
Search the message by search engine otherwise.
@@ -154,8 +142,7 @@ adb shell pm unsuspend com.package.name
154142

155143
### Modify file
156144

157-
Access `/data/system/users/0/package-restrictions.xml`, this file stores the restrictions about
158-
apps. You can modify, rename or just delete it.
145+
Access `/data/system/users/0/package-restrictions.xml`, this file stores the restrictions about apps. You can modify, rename or just delete it.
159146

160147
- Enable app: Modify the value of `enabled` from 2 (DISABLED) or 3 (DISABLED_USER) to 1 (ENABLED)
161148

@@ -175,39 +162,31 @@ adb shell am start -a action -e key value
175162

176163
`action` can be one of the following constants:
177164

178-
- `com.aistra.hail.action.LAUNCH`: Unfreeze and launch target app. If it is unfrozen, it will launch
179-
directly. `key="package"` `value="com.package.name"`
165+
- `com.aistra.hail.action.LAUNCH`: Unfreeze and launch target app. If it is unfrozen, it will launch directly. `key="package"` `value="com.package.name"`
180166

181-
- `com.aistra.hail.action.FREEZE`: Freeze target app. It must be checked at
182-
Home. `key="package"` `value="com.package.name"`
167+
- `com.aistra.hail.action.FREEZE`: Freeze target app. It must be checked at Home. `key="package"` `value="com.package.name"`
183168

184-
- `com.aistra.hail.action.UNFREEZE`: Unfreeze target
185-
app. `key="package"` `value="com.package.name"`
169+
- `com.aistra.hail.action.UNFREEZE`: Unfreeze target app. `key="package"` `value="com.package.name"`
186170

187-
- `com.aistra.hail.action.FREEZE_TAG`: Freeze all non-whitelisted apps in the target
188-
tag. `key="tag"` `value="Tag name"`
171+
- `com.aistra.hail.action.FREEZE_TAG`: Freeze all non-whitelisted apps in the target tag. `key="tag"` `value="Tag name"`
189172

190-
- `com.aistra.hail.action.UNFREEZE_TAG`: Unfreeze all apps in the target
191-
tag. `key="tag"` `value="Tag name"`
173+
- `com.aistra.hail.action.UNFREEZE_TAG`: Unfreeze all apps in the target tag. `key="tag"` `value="Tag name"`
192174

193175
- `com.aistra.hail.action.FREEZE_ALL`: Freeze all apps at Home. `extra` is not necessary.
194176

195177
- `com.aistra.hail.action.UNFREEZE_ALL`: Unfreeze all apps at Home. `extra` is not necessary.
196178

197-
- `com.aistra.hail.action.FREEZE_NON_WHITELISTED`: Freeze all non-whitelisted apps at Home. `extra`
198-
is not necessary.
179+
- `com.aistra.hail.action.FREEZE_NON_WHITELISTED`: Freeze all non-whitelisted apps at Home. `extra` is not necessary.
199180

200181
- `com.aistra.hail.action.FREEZE_AUTO`: Auto freeze apps at Home. `extra` is not necessary.
201182

202183
- `com.aistra.hail.action.LOCK`: Lock screen. `extra` is not necessary.
203184

204-
- `com.aistra.hail.action.LOCK_FREEZE`: Freeze all apps at Home and lock screen. `extra` is not
205-
necessary.
185+
- `com.aistra.hail.action.LOCK_FREEZE`: Freeze all apps at Home and lock screen. `extra` is not necessary.
206186

207187
## Help Translate
208188

209-
To translate Hail into your language, or to improve an existing translation,
210-
use [Weblate](https://hosted.weblate.org/engage/hail/).
189+
To translate Hail into your language, or to improve an existing translation, use [Weblate](https://hosted.weblate.org/engage/hail/).
211190

212191
[![Translation status](https://hosted.weblate.org/widgets/hail/-/multi-auto.svg)](https://hosted.weblate.org/engage/hail/)
213192

@@ -217,7 +196,7 @@ use [Weblate](https://hosted.weblate.org/engage/hail/).
217196
Copyright (C) 2021-2024 Aistra
218197
Copyright (C) 2022-2024 Hail contributors
219198

220-
This program is free software: you can redistribute it and/or modify
199+
This program is a free software: you can redistribute it and/or modify
221200
it under the terms of the GNU General Public License as published by
222201
the Free Software Foundation, either version 3 of the License, or
223202
(at your option) any later version.

app/src/main/kotlin/com/aistra/hail/ui/api/ApiActivity.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class ApiActivity : AppCompatActivity() {
3838
true, HailData.checkedList.filter { it.tagId == requireTagId }, true
3939
)
4040

41-
HailApi.ACTION_UNFREEZE_TAG -> setListFrozen(false,
41+
HailApi.ACTION_UNFREEZE_TAG -> setListFrozen(
42+
false,
4243
HailData.checkedList.filter { it.tagId == requireTagId })
4344

4445
HailApi.ACTION_FREEZE_ALL -> setListFrozen(true)
@@ -97,9 +98,8 @@ class ApiActivity : AppCompatActivity() {
9798

9899
private fun launchApp(pkg: String, tagId: Int? = null) {
99100
if (tagId != null) setListFrozen(false, HailData.checkedList.filter { it.tagId == tagId })
100-
if (AppManager.isAppFrozen(pkg)) {
101-
if (AppManager.setAppFrozen(pkg, false)) app.setAutoFreezeService()
102-
else throw IllegalStateException(getString(R.string.permission_denied))
101+
if (AppManager.isAppFrozen(pkg) && AppManager.setAppFrozen(pkg, false)) {
102+
app.setAutoFreezeService()
103103
}
104104
packageManager.getLaunchIntentForPackage(pkg)?.let {
105105
HShortcuts.addDynamicShortcut(pkg)

0 commit comments

Comments
 (0)