Skip to content

Commit 6ce3a14

Browse files
committed
open source for a14
1 parent d74ca22 commit 6ce3a14

File tree

130 files changed

+6494
-9385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+6494
-9385
lines changed

.github/workflows/crowdin.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Crowdin Action
2+
3+
on:
4+
workflow_dispatch
5+
6+
permissions:
7+
pull-requests: write
8+
contents: write
9+
10+
jobs:
11+
synchronize-with-crowdin:
12+
runs-on: ubuntu-22.04
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: crowdin action
19+
uses: crowdin/github-action@v1
20+
with:
21+
upload_sources: true
22+
upload_sources_args: '--preserve-hierarchy -s app/src/main/res/values/strings.xml -t app/src/main/res/values-%android_code%/%original_file_name%'
23+
upload_translations: false
24+
download_translations: true
25+
skip_untranslated_strings: true
26+
localization_branch_name: l10n_crowdin
27+
create_pull_request: true
28+
pull_request_title: 'New Crowdin Translations'
29+
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
30+
pull_request_base_branch_name: 'feat-a14'
31+
project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
32+
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
36+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ app/standalone/*
1616
/.idea/misc.xml
1717
app/develop/
1818
.idea/.name
19+
.idea/copilot/

.idea/deploymentTargetSelector.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ def sFile = file(keystoreProperties['storeFile'])
88
def sPassword = keystoreProperties['storePassword']
99
def kAlias = keystoreProperties['keyAlias']
1010
def kPassword = keystoreProperties['keyPassword']
11-
def lastVersion = 90
12-
def lastVersionName = "23.12.30"
13-
14-
if (gradle.startParameter.taskNames.contains(":app:assembleDevelop")) {
15-
lastVersion += 1
16-
}
11+
def lastVersion = 73
12+
def lastVersionName = "24.10.12"
1713

1814
android {
1915
namespace "name.monwf.customiuizer"
@@ -27,16 +23,15 @@ android {
2723
v2SigningEnabled true
2824
}
2925
}
30-
compileSdk 34
3126
defaultConfig {
3227
applicationId "name.monwf.customiuizer"
33-
minSdkVersion 33
28+
minSdkVersion 34
3429
//noinspection OldTargetApi,ExpiredTargetSdkVersion
3530
targetSdkVersion 34
31+
compileSdk 35
3632
versionCode lastVersion
3733
versionName lastVersionName
38-
buildConfigField "long", "BUILD_TIME", System.currentTimeMillis() + "L"
39-
resConfigs 'ru-rRU', 'zh-rCN', 'zh-rTW', 'ja-rJP', 'vi-rVN', 'cs-rCZ', 'pt-rBR', 'tr-rTR', 'es-rES'
34+
resConfigs 'ru-rRU', 'zh-rCN', 'ja-rJP', 'vi-rVN', 'cs-rCZ', 'pt-rBR', 'tr-rTR', 'es-rES'
4035
ndk { abiFilters "arm64-v8a" }
4136
}
4237
buildTypes {
@@ -66,10 +61,19 @@ android {
6661
excludes += ['META-INF/*.kotlin_module', 'META-INF/androidx.*.version', '**.kotlin_builtins', '**.kotlin_metadata']
6762
}
6863
}
69-
androidResources {
70-
noCompress 'zip'
64+
applicationVariants.configureEach { variant ->
65+
variant.outputs.configureEach {
66+
if (variant.buildType.name == 'develop') {
67+
setVersionCodeOverride(variant.versionCode + 1)
68+
def finalVersionName = new Date().format('yy.MM.dd') + '-test'
69+
setVersionNameOverride(finalVersionName)
70+
setProperty("outputFileName", "Pengeek-" + finalVersionName + ".apk")
71+
}
72+
else {
73+
setProperty("outputFileName", "Pengeek-" + lastVersionName + ".apk")
74+
}
75+
}
7176
}
72-
buildToolsVersion '34.0.0'
7377
// gradle.projectsEvaluated {
7478
// tasks.withType(JavaCompile) {
7579
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
@@ -79,20 +83,30 @@ android {
7983
sourceCompatibility JavaVersion.VERSION_17
8084
targetCompatibility JavaVersion.VERSION_17
8185
}
86+
buildFeatures {
87+
buildConfig = true
88+
}
89+
dependenciesInfo {
90+
// Disables dependency metadata when building APKs.
91+
includeInApk = false
92+
// Disables dependency metadata when building Android App Bundles.
93+
includeInBundle = false
94+
}
8295
}
8396

8497
dependencies {
8598
// implementation "ch.acra:acra-core:$acraVersion"
8699
// noinspection DifferentStdlibGradleVersion
87100
compileOnly files('lib/api-100.aar')
88-
compileOnly files('lib/miuisystem.jar')
89101
compileOnly files('lib/framework.jar')
90102

91103
implementation "io.github.libxposed:service:100-1.0.0"
92-
implementation "org.apache.commons:commons-lang3:3.13.0"
104+
implementation "org.apache.commons:commons-lang3:3.15.0"
93105
implementation "androidx.preference:preference:1.2.1"
94106
implementation 'androidx.palette:palette:1.0.0'
95-
implementation 'androidx.appcompat:appcompat:1.6.1'
107+
implementation 'androidx.appcompat:appcompat:1.7.0'
108+
implementation 'org.luckypray:dexkit:2.0.2'
109+
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0"))
96110
// implementation "androidx.recyclerview:recyclerview:1.2.1"
97111
// implementation 'com.google.android.flexbox:flexbox:3.0.0'
98112
// implementation 'com.google.android.material:material:1.6.1'

app/lib/framework.jar

-482 KB
Binary file not shown.

app/lib/miui.jar

-1.64 MB
Binary file not shown.

app/lib/miuisystem.jar

-856 KB
Binary file not shown.

app/proguard-rules.pro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@
2424
-repackageclasses
2525
-allowaccessmodification
2626

27-
-dontwarn android.app.ActivityTaskManager$RootTaskInfo, android.util.Singleton
27+
#-dontwarn android.app.ActivityTaskManager$RootTaskInfo, android.util.Singleton
28+
-dontwarn kotlin.jvm.internal.SourceDebugExtension
29+
-dontwarn android.**
30+
-dontwarn android.view.**
31+
-dontwarn miui.**
2832
# -dontnote **

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
xmlns:tools="http://schemas.android.com/tools" >
44

55
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
6-
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS"
7-
tools:ignore="ProtectedPermissions" />
86
<uses-permission android:name="android.permission.INTERNET" />
97
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
108
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@@ -16,24 +14,15 @@
1614
tools:ignore="ProtectedPermissions" />
1715
<uses-permission android:name="android.permission.VIBRATE" />
1816
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
2017
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
2118
tools:ignore="QueryAllPackagesPermission" />
22-
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
23-
tools:ignore="ProtectedPermissions" />
2419
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"
2520
tools:ignore="ProtectedPermissions" />
26-
<uses-permission android:name="android.permission.MANAGE_USB"
27-
tools:ignore="ProtectedPermissions" />
2821
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"
2922
tools:ignore="ProtectedPermissions" />
3023
<uses-permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE"
3124
tools:ignore="ProtectedPermissions" />
3225

33-
<uses-permission android:name="miui.permission.READ_LOGS" />
34-
<uses-permission android:name="miui.permission.DUMP_CACHED_LOG" />
35-
<uses-permission android:name="com.miui.securitycenter.permission.ACCESS_SECURITY_CENTER_PROVIDER" />
36-
3726
<application
3827
android:hasFragileUserData="true"
3928
android:hardwareAccelerated="true"
@@ -43,7 +32,6 @@
4332
android:description="@string/app_slogan"
4433
android:supportsRtl="true"
4534
android:name=".MainApplication"
46-
android:usesCleartextTraffic="true"
4735
android:requestLegacyExternalStorage="true"
4836
tools:ignore="GoogleAppIndexingWarning">
4937

app/src/main/java/name/monwf/customiuizer/AboutFragment.java

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
import android.app.Activity;
44
import android.content.res.Configuration;
55
import android.os.Bundle;
6+
import android.text.SpannableString;
67
import android.view.View;
78
import android.widget.RelativeLayout;
89
import android.widget.TextView;
910

11+
import androidx.preference.CheckBoxPreference;
1012
import androidx.preference.Preference;
1113

1214
import java.text.SimpleDateFormat;
15+
import java.util.ArrayList;
16+
import java.util.Arrays;
1317
import java.util.Date;
1418
import java.util.Locale;
1519

20+
import name.monwf.customiuizer.prefs.ListPreferenceEx;
1621
import name.monwf.customiuizer.utils.Helpers;
1722

1823
public class AboutFragment extends SubFragment {
@@ -56,36 +61,52 @@ public boolean onPreferenceClick(Preference pref) {
5661
return true;
5762
}
5863
});
59-
findPreference("pref_key_xda").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
64+
65+
String[] locales = new String[] { "zh-CN", "ru-RU", "ja-JP", "vi-VN", "cs-CZ", "pt-BR", "tr-TR", "es-ES" };
66+
67+
ArrayList<String> localesArr = new ArrayList<String>(Arrays.asList(locales));
68+
ArrayList<SpannableString> localeNames = new ArrayList<SpannableString>();
69+
localesArr.add(0, "en");
70+
for (String locale: localesArr) try {
71+
Locale loc = Locale.forLanguageTag(locale);
72+
StringBuilder locStr;
73+
SpannableString locSpanString;
74+
if (locale.equals("zh-TW")) {
75+
locStr = new StringBuilder("繁體中文 (台灣)");
76+
}
77+
else {
78+
locStr = new StringBuilder(loc.getDisplayLanguage(loc));
79+
locStr.setCharAt(0, Character.toUpperCase(locStr.charAt(0)));
80+
if (locale.equals("pt-BR")) {
81+
locStr.append(" (Brasil)");
82+
}
83+
}
84+
locSpanString = new SpannableString(locStr.toString());
85+
localeNames.add(locSpanString);
86+
} catch (Throwable t) {
87+
localeNames.add(new SpannableString(Locale.getDefault().getDisplayLanguage(Locale.getDefault())));
88+
}
89+
90+
localesArr.add(0, "auto");
91+
localeNames.add(0, new SpannableString(getString(R.string.array_system_default)));
92+
93+
ListPreferenceEx locale = findPreference("pref_key_miuizer_locale");
94+
locale.setEntries(localeNames.toArray(new CharSequence[0]));
95+
locale.setEntryValues(localesArr.toArray(new CharSequence[0]));
96+
locale.setOnPreferenceChangeListener(new CheckBoxPreference.OnPreferenceChangeListener() {
6097
@Override
61-
public boolean onPreferenceClick(Preference pref) {
62-
Helpers.openURL(act, "https://forum.xda-developers.com/t/mod-xposed-3-2-1-customiuizer-customize-your-miui-rom.3910732/");
98+
public boolean onPreferenceChange(Preference preference, Object newValue) {
99+
getActivity().recreate();
63100
return true;
64101
}
65102
});
66103

67-
if (isLangRu) {
68-
Preference pref4pda = findPreference("pref_key_4pda");
69-
pref4pda.setVisible(true);
70-
pref4pda.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
71-
@Override
72-
public boolean onPreferenceClick(Preference pref) {
73-
Helpers.openURL(act, "https://4pda.ru/forum/index.php?showtopic=945275");
74-
return true;
75-
}
76-
});
77-
}
78-
79104
//Add version name to support title
80105
View view = getView();
81106
if (view != null) try {
82107
TextView version = view.findViewById(R.id.about_version);
83-
String versionName = BuildConfig.VERSION_NAME;
84-
if (BuildConfig.BUILD_TYPE.equals("develop")) {
85-
SimpleDateFormat formatter = new SimpleDateFormat("yy.MM.dd", Locale.getDefault());
86-
Date buildDate = new Date(BuildConfig.BUILD_TIME);
87-
versionName = formatter.format(buildDate) + "-test";
88-
}
108+
String versionName = getValidContext().getPackageManager()
109+
.getPackageInfo(getValidContext().getPackageName(), 0).versionName;
89110
version.setText(String.format(getResources().getString(R.string.about_version), versionName));
90111
} catch (Throwable e) {
91112
//Shouldn't happen...

app/src/main/java/name/monwf/customiuizer/MainActivity.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import android.annotation.SuppressLint;
55
import android.content.Context;
66
import android.content.DialogInterface;
7-
import android.content.Intent;
87
import android.content.SharedPreferences;
98
import android.content.pm.PackageManager;
109
import android.os.Bundle;
@@ -17,14 +16,12 @@
1716
import androidx.appcompat.widget.Toolbar;
1817
import androidx.fragment.app.Fragment;
1918

20-
import java.util.ArrayList;
2119
import java.util.HashSet;
2220
import java.util.Set;
2321

2422
import io.github.libxposed.service.RemotePreferences;
2523
import io.github.libxposed.service.XposedService;
2624
import io.github.libxposed.service.XposedServiceHelper;
27-
import name.monwf.customiuizer.mods.GlobalActions;
2825
import name.monwf.customiuizer.utils.AppHelper;
2926
import name.monwf.customiuizer.utils.Helpers;
3027

@@ -120,6 +117,17 @@ else if (val instanceof Set<?>) {
120117
AppHelper.appPrefs.registerOnSharedPreferenceChangeListener(prefsChanged);
121118
}
122119

120+
public void navToSubFragment(Fragment fragment, Bundle args, AppHelper.SettingsType settingsType, AppHelper.ActionBarType abType, int titleResId, int contentResId) {
121+
navToSubFragment(fragment, args, settingsType, abType, getResources().getString(titleResId), contentResId);
122+
}
123+
124+
public void navToSubFragment(Fragment fragment, Bundle args, AppHelper.SettingsType settingsType, AppHelper.ActionBarType abType, String title, int contentResId) {
125+
Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
126+
if (currentFragment != null && currentFragment instanceof PreferenceFragmentBase) {
127+
((PreferenceFragmentBase) currentFragment).openSubFragment(fragment, args, settingsType, abType, title, contentResId);
128+
}
129+
}
130+
123131
@Override
124132
public void onSaveInstanceState(Bundle savedInstanceState) {
125133
getSupportFragmentManager().putFragment(savedInstanceState, "mainFrag", mainFrag);

0 commit comments

Comments
 (0)