Skip to content

Commit

Permalink
Bunch of temporal updates
Browse files Browse the repository at this point in the history
* Added all the changelogs under the same component and remove the card
* Properly added UpdaterService as a class (not sure when I set it as object)
* Moved package name to co.aospa.hub to match current OTA package
* Only update notification and progress bar when percentage grows at least one integer
* Updated and fixed some stuff

Signed-off-by: Hernán Castañón Álvarez <[email protected]>
  • Loading branch information
Herna1994 committed Nov 5, 2023
1 parent a52c5bc commit c943b9b
Show file tree
Hide file tree
Showing 40 changed files with 326 additions and 385 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
}

android {
namespace = "co.aospa.paranoidhub"
namespace = "co.aospa.hub"
compileSdk = 34

defaultConfig {
applicationId = "co.aospa.paranoidhub"
applicationId = "co.aospa.hub"
minSdk = 33
targetSdk = 34
versionCode = 1
Expand All @@ -29,7 +29,7 @@ android {
release {
isDebuggable = true
isMinifyEnabled = true
applicationIdSuffix = ".release"
//applicationIdSuffix = ".release"
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
24 changes: 2 additions & 22 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,13 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# Keep inherited services.
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * extends <1>

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# R8 full mode strips generic signatures from return types if not kept.
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# If a class is used in some way by the application, and has fields annotated with @SerializedName
# and a no-args constructor, keep those fields and the constructor
# Based on https://issuetracker.google.com/issues/150189783#comment11
# See also https://github.com/google/gson/pull/2420#discussion_r1241813541 for a more detailed explanation
-if class *
-keepclasseswithmembers,allowobfuscation,allowoptimization class <1> {
<init>();
@com.google.gson.annotations.SerializedName <fields>;
}

# R8 full mode strips generic signatures from return types if not kept.
-keep,allowobfuscation,allowshrinking class retrofit2.Response

-dontwarn com.android.org.conscrypt.**
-dontwarn dalvik.system.**
-dontwarn libcore.util.**
-dontwarn sun.misc.**
-dontwarn sun.misc.**
-dontwarn org.slf4j.impl.StaticLoggerBinder
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "APK",
"kind": "Directory"
},
"applicationId": "co.aospa.paranoidhub.release",
"applicationId": "co.aospa.paranoidhub",
"variantName": "release",
"elements": [
{
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,25 @@
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:enableOnBackInvokedCallback="true"
android:hardwareAccelerated="true"
>
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.ParanoidHub"
android:screenOrientation="portrait">
<intent-filter android:priority="1">
<action android:name="android.settings.SYSTEM_UPDATE_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="com.android.settings.SHORTCUT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="DOWNLOAD"/>
<action android:name="CANCEL_DOWNLOAD"/>
Expand All @@ -43,8 +52,11 @@
android:name=".utils.Scheduler"
android:exported="false" />

<service android:name=".utils.UpdateService"
android:exported="false"/>

<receiver
android:name="co.aospa.paranoidhub.utils.AlarmReceiver"
android:name="co.aospa.hub.utils.AlarmReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub
package co.aospa.hub

object GlobalConstants {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub
package co.aospa.hub

import android.Manifest
import android.app.Activity
Expand Down Expand Up @@ -38,14 +38,13 @@ import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilledTonalIconButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Scaffold
Expand All @@ -70,19 +69,18 @@ import androidx.compose.ui.unit.dp
import androidx.core.app.ActivityCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import co.aospa.paranoidhub.data.api.model.State
import co.aospa.paranoidhub.ui.components.LocalUpdateBottomSheet
import co.aospa.paranoidhub.ui.components.DeviceChangelog
import co.aospa.paranoidhub.ui.components.NewUpdateCard
import co.aospa.paranoidhub.ui.components.ParanoidAndroidVersion
import co.aospa.paranoidhub.ui.components.PlatformChangelog
import co.aospa.paranoidhub.ui.components.ProgressBar
import co.aospa.paranoidhub.ui.components.SettingsDialog
import co.aospa.paranoidhub.ui.components.StateButtons
import co.aospa.paranoidhub.ui.theme.ParanoidHubTheme
import co.aospa.paranoidhub.utils.VibrateUtils
import co.aospa.paranoidhub.ui.viewmodels.MainActivityViewModel
import co.aospa.paranoidhub.utils.Scheduler
import co.aospa.hub.data.api.model.State
import co.aospa.hub.ui.components.LocalUpdateBottomSheet
import co.aospa.hub.ui.components.Changelog
import co.aospa.hub.ui.components.NewUpdateCard
import co.aospa.hub.ui.components.ParanoidAndroidVersion
import co.aospa.hub.ui.components.ProgressBar
import co.aospa.hub.ui.components.SettingsDialog
import co.aospa.hub.ui.components.StateButtons
import co.aospa.hub.ui.theme.ParanoidHubTheme
import co.aospa.hub.utils.VibrateUtils
import co.aospa.hub.ui.viewmodels.MainActivityViewModel
import co.aospa.hub.utils.Scheduler

private lateinit var viewModel: MainActivityViewModel
private lateinit var filePickerLauncher: ActivityResultLauncher<Intent>
Expand Down Expand Up @@ -237,7 +235,7 @@ fun MainView() {
topBar = {
CenterAlignedTopAppBar(
navigationIcon = {
FilledTonalIconButton(
IconButton(
onClick = { activity?.finish() }
) {
Icon(
Expand Down Expand Up @@ -281,7 +279,7 @@ fun MainView() {
enter = slideInHorizontally(initialOffsetX = { 70 },),
exit = slideOutHorizontally(targetOffsetX = { 140 })
) {
FilledTonalIconButton(onClick = { showSettingsDialog = true }) {
IconButton(onClick = { showSettingsDialog = true }) {
Icon(
imageVector = Icons.Default.Settings,
contentDescription = "Settings"
Expand Down Expand Up @@ -339,14 +337,7 @@ fun MainView() {
AnimatedVisibility(
visible = uiState.state != State.SEARCHING
) {
LazyColumn {
item {
DeviceChangelog(uiState.update?.changelog_device)
}
item {
PlatformChangelog(uiState.update!!)
}
}
Changelog(uiState.update!!)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.aospa.paranoidhub.data.api
package co.aospa.hub.data.api

import co.aospa.paranoidhub.GlobalConstants
import co.aospa.hub.GlobalConstants
import io.ktor.client.HttpClient
import io.ktor.client.engine.okhttp.OkHttp
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.aospa.paranoidhub.data.api.methods
package co.aospa.hub.data.api.methods

import co.aospa.paranoidhub.data.api.ApiClient
import co.aospa.paranoidhub.data.api.methods.getdeviceinformation.GetDeviceInformationResponse
import co.aospa.hub.data.api.ApiClient
import co.aospa.hub.data.api.methods.getdeviceinformation.GetDeviceInformationResponse
import io.ktor.client.call.body

interface ParanoidHubApi {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub.data.api.methods.getdeviceinformation
package co.aospa.hub.data.api.methods.getdeviceinformation

import kotlinx.serialization.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub.data.api.model
package co.aospa.hub.data.api.model

data class DeviceInformation (
val codename: String?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub.data.api.model
package co.aospa.hub.data.api.model

enum class Flavor {
Stable,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub.data.api.model
package co.aospa.hub.data.api.model

open class State {
object NONE: State()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.aospa.paranoidhub.data.api.model
package co.aospa.hub.data.api.model

data class Updates (
val paranoidAndroidVersion: String?,
Expand Down
Loading

0 comments on commit c943b9b

Please sign in to comment.