From f58a6710e100a6aa778b19279c8ab3e83a007f9e Mon Sep 17 00:00:00 2001 From: dedy prasetyo Date: Fri, 4 Aug 2023 09:13:43 +0000 Subject: [PATCH 01/40] Translated using Weblate (Indonesian) Currently translated at 100.0% (130 of 130 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/id/ --- app/src/main/res/values-in/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index d2276153..fa0e3ddc 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -18,7 +18,7 @@ Bekukan semua Bekukan label ini Aktifkan semua - Bekukan selain daftar putih + Bekukan semua selain daftar putih Kunci Luncurkan Copot From bfd840228c30475388cbb42cabd6a4af0ab3e74b Mon Sep 17 00:00:00 2001 From: lukymas Date: Mon, 14 Aug 2023 07:31:43 +0200 Subject: [PATCH 02/40] Added translation using Weblate (Czech) --- app/src/main/res/values-cs/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 app/src/main/res/values-cs/strings.xml diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml new file mode 100644 index 00000000..a6b3daec --- /dev/null +++ b/app/src/main/res/values-cs/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From a194ae576e7d815e849b2741eed4d9c974918eb8 Mon Sep 17 00:00:00 2001 From: lukymas Date: Mon, 14 Aug 2023 05:33:10 +0000 Subject: [PATCH 03/40] Translated using Weblate (Czech) Currently translated at 34.6% (45 of 130 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/cs/ --- app/src/main/res/values-cs/strings.xml | 51 +++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index a6b3daec..38d9a953 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -1,2 +1,51 @@ - \ No newline at end of file + + Aplikace + Nastavení + O nás + Výchozí + Verze + Skupina QQ + ZmrazitApk + Přispět + GitHub + Přeložit + Licence + Zmrazit všechny + Odmrazit všechny + Zmrazit aktuální + Odmrazit aktuální + Zmrazit nezařazené na bílou listinu + Zamknout + Uzamknout a Zmrazit + Spustit + Zmrazit + Odmrazit + Přidat štítek + Odstranit štítek + Přidat na dom. obrazovku + Exportovat do schránky + Importovat ze schránky + Odebrat z domů + Zpátky + Extrahovat APK + Chceš odinstalovat tuto aplikaci\? + Režim fungování + Nečinná + Majitel Zařízení - Skrýt + Superuser - Suspendovat + Shizuku - Deaktivovat + Hail + Domů + Skupina telegram + Uplatnit kód + Nastavit štítek + Odmrazit a Odstranit z Domů + Zrušit výběr + Odinstalovat + Pomoc + Najít + Informace o aplikaci + Majitel Zařízení - Suspendovat + Superuser - Deaktivovat + \ No newline at end of file From 7303ad318815020ae341d6c1b67c2699fd9d36e3 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:50:51 +0800 Subject: [PATCH 04/40] fix: unnecessary auto freeze --- app/src/main/kotlin/com/aistra/hail/HailApp.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/HailApp.kt b/app/src/main/kotlin/com/aistra/hail/HailApp.kt index c57f03e8..869d9333 100644 --- a/app/src/main/kotlin/com/aistra/hail/HailApp.kt +++ b/app/src/main/kotlin/com/aistra/hail/HailApp.kt @@ -9,7 +9,6 @@ import com.aistra.hail.app.AppManager import com.aistra.hail.app.HailData import com.aistra.hail.services.AutoFreezeService import com.aistra.hail.utils.HDhizuku -import com.google.android.material.color.DynamicColors class HailApp : Application() { override fun onCreate() { @@ -22,8 +21,12 @@ class HailApp : Application() { fun setAutoFreezeService(enabled: Boolean? = null) { if (HailData.autoFreezeAfterLock.not()) return - val start = enabled - ?: HailData.checkedList.any { !AppManager.isAppFrozen(it.packageName) && !it.whitelisted } + val start = enabled ?: HailData.checkedList.any { + it.packageName != packageName + && it.applicationInfo != null + && !AppManager.isAppFrozen(it.packageName) + && !it.whitelisted + } val intent = Intent(app, AutoFreezeService::class.java) val name = ComponentName(app, AutoFreezeService::class.java) if (start) { From 7f824999120ecf20db63a3462be5af9013ebbe5f Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:19:08 +0800 Subject: [PATCH 05/40] build: bump AGP version to 8.1.1 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 25bbd438..bb9f4273 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.1.0" apply false + id("com.android.application") version "8.1.1" apply false kotlin("android") version "1.8.20" apply false } From 2226a5d683601ffa4fe4b6d7302f5dc66206e266 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:21:31 +0800 Subject: [PATCH 06/40] perf: set device owner dialog --- .../kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt | 4 +++- app/src/main/kotlin/com/aistra/hail/utils/HPolicy.kt | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index 4afb11b1..6d0f725a 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -23,6 +23,7 @@ import com.aistra.hail.app.HailData import com.aistra.hail.databinding.DialogInputBinding import com.aistra.hail.utils.* import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.google.android.material.textview.MaterialTextView import com.rosan.dhizuku.api.Dhizuku import com.rosan.dhizuku.api.DhizukuRequestPermissionListener import kotlinx.coroutines.Dispatchers @@ -192,8 +193,9 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan MaterialAlertDialogBuilder(requireActivity()).setTitle(R.string.title_set_owner) .setMessage(getString(R.string.msg_set_owner, HPolicy.ADB_COMMAND)) .setPositiveButton(android.R.string.ok, null) - .setNeutralButton(android.R.string.copy) { _, _ -> HUI.copyText(HPolicy.DPM_COMMAND) } + .setNeutralButton(android.R.string.copy) { _, _ -> HUI.copyText(HPolicy.ADB_COMMAND) } .show() + .findViewById(android.R.id.message)?.setTextIsSelectable(true) return false } diff --git a/app/src/main/kotlin/com/aistra/hail/utils/HPolicy.kt b/app/src/main/kotlin/com/aistra/hail/utils/HPolicy.kt index cc63a101..4a0043f4 100644 --- a/app/src/main/kotlin/com/aistra/hail/utils/HPolicy.kt +++ b/app/src/main/kotlin/com/aistra/hail/utils/HPolicy.kt @@ -11,7 +11,7 @@ import com.aistra.hail.receiver.DeviceAdminReceiver object HPolicy { private val dpm = app.getSystemService()!! private val admin = ComponentName(app, DeviceAdminReceiver::class.java) - val DPM_COMMAND = "dpm set-device-owner ${admin.flattenToShortString()}" + private val DPM_COMMAND = "dpm set-device-owner ${admin.flattenToShortString()}" val ADB_COMMAND = "adb shell $DPM_COMMAND" private val isDeviceOwner get() = dpm.isDeviceOwnerApp(app.packageName) @@ -40,6 +40,7 @@ object HPolicy { ) true } + else -> false } From bbf9eb9b153f0b8004becf6a18802feeb9e6cb86 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:25:24 +0800 Subject: [PATCH 07/40] perf: icon pack dialog --- .../kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index 6d0f725a..5c1cd890 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -96,6 +96,10 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan it, PackageManager.ResolveInfoFlags.of(0) ) else app.packageManager.queryIntentActivities(it, 0) }.map { it.activityInfo } + if (list.isEmpty()) { + HUI.showToast(R.string.app_not_installed) + return + } MaterialAlertDialogBuilder(requireActivity()).setTitle(R.string.icon_pack) .setItems(list.map { it.loadLabel(app.packageManager) }.toTypedArray()) { _, which -> if (HailData.iconPack == list[which].packageName) return@setItems From 7f073d01ca36a1df0f9ee23c252e214415557488 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:55:21 +0800 Subject: [PATCH 08/40] fix: hidden app not found --- .../aistra/hail/ui/about/AboutViewModel.kt | 2 +- .../com/aistra/hail/ui/api/ApiActivity.kt | 2 +- .../com/aistra/hail/ui/apps/AppsAdapter.kt | 42 ++++++++++++------- .../com/aistra/hail/ui/apps/AppsFragment.kt | 18 ++++---- .../com/aistra/hail/ui/home/PagerFragment.kt | 4 +- .../kotlin/com/aistra/hail/utils/HPackages.kt | 24 ++++++----- .../kotlin/com/aistra/hail/utils/HShizuku.kt | 8 ++-- .../com/aistra/hail/utils/NameComparator.kt | 8 ++-- 8 files changed, 61 insertions(+), 47 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/about/AboutViewModel.kt b/app/src/main/kotlin/com/aistra/hail/ui/about/AboutViewModel.kt index e00cd311..473c2731 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/about/AboutViewModel.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/about/AboutViewModel.kt @@ -17,7 +17,7 @@ import java.text.SimpleDateFormat class AboutViewModel(val app: Application) : AndroidViewModel(app) { val time = MutableLiveData().apply { value = SimpleDateFormat.getDateInstance() - .format(HPackages.getPackageInfoOrNull(app.packageName)!!.firstInstallTime) + .format(HPackages.getUnhiddenPackageInfoOrNull(app.packageName)!!.firstInstallTime) } val snack = MutableLiveData() diff --git a/app/src/main/kotlin/com/aistra/hail/ui/api/ApiActivity.kt b/app/src/main/kotlin/com/aistra/hail/ui/api/ApiActivity.kt index 8b6663ab..915d7305 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/api/ApiActivity.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/api/ApiActivity.kt @@ -62,7 +62,7 @@ class ApiActivity : AppCompatActivity() { private fun requirePackage(extraName: String = HailData.KEY_PACKAGE): String = intent?.getStringExtra(extraName)?.also { - HPackages.getPackageInfoOrNull(it) + HPackages.getApplicationInfoOrNull(it) ?: throw NameNotFoundException(getString(R.string.app_not_installed)) } ?: throw IllegalArgumentException("package must not be null") diff --git a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt index b4e4a823..abfb1389 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt @@ -1,7 +1,6 @@ package com.aistra.hail.ui.apps import android.content.pm.ApplicationInfo -import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.view.LayoutInflater import android.view.View @@ -27,11 +26,15 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext object AppsAdapter : - ListAdapter(object : DiffUtil.ItemCallback() { - override fun areItemsTheSame(oldItem: PackageInfo, newItem: PackageInfo): Boolean = + ListAdapter(object : + DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: ApplicationInfo, newItem: ApplicationInfo): Boolean = oldItem.packageName == newItem.packageName - override fun areContentsTheSame(oldItem: PackageInfo, newItem: PackageInfo): Boolean = + override fun areContentsTheSame( + oldItem: ApplicationInfo, + newItem: ApplicationInfo + ): Boolean = areItemsTheSame(oldItem, newItem) }) { lateinit var onItemClickListener: OnItemClickListener @@ -40,12 +43,15 @@ object AppsAdapter : private var loadIconJob: Job? = null private var refreshJob: Job? = null - private val PackageInfo.isSystemApp: Boolean - get() = applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM == ApplicationInfo.FLAG_SYSTEM + private val ApplicationInfo.isSystemApp: Boolean + get() = flags and ApplicationInfo.FLAG_SYSTEM == ApplicationInfo.FLAG_SYSTEM - private suspend fun filterList(query: String? = null, pm: PackageManager): List = + private suspend fun filterList( + query: String? = null, + pm: PackageManager + ): List = withContext(Dispatchers.Default) { - HPackages.getInstalledPackages().filter { + HPackages.getInstalledApplications().filter { ((HailData.filterUserApps && !it.isSystemApp) || (HailData.filterSystemApps && it.isSystemApp)) @@ -53,11 +59,18 @@ object AppsAdapter : || (HailData.filterUnfrozenApps && !AppManager.isAppFrozen(it.packageName))) && (query.isNullOrEmpty() || it.packageName.contains(query, true) - || it.applicationInfo.loadLabel(pm).toString().contains(query, true)) + || it.loadLabel(pm).toString().contains(query, true)) }.run { when (HailData.sortBy) { - HailData.SORT_INSTALL -> sortedBy { it.firstInstallTime } - HailData.SORT_UPDATE -> sortedByDescending { it.lastUpdateTime } + HailData.SORT_INSTALL -> sortedBy { + HPackages.getUnhiddenPackageInfoOrNull(it.packageName) + ?.firstInstallTime ?: 0 + } + + HailData.SORT_UPDATE -> sortedByDescending { + HPackages.getUnhiddenPackageInfoOrNull(it.packageName)?.lastUpdateTime ?: 0 + } + else -> sortedWith(NameComparator) } } @@ -79,7 +92,6 @@ object AppsAdapter : override fun onBindViewHolder(holder: ViewHolder, position: Int) { val info = currentList[position] - val app = info.applicationInfo val pkg = info.packageName val frozen = AppManager.isAppFrozen(pkg) holder.itemView.run { @@ -88,11 +100,11 @@ object AppsAdapter : setOnLongClickListener { onItemLongClickListener.onItemLongClick(info) } findViewById(R.id.app_icon).run { loadIconJob = AppIconCache.loadIconBitmapAsync( - context, app, HPackages.myUserId, this, HailData.grayscaleIcon && frozen + context, info, HPackages.myUserId, this, HailData.grayscaleIcon && frozen ) } findViewById(R.id.app_name).run { - val name = app.loadLabel(context.packageManager) + val name = info.loadLabel(context.packageManager) text = if (!HailData.grayscaleIcon && frozen) "❄️$name" else name isEnabled = !HailData.grayscaleIcon || !frozen } @@ -122,7 +134,7 @@ object AppsAdapter : } interface OnItemLongClickListener { - fun onItemLongClick(info: PackageInfo): Boolean + fun onItemLongClick(info: ApplicationInfo): Boolean } interface OnItemCheckedChangeListener { diff --git a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt index d77a30d6..c8f43d93 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt @@ -1,6 +1,6 @@ package com.aistra.hail.ui.apps -import android.content.pm.PackageInfo +import android.content.pm.ApplicationInfo import android.os.Bundle import android.provider.Settings import android.view.LayoutInflater @@ -64,8 +64,8 @@ class AppsFragment : MainFragment(), AppsAdapter.OnItemClickListener, buttonView.toggle() } - override fun onItemLongClick(info: PackageInfo): Boolean = true.also { - val name = info.applicationInfo.loadLabel(app.packageManager) + override fun onItemLongClick(info: ApplicationInfo): Boolean = true.also { + val name = info.loadLabel(app.packageManager) val pkg = info.packageName MaterialAlertDialogBuilder(activity).setTitle(name) .setItems(resources.getStringArray(R.array.apps_action_entries)) { _, which -> @@ -84,14 +84,14 @@ class AppsFragment : MainFragment(), AppsAdapter.OnItemClickListener, MaterialAlertDialogBuilder(activity).setView(R.layout.dialog_progress) .setCancelable(false).create() dialog.show() - val target = "${HFiles.DIR_OUTPUT}/$name-${info.versionName}-${ - PackageInfoCompat.getLongVersionCode(info) + val target = "${HFiles.DIR_OUTPUT}/$name-${ + HPackages.getUnhiddenPackageInfoOrNull(pkg)?.versionName ?: "unknown" + }-${ + HPackages.getUnhiddenPackageInfoOrNull(pkg) + ?.let { PackageInfoCompat.getLongVersionCode(it) } ?: 0 }.apk" HUI.showToast( - if (HFiles.copy( - info.applicationInfo.sourceDir, target - ) - ) R.string.msg_extract_apk + if (HFiles.copy(info.sourceDir, target)) R.string.msg_extract_apk else R.string.operation_failed, target, true ) dialog.dismiss() diff --git a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt index 74e1f2f7..3de54f7d 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt @@ -430,7 +430,7 @@ class PagerFragment : MainFragment(), PagerAdapter.OnItemClickListener, var i = 0 for (index in 0 until json.length()) { val pkg = json.getString(index) - if (HPackages.getPackageInfoOrNull(pkg) != null && !HailData.isChecked(pkg)) { + if (HPackages.getApplicationInfoOrNull(pkg) != null && !HailData.isChecked(pkg)) { HailData.addCheckedApp(pkg, false, tag.second) i++ } @@ -443,7 +443,7 @@ class PagerFragment : MainFragment(), PagerAdapter.OnItemClickListener, } private suspend fun importFrozenApp() = withContext(Dispatchers.IO) { - HPackages.getInstalledPackages().map { it.packageName } + HPackages.getInstalledApplications().map { it.packageName } .filter { AppManager.isAppFrozen(it) && !HailData.isChecked(it) } .onEach { HailData.addCheckedApp(it, false, tag.second) }.size } diff --git a/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt b/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt index a2dd4804..52feae5b 100644 --- a/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt +++ b/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt @@ -1,7 +1,6 @@ package com.aistra.hail.utils import android.content.pm.ApplicationInfo -import android.content.pm.PackageInfo import android.content.pm.PackageManager import com.aistra.hail.HailApp.Companion.app @@ -11,16 +10,14 @@ object HPackages { fun packageUri(packageName: String) = "package:$packageName" @Suppress("DEPRECATION") - fun getInstalledPackages(flags: Int = PackageManager.MATCH_UNINSTALLED_PACKAGES): List = - if (HTarget.T) app.packageManager.getInstalledPackages( - PackageManager.PackageInfoFlags.of( - flags.toLong() - ) + fun getInstalledApplications(flags: Int = PackageManager.MATCH_UNINSTALLED_PACKAGES): List = + if (HTarget.T) app.packageManager.getInstalledApplications( + PackageManager.ApplicationInfoFlags.of(flags.toLong()) ) - else app.packageManager.getInstalledPackages(flags) + else app.packageManager.getInstalledApplications(flags) @Suppress("DEPRECATION") - fun getPackageInfoOrNull( + fun getUnhiddenPackageInfoOrNull( packageName: String, flags: Int = PackageManager.MATCH_UNINSTALLED_PACKAGES ) = runCatching { if (HTarget.T) app.packageManager.getPackageInfo( @@ -31,16 +28,21 @@ object HPackages { fun getApplicationInfoOrNull( packageName: String, flags: Int = PackageManager.MATCH_UNINSTALLED_PACKAGES - ) = getPackageInfoOrNull(packageName, flags)?.applicationInfo + ) = runCatching { + if (HTarget.T) app.packageManager.getApplicationInfo( + packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()) + ) + else app.packageManager.getApplicationInfo(packageName, flags) + }.getOrNull() fun isAppDisabled(packageName: String): Boolean = getApplicationInfoOrNull(packageName)?.enabled?.not() ?: false - fun isAppSuspended(packageName: String): Boolean = getPackageInfoOrNull(packageName)?.let { + fun isAppSuspended(packageName: String): Boolean = getApplicationInfoOrNull(packageName)?.let { val pm = app.packageManager when { HTarget.Q -> pm.isPackageSuspended(packageName) - HTarget.N -> it.applicationInfo.flags and ApplicationInfo.FLAG_SUSPENDED == ApplicationInfo.FLAG_SUSPENDED + HTarget.N -> it.flags and ApplicationInfo.FLAG_SUSPENDED == ApplicationInfo.FLAG_SUSPENDED else -> false } } ?: false diff --git a/app/src/main/kotlin/com/aistra/hail/utils/HShizuku.kt b/app/src/main/kotlin/com/aistra/hail/utils/HShizuku.kt index 369234a2..28219b05 100644 --- a/app/src/main/kotlin/com/aistra/hail/utils/HShizuku.kt +++ b/app/src/main/kotlin/com/aistra/hail/utils/HShizuku.kt @@ -64,7 +64,7 @@ object HShizuku { } fun setAppDisabled(packageName: String, disabled: Boolean): Boolean { - HPackages.getPackageInfoOrNull(packageName) ?: return false + HPackages.getApplicationInfoOrNull(packageName) ?: return false if (disabled) forceStopApp(packageName) runCatching { val pm = asInterface("android.content.pm.IPackageManager", "package") @@ -88,7 +88,7 @@ object HShizuku { } fun isAppHidden(packageName: String): Boolean { - HPackages.getPackageInfoOrNull(packageName) ?: return false + HPackages.getApplicationInfoOrNull(packageName) ?: return false return runCatching { val pm = asInterface("android.content.pm.IPackageManager", "package") (if (HTarget.P) HiddenApiBypass.invoke( @@ -103,7 +103,7 @@ object HShizuku { } fun setAppHidden(packageName: String, hidden: Boolean): Boolean { - HPackages.getPackageInfoOrNull(packageName) ?: return false + HPackages.getApplicationInfoOrNull(packageName) ?: return false if (hidden) forceStopApp(packageName) return runCatching { val pm = asInterface("android.content.pm.IPackageManager", "package") @@ -120,7 +120,7 @@ object HShizuku { } fun setAppSuspended(packageName: String, suspended: Boolean): Boolean { - HPackages.getPackageInfoOrNull(packageName) ?: return false + HPackages.getApplicationInfoOrNull(packageName) ?: return false if (suspended) forceStopApp(packageName) return runCatching { val pm = asInterface("android.content.pm.IPackageManager", "package") diff --git a/app/src/main/kotlin/com/aistra/hail/utils/NameComparator.kt b/app/src/main/kotlin/com/aistra/hail/utils/NameComparator.kt index dbb5b68b..a67ffc53 100644 --- a/app/src/main/kotlin/com/aistra/hail/utils/NameComparator.kt +++ b/app/src/main/kotlin/com/aistra/hail/utils/NameComparator.kt @@ -1,6 +1,6 @@ package com.aistra.hail.utils -import android.content.pm.PackageInfo +import android.content.pm.ApplicationInfo import com.aistra.hail.HailApp.Companion.app import com.aistra.hail.app.AppInfo import java.text.Collator @@ -8,9 +8,9 @@ import java.text.Collator object NameComparator : Comparator { private val c = Collator.getInstance() override fun compare(a: Any, b: Any): Int = when { - a is PackageInfo && b is PackageInfo -> c.compare( - a.applicationInfo.loadLabel(app.packageManager), - b.applicationInfo.loadLabel(app.packageManager) + a is ApplicationInfo && b is ApplicationInfo -> c.compare( + a.loadLabel(app.packageManager), + b.loadLabel(app.packageManager) ) a is AppInfo && b is AppInfo -> when { a.pinned && !b.pinned -> -1 From 769d1f462d63b9981c727ff08430e22870f239ce Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:34:15 +0800 Subject: [PATCH 09/40] feat: Superuser - Hide ref https://github.com/andy-math/Hail/commit/e055521068819fc6a1ff05d2e22240000c605f5b --- app/src/main/kotlin/com/aistra/hail/app/AppManager.kt | 5 ++--- app/src/main/kotlin/com/aistra/hail/app/HailData.kt | 3 ++- app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt | 7 +++++-- app/src/main/kotlin/com/aistra/hail/utils/HShell.kt | 3 +++ app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/arrays.xml | 2 ++ app/src/main/res/values/strings.xml | 1 + 8 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt b/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt index e44abdc5..7ddda37f 100644 --- a/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt +++ b/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt @@ -22,9 +22,7 @@ object AppManager { } fun isAppFrozen(packageName: String): Boolean = when { - HailData.workingMode == HailData.MODE_OWNER_HIDE -> HPolicy.isAppHidden(packageName) - HailData.workingMode == HailData.MODE_DHIZUKU_HIDE -> HDhizuku.isAppHidden(packageName) - HailData.workingMode == HailData.MODE_SHIZUKU_HIDE -> HShizuku.isAppHidden(packageName) + HailData.workingMode.endsWith(HailData.HIDE) -> HPackages.isAppHidden(packageName) HailData.workingMode.endsWith(HailData.SUSPEND) -> HPackages.isAppSuspended(packageName) else -> HPackages.isAppDisabled(packageName) } @@ -36,6 +34,7 @@ object AppManager { HailData.MODE_DHIZUKU_HIDE -> HDhizuku.setAppHidden(packageName, frozen) HailData.MODE_DHIZUKU_SUSPEND -> HDhizuku.setAppSuspended(packageName, frozen) HailData.MODE_SU_DISABLE -> HShell.setAppDisabled(packageName, frozen) + HailData.MODE_SU_HIDE -> HShell.setAppHidden(packageName, frozen) HailData.MODE_SU_SUSPEND -> HShell.setAppSuspended(packageName, frozen) HailData.MODE_SHIZUKU_DISABLE -> HShizuku.setAppDisabled(packageName, frozen) HailData.MODE_SHIZUKU_HIDE -> HShizuku.setAppHidden(packageName, frozen) diff --git a/app/src/main/kotlin/com/aistra/hail/app/HailData.kt b/app/src/main/kotlin/com/aistra/hail/app/HailData.kt index 1831e9c5..ea7b7738 100644 --- a/app/src/main/kotlin/com/aistra/hail/app/HailData.kt +++ b/app/src/main/kotlin/com/aistra/hail/app/HailData.kt @@ -35,13 +35,14 @@ object HailData { const val SU = "su_" const val SHIZUKU = "shizuku_" private const val DISABLE = "disable" - private const val HIDE = "hide" + const val HIDE = "hide" const val SUSPEND = "suspend" const val MODE_OWNER_HIDE = OWNER + HIDE const val MODE_OWNER_SUSPEND = OWNER + SUSPEND const val MODE_DHIZUKU_HIDE = DHIZUKU + HIDE const val MODE_DHIZUKU_SUSPEND = DHIZUKU + SUSPEND const val MODE_SU_DISABLE = SU + DISABLE + const val MODE_SU_HIDE = SU + HIDE const val MODE_SU_SUSPEND = SU + SUSPEND const val MODE_SHIZUKU_DISABLE = SHIZUKU + DISABLE const val MODE_SHIZUKU_HIDE = SHIZUKU + HIDE diff --git a/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt b/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt index 52feae5b..dae2a79b 100644 --- a/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt +++ b/app/src/main/kotlin/com/aistra/hail/utils/HPackages.kt @@ -38,10 +38,13 @@ object HPackages { fun isAppDisabled(packageName: String): Boolean = getApplicationInfoOrNull(packageName)?.enabled?.not() ?: false + fun isAppHidden(packageName: String): Boolean = getApplicationInfoOrNull(packageName)?.let { + (ApplicationInfo::class.java.getField("privateFlags").get(it) as Int) and 1 == 1 + } ?: false + fun isAppSuspended(packageName: String): Boolean = getApplicationInfoOrNull(packageName)?.let { - val pm = app.packageManager when { - HTarget.Q -> pm.isPackageSuspended(packageName) + HTarget.Q -> app.packageManager.isPackageSuspended(packageName) HTarget.N -> it.flags and ApplicationInfo.FLAG_SUSPENDED == ApplicationInfo.FLAG_SUSPENDED else -> false } diff --git a/app/src/main/kotlin/com/aistra/hail/utils/HShell.kt b/app/src/main/kotlin/com/aistra/hail/utils/HShell.kt index 4ea352e8..808460fd 100644 --- a/app/src/main/kotlin/com/aistra/hail/utils/HShell.kt +++ b/app/src/main/kotlin/com/aistra/hail/utils/HShell.kt @@ -21,6 +21,9 @@ object HShell { fun setAppDisabled(packageName: String, disabled: Boolean): Boolean = execSU("pm ${if (disabled) "disable" else "enable"} $packageName").first == 0 + fun setAppHidden(packageName: String, hidden: Boolean): Boolean = + execSU("pm ${if (hidden) "hide" else "unhide"} $packageName").first == 0 + fun setAppSuspended(packageName: String, suspended: Boolean): Boolean = execSU("pm ${if (suspended) "suspend" else "unsuspend"} $packageName").first == 0 diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8e7bb74a..72d37c37 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -138,4 +138,5 @@ 终端 Dhizuku - 隐藏 Dhizuku - 暂停 + 超级用户 - 隐藏 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 8c2ee702..d54ead1d 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -138,4 +138,5 @@ Dhizuku - 隱藏 Dhizuku - 暫停 終端機 + 超級使用者 - 隱藏 \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 62271f6d..703018d9 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -35,6 +35,7 @@ @string/mode_shizuku_hide @string/mode_shizuku_suspend @string/mode_su_disable + @string/mode_su_hide @string/mode_su_suspend @string/mode_dhizuku_hide @string/mode_dhizuku_suspend @@ -47,6 +48,7 @@ shizuku_hide shizuku_suspend su_disable + su_hide su_suspend dhizuku_hide dhizuku_suspend diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9c3c1bc5..6158a3dd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -137,4 +137,5 @@ Terminal Dhizuku - Hide Dhizuku - Suspend + Superuser - Hide \ No newline at end of file From a9fcc48f6a7e75ed50a0d9b7b67f6879337b356d Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Fri, 1 Sep 2023 16:55:44 +0000 Subject: [PATCH 10/40] Translated using Weblate (Spanish) Currently translated at 100.0% (131 of 131 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/es/ --- app/src/main/res/values-es/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7250eda1..b31712ca 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -139,4 +139,5 @@ Terminal Dhizuku - Ocultar Dhizuku - Suspender + Superusuario - Ocultar \ No newline at end of file From 3265d8013497be41e00e1ee9e950d2ca80d0888b Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Sat, 2 Sep 2023 14:17:21 +0800 Subject: [PATCH 11/40] perf: terminal result dialog --- .../main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index 5c1cd890..07ecc0a1 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -289,6 +289,7 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan setMessage(getString(R.string.operation_failed, exitValue.toString())) } }.setPositiveButton(android.R.string.ok, null).show() + .findViewById(android.R.id.message)?.setTextIsSelectable(true) } override fun onMenuItemSelected(item: MenuItem): Boolean { From c47fca49fe80c0c425e3f1e385ea844b92d346c8 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Sat, 2 Sep 2023 14:29:52 +0800 Subject: [PATCH 12/40] perf: idle mode --- .../kotlin/com/aistra/hail/app/AppManager.kt | 27 ++++++++----------- .../kotlin/com/aistra/hail/app/HailData.kt | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt b/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt index 7ddda37f..965eb88b 100644 --- a/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt +++ b/app/src/main/kotlin/com/aistra/hail/app/AppManager.kt @@ -22,9 +22,12 @@ object AppManager { } fun isAppFrozen(packageName: String): Boolean = when { + HailData.workingMode.endsWith(HailData.DISABLE) -> HPackages.isAppDisabled(packageName) HailData.workingMode.endsWith(HailData.HIDE) -> HPackages.isAppHidden(packageName) HailData.workingMode.endsWith(HailData.SUSPEND) -> HPackages.isAppSuspended(packageName) else -> HPackages.isAppDisabled(packageName) + || HPackages.isAppHidden(packageName) + || HPackages.isAppSuspended(packageName) } fun setAppFrozen(packageName: String, frozen: Boolean): Boolean = @@ -44,25 +47,17 @@ object AppManager { fun uninstallApp(packageName: String): Boolean { when { - HailData.workingMode.startsWith(HailData.OWNER) -> if (HPolicy.uninstallApp( - packageName - ) - ) return true + HailData.workingMode.startsWith(HailData.OWNER) -> + if (HPolicy.uninstallApp(packageName)) return true - HailData.workingMode.startsWith(HailData.DHIZUKU) -> if (HDhizuku.uninstallApp( - packageName - ) - ) return true + HailData.workingMode.startsWith(HailData.DHIZUKU) -> + if (HDhizuku.uninstallApp(packageName)) return true - HailData.workingMode.startsWith(HailData.SU) -> if (HShell.uninstallApp( - packageName - ) - ) return true + HailData.workingMode.startsWith(HailData.SU) -> + if (HShell.uninstallApp(packageName)) return true - HailData.workingMode.startsWith(HailData.SHIZUKU) -> if (HShizuku.uninstallApp( - packageName - ) - ) return true + HailData.workingMode.startsWith(HailData.SHIZUKU) -> + if (HShizuku.uninstallApp(packageName)) return true } HUI.startActivity(Intent.ACTION_DELETE, HPackages.packageUri(packageName)) return false diff --git a/app/src/main/kotlin/com/aistra/hail/app/HailData.kt b/app/src/main/kotlin/com/aistra/hail/app/HailData.kt index ea7b7738..9745c20f 100644 --- a/app/src/main/kotlin/com/aistra/hail/app/HailData.kt +++ b/app/src/main/kotlin/com/aistra/hail/app/HailData.kt @@ -34,7 +34,7 @@ object HailData { const val DHIZUKU = "dhizuku_" const val SU = "su_" const val SHIZUKU = "shizuku_" - private const val DISABLE = "disable" + const val DISABLE = "disable" const val HIDE = "hide" const val SUSPEND = "suspend" const val MODE_OWNER_HIDE = OWNER + HIDE From f3ce84d97f98fe1e734c8752cd48f5d653306c4a Mon Sep 17 00:00:00 2001 From: Vinicius Date: Mon, 4 Sep 2023 02:07:10 +0200 Subject: [PATCH 13/40] Added translation using Weblate (Portuguese (Brazil)) --- app/src/main/res/values-pt-rBR/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 app/src/main/res/values-pt-rBR/strings.xml diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml new file mode 100644 index 00000000..a6b3daec --- /dev/null +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 173fb9a3583a99fbdff0c58129e231e12a17b05d Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:00:00 +0800 Subject: [PATCH 14/40] chore: CoolApk 2 F-Droid --- app/src/main/kotlin/com/aistra/hail/app/HailData.kt | 2 +- app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt | 4 ++-- app/src/main/res/layout/fragment_about.xml | 4 ++-- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fa/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-in/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja-rJP/strings.xml | 1 - app/src/main/res/values-nb-rNO/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-uk/strings.xml | 1 - app/src/main/res/values-ur/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 20 files changed, 8 insertions(+), 22 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/app/HailData.kt b/app/src/main/kotlin/com/aistra/hail/app/HailData.kt index 9745c20f..64529910 100644 --- a/app/src/main/kotlin/com/aistra/hail/app/HailData.kt +++ b/app/src/main/kotlin/com/aistra/hail/app/HailData.kt @@ -17,7 +17,7 @@ object HailData { const val URL_RELEASES = "$URL_GITHUB/releases" const val URL_TELEGRAM = "https://t.me/+yvRXYTounDIxODFl" const val URL_QQ = "http://qm.qq.com/cgi-bin/qm/qr?k=I2g_Ymanc6bQMo4cVKTG0knARE0twtSG" - const val URL_COOLAPK = "https://www.coolapk.com/apk/${BuildConfig.APPLICATION_ID}" + const val URL_FDROID = "https://f-droid.org/packages/${BuildConfig.APPLICATION_ID}" const val URL_ALIPAY = "https://qr.alipay.com/tsx02922ajwj6xekqyd1rbf" const val URL_ALIPAY_API = "alipays://platformapi/startapp?saId=10000007&qrcode=$URL_ALIPAY" const val URL_BILIBILI = "https://space.bilibili.com/9261272" diff --git a/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt index d9916551..8692372f 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt @@ -45,7 +45,7 @@ class AboutFragment : MainFragment(), View.OnClickListener { binding.actionTime.setOnClickListener(this) binding.actionTelegram.setOnClickListener(this) binding.actionQq.setOnClickListener(this) - binding.actionCoolapk.setOnClickListener(this) + binding.actionFdroid.setOnClickListener(this) binding.actionDonate.setOnClickListener(this) binding.actionGithub.setOnClickListener(this) binding.actionTranslate.setOnClickListener(this) @@ -60,7 +60,7 @@ class AboutFragment : MainFragment(), View.OnClickListener { binding.actionTime -> onRedeem() binding.actionTelegram -> HUI.openLink(HailData.URL_TELEGRAM) binding.actionQq -> HUI.openLink(HailData.URL_QQ) - binding.actionCoolapk -> HUI.openLink(HailData.URL_COOLAPK) + binding.actionFdroid -> HUI.openLink(HailData.URL_FDROID) binding.actionDonate -> onDonate() binding.actionGithub -> HUI.openLink(HailData.URL_GITHUB) binding.actionTranslate -> HUI.openLink(HailData.URL_TRANSLATE) diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index d8a6f531..3746cc45 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -199,7 +199,7 @@ diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 38d9a953..7a03ba9a 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -6,7 +6,6 @@ Výchozí Verze Skupina QQ - ZmrazitApk Přispět GitHub Přeložit diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 6b6ff8e4..09111f84 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -11,7 +11,6 @@ Installationszeitpunkt Telegram Gruppe QQ Gruppe - CoolApk Spenden Gutscheincode einlösen GitHub diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index b31712ca..0da731fc 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -11,7 +11,6 @@ Fecha de instalación Grupo de Telegram Grupo en QQ - CoolApk Donar Canjear código GitHub diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 29e62d65..1c61b135 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -11,7 +11,6 @@ نصب تایم گروه تلگرامی گروه کیوکیو - کول‌ای‌پی‌کی اعانه گیت‌هاب ترجمه diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index c0eb7924..129796b6 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -14,7 +14,6 @@ Temps d\'installation Groupe Telegram Groupe QQ - CoolApk Geler tout sauf la liste blanche Verrouiller Verrouiller et geler diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index fa0e3ddc..2dabcd0c 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -10,7 +10,6 @@ Grup Telegram Grup QQ Terjemahkan - CoolApk Donasi ke pengembang Tukarkan kode Github diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9b4e8f76..d87bf4fe 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -11,7 +11,6 @@ Install time Telegram Group QQ Group - CoolApk Donate Redeem code GitHub diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index d0c62ae9..fdd901e6 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -11,7 +11,6 @@ インストール日 Telegram グループ QQ グループ - CoolApk サポートする 日付コードを変更します GitHub diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index abd97868..1ffa963f 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -79,7 +79,6 @@ Shizuku — skru av Filter Fryseklar-het. - CoolApk Avinstaller dette programmet\? Enhetseier — skjul Innløs kode diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index a7214697..1aaf5c97 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -7,7 +7,6 @@ Czas instalacji Grupa Telegram Grupa QQ - CoolApk Wspomóż Wykorzystaj kod Przetłumacz diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index c4fdc611..8f944ce4 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -11,7 +11,6 @@ Время установки Группа в Telegram QQ группа - CoolApk Пожертвования Промокод GitHub diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 7cbaa9a0..64276911 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -7,7 +7,6 @@ Varsayılan Sürüm Kurulma zamanı - CoolApk Bağış Kod kullan GitHub diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 2debfc28..477d143b 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -3,7 +3,6 @@ Додати на Домашню Біометричний вхід Очистити всі динамічні ярлики - CoolApk Відкласти завдання Зняти виділення Інформація про додаток diff --git a/app/src/main/res/values-ur/strings.xml b/app/src/main/res/values-ur/strings.xml index ae90a465..646ee8a0 100644 --- a/app/src/main/res/values-ur/strings.xml +++ b/app/src/main/res/values-ur/strings.xml @@ -14,7 +14,6 @@ انسٹال کرنے کا وقت ٹیلیگرام گروپ کیو کیو گروپ - CoolApk عطیہ کریں رڈیم کوڈ منجمد diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 72d37c37..52bf9eb9 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -11,7 +11,6 @@ 安装时间 Telegram 群组 QQ群 - 酷安 捐赠 兑换码 GitHub @@ -139,4 +138,5 @@ Dhizuku - 隐藏 Dhizuku - 暂停 超级用户 - 隐藏 + F-Droid \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d54ead1d..83cd1525 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -11,7 +11,6 @@ 安裝時間 Telegram 群組 QQ 群組 - 酷安 捐贈 兌換代碼 GitHub @@ -139,4 +138,5 @@ Dhizuku - 暫停 終端機 超級使用者 - 隱藏 + F-Droid \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6158a3dd..f4989260 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,7 +11,6 @@ Install time Telegram Group QQ Group - CoolApk Donate Redeem code GitHub @@ -138,4 +137,5 @@ Dhizuku - Hide Dhizuku - Suspend Superuser - Hide + F-Droid \ No newline at end of file From f562365bd1f8246b51c135c7dddffdf6c37202a5 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Mon, 4 Sep 2023 00:07:31 +0000 Subject: [PATCH 15/40] Translated using Weblate (Portuguese (Brazil)) Currently translated at 0.7% (1 of 131 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/pt_BR/ --- app/src/main/res/values-pt-rBR/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index a6b3daec..86d95ca8 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1,2 +1,4 @@ - \ No newline at end of file + + Hail + \ No newline at end of file From f50793fcd00c8c17c980f526e7423e0bbda129e5 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:46:47 +0800 Subject: [PATCH 16/40] chore: update README --- README.md | 37 ++++++++++++++++++++----------------- README_EN.md | 40 ++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 6b51e451..a01677f1 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,9 @@ [![Downloads](https://img.shields.io/github/downloads/aistra0528/Hail/total.svg)](https://github.com/aistra0528/Hail/releases) [![License](https://img.shields.io/github/license/aistra0528/Hail)](LICENSE) -雹是一款用于冻结 Android 应用的自由软件,您可自由享用所有功能。 +雹是一款用于冻结 Android 应用的自由软件。[GitHub Releases](https://github.com/aistra0528/Hail/releases) -[Get it on CoolApk](https://www.coolapk.com/apk/com.aistra.hail) [Get it on F-Droid](https://f-droid.org/packages/com.aistra.hail/) -[Get it on Google Play](https://play.google.com/store/apps/details?id=com.aistra.hail) - -酷安版签名与 [GitHub Releases](https://github.com/aistra0528/Hail/releases) 一致,F-Droid 版由 F-Droid 签名。 - -Google Play 版为 [@purofle](https://github.com/purofle) 的 [Fork](https://github.com/purofle/Hail),由 -Google 签名。 @@ -45,15 +38,15 @@ Google 签名。 ## 工作模式 -雹支持以`设备所有者`、`超级用户` (Root) 和`Shizuku` (含 Sui) 模式工作。 +雹支持以`设备所有者`、`Dhizuku`、`超级用户` (Root) 和`Shizuku` (含 Sui) 模式工作。 **冻结的应用需要通过相同工作模式解冻。** -1. 如果您的设备支持无线调试或已 root,推荐选择`Shizuku`。[关于 Shizuku](https://github.com/RikkaApps/Shizuku) +1. 如果您的设备支持无线调试或已 root,推荐选择`Shizuku`。 2. 如果您的设备已 root,可选择`超级用户`。**此模式速度相对较慢。** -3. 如果您的设备不支持无线调试且未 root,可选择`设备所有者`。**此模式设置较为繁琐。** +3. 如果您的设备不支持无线调试且未 root,可选择`设备所有者`或`Dhizuku`。**这些模式设置较为繁琐。** ### 设备所有者 - 隐藏 / 暂停 @@ -90,35 +83,45 @@ Active admin set to component {com.aistra.hail/com.aistra.hail.receiver.DeviceAd 在雹的应用界面长按雹,在弹出的选项中选择卸载。 -### 超级用户 - 停用 / 暂停 +### Dhizuku - 隐藏 / 暂停 + +此模式通过将 [Dhizuku](https://github.com/iamr0s/Dhizuku) 设置为设备所有者 (Device Owner),调用: + +- `DevicePolicyManager.setApplicationHidden`方法隐藏应用。 + +- `DevicePolicyManager.setPackagesSuspended`方法暂停应用。 + +### 超级用户 - 停用 / 隐藏 / 暂停 此模式通过授予雹超级用户 (Superuser) 权限,执行: - `pm disable`命令停用应用。 +- `pm hide`命令隐藏应用。 + - `pm suspend`命令暂停应用。 ### Shizuku - 停用 / 隐藏 / 暂停 -此模式通过 Shizuku 调用非 SDK 接口: +此模式通过 [Shizuku](https://github.com/RikkaApps/Shizuku) 调用非 SDK 接口: - `IPackageManager.setApplicationEnabledSetting`方法停用应用。 -- `IPackageManager.setApplicationHiddenSettingAsUser`方法隐藏应用。 (可能需要 root) +- `IPackageManager.setApplicationHiddenSettingAsUser`方法隐藏应用。 (需要 root) - `IPackageManager.setPackagesSuspendedAsUser`方法暂停应用。 ## 恢复 -### 通过 adb (可能需要 root) +### 通过 adb 替换 com.package.name 为目标应用的包名。 ```shell # 启用应用 adb shell pm enable com.package.name -# 取消隐藏应用 -adb shell pm unhide com.package.name +# 取消隐藏应用 (需要 root) +adb shell su -c pm unhide com.package.name # 取消暂停应用 adb shell pm unsuspend com.package.name ``` diff --git a/README_EN.md b/README_EN.md index ed0c5b87..36297938 100644 --- a/README_EN.md +++ b/README_EN.md @@ -9,18 +9,9 @@ [![Downloads](https://img.shields.io/github/downloads/aistra0528/Hail/total.svg)](https://github.com/aistra0528/Hail/releases) [![License](https://img.shields.io/github/license/aistra0528/Hail)](LICENSE) -Hail is a free-as-in-freedom software to freeze Android apps. Enjoy all features freely! +Hail is a free-as-in-freedom software to freeze Android apps. [GitHub Releases](https://github.com/aistra0528/Hail/releases) -[Get it on CoolApk](https://www.coolapk.com/apk/com.aistra.hail) [Get it on F-Droid](https://f-droid.org/packages/com.aistra.hail/) -[Get it on Google Play](https://play.google.com/store/apps/details?id=com.aistra.hail) - -CoolApk releases are signed the same -as [GitHub Releases](https://github.com/aistra0528/Hail/releases), and F-Droid releases are signed -by F-Droid. - -Google Play releases are the [Fork](https://github.com/purofle/Hail) -by [@purofle](https://github.com/purofle), signed by Google. @@ -54,16 +45,15 @@ Suspended apps will be shown as grayscale icons in the launcher. Unsuspend them ## Working mode -Hail can work with `Device Owner`, `Superuser` (Root) and `Shizuku` (including Sui). +Hail can work with `Device Owner`, `Dhizuku`, `Superuser` (Root) and `Shizuku` (including Sui). **Frozen app need to be unfrozen by the same working mode.** -1. For devices support wifi adb or rooted, `Shizuku` is - recommend. [About Shizuku](https://github.com/RikkaApps/Shizuku) +1. For devices support wifi adb or rooted, `Shizuku` is recommend. 2. For rooted devices, `Superuser` is alternative. **It is slower.** -3. Select `Device Owner` otherwise. **It's a pain to set up.** +3. Select `Device Owner` or `Dhizuku` otherwise. **These are a pain to set up.** ### Device Owner - Hide / Suspend @@ -100,35 +90,45 @@ Search the message by search engine otherwise. Long press Hail at Apps, then select Uninstall in options. -### Superuser - Disable / Suspend +### [Dhizuku](https://github.com/iamr0s/Dhizuku) - Hide / Suspend + +This mode invoke: + +- `DevicePolicyManager.setApplicationHidden` to hide apps. + +- `DevicePolicyManager.setPackagesSuspended` to suspend apps. + +### Superuser - Disable / Hide / Suspend This mode execute: - `pm disable` to disable apps. +- `pm hide` to hide apps. + - `pm suspend` to suspend apps. -### Shizuku - Disable / Hide / Suspend +### [Shizuku](https://github.com/RikkaApps/Shizuku) - Disable / Hide / Suspend This mode invoke non-SDK interface: - `IPackageManager.setApplicationEnabledSetting` to disable apps. -- `IPackageManager.setApplicationHiddenSettingAsUser` to hide apps. (root may be required) +- `IPackageManager.setApplicationHiddenSettingAsUser` to hide apps. (root required) - `IPackageManager.setPackagesSuspendedAsUser` to suspend apps. ## Revert -### By adb (root may be required) +### By adb Replace com.package.name to the package name of target app. ```shell # Enable app adb shell pm enable com.package.name -# Unhide app -adb shell pm unhide com.package.name +# Unhide app (root required) +adb shell su -c pm unhide com.package.name # Unsuspend app adb shell pm unsuspend com.package.name ``` From 1c5b0827fb723f9991b526ed6a1920ad88f1d698 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:55:59 +0800 Subject: [PATCH 17/40] chore: update fastlane --- .../android/en-US/full_description.txt | 18 ++---------------- .../android/zh-CN/full_description.txt | 15 +-------------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index e02e2a1a..0bcda51a 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -12,19 +12,5 @@

Suspend

Suspended apps will be shown as grayscale icons in the launcher. Unsuspend them to revert.

Working mode

-

Hail can work with Device Owner, Superuser (Root) and - Shizuku (including Sui).

-

Frozen app need to be unfrozen by the same working mode.

-
    -
  1. -

    For devices support wifi adb or rooted, Shizuku is - recommend. About Shizuku

    -
  2. -
  3. -

    For rooted devices, Superuser is alternative. It is slower. -

    -
  4. -
  5. -

    Select Device Owner otherwise. It's a pain to set up.

    -
  6. -
\ No newline at end of file +

Hail can work with Device Owner, Dhizuku, Superuser (Root) and + Shizuku (including Sui).

\ No newline at end of file diff --git a/fastlane/metadata/android/zh-CN/full_description.txt b/fastlane/metadata/android/zh-CN/full_description.txt index bc2a6e1d..6ea33aa2 100644 --- a/fastlane/metadata/android/zh-CN/full_description.txt +++ b/fastlane/metadata/android/zh-CN/full_description.txt @@ -12,17 +12,4 @@

暂停

被暂停suspend的应用在启动器中会显示为灰度图标。取消暂停unsuspend应用即可恢复。

工作模式

-

雹支持以设备所有者超级用户 (Root) 和Shizuku (含 Sui) 模式工作。

-

冻结的应用需要通过相同工作模式解冻。

-
    -
  1. -

    如果您的设备支持无线调试或已 root,推荐选择Shizuku关于 Shizuku

    -
  2. -
  3. -

    如果您的设备已 root,可选择超级用户此模式速度相对较慢。

    -
  4. -
  5. -

    如果您的设备不支持无线调试且未 root,可选择设备所有者此模式设置较为繁琐。

    -
  6. -
\ No newline at end of file +

雹支持以设备所有者Dhizuku超级用户 (Root) 和Shizuku (含 Sui) 模式工作。

\ No newline at end of file From 8501ca8327974b57219bd4d6f544ce20956de3fb Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:58:29 +0800 Subject: [PATCH 18/40] chore: remove coolapk badge --- coolapk-badge.png | Bin 18005 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 coolapk-badge.png diff --git a/coolapk-badge.png b/coolapk-badge.png deleted file mode 100644 index b2910ddc08b25b92c1a602ccef1febf14bf77be5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18005 zcmd`7^;=Zm8!(I_f+F3FbSPZ|N{4i(NQX2?cY`7fNJ}H#Al(hp0!oLpba(f=#?SXT z*K>Y2=O1`4YR}$##hvR;z9=h7VW1MDA|N1O$ViK;A|N2b!1XoC6YyK$47LsaAeoCO zh#(+TM55gqB7@JA#?q<^2ne3E2nZh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WssR@ zF{$VRqIa4RC|^|`$&O4Hq`bPf@0yer!SW zXu9_Yk84OFvj=EW{sk@{S+-6>ov<^`2)oNEbZ}m|3f&=17i{|5+%Amd(^a598K+Z6 zMSuR+h+fi43U}{|QGs}T7X@Lb1O+j25_+_EIXb}?jq=pAXF7rqs;u6iX?O3aa6;ZA z*PO@^UK~L$3fmek?Jw0_+rkYc9-~;liDmWMW;OHN;;7g*aT$AFmz?8 zv-1(2?<7xq8vXRPcGc9LnbP|H=&=mJ$ukup|NipEOoJe zd`x)*OtjDP=yBGDv12W?QZH&a?)Rnd|9m6*J0%M<`WdtI@Kmq#5~Ch922qS2R;dF? z#rQiVEu_mw++%d`kaA{S{yGwFzcIjsnkoM@@hBgn7$O%1$j=ZT4oxpLpL3t0Cj?Sg@AJg8#(w(pf^&*~HM}pURzSmrQ toUfVK+4ddd{=Wv;*qK Date: Tue, 5 Sep 2023 06:50:16 +0200 Subject: [PATCH 19/40] Added translation using Weblate (Arabic) --- app/src/main/res/values-ar/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 app/src/main/res/values-ar/strings.xml diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml new file mode 100644 index 00000000..a6b3daec --- /dev/null +++ b/app/src/main/res/values-ar/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From f39c41b32a23362f3cc917012f217b3220a78a00 Mon Sep 17 00:00:00 2001 From: AppsTool Date: Tue, 5 Sep 2023 04:51:31 +0000 Subject: [PATCH 20/40] Translated using Weblate (Arabic) Currently translated at 0.7% (1 of 131 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/ar/ --- app/src/main/res/values-ar/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index a6b3daec..86d95ca8 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -1,2 +1,4 @@ - \ No newline at end of file + + Hail + \ No newline at end of file From d901914be8f8bc0e7f919604c5556dcb7b30f161 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Thu, 7 Sep 2023 00:11:22 +0000 Subject: [PATCH 21/40] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (131 of 131 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/pt_BR/ --- app/src/main/res/values-pt-rBR/strings.xml | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 86d95ca8..cbd0e58c 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1,4 +1,144 @@ Hail + Se o Hail for removido como proprietário do dispositivo, poderá haver dificuldades para reorganizar os aplicativos após a remoção do Hail. +\nOs aplicativos congelados permanecerão congelados após a remoção. Certifique-se de descongelar os aplicativos importantes. + Congelado: %s + Obrigado! + Adicionar à lista de permissões + Sintetizar ícones adaptativos + Customizar + Código inválido + Unpin + Remover proprietário do dispositivo + Desmarcar + Descongelar: %s + Remover da tela inicial + Tarefa adiada + Tag de descongelamento + Deseja desinstalar este aplicativo\? + Proprietário do dispositivo - Suspenso + Dhizuku - Suspenso + Limpe todos os atalhos dinâmicos + Ausente + Importar app + Importar da área de transferência + Shizuku desapareceu :( + Exportado: %s + Copiado: %s + Liberapay + Ignorar app em primeiro plano + Pacote de ícones + Proprietário do dispositivo - Oculto + Modo de trabalho + Nome + O serviço de auto congelamento está em execução + Congelados + Selecionado: %s + Terminal + Grupo do Telegram + Toque para seleção múltipla + Usuário + Nada aqui + Emita o comando do adb: +\n%s + Nenhum + Bloquear e congelar + Importar app congelado + Depois da tela bloqueada + Descongelar tudo + + %2$s após %1$d minuto: %3$s + %2$s após %1$d minutos: %3$s + %2$s após %1$d minutos: %3$s + + Exportar para a área de transferência + Pin + Importado: %s + Login biométrico + Exportar atual + Congelar + Superusuário - Desativar + Atalhos + Sobre + Bilibili space + Ação de bloco + Exportar tudo + Ícone em tons de cinza + Definir tag + Aplicativo não instalado + Ordenar por + Superusuário - Oculto + Informações do App + Obrigado! + Ícone compacto + Bilibili + Resgatar código + Cancelar + Desinstalar + Dhizuku – Oculto + Extrair APK + Tag de congelamento + Selecionar tudo + Descongelar e remover da tela inicial + Pular durante o carregamento + PayPal + Padrão + Filtro + Falha na operação: %s + Adicionar à tela inicial + Shizuku - Oculto + Iniciar + Adicionar tag + Alipay + Desfazer + Sistema + Primeira instalação + Remover tag + Shizuku – Suspenso + Superusuário - Suspenso + + %d minuto + %d minutos + %d minutos + + F-Droid + Bloquear + Antes de congelar aplicativos, selecione um modo de funcionamento nas configurações. + Última atualização + O código expirou + Descongelar + WeChat Pay + Faça login usando sua credencial biométrica + Permissão negada + Ajuda + Grupo do QQ + Procurar + Congelamento! + Congelamento automático + Início + Licenças + Traduzir + Shizuku – Desativado + Siga-me no Bilibili. + Doar + Tempo de instalação + GitHub + Atividade de iniciação não encontrada + Configurações + Versão + Apps + Não foi possível se comunicar com o servidor. Por favor, tente novamente mais tarde. + Definir proprietário do dispositivo + Congelar o atual + Extraído para: %s + Congelar não incluído na lista de permissões + Descongelar o atual + Ação de atalho dinâmico + Atraso de congelamento (minutos) + Congelar tudo + Pular app de notificação + Descongelados + Escanear + Remover da lista de permissões \ No newline at end of file From 11704821b0072c955ff5fbefdc656989638588c8 Mon Sep 17 00:00:00 2001 From: AppsTool Date: Tue, 5 Sep 2023 23:07:02 +0000 Subject: [PATCH 22/40] Translated using Weblate (Arabic) Currently translated at 100.0% (131 of 131 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/ar/ --- app/src/main/res/values-ar/strings.xml | 146 +++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 86d95ca8..00e5cbfe 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -1,4 +1,150 @@ Hail + إذا تمت إزالة Hail كمالك للجهاز، فقد تكون هناك صعوبات في إعادة تنظيم التطبيقات بعد إزالة hail. +\nستظل التطبيقات المجمدة مجمدة بعد إلغاء التثبيت، يرجى التأكد من إلغاء تجميد التطبيقات المهمة. + مجمد: %s + شكرا لك! + إضافة إلى القائمة البيضاء + تؤليف الأيقونات التكيفية + تخصيص + رمز غير صالح + إزالة التثبيت + إزالة مالك الجهاز + الغاء تحديد + غير مجمد: %s + إزالة من الصفحة الرئيسية + تأجيل التجميد + إلغاء تجميد العلامة + هل تريد إلغاء تثبيت هذا التطبيق؟ + مالك الجهاز - تعليق + ديزوكو - تعليق + مسح كل الاختصارات الديناميكية + خامل + استيراد التطبيق + استيراد من الحافظة + شيزوكو مفقود :( + مصدّر: %s + منسوخ: %s + ليبراباي + تخطي التطبيق الأمامي + حزمة الأيقونات + مالك الجهاز - إخفاء + وضع العمل + التسمية + خدمة التجميد التلقائي قيد التشغيل + مجمد + المحدد: %s + الطرفية + مجموعة تيليجرام + انقر للتحديد المتعدد + المستخدم + لا شيء هنا + إصدار الأمر من adb: +\n%s + لا شيء + قفل وتجميد + استيراد التطبيق المجمد + بعد قفل الشاشة + إلغاء تجميد الكل + + بعد أقل من دقيقة: + بعد دقيقة واحدة: + بعد دقيقتين: + %2$s بعد %1$d دقائق: %3$s + %2$s بعد %1$d دقيقة: %3$s + %2$s بعد %1$d دقائق: %3$s + + تصدير إلى الحافظة + تثبيت + مستور: %s + تسجيل الدخول البيومتري + تصدير الحالية + تجميد + المستخدم الجذر - تعطيل + الاختصارات + لمحة + مساحة بيليبيلي + عمل الزر + تصدير الكل + أيقونة التدرج الرمادي + تحديد علامة + التطبيق ليس مثبتا + ترتيب حسب + مستخدم الجذر - إخفاء + معلومات التطبيق + شكرا لك! + أيقونة مضغوطة + بيليبيلي-Bilibili + استرداد الرمز + إلغاء + إلغاء التثبيت + ديزوكو - إخفاء + استخراج APK + علامة التجميد + تحديد الكل + إلغاء التجميد وإزالة من الصفحة الرئيسية + تخطي أثناء الشحن + بايبال-PayPal + افتراضي + فلاتر + فشلت العملية: %s + إضافة إلى الشاشة الرئيسية + شيزوكو - إخفاء + فتح + إضافة علامة + علي باي + تراجع + النظام + أول تثبيت + إزالة علامة + شيزوكو - تعليق + المستخدم الجذر - تعليق + + أقل من دقيقة + دقيقة واحدة + دقيقتين + %d دقائق + %d دقيقةً + %d دقيقة + + إف-درويد + القفل + قبل تجميد التطبيقات ، يرجى تحديد وضع العمل في الإعدادات. + آخر تحديث + انتهت صلاحية الرمز + إلغاء التجميد + وي تشات باي + تسجيل الدخول باستخدام بيانات الاعتماد البيومترية الخاصة بك + تم رفض الإذن + مساعدة + مجموعة QQ + بحث + تجميد! + تجميد تلقائي + رئيسي + التراخيص + الترجمة + شيزوكو - تعطيل + تابعني على بيليبيلي. + تبرّع + وقت التثبيت + جيثب + لم يتم العثور على نشاط التشغيل + الاعدادات + نسخة + التطبيقات + غير قادر على الاتصال بالخادم. يرجى إعادة المحاولة لاحقا. + تحديد مالك الجهاز + المجيد الحاليا + مستخرج إلى: %s + تجميد باستشناء القائمة البيضاء + إلغاء تجميد الحالي + عمل الاختصار الديناميكي + تأخير التجميد (بالدقائق) + تجميد الكل + تخطي تطبيق الإخطار + غير مجمد + مسح ضوئي + إزالة من القائمة البيضاء \ No newline at end of file From fc46150ac8821492e0142836e899021f6adf3216 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:21:51 +0800 Subject: [PATCH 23/40] perf: owner remove dialog --- .../com/aistra/hail/ui/apps/AppsFragment.kt | 10 +--------- .../com/aistra/hail/ui/main/MainActivity.kt | 10 ++++++++++ .../aistra/hail/ui/settings/SettingsFragment.kt | 9 ++++++--- .../res/drawable/ic_outline_remove_owner.xml | 16 ++++++++++++++++ app/src/main/res/menu/menu_settings.xml | 6 ++++++ 5 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 app/src/main/res/drawable/ic_outline_remove_owner.xml diff --git a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt index c8f43d93..fd327bee 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt @@ -100,15 +100,7 @@ class AppsFragment : MainFragment(), AppsAdapter.OnItemClickListener, 3 -> when { pkg == app.packageName -> { when { - HPolicy.isDeviceOwnerActive -> MaterialAlertDialogBuilder(activity).setTitle( - R.string.title_remove_owner - ).setMessage(R.string.msg_remove_owner) - .setPositiveButton(android.R.string.ok) { _, _ -> - HPolicy.setOrganizationName() - HPolicy.clearDeviceOwnerApp() - uninstallDialog(name, pkg) - }.setNegativeButton(android.R.string.cancel, null).show() - + HPolicy.isDeviceOwnerActive -> activity.ownerRemoveDialog() HPolicy.isAdminActive -> { HPolicy.removeActiveAdmin() uninstallDialog(name, pkg) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt b/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt index efe66337..e768e67f 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt @@ -19,6 +19,7 @@ import androidx.navigation.ui.setupWithNavController import com.aistra.hail.R import com.aistra.hail.app.HailData import com.aistra.hail.databinding.ActivityMainBinding +import com.aistra.hail.utils.HPolicy import com.aistra.hail.utils.HUI import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton @@ -108,6 +109,15 @@ class MainActivity : AppCompatActivity(), NavController.OnDestinationChangedList .setOnDismissListener { HailData.setGuideVersion() }.show() } + fun ownerRemoveDialog() { + MaterialAlertDialogBuilder(this).setTitle(R.string.title_remove_owner) + .setMessage(R.string.msg_remove_owner) + .setPositiveButton(android.R.string.ok) { _, _ -> + HPolicy.setOrganizationName() + HPolicy.clearDeviceOwnerApp() + }.setNegativeButton(android.R.string.cancel, null).show() + } + override fun onStop() { super.onStop() if (HailData.biometricLogin) finishAndRemoveTask() diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index 07ecc0a1..adc17fd4 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -21,6 +21,7 @@ import com.aistra.hail.app.AppManager import com.aistra.hail.app.HailApi import com.aistra.hail.app.HailData import com.aistra.hail.databinding.DialogInputBinding +import com.aistra.hail.ui.main.MainActivity import com.aistra.hail.utils.* import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.textview.MaterialTextView @@ -311,6 +312,7 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan }.setNegativeButton(android.R.string.cancel, null).show() } + R.id.action_remove_owner -> (requireActivity() as MainActivity).ownerRemoveDialog() R.id.action_help -> HUI.openLink(HailData.URL_README) } return false @@ -318,8 +320,9 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan override fun onCreateMenu(menu: Menu, inflater: MenuInflater) { inflater.inflate(R.menu.menu_settings, menu) - if (HailData.workingMode.startsWith(HailData.SU) || HailData.workingMode.startsWith(HailData.SHIZUKU)) menu.findItem( - R.id.action_terminal - ).isVisible = true + if (HailData.workingMode.startsWith(HailData.SU) || HailData.workingMode.startsWith(HailData.SHIZUKU)) + menu.findItem(R.id.action_terminal).isVisible = true + else if (HPolicy.isDeviceOwnerActive) + menu.findItem(R.id.action_remove_owner).isVisible = true } } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_outline_remove_owner.xml b/app/src/main/res/drawable/ic_outline_remove_owner.xml new file mode 100644 index 00000000..c543a508 --- /dev/null +++ b/app/src/main/res/drawable/ic_outline_remove_owner.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/app/src/main/res/menu/menu_settings.xml b/app/src/main/res/menu/menu_settings.xml index 543248c9..151ff00e 100644 --- a/app/src/main/res/menu/menu_settings.xml +++ b/app/src/main/res/menu/menu_settings.xml @@ -6,6 +6,12 @@ android:title="@string/action_terminal" android:visible="false" app:showAsAction="ifRoom" /> + Date: Fri, 8 Sep 2023 12:50:09 +0000 Subject: [PATCH 24/40] Translated using Weblate (Spanish) Currently translated at 100.0% (131 of 131 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/es/ --- app/src/main/res/values-es/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 0da731fc..4de2673e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -139,4 +139,5 @@ Dhizuku - Ocultar Dhizuku - Suspender Superusuario - Ocultar + F-Droid \ No newline at end of file From 49d7a9839f24d9cbfecaf374a034a65d3acf4f40 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:05:06 +0800 Subject: [PATCH 25/40] perf: clarify shortcut dialog --- app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt | 4 ++-- app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt index 3de54f7d..2122b6f5 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt @@ -226,14 +226,14 @@ class PagerFragment : MainFragment(), PagerAdapter.OnItemClickListener, HailApi.getIntentForPackage(HailApi.ACTION_LAUNCH, pkg) .addTag(HailData.tags[index].first) ) - }.setNegativeButton(R.string.action_none) { _, _ -> + }.setPositiveButton(R.string.action_skip) { _, _ -> HShortcuts.addPinShortcut( info, pkg, info.name, HailApi.getIntentForPackage(HailApi.ACTION_LAUNCH, pkg) ) - }.show() + }.setNegativeButton(android.R.string.cancel, null).show() 7 -> exportToClipboard(listOf(info)) 8 -> removeCheckedApp(pkg) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 52bf9eb9..44ae877b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -139,4 +139,5 @@ Dhizuku - 暂停 超级用户 - 隐藏 F-Droid + 跳过 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 83cd1525..4e5cd24c 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -139,4 +139,5 @@ 終端機 超級使用者 - 隱藏 F-Droid + 跳過 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f4989260..a1f5de1a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -138,4 +138,5 @@ Dhizuku - Suspend Superuser - Hide F-Droid + Skip \ No newline at end of file From 68b1ac5d253a750f91ebfa412129659b9d31fdfd Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:18:36 +0800 Subject: [PATCH 26/40] fix: notification listener not found --- app/src/main/kotlin/com/aistra/hail/HailApp.kt | 17 ++++++++++------- .../aistra/hail/ui/settings/SettingsFragment.kt | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/HailApp.kt b/app/src/main/kotlin/com/aistra/hail/HailApp.kt index 869d9333..ff7dfbf9 100644 --- a/app/src/main/kotlin/com/aistra/hail/HailApp.kt +++ b/app/src/main/kotlin/com/aistra/hail/HailApp.kt @@ -28,20 +28,23 @@ class HailApp : Application() { && !it.whitelisted } val intent = Intent(app, AutoFreezeService::class.java) - val name = ComponentName(app, AutoFreezeService::class.java) if (start) { - packageManager.setComponentEnabledSetting( - name, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP - ) + setAutoFreezeServiceEnabled(true) ContextCompat.startForegroundService(app, intent) } else { stopService(intent) - packageManager.setComponentEnabledSetting( - name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP - ) + setAutoFreezeServiceEnabled(false) } } + fun setAutoFreezeServiceEnabled(enabled: Boolean) { + packageManager.setComponentEnabledSetting( + ComponentName(app, AutoFreezeService::class.java), + if (enabled) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP + ) + } + companion object { lateinit var app: HailApp private set } diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index adc17fd4..5ca8dabc 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -60,6 +60,7 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan val isGranted = NotificationManagerCompat.getEnabledListenerPackages(requireContext()) .contains(requireContext().packageName) if (value == true && !isGranted) { + app.setAutoFreezeServiceEnabled(true) startActivity(Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS)) false } else true From 2bcddef375eb40362b46bd5e844af7c4813c85c2 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:32:01 +0800 Subject: [PATCH 27/40] chore: update README --- README.md | 2 +- README_EN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a01677f1..da4b2c08 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Active admin set to component {com.aistra.hail/com.aistra.hail.receiver.DeviceAd #### 移除雹的设备所有者 -在雹的应用界面长按雹,在弹出的选项中选择卸载。 +设置 > 移除设备所有者 ### Dhizuku - 隐藏 / 暂停 diff --git a/README_EN.md b/README_EN.md index 36297938..63530a61 100644 --- a/README_EN.md +++ b/README_EN.md @@ -88,7 +88,7 @@ Search the message by search engine otherwise. #### Remove device owner -Long press Hail at Apps, then select Uninstall in options. +Settings > Remove Device Owner ### [Dhizuku](https://github.com/iamr0s/Dhizuku) - Hide / Suspend From 850e616db38e6e9e72650b43183b4e374e859487 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Thu, 14 Sep 2023 11:03:54 +0000 Subject: [PATCH 28/40] Translated using Weblate (Spanish) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/es/ --- app/src/main/res/values-es/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 4de2673e..9a62dad2 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -140,4 +140,5 @@ Dhizuku - Suspender Superusuario - Ocultar F-Droid + Omitir \ No newline at end of file From 24cce21a186a7e17aa84ebe34822ff16946b9736 Mon Sep 17 00:00:00 2001 From: Aistra Date: Wed, 13 Sep 2023 06:38:19 +0000 Subject: [PATCH 29/40] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/zh_Hant/ --- app/src/main/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 4e5cd24c..4510bc99 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -28,7 +28,7 @@ 延期工作 新增標籤 移除標籤 - 設定標籤 + 標籤分組 新增至主畫面 匯出至剪貼簿 從剪貼簿匯入 From 14971b10e1e32ea7fee55d4fca03d7c44c6091bc Mon Sep 17 00:00:00 2001 From: dedy prasetyo Date: Wed, 13 Sep 2023 12:40:20 +0000 Subject: [PATCH 30/40] Translated using Weblate (Indonesian) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/id/ --- app/src/main/res/values-in/strings.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 2dabcd0c..d0244f70 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -39,8 +39,8 @@ Copot pemasangan aplikasi ini\? Mode kerja Pemilik Perangkat - Sembunyikan - SuperUser - Tangguhkan - SuperUser - Matikan + Superuser - Tangguhkan + Superuser - Matikan Shizuku - Matikan Shizuku - Tangguhkan Kode salah @@ -135,4 +135,7 @@ Tandai semua Dhizuku - Sembunyikan Dhizuku - Tangguhkan + Lewati + Superuser - Sembunyikan + F-Droid \ No newline at end of file From f057e8dffa245f1ed70ce0892dcac674bed11834 Mon Sep 17 00:00:00 2001 From: Aistra Date: Wed, 13 Sep 2023 06:36:15 +0000 Subject: [PATCH 31/40] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/zh_Hans/ --- app/src/main/res/values-zh-rCN/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 44ae877b..db028853 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -28,7 +28,7 @@ 定时任务 添加标签 移除标签 - 设置标签 + 标签分组 添加到主屏幕 导出到剪切板 从剪切板导入 From 7da68f93339f9a144ab573eddc2b125677ddb4d6 Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:10:39 +0800 Subject: [PATCH 32/40] chore: update locales_config.xml --- app/src/main/res/xml/locales_config.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/res/xml/locales_config.xml b/app/src/main/res/xml/locales_config.xml index 48918de6..579f1556 100644 --- a/app/src/main/res/xml/locales_config.xml +++ b/app/src/main/res/xml/locales_config.xml @@ -1,5 +1,7 @@ + + From 79adb5eb78e2d4363cdcbbdfc8013a6f2443ec7d Mon Sep 17 00:00:00 2001 From: Aistra <55940744+aistra0528@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:19:35 +0800 Subject: [PATCH 33/40] chore: bump version to 1.5.0 --- app/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index de548a4c..95e6f038 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,8 +11,8 @@ android { applicationId = "com.aistra.hail" minSdk = 23 targetSdk = 33 - versionCode = 27 - versionName = "1.4.0" + versionCode = 28 + versionName = "1.5.0" } val signing = if (file("../signing.properties").exists()) { @@ -61,7 +61,7 @@ android { } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.appcompat:appcompat:1.6.1") implementation("androidx.biometric:biometric:1.1.0") From 1593883a137e38e7a984022d7fe308647437b7a2 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Sun, 17 Sep 2023 13:52:12 +0000 Subject: [PATCH 34/40] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/pt_BR/ --- app/src/main/res/values-pt-rBR/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index cbd0e58c..ce09aeea 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -141,4 +141,5 @@ Descongelados Escanear Remover da lista de permissões + Pular \ No newline at end of file From 2bf1854deeb5f67f533e0e7db0b20ce29a162527 Mon Sep 17 00:00:00 2001 From: Jesse205 <51242302+Jesse205@users.noreply.github.com> Date: Sun, 24 Sep 2023 17:58:24 +0800 Subject: [PATCH 35/40] fix: Show/hide the terminal menu when changing modes (#132) --- .../com/aistra/hail/ui/settings/SettingsFragment.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index 5ca8dabc..6e6febd0 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.content.pm.PackageManager import android.os.Bundle import android.provider.Settings +import android.util.Log import android.view.* import android.widget.FrameLayout import androidx.appcompat.content.res.AppCompatResources @@ -193,6 +194,8 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan } override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean { + // Show/hide terminal menu. + activity?.invalidateOptionsMenu() val mode = newValue as String when { mode.startsWith(HailData.OWNER) -> if (!HPolicy.isDeviceOwnerActive) { @@ -274,6 +277,7 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan false } } + return true } @@ -321,6 +325,10 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan override fun onCreateMenu(menu: Menu, inflater: MenuInflater) { inflater.inflate(R.menu.menu_settings, menu) + } + + override fun onPrepareMenu(menu: Menu) { + super.onPrepareMenu(menu) if (HailData.workingMode.startsWith(HailData.SU) || HailData.workingMode.startsWith(HailData.SHIZUKU)) menu.findItem(R.id.action_terminal).isVisible = true else if (HPolicy.isDeviceOwnerActive) From becdff0613eb4f7286b8e6659d687fb667f82175 Mon Sep 17 00:00:00 2001 From: Jesse205 <51242302+Jesse205@users.noreply.github.com> Date: Sun, 24 Sep 2023 18:00:40 +0800 Subject: [PATCH 36/40] feat: liftable appbar (#133) --- app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt | 2 ++ app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt | 2 ++ app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt | 1 + app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt | 3 +++ .../kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt | 2 ++ app/src/main/res/layout-land/app_bar_main.xml | 4 +--- app/src/main/res/layout/app_bar_main.xml | 4 +--- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt index 8692372f..6a643b6c 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/about/AboutFragment.kt @@ -29,6 +29,8 @@ class AboutFragment : MainFragment(), View.OnClickListener { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { _binding = FragmentAboutBinding.inflate(inflater, container, false) + activity.appbar.setLiftOnScrollTargetView(binding.root) + binding.descVersion.text = HailData.VERSION aboutViewModel = ViewModelProvider(this)[AboutViewModel::class.java] aboutViewModel.time.observe(viewLifecycleOwner) { diff --git a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt index fd327bee..22f80b73 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsFragment.kt @@ -43,6 +43,8 @@ class AppsFragment : MainFragment(), AppsAdapter.OnItemClickListener, return SwipeRefreshLayout(activity).apply { refreshLayout = this addView(RecyclerView(activity).apply { + activity.appbar.setLiftOnScrollTargetView(this) + layoutManager = GridLayoutManager(activity, resources.getInteger(R.integer.apps_span)) adapter = AppsAdapter.apply { diff --git a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt index 2122b6f5..707263e6 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt @@ -99,6 +99,7 @@ class PagerFragment : MainFragment(), PagerAdapter.OnItemClickListener, super.onResume() updateCurrentList() updateBarTitle() + activity.appbar.setLiftOnScrollTargetView(binding.recyclerView) tabs.getTabAt(tabs.selectedTabPosition)?.view?.setOnLongClickListener { if (isResumed) showTagDialog() true diff --git a/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt b/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt index e768e67f..3f2769fa 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt @@ -21,11 +21,13 @@ import com.aistra.hail.app.HailData import com.aistra.hail.databinding.ActivityMainBinding import com.aistra.hail.utils.HPolicy import com.aistra.hail.utils.HUI +import com.google.android.material.appbar.AppBarLayout import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton class MainActivity : AppCompatActivity(), NavController.OnDestinationChangedListener { lateinit var fab: ExtendedFloatingActionButton + lateinit var appbar: AppBarLayout private lateinit var navController: NavController private lateinit var appBarConfiguration: AppBarConfiguration @@ -69,6 +71,7 @@ class MainActivity : AppCompatActivity(), NavController.OnDestinationChangedList setContentView(root) setSupportActionBar(appBarMain.toolbar) fab = appBarMain.fab + appbar = appBarMain.appBarLayout navController = findNavController(R.id.nav_host_fragment) navController.addOnDestinationChangedListener(this@MainActivity) appBarConfiguration = AppBarConfiguration.Builder( diff --git a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt index 6e6febd0..38c7e01d 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/settings/SettingsFragment.kt @@ -45,6 +45,8 @@ class SettingsFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChan ): View { val menuHost = requireActivity() as MenuHost menuHost.addMenuProvider(this, viewLifecycleOwner, Lifecycle.State.RESUMED) + (requireActivity() as MainActivity).appbar.liftOnScrollTargetViewId = R.id.recycler_view + return super.onCreateView(inflater, container, savedInstanceState) } diff --git a/app/src/main/res/layout-land/app_bar_main.xml b/app/src/main/res/layout-land/app_bar_main.xml index 6386cab5..c8f1c191 100644 --- a/app/src/main/res/layout-land/app_bar_main.xml +++ b/app/src/main/res/layout-land/app_bar_main.xml @@ -11,9 +11,7 @@ android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:theme="@style/Theme.Hail.AppBarOverlay" - app:liftOnScroll="false" - app:liftOnScrollColor="@android:color/transparent"> + android:theme="@style/Theme.Hail.AppBarOverlay"> + android:theme="@style/Theme.Hail.AppBarOverlay"> Date: Tue, 26 Sep 2023 06:15:42 +0000 Subject: [PATCH 37/40] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/zh_Hans/ --- app/src/main/res/values-zh-rCN/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index db028853..bc04c7d2 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -102,8 +102,8 @@ 自动冻结 自动冻结服务正在运行 锁屏后 - 充电时跳过 - 跳过前台应用 + 充电时例外 + 保留前台应用 自定义 灰度图标 紧凑图标 @@ -119,7 +119,7 @@ 合成自适应图标 导出当前 全部导出 - 跳过通知中应用 + 保留通知中应用 冻结延时(分钟) 设备所有者 - 暂停 超级用户 - 暂停 From d0b33e0e9aaffa32f57d88a1d3e0fbcec1bbfb78 Mon Sep 17 00:00:00 2001 From: Jesse205 <51242302+Jesse205@users.noreply.github.com> Date: Tue, 3 Oct 2023 01:06:58 +0800 Subject: [PATCH 38/40] fix: crash because fragment tag (#137) * fix: crash because fragment tag * fix: delete ignore --- .../main/kotlin/com/aistra/hail/ui/main/MainActivity.kt | 7 +++++-- app/src/main/res/layout/content_main.xml | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt b/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt index 3f2769fa..ac72741b 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/main/MainActivity.kt @@ -11,7 +11,7 @@ import androidx.core.view.isVisible import androidx.core.view.updatePadding import androidx.navigation.NavController import androidx.navigation.NavDestination -import androidx.navigation.findNavController +import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.navigateUp import androidx.navigation.ui.setupActionBarWithNavController @@ -72,7 +72,10 @@ class MainActivity : AppCompatActivity(), NavController.OnDestinationChangedList setSupportActionBar(appBarMain.toolbar) fab = appBarMain.fab appbar = appBarMain.appBarLayout - navController = findNavController(R.id.nav_host_fragment) + + val navHostFragment = + supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment + val navController = navHostFragment.navController navController.addOnDestinationChangedListener(this@MainActivity) appBarConfiguration = AppBarConfiguration.Builder( R.id.nav_home, R.id.nav_apps, R.id.nav_settings, R.id.nav_about diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 843cf7e5..77d15a08 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -7,13 +7,12 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showIn="@layout/app_bar_main"> - + app:navGraph="@navigation/mobile_navigation" /> From 6be13cdd35b694f1f4eeedb19a88766fc3ecdddf Mon Sep 17 00:00:00 2001 From: AppsTool Date: Mon, 2 Oct 2023 00:18:37 +0000 Subject: [PATCH 39/40] Translated using Weblate (Arabic) Currently translated at 100.0% (132 of 132 strings) Translation: Hail/Hail Translate-URL: https://hosted.weblate.org/projects/hail/hail/ar/ --- app/src/main/res/values-ar/strings.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 00e5cbfe..ed40fdbb 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -24,7 +24,7 @@ استيراد التطبيق استيراد من الحافظة شيزوكو مفقود :( - مصدّر: %s + تم تصدير: %s منسوخ: %s ليبراباي تخطي التطبيق الأمامي @@ -57,7 +57,7 @@ تصدير إلى الحافظة تثبيت - مستور: %s + تم استيراد: %s تسجيل الدخول البيومتري تصدير الحالية تجميد @@ -136,15 +136,16 @@ التطبيقات غير قادر على الاتصال بالخادم. يرجى إعادة المحاولة لاحقا. تحديد مالك الجهاز - المجيد الحاليا + تجميد الحالية مستخرج إلى: %s تجميد باستشناء القائمة البيضاء - إلغاء تجميد الحالي - عمل الاختصار الديناميكي + إلغاء تجميد الحالية + عمل الإختصار الديناميكي تأخير التجميد (بالدقائق) تجميد الكل تخطي تطبيق الإخطار غير مجمد مسح ضوئي إزالة من القائمة البيضاء + تخطي \ No newline at end of file From 365c2e0c75e4b66ef47ecb9ae63ab423e3c33c16 Mon Sep 17 00:00:00 2001 From: whp98 Date: Sun, 8 Oct 2023 17:47:42 +0800 Subject: [PATCH 40/40] add function PinyinSearch for chinese user --- app/build.gradle.kts | 1 + .../com/aistra/hail/ui/apps/AppsAdapter.kt | 7 +- .../com/aistra/hail/ui/home/PagerFragment.kt | 5 +- .../com/aistra/hail/utils/PinyinSearch.kt | 144 ++++++++++++++++++ 4 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 app/src/main/kotlin/com/aistra/hail/utils/PinyinSearch.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 95e6f038..85b661cb 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -78,4 +78,5 @@ dependencies { implementation("io.github.iamr0s:Dhizuku-API:2.4") implementation("me.zhanghai.android.appiconloader:appiconloader:1.5.0") implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3") + implementation("com.belerweb:pinyin4j:2.5.1") } \ No newline at end of file diff --git a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt index abfb1389..a938ae52 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/apps/AppsAdapter.kt @@ -18,6 +18,7 @@ import com.aistra.hail.app.HailData import com.aistra.hail.utils.AppIconCache import com.aistra.hail.utils.HPackages import com.aistra.hail.utils.NameComparator +import com.aistra.hail.utils.PinyinSearch import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job @@ -58,8 +59,10 @@ object AppsAdapter : && ((HailData.filterFrozenApps && AppManager.isAppFrozen(it.packageName)) || (HailData.filterUnfrozenApps && !AppManager.isAppFrozen(it.packageName))) - && (query.isNullOrEmpty() || it.packageName.contains(query, true) - || it.loadLabel(pm).toString().contains(query, true)) + && (query.isNullOrEmpty() + || it.packageName.contains(query, true) + || it.loadLabel(pm).toString().contains(query, true) + || PinyinSearch.searchPinyinAll(it.loadLabel(pm).toString(), query)) }.run { when (HailData.sortBy) { HailData.SORT_INSTALL -> sortedBy { diff --git a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt index 707263e6..c0a1d939 100644 --- a/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt +++ b/app/src/main/kotlin/com/aistra/hail/ui/home/PagerFragment.kt @@ -31,6 +31,7 @@ import com.aistra.hail.utils.HPackages import com.aistra.hail.utils.HShortcuts import com.aistra.hail.utils.HUI import com.aistra.hail.utils.NameComparator +import com.aistra.hail.utils.PinyinSearch import com.aistra.hail.work.HWork import com.google.android.material.color.MaterialColors import com.google.android.material.dialog.MaterialAlertDialogBuilder @@ -115,7 +116,9 @@ class PagerFragment : MainFragment(), PagerAdapter.OnItemClickListener, private fun updateCurrentList() = HailData.checkedList.filter { if (query.isEmpty()) it.tagId == tag.second - else it.packageName.contains(query, true) || it.name.contains(query, true) + else (it.packageName.contains(query, true) + || it.name.contains(query, true) + || PinyinSearch.searchPinyinAll(it.name.toString(), query)) }.sortedWith(NameComparator).let { binding.empty.isVisible = it.isEmpty() pagerAdapter.submitList(it) diff --git a/app/src/main/kotlin/com/aistra/hail/utils/PinyinSearch.kt b/app/src/main/kotlin/com/aistra/hail/utils/PinyinSearch.kt new file mode 100644 index 00000000..ccfc6c65 --- /dev/null +++ b/app/src/main/kotlin/com/aistra/hail/utils/PinyinSearch.kt @@ -0,0 +1,144 @@ +package com.aistra.hail.utils + +import net.sourceforge.pinyin4j.PinyinHelper +import java.util.Locale + + +/**中文拼音搜索类*/ +object PinyinSearch { + /** + * 分别使用首字母和全拼进行匹配,满足条件之一就返回true, + * 如果当前语言不是中文就直接返回false + * @param textToSearch 需要匹配的字符串 + * @param textInput 用户输入 + * */ + fun searchPinyinAll(textToSearch: String?, textInput: String): Boolean { + if (textToSearch==null){ + return false + } + val language = Locale.getDefault().language + return if (language.equals(Locale.CHINESE.language)) { + searchCap(textToSearch, textInput) || searchAllSpell(textToSearch, textInput) + } else { + false + } + } + + /** + * 根据首字母进行搜索 + * 比如搜索”计算器“ 只需要输入 ”jsq“ + * */ + fun searchCap(appName: String, pinyinCap: String): Boolean { + if (pinyinCap.length < 80) { + for (index in getNameStringList(appName)) { + if (index.contains(pinyinCap, true)) { + return true + } + } + return false + } else { + return false + } + } + + /** + * 根据全部拼音进行搜索 + * 比如搜索 计算器 只需要输入 "jisuanqi" + * */ + fun searchAllSpell(appName: String, pinyinAll: String): Boolean { + if (pinyinAll.length < 30) { + for (index in getNameStringPinyinAll(appName)) { + if (index.contains(pinyinAll, true)) { + return true + } + } + return false + } else { + return false + } + } + + fun getNameStringPinyinAll(target: String): ArrayList { + val res = ArrayList() + getNameCapListPinyinAll(Array(target.length) { "" }, 0, target, res) + return res + } + + fun getNameStringList(target: String): ArrayList { + val res = ArrayList() + getNameCapList(CharArray(target.length), 0, target, res) + return res + } + + fun getNameCapList( + capList: CharArray, currentIndex: Int, target: String, result: ArrayList + ) { + if (currentIndex == target.length - 1) { + val arrayOrNull = PinyinHelper.toHanyuPinyinStringArray(target[currentIndex]) + if (arrayOrNull == null) { + capList[currentIndex] = target[currentIndex] + result.add(String(capList)) + } else { + val arrayOrNullCharArray = arrayOrNull.map { e -> e[0] }.distinct().toCharArray() + for (item in arrayOrNullCharArray) { + capList[currentIndex] = item + result.add(String(capList)) + } + } + + } else { + val arrayOrNull = PinyinHelper.toHanyuPinyinStringArray(target[currentIndex]) + if (arrayOrNull == null) { + val arr = capList.copyOf() + arr[currentIndex] = target[currentIndex] + val newIndex = currentIndex + 1 + getNameCapList(arr, newIndex, target, result) + } else { + val arrayOrNullCharArray = arrayOrNull.map { e -> e[0] }.distinct().toCharArray() + for (item in arrayOrNullCharArray) { + val arr = capList.copyOf() + arr[currentIndex] = item + val newIndex = currentIndex + 1 + getNameCapList(arr, newIndex, target, result) + } + } + + } + } + + fun getNameCapListPinyinAll( + fullList: Array, currentIndex: Int, target: String, result: ArrayList + ) { + if (currentIndex == target.length - 1) { + val arrayOrNull = PinyinHelper.toHanyuPinyinStringArray(target[currentIndex]) + if (arrayOrNull == null) { + fullList[currentIndex] = target[currentIndex].toString() + result.add(fullList.joinToString("")) + } else { + val arrayDis = arrayOrNull.map { e -> e.substring(0, e.length - 1) }.distinct() + for (item in arrayDis) { + fullList[currentIndex] = item + result.add(fullList.joinToString("")) + } + } + + } else { + val arrayOrNull = PinyinHelper.toHanyuPinyinStringArray(target[currentIndex]) + if (arrayOrNull == null) { + val arr = fullList.copyOf() + arr[currentIndex] = target[currentIndex].toString() + val newIndex = currentIndex + 1 + getNameCapListPinyinAll(arr, newIndex, target, result) + } else { + val arrayDis = arrayOrNull.map { e -> e.substring(0, e.length - 1) }.distinct() + for (item in arrayDis) { + val arr = fullList.copyOf() + arr[currentIndex] = item + val newIndex = currentIndex + 1 + getNameCapListPinyinAll(arr, newIndex, target, result) + } + } + + } + } +} \ No newline at end of file