Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ build/
.externalNativeBuild
.cxx
local.properties
/app/release
/app/release/*
!/app/release/keepRules
/app/beta
/app/canary
/app/debug
Expand Down
6 changes: 1 addition & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,14 @@ android {
}

val applyBase: ApplicationBuildType.() -> Unit = {
isMinifyEnabled = true
// noinspection NotShrinkingResources
isShrinkResources = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
optimization.enable = true
buildConfigField("String", "GIT_CODE", "\"$gitVersionCode\"")
}

release {
applyBase()
configSigning()
buildConfigField("String", "GIT_HASH", "\"$gitHash\"")
proguardFiles("proguard-log.pro")
versionNameSuffix = "-$dateSuffix"
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void setPreference() {
if (getContext() == null) {
return;
}
int iconSize = getResources().getDimensionPixelSize(fan.preference.R.dimen.miuix_preference_icon_height);
int iconSize = getResources().getDimensionPixelSize(R.dimen.header_icon_size);
Resources resources = getResources();
try (XmlResourceParser xml = resources.getXml(R.xml.prefs_settings_safe_mode)) {
int event = xml.getEventType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
import android.widget.TextView;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.common.utils.AppLanguageHelper;

import java.lang.ref.WeakReference;

public class HomePageTipHelper {

private static final Object TIP_REQUEST_LOCK = new Object();
private static String mCurrentTip = "";
/** 产生 mCurrentTip 时使用的应用语言,用于在切语言后令缓存失效。 */
private static String mCurrentTipLang = "";
private static boolean sIsLoadingTip;
private static WeakReference<TextView> sCurrentTipViewRef = new WeakReference<>(null);

Expand All @@ -23,9 +26,12 @@ public static View getTipView(Context context) {

if (tipView != null) {
sCurrentTipViewRef = new WeakReference<>(tipView);
if (!TextUtils.isEmpty(mCurrentTip)) {
String currentLang = AppLanguageHelper.getLanguage(context);
boolean langChanged = !TextUtils.equals(currentLang, mCurrentTipLang);
if (!TextUtils.isEmpty(mCurrentTip) && !langChanged) {
tipView.setText("Tip: " + mCurrentTip);
} else {
// 语言变了或者还没拉过,重新拉一条。
tipView.setText("Tip: Loading...");
updateTipTextWithView(context, tipView);
}
Expand Down Expand Up @@ -56,11 +62,13 @@ public static void updateTipTextWithView(Context context, final TextView targetV
sIsLoadingTip = true;
}

final String requestLang = AppLanguageHelper.getLanguage(context);
HomePageTipManager.getRandomTipAsync(context.getApplicationContext(), tip -> {
synchronized (TIP_REQUEST_LOCK) {
sIsLoadingTip = false;
}
mCurrentTip = tip;
mCurrentTipLang = requestLang;
String tipText = "Tip: " + mCurrentTip;
targetView.setText(tipText);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.os.Handler;
import android.os.Looper;

import com.sevtinge.hyperceiler.libhook.utils.api.DeviceHelper;
import com.sevtinge.hyperceiler.common.utils.AppLanguageHelper;

import java.io.BufferedReader;
import java.io.IOException;
Expand All @@ -30,7 +30,7 @@ public interface TipCallback {
}

public static void getRandomTipAsync(Context context, TipCallback callback) {
String lang = DeviceHelper.Hardware.getLanguage();
String lang = AppLanguageHelper.getLanguage(context);
EXECUTOR.execute(() -> {
List<String> tips = getTipsFromAssets(context, lang);
String selected = tips.isEmpty() ? "Enjoy using HyperCeiler!" : tips.get(RANDOM.nextInt(tips.size()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import com.sevtinge.hyperceiler.libhook.utils.api.BackupUtils;
import com.sevtinge.hyperceiler.search.SearchHelper;
import com.sevtinge.hyperceiler.sub.ScopePickerActivity;
import com.sevtinge.hyperceiler.ui.HomePageActivity;
import com.sevtinge.hyperceiler.ui.LauncherActivity;
import com.sevtinge.hyperceiler.ui.SplashActivity;
import com.sevtinge.hyperceiler.utils.DialogHelper;
Expand Down Expand Up @@ -170,11 +169,8 @@ public void initPrefs() {

mLanguage.setOnPreferenceChangeListener((preference, o) -> {
int index = Integer.parseInt((String) o);
LanguageHelper.setIndexLanguage(getActivity(), index, false);
LanguageHelper.setIndexLanguage(getActivity(), index, true);
SearchHelper.initIndex(requireContext(), true);
if (getActivity() instanceof HomePageActivity activity) {
activity.reloadPagesForLanguageChange();
}
return true;
});

Expand Down
12 changes: 12 additions & 0 deletions app/proguard-rules.pro → app/src/main/keepRules/rules.keep
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Add project specific R8 rules here.
# AGP will combine all keep rule files in src/main/keepRules to pass to R8
#
# For more details, see
# https://d.android.com/r/tools/r8/keep-rules

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# --- Kotlin / Java ---
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
public static void check*(...);
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/raw/keep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/statusbar_signal_*"
tools:shrinkMode="strict" />
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ android.nonTransitiveRClass=true
android.enableAppCompileTimeRClass=true
android.enableBuildConfigAsBytecode=true
org.gradle.caching=true
android.r8.gradual.support=true
android.r8.maxWorkers=4
# Android 17
android.suppressUnsupportedCompileSdk=37.0
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
# Build tools
agp = "9.1.0"
agp = "9.2.1"
lsparanoid = "0.6.0"
autoService = "1.1.1"

# AndroidX
annotation = "1.9.1"
annotation = "1.10.0"
constraintlayout = "2.2.1"
coordinatorlayout = "1.3.0"
core = "1.18.0"
Expand All @@ -18,19 +18,19 @@ viewpager2 = "1.1.0"
miuix = "1.0.12.5"

# Xposed & Hooks
xposed-api = "101.0.0"
xposed-api = "101.0.1"
xposed-service = "101.0.0"
dexkit = "2.2.0"
ezxhelper = "3.1.1-rc1"
ezxhelper = "3.2.0-preview1"
hiddenapibypass = "6.1"

# Third-party
expansions = "1.0.0"
gson = "2.13.2"
gson = "2.14.0"
hyperfocusapi = "2.0"
appiconloader = "1.5.0"
lunarcalendar = "latest.release"
superLyricApi = "3.3"
superLyricApi = "3.4"

[libraries]
# AndroidX
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 10 additions & 21 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions library/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ android {
}

buildTypes {
release {
consumerProguardFiles("proguard-rules.pro")
}
create("beta") {
consumerProguardFiles("proguard-rules.pro")
}
create("canary") {
consumerProguardFiles("proguard-rules.pro")
}
release {}
create("beta") {}
create("canary") {}
}
}

Expand Down
22 changes: 0 additions & 22 deletions library/common/proguard-rules.pro

This file was deleted.

Loading
Loading