Skip to content

Commit 13e746e

Browse files
committed
ignore
1 parent 305b74b commit 13e746e

14 files changed

Lines changed: 313 additions & 31 deletions

File tree

app/build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ android {
1818
version = release(36)
1919
}
2020

21+
val flavorGitHub = "github"
22+
val flavorFDroid = "fdroid"
23+
2124
defaultConfig {
2225
applicationId = "in.hridayan.ashell"
2326
minSdk = 28
2427
targetSdk = 36
2528
versionCode = 59
2629
versionName = "v7.2.0"
2730

31+
buildConfigField("String", "DIST_FLAVOR_GITHUB", "\"$flavorGitHub\"")
32+
buildConfigField("String", "DIST_FLAVOR_FDROID", "\"$flavorFDroid\"")
33+
2834
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2935
}
3036

@@ -87,10 +93,10 @@ android {
8793
flavorDimensions.add("distribution")
8894

8995
productFlavors {
90-
create("github") {
96+
create(flavorGitHub) {
9197
dimension = "distribution"
9298
}
93-
create("fdroid") {
99+
create(flavorFDroid) {
94100
dimension = "distribution"
95101
}
96102
}

app/lint-baseline.xml

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,248 @@
188188
column="15"/>
189189
</issue>
190190

191+
<issue
192+
id="ExtraTranslation"
193+
message="&quot;pre_release&quot; is translated here but not found in default locale"
194+
errorLine1=" &lt;string name=&quot;pre_release&quot;>Vorabversion&lt;/string>"
195+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
196+
<location
197+
file="src/main/res/values-de-rDE/strings.xml"
198+
line="370"
199+
column="13"/>
200+
</issue>
201+
202+
<issue
203+
id="ExtraTranslation"
204+
message="&quot;pre_release&quot; is translated here but not found in default locale"
205+
errorLine1=" &lt;string name=&quot;pre_release&quot;>پیش‌انتشار&lt;/string>"
206+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
207+
<location
208+
file="src/main/res/values-fa-rIR/strings.xml"
209+
line="370"
210+
column="13"/>
211+
</issue>
212+
213+
<issue
214+
id="ExtraTranslation"
215+
message="&quot;pre_release&quot; is translated here but not found in default locale"
216+
errorLine1=" &lt;string name=&quot;pre_release&quot;>Pré-version&lt;/string>"
217+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
218+
<location
219+
file="src/main/res/values-fr-rFR/strings.xml"
220+
line="370"
221+
column="13"/>
222+
</issue>
223+
224+
<issue
225+
id="ExtraTranslation"
226+
message="&quot;pre_release&quot; is translated here but not found in default locale"
227+
errorLine1=" &lt;string name=&quot;pre_release&quot;>प्री-रिलीज़&lt;/string>"
228+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
229+
<location
230+
file="src/main/res/values-hi-rIN/strings.xml"
231+
line="370"
232+
column="13"/>
233+
</issue>
234+
235+
<issue
236+
id="ExtraTranslation"
237+
message="&quot;pre_release&quot; is translated here but not found in default locale"
238+
errorLine1=" &lt;string name=&quot;pre_release&quot;>プレリリース&lt;/string>"
239+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
240+
<location
241+
file="src/main/res/values-ja-rJP/strings.xml"
242+
line="370"
243+
column="13"/>
244+
</issue>
245+
246+
<issue
247+
id="ExtraTranslation"
248+
message="&quot;pre_release&quot; is translated here but not found in default locale"
249+
errorLine1=" &lt;string name=&quot;pre_release&quot;>Pré-lançamento&lt;/string>"
250+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
251+
<location
252+
file="src/main/res/values-pt-rPT/strings.xml"
253+
line="370"
254+
column="13"/>
255+
</issue>
256+
257+
<issue
258+
id="ExtraTranslation"
259+
message="&quot;pre_release&quot; is translated here but not found in default locale"
260+
errorLine1=" &lt;string name=&quot;pre_release&quot;>Предварительный релиз&lt;/string>"
261+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
262+
<location
263+
file="src/main/res/values-ru-rRU/strings.xml"
264+
line="370"
265+
column="13"/>
266+
</issue>
267+
268+
<issue
269+
id="ExtraTranslation"
270+
message="&quot;pre_release&quot; is translated here but not found in default locale"
271+
errorLine1=" &lt;string name=&quot;pre_release&quot;>Yayın öncesi (Pre-release)&lt;/string>"
272+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
273+
<location
274+
file="src/main/res/values-tr-rTR/strings.xml"
275+
line="370"
276+
column="13"/>
277+
</issue>
278+
279+
<issue
280+
id="ExtraTranslation"
281+
message="&quot;pre_release&quot; is translated here but not found in default locale"
282+
errorLine1=" &lt;string name=&quot;pre_release&quot;>Перед-реліз&lt;/string>"
283+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
284+
<location
285+
file="src/main/res/values-uk-rUA/strings.xml"
286+
line="370"
287+
column="13"/>
288+
</issue>
289+
290+
<issue
291+
id="ExtraTranslation"
292+
message="&quot;pre_release&quot; is translated here but not found in default locale"
293+
errorLine1=" &lt;string name=&quot;pre_release&quot;>预发布版&lt;/string>"
294+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
295+
<location
296+
file="src/main/res/values-zh-rCN/strings.xml"
297+
line="370"
298+
column="13"/>
299+
</issue>
300+
301+
<issue
302+
id="ExtraTranslation"
303+
message="&quot;pre_release&quot; is translated here but not found in default locale"
304+
errorLine1=" &lt;string name=&quot;pre_release&quot;>إصدار تجريبي&lt;/string>"
305+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
306+
<location
307+
file="src/main/res/values-ar-rSA/strings.xml"
308+
line="371"
309+
column="13"/>
310+
</issue>
311+
312+
<issue
313+
id="ExtraTranslation"
314+
message="&quot;stable&quot; is translated here but not found in default locale"
315+
errorLine1=" &lt;string name=&quot;stable&quot;>Stabil&lt;/string>"
316+
errorLine2=" ~~~~~~~~~~~~~">
317+
<location
318+
file="src/main/res/values-de-rDE/strings.xml"
319+
line="457"
320+
column="13"/>
321+
</issue>
322+
323+
<issue
324+
id="ExtraTranslation"
325+
message="&quot;stable&quot; is translated here but not found in default locale"
326+
errorLine1=" &lt;string name=&quot;stable&quot;>پایدار&lt;/string>"
327+
errorLine2=" ~~~~~~~~~~~~~">
328+
<location
329+
file="src/main/res/values-fa-rIR/strings.xml"
330+
line="457"
331+
column="13"/>
332+
</issue>
333+
334+
<issue
335+
id="ExtraTranslation"
336+
message="&quot;stable&quot; is translated here but not found in default locale"
337+
errorLine1=" &lt;string name=&quot;stable&quot;>Stable&lt;/string>"
338+
errorLine2=" ~~~~~~~~~~~~~">
339+
<location
340+
file="src/main/res/values-fr-rFR/strings.xml"
341+
line="457"
342+
column="13"/>
343+
</issue>
344+
345+
<issue
346+
id="ExtraTranslation"
347+
message="&quot;stable&quot; is translated here but not found in default locale"
348+
errorLine1=" &lt;string name=&quot;stable&quot;>स्थिर&lt;/string>"
349+
errorLine2=" ~~~~~~~~~~~~~">
350+
<location
351+
file="src/main/res/values-hi-rIN/strings.xml"
352+
line="457"
353+
column="13"/>
354+
</issue>
355+
356+
<issue
357+
id="ExtraTranslation"
358+
message="&quot;stable&quot; is translated here but not found in default locale"
359+
errorLine1=" &lt;string name=&quot;stable&quot;>安定版&lt;/string>"
360+
errorLine2=" ~~~~~~~~~~~~~">
361+
<location
362+
file="src/main/res/values-ja-rJP/strings.xml"
363+
line="457"
364+
column="13"/>
365+
</issue>
366+
367+
<issue
368+
id="ExtraTranslation"
369+
message="&quot;stable&quot; is translated here but not found in default locale"
370+
errorLine1=" &lt;string name=&quot;stable&quot;>Estável&lt;/string>"
371+
errorLine2=" ~~~~~~~~~~~~~">
372+
<location
373+
file="src/main/res/values-pt-rPT/strings.xml"
374+
line="457"
375+
column="13"/>
376+
</issue>
377+
378+
<issue
379+
id="ExtraTranslation"
380+
message="&quot;stable&quot; is translated here but not found in default locale"
381+
errorLine1=" &lt;string name=&quot;stable&quot;>Стабильный&lt;/string>"
382+
errorLine2=" ~~~~~~~~~~~~~">
383+
<location
384+
file="src/main/res/values-ru-rRU/strings.xml"
385+
line="457"
386+
column="13"/>
387+
</issue>
388+
389+
<issue
390+
id="ExtraTranslation"
391+
message="&quot;stable&quot; is translated here but not found in default locale"
392+
errorLine1=" &lt;string name=&quot;stable&quot;>Kararlı (Stable)&lt;/string>"
393+
errorLine2=" ~~~~~~~~~~~~~">
394+
<location
395+
file="src/main/res/values-tr-rTR/strings.xml"
396+
line="457"
397+
column="13"/>
398+
</issue>
399+
400+
<issue
401+
id="ExtraTranslation"
402+
message="&quot;stable&quot; is translated here but not found in default locale"
403+
errorLine1=" &lt;string name=&quot;stable&quot;>Стабільний&lt;/string>"
404+
errorLine2=" ~~~~~~~~~~~~~">
405+
<location
406+
file="src/main/res/values-uk-rUA/strings.xml"
407+
line="457"
408+
column="13"/>
409+
</issue>
410+
411+
<issue
412+
id="ExtraTranslation"
413+
message="&quot;stable&quot; is translated here but not found in default locale"
414+
errorLine1=" &lt;string name=&quot;stable&quot;>稳定版&lt;/string>"
415+
errorLine2=" ~~~~~~~~~~~~~">
416+
<location
417+
file="src/main/res/values-zh-rCN/strings.xml"
418+
line="457"
419+
column="13"/>
420+
</issue>
421+
422+
<issue
423+
id="ExtraTranslation"
424+
message="&quot;stable&quot; is translated here but not found in default locale"
425+
errorLine1=" &lt;string name=&quot;stable&quot;>مستقر&lt;/string>"
426+
errorLine2=" ~~~~~~~~~~~~~">
427+
<location
428+
file="src/main/res/values-ar-rSA/strings.xml"
429+
line="458"
430+
column="13"/>
431+
</issue>
432+
191433
<issue
192434
id="PluralsCandidate"
193435
message="Formatting %d followed by words (&quot;remaining&quot;): This should probably be a plural rather than a string"
@@ -921,6 +1163,28 @@
9211163
column="1"/>
9221164
</issue>
9231165

1166+
<issue
1167+
id="UnusedResources"
1168+
message="The resource `R.string.pre_release` appears to be unused"
1169+
errorLine1=" &lt;string name=&quot;pre_release&quot;>إصدار تجريبي&lt;/string>"
1170+
errorLine2=" ~~~~~~~~~~~~~~~~~~">
1171+
<location
1172+
file="src/main/res/values-ar-rSA/strings.xml"
1173+
line="371"
1174+
column="13"/>
1175+
</issue>
1176+
1177+
<issue
1178+
id="UnusedResources"
1179+
message="The resource `R.string.stable` appears to be unused"
1180+
errorLine1=" &lt;string name=&quot;stable&quot;>مستقر&lt;/string>"
1181+
errorLine2=" ~~~~~~~~~~~~~">
1182+
<location
1183+
file="src/main/res/values-ar-rSA/strings.xml"
1184+
line="458"
1185+
column="13"/>
1186+
</issue>
1187+
9241188
<issue
9251189
id="UnusedResources"
9261190
message="The resource `R.drawable.thumb_drawable` appears to be unused"

app/src/main/java/in/hridayan/ashell/activities/MainActivity.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,9 @@ class MainActivity : ComponentActivity() {
4444

4545
lifecycleScope.launch {
4646
val autoUpdateEnabled = settingsViewModel.getBoolean(SettingsKeys.AUTO_UPDATE).first()
47-
val includePrerelease =
48-
settingsViewModel.getInt(SettingsKeys.GITHUB_RELEASE_TYPE)
49-
.first() == GithubReleaseType.PRE_RELEASE
5047

5148
if (autoUpdateEnabled) {
52-
autoUpdateViewModel.checkForUpdates(
53-
includePrerelease = includePrerelease
54-
)
49+
autoUpdateViewModel.checkForUpdates()
5550
}
5651
}
5752

app/src/main/java/in/hridayan/ashell/core/common/LocalSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ val LocalSettings = compositionLocalOf {
1818
seedColor = SeedColorProvider.seed,
1919
isDynamicColor = true,
2020
isHapticEnabled = true,
21-
githubReleaseType = GithubReleaseType.STABLE,
21+
githubReleaseType = GithubReleaseType.STABLE_GITHUB,
2222
savedVersionCode = 0,
2323
enableDirectDownload = true,
2424
localAdbMode = LocalAdbWorkingMode.BASIC,

app/src/main/java/in/hridayan/ashell/core/data/remote/mapper/GithubReleaseMapper.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
package `in`.hridayan.ashell.core.data.remote.mapper
22

3+
import `in`.hridayan.ashell.BuildConfig
34
import `in`.hridayan.ashell.core.data.remote.dto.GithubReleaseDto
45
import `in`.hridayan.ashell.core.domain.model.GithubRelease
6+
import `in`.hridayan.ashell.core.domain.model.GithubReleaseType
7+
8+
fun GithubReleaseDto.toDomain(releaseType: Int): GithubRelease {
9+
val flavor = if (releaseType == GithubReleaseType.STABLE_FDROID) {
10+
BuildConfig.DIST_FLAVOR_FDROID
11+
} else {
12+
BuildConfig.DIST_FLAVOR_GITHUB
13+
}
14+
val apkAsset = assets.firstOrNull {
15+
it.name.contains(flavor, ignoreCase = true) && it.name.endsWith(".apk")
16+
}
517

6-
fun GithubReleaseDto.toDomain(): GithubRelease {
7-
val apkAsset = assets.firstOrNull { it.name.endsWith(".apk") }
818
return GithubRelease(
919
tagName = tagName,
1020
apkUrl = apkAsset?.browserDownloadUrl

app/src/main/java/in/hridayan/ashell/core/data/remote/repository/GithubDataRepositoryImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class GithubDataRepositoryImpl @Inject constructor(
2828
) : GithubDataRepository {
2929
private val repoKey = "DP-Hridayan/aShellYou"
3030

31-
override suspend fun fetchLatestRelease(includePrerelease: Boolean): UpdateResult {
31+
override suspend fun fetchLatestRelease(includePrerelease: Boolean, releaseType: Int): UpdateResult {
3232
return try {
3333
Log.d("GithubDataRepository", "Fetching latest release from Github")
34-
val response = api.fetchLatestRelease(includePrerelease).toDomain()
34+
val response = api.fetchLatestRelease(includePrerelease).toDomain(releaseType)
3535
UpdateResult.Success(response, response.tagName.isNotEmpty())
3636
} catch (e: SocketTimeoutException) {
3737
Log.e("GithubDataRepository", "Timeout", e)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package `in`.hridayan.ashell.core.domain.model
22

33
object GithubReleaseType {
4-
const val STABLE = 1
5-
const val PRE_RELEASE = 2
4+
const val STABLE_FDROID = 0
5+
const val STABLE_GITHUB = 1
6+
const val PRE_RELEASE_GITHUB = 2
67
}

app/src/main/java/in/hridayan/ashell/core/domain/repository/GithubDataRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import `in`.hridayan.ashell.settings.domain.model.UpdateResult
55
import kotlinx.coroutines.flow.Flow
66

77
interface GithubDataRepository {
8-
suspend fun fetchLatestRelease(includePrerelease: Boolean): UpdateResult
8+
suspend fun fetchLatestRelease(includePrerelease: Boolean, releaseType: Int): UpdateResult
99
fun observeRepoStats(): Flow<GithubRepoStats>
1010
suspend fun refreshRepoStats()
1111
}

0 commit comments

Comments
 (0)