From 01b8bb8399242881e756f407e136853bbb53db22 Mon Sep 17 00:00:00 2001 From: Lennoard Date: Sun, 30 May 2021 15:21:50 -0300 Subject: [PATCH 1/4] bugfix: crashes in older APIs --- .../hebf/ui/appintro/AppIntroActivity.kt | 2 +- .../com/androidvip/hebf/views/DashCard.kt | 2 +- .../com/androidvip/hebf/views/ServiceState.kt | 12 +++- .../main/res/layout/activity_app_intro.xml | 2 +- app/src/main/res/layout/fragment_battery.xml | 6 +- app/src/main/res/layout/fragment_intro1.xml | 67 +++++++------------ .../main/res/layout/fragment_performance2.xml | 3 +- 7 files changed, 44 insertions(+), 50 deletions(-) diff --git a/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt b/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt index 5cf1b2d..197901e 100644 --- a/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt +++ b/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt @@ -63,7 +63,7 @@ class AppIntroActivity : BaseActivity() { titleTextSwitcher.setFactory { val textView = TextView(this).apply { textSize = 30f - setTextColor(Color.WHITE) + setTextColor(ContextCompat.getColor(context, R.color.colorOnSurface)) } val layoutParams = FrameLayout.LayoutParams( diff --git a/app/src/main/java/com/androidvip/hebf/views/DashCard.kt b/app/src/main/java/com/androidvip/hebf/views/DashCard.kt index 76fefe7..5569015 100644 --- a/app/src/main/java/com/androidvip/hebf/views/DashCard.kt +++ b/app/src/main/java/com/androidvip/hebf/views/DashCard.kt @@ -21,7 +21,7 @@ class DashCard @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyle: Int = 0 -) : MaterialCardView(context, attrs, defStyle) { +) : LinearLayout(context, attrs, defStyle) { private val titleTextView: AppCompatTextView by lazy { findViewById(R.id.dashCardTitle) } private val valueTextView: AppCompatTextView by lazy { findViewById(R.id.dashCardValue) } diff --git a/app/src/main/java/com/androidvip/hebf/views/ServiceState.kt b/app/src/main/java/com/androidvip/hebf/views/ServiceState.kt index f4f133c..52e86ff 100644 --- a/app/src/main/java/com/androidvip/hebf/views/ServiceState.kt +++ b/app/src/main/java/com/androidvip/hebf/views/ServiceState.kt @@ -11,6 +11,7 @@ import androidx.core.content.ContextCompat import androidx.core.view.forEach import androidx.core.widget.ImageViewCompat import com.androidvip.hebf.R +import com.androidvip.hebf.createVectorDrawable import com.androidvip.hebf.runOnMainThread import com.google.android.material.switchmaterial.SwitchMaterial import com.topjohnwu.superuser.ShellUtils @@ -50,8 +51,15 @@ class ServiceState @JvmOverloads constructor( } } - val icon = attributes.getDrawable(R.styleable.ServiceState_serviceIcon) - this.icon.setImageDrawable(icon) + runCatching { + val icon = attributes.getDrawable(R.styleable.ServiceState_serviceIcon) + this.icon.setImageDrawable(icon) + }.onFailure { + val iconId = attributes.getResourceId( + R.styleable.ServiceState_serviceIcon, R.drawable.ic_settings + ) + this.icon.setImageDrawable(context.createVectorDrawable(iconId)) + } } finally { attributes.recycle() } diff --git a/app/src/main/res/layout/activity_app_intro.xml b/app/src/main/res/layout/activity_app_intro.xml index 1338169..03ec14b 100644 --- a/app/src/main/res/layout/activity_app_intro.xml +++ b/app/src/main/res/layout/activity_app_intro.xml @@ -55,7 +55,7 @@ + android:layout_marginTop="@dimen/collapsing_app_bar_height"> + app:cardPreventCornerOverlap="false" + app:layout_constraintTop_toBottomOf="@id/lowRamFlag" + tools:visibility="visible"> + android:orientation="vertical" + android:padding="@dimen/medium_margin"> - + - - - - - - - - - + android:fontFamily="sans-serif-condensed" + android:gravity="center_horizontal" + android:padding="4dp" + android:text="@string/hebf_sobre_sub" + android:textAppearance="@style/TextAppearance.HEBF.Body2" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - + diff --git a/app/src/main/res/layout/fragment_performance2.xml b/app/src/main/res/layout/fragment_performance2.xml index af034b4..45eb94d 100644 --- a/app/src/main/res/layout/fragment_performance2.xml +++ b/app/src/main/res/layout/fragment_performance2.xml @@ -23,7 +23,8 @@ android:layout_marginTop="@dimen/small_margin" android:layout_marginRight="@dimen/default_margin" android:outlineSpotShadowColor="@color/colorPrimary" - app:cardElevation="@dimen/default_margin_alt"> + app:cardElevation="@dimen/default_margin_alt" + app:cardPreventCornerOverlap="false"> Date: Sun, 30 May 2021 15:27:21 -0300 Subject: [PATCH 2/4] Updated .gitignore --- .gitignore | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.gitignore b/.gitignore index 2e263c0..d835a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,55 @@ app/src/main/main.iml HEBFOptimizer.iml .vs/* .idea/gradle.xml + +# Node artifact files +node_modules/ + +# Compiled Java class files +*.class + +# Log files +*.log + +# Maven +target/ +dist/ + +# Unit test reports +TEST*.xml + +# OS-specific files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Files for the ART/Dalvik VM +*.dex + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +*.iml +.gradle +/local.properties +/build +/captures + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ + +#Signing config +/keystore.properties \ No newline at end of file From 3f803f5d519364e34e11a351ca651091b4586c1f Mon Sep 17 00:00:00 2001 From: Lennoard Date: Sun, 30 May 2021 15:49:36 -0300 Subject: [PATCH 3/4] Signing release config --- app/build.gradle.kts | 25 +++++++++++++++++++ .../hebf/ui/appintro/AppIntroActivity.kt | 2 ++ .../main/res/layout/activity_app_intro.xml | 1 + 3 files changed, 28 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index eb95b6a..73e6db3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,5 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion +import java.util.Properties plugins { id("com.android.application") @@ -35,11 +36,35 @@ android { multiDexEnabled = true } + signingConfigs { + create("release") { + val keyFile = rootProject.file("keystore.properties") + if (!keyFile.exists()) { + keyFile.createNewFile() + keyFile.writeText(buildString { + appendln("keyAlias=") + appendln("keyPassword=") + appendln("storeFile=/") + appendln("storePassword=") + }) + } + val keystoreProps = Properties().apply { + load(keyFile.inputStream()) + } + + keyAlias = keystoreProps["keyAlias"] as? String ?: "" + keyPassword = keystoreProps["keyPassword"] as? String ?: "" + storeFile = file(keystoreProps["storeFile"] as? String ?: "/") + storePassword = keystoreProps["storePassword"] as? String ?: "" + } + } + buildTypes { getByName("release") { isDebuggable = false isMinifyEnabled = true isShrinkResources = true + signingConfig = signingConfigs.getByName("release") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", diff --git a/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt b/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt index 197901e..27c7ed9 100644 --- a/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt +++ b/app/src/main/java/com/androidvip/hebf/ui/appintro/AppIntroActivity.kt @@ -12,6 +12,7 @@ import android.widget.* import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat +import androidx.core.view.ViewCompat import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentStatePagerAdapter @@ -47,6 +48,7 @@ class AppIntroActivity : BaseActivity() { setSupportActionBar(toolbar) supportActionBar?.setDisplayHomeAsUpEnabled(false) supportActionBar?.setDisplayShowTitleEnabled(false) + ViewCompat.setElevation(toolbar, 0F) val tempFolder = K.HEBF.getTempDir(this) if (!tempFolder.exists()) { diff --git a/app/src/main/res/layout/activity_app_intro.xml b/app/src/main/res/layout/activity_app_intro.xml index 03ec14b..42a37ea 100644 --- a/app/src/main/res/layout/activity_app_intro.xml +++ b/app/src/main/res/layout/activity_app_intro.xml @@ -46,6 +46,7 @@ android:layout_height="?attr/actionBarSize" android:background="@color/colorBackground" app:layout_collapseMode="pin" + android:elevation="0dp" app:popupTheme="@style/AppTheme.PopupOverlay" /> From e3b6e597295ccaf0a5619de3fa4b21e0363e6e72 Mon Sep 17 00:00:00 2001 From: Lennoard Date: Sun, 30 May 2021 16:31:48 -0300 Subject: [PATCH 4/4] Release v3.0.0 Signed-off-by: Lennoard --- app/src/main/res/drawable/ic_code.xml | 10 +++++++++ app/src/main/res/layout/activity_about.xml | 15 +++++++++++--- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 21 +++++++++++++++++++ app/src/main/res/values-hi/strings.xml | 1 + app/src/main/res/values-in/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 24 ++++++++++++---------- 11 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 app/src/main/res/drawable/ic_code.xml diff --git a/app/src/main/res/drawable/ic_code.xml b/app/src/main/res/drawable/ic_code.xml new file mode 100644 index 0000000..14302a8 --- /dev/null +++ b/app/src/main/res/drawable/ic_code.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 1541ccd..1d6dcb7 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -21,8 +21,8 @@ android:background="@color/colorSurface" app:layout_collapseMode="pin" app:popupTheme="@style/AppTheme.PopupOverlay" - app:titleTextColor="@color/colorOnBackground" - app:title="@string/sobre" /> + app:title="@string/sobre" + app:titleTextColor="@color/colorOnBackground" /> @@ -85,13 +85,22 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/small_margin" android:layout_marginEnd="@dimen/default_margin" - android:paddingBottom="@dimen/default_margin" android:text="@string/hebf_sobre_sub" android:textAppearance="@style/TextAppearance.HEBF.Body2" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@+id/card_img_hebf" app:layout_constraintTop_toBottomOf="@+id/appCompatTextView4" /> + diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index e90e4b5..752858b 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -443,4 +443,5 @@ Force device-idle (Doze) لم يتم دخولك System apps + مصدر الرمز \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4ba6cc9..8978758 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -446,4 +446,5 @@ Du bist nicht eingeloggt Benachrichtigungseinstellungen Smart Pixels + Quellcode \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ef3dd49..c122adc 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -496,5 +496,26 @@ Fabricante Marca Escanear + Código fuente + Tablero + Notificaciones + Ajuste preciso + Estadísticas + Porcentaje de batería + Datos no disponibles. Habilite la recopilación de estadísticas en la configuración de VIP + No Notificaciones + Legado + Establecer el gobernador de la CPU + Advertencia: Parece que está utilizando un kernel EAS, de ser así, no intente cambiar esta opción. + Se requiere acceso de root + El modo Doze reduce el consumo de batería al diferir la CPU en segundo plano y la actividad de la red para las aplicaciones cuando el dispositivo no se usa durante largos períodos de tiempo hasta las ventanas de mantenimiento + Permitir recopilación de estadísticas + Hace que VIP recopile información de la batería periódicamente para fines de informes + Apaga algunos píxeles de la pantalla para reducir el consumo de energía. La implementación depende del framework. + Activa el modo de ahorro de energía predeterminado de Android independientemente del nivel de batería + Cambiar el gobernador de la CPU cuando está activado + Activa el modo de escala de grises para ahorrar energía. Advertencia: esto anulará cualquier modo daltónico o configuración anterior de KCAL. + Fuerza el modo inactivo del dispositivo inmediatamente independientemente de cualquier estado anterior. + Forzar la detención de aplicaciones cuando está activado diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 884fb04..8600372 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -448,4 +448,5 @@ विशेष पेशकश सीमित समय के लिए विशेष छूट के साथ प्रीमियम पैकेज प्राप्त करें! आप रूटलेस मोड में हैं। कई विकल्प केवल रूट एक्सेस के साथ उपलब्ध हैं। फिर से सुपरयुसर अधिकारों का अनुरोध करने के लिए टैप करें। + सोर्स कोड diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 40542e9..ac01355 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -462,5 +462,6 @@ adaptor AC USB pengisi daya nirkabel + Kode sumber \ No newline at end of file diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 7c47714..29b1c27 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -516,4 +516,5 @@ Fabricante Marca Escanear + Código fonte \ No newline at end of file diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index b3fa3f2..cacd407 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -468,6 +468,7 @@ Mevcut ön plan uygulamasını almak için kullanılır Sistem ayarlarını yaz Parlaklığı ve ekran zaman aşımını değiştirmek için kullanılır + Kaynak kodu diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 4cbd10f..04018d9 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -443,4 +443,5 @@ 在RAM中创建一个压缩块设备,该设备将用于交换而不是较慢的交换分区,从而实现更快的数据交换。 Force device-idle (Doze) 你没有登录 + 源代码 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f85ecc1..33704dc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,17 +1,18 @@ HEBF Optimizer - Codename: Amanda\n2020/10/10 - v2.5.0 (180) - \n - ▪ Added brightness control to Game Booster\n - ▪ Launch any app with Game Booster\n - ▪ New dashboard screen\n - ▪ Improved coroutines management, app should be a bit more snappier\n - ▪ Improved background services execution\n - ▪ Updated Turkish translations (credits: Hüseyin Küpeli)\n - ▪ Fixed a bug that caused a few layouts not to adjust when changing orientation\n - ▪ Updated Games database\n + Codename: Luana\n2021/05/30 + v3.0.0 (184) + \n\n + ▪ OPEN SOURCE! (https://github.com/Lennoard/hebf-android)\n\n + ▪ Huge interface redesign\n + ▪ Bug fixes for older APIs\n + ▪ New dashboard screen with statistics\n + ▪ Merged root and rootless mode\n + ▪ Updated Cleaner paths\n + ▪ Removed Media server options\n + ▪ Removed power saver for multicore CPUs\n + ▪ Removed Better Multitasking option, use LMK instead\n We need your permission to perform battery-saving actions and close inactive applications. Click on continue and the settings screen will open, look for something similar to what the tutorial below shows: Accessibility Service @@ -535,5 +536,6 @@ Manufacturer Brand Scan + Source code