Skip to content

Commit f589e77

Browse files
committed
chore (build): Add legacy build
1 parent af50acc commit f589e77

33 files changed

+171
-48
lines changed

app/build.gradle

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ android {
1919
applicationId 'org.dokiteam.doki'
2020
minSdk = 21
2121
targetSdk = 36
22-
versionCode = 1014
23-
versionName = 'PRODUCTION'
22+
23+
versionCode = 1
24+
versionName "1.0"
25+
2426
generatedDensities = []
2527
testInstrumentationRunner 'org.dokiteam.doki.HiltTestRunner'
2628
ksp {
@@ -43,6 +45,15 @@ android {
4345
resValue "string", "github_updates_repo", ghUser
4446
resValue 'string', 'tg_backup_bot_token', tgKey
4547
}
48+
signingConfigs {
49+
DokiApp {
50+
storeFile file("sign.p12")
51+
storePassword "kotatsuanddokiarethebest"
52+
keyAlias "DokiApp"
53+
keyPassword "kotatsuanddokiarethebest"
54+
storeType "PKCS12"
55+
}
56+
}
4657
buildTypes {
4758
debug {
4859
applicationIdSuffix = '.debug'
@@ -51,7 +62,15 @@ android {
5162
minifyEnabled true
5263
shrinkResources true
5364
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
65+
signingConfig signingConfigs.DokiApp
5466
}
67+
legacy {
68+
applicationIdSuffix = '.legacy'
69+
minifyEnabled true
70+
shrinkResources true
71+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
72+
signingConfig signingConfigs.DokiApp
73+
}
5574
}
5675
buildFeatures {
5776
viewBinding true
@@ -105,6 +124,20 @@ android {
105124
freeCompilerArgs += ['-opt-in=org.dokiteam.doki.parsers.InternalParsersApi']
106125
}
107126
}
127+
applicationVariants.configureEach { variant ->
128+
def now = LocalDateTime.now()
129+
if (variant.name == 'legacy') {
130+
variant.outputs.each { output ->
131+
output.versionCodeOverride = now.format("yyMMdd").toInteger()
132+
output.versionNameOverride = 'C' + now.format("yyMMdd")
133+
}
134+
} else if (variant.name == 'release') {
135+
variant.outputs.each { output ->
136+
output.versionCodeOverride = now.format("yyMMdd").toInteger()
137+
output.versionNameOverride = 'P' + now.format("yyMMdd")
138+
}
139+
}
140+
}
108141
}
109142
dependencies {
110143
implementation(libs.doki.exts) {

app/sign.p12

2.67 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.dokiteam.doki
2+
3+
import org.dokiteam.doki.core.BaseApp
4+
5+
class DokiApp : BaseApp()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.dokiteam.doki.core.network
2+
3+
import okhttp3.Interceptor
4+
import okhttp3.Response
5+
6+
class CurlLoggingInterceptor : Interceptor {
7+
8+
override fun intercept(chain: Interceptor.Chain): Response {
9+
return chain.proceed(chain.request()) // no-op implementation
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.dokiteam.doki.core.parser
2+
3+
import org.dokiteam.doki.core.cache.MemoryContentCache
4+
import org.dokiteam.doki.core.model.TestMangaSource
5+
import org.dokiteam.doki.parsers.MangaLoaderContext
6+
7+
@Suppress("unused")
8+
class TestMangaRepository(
9+
private val loaderContext: MangaLoaderContext,
10+
cache: MemoryContentCache
11+
) : EmptyMangaRepository(TestMangaSource)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.dokiteam.doki.core.ui
2+
3+
import android.content.Context
4+
import androidx.core.content.ContextCompat
5+
import androidx.lifecycle.LifecycleService
6+
7+
abstract class BaseService : LifecycleService() {
8+
9+
override fun attachBaseContext(newBase: Context) {
10+
super.attachBaseContext(ContextCompat.getContextForLanguage(newBase))
11+
}
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@file:Suppress("UnusedReceiverParameter")
2+
3+
package org.dokiteam.doki.core.util.ext
4+
5+
@Suppress("NOTHING_TO_INLINE")
6+
inline fun Throwable.printStackTraceDebug() = Unit
7+
8+
fun assertNotInMainThread() = Unit
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@mipmap/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
6+
</adaptive-icon>
6.66 KB
Loading
852 Bytes
Loading

0 commit comments

Comments
 (0)