Skip to content

Commit 6bc5f21

Browse files
committed
ignore
1 parent b63d0b9 commit 6bc5f21

3 files changed

Lines changed: 69 additions & 22 deletions

File tree

app/build.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,21 @@ androidComponents {
154154
}
155155
}
156156

157+
aboutLibraries {
158+
offlineMode = false
159+
160+
collect {
161+
includePlatform = true
162+
fetchRemoteLicense = false
163+
fetchRemoteFunding = false
164+
}
165+
166+
library {
167+
duplicationMode = com.mikepenz.aboutlibraries.plugin.DuplicateMode.MERGE
168+
duplicationRule = com.mikepenz.aboutlibraries.plugin.DuplicateRule.SIMPLE
169+
}
170+
}
171+
157172
tasks.withType<KotlinCompile>().configureEach {
158173
ksp {
159174
arg("room.schemaLocation", "$projectDir/schemas")

app/lint-baseline.xml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
errorLine2=" ~~~~~~~~~~~~~~">
99
<location
1010
file="build.gradle.kts"
11-
line="27"
11+
line="28"
1212
column="9"/>
1313
</issue>
1414

@@ -107,7 +107,7 @@
107107
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
108108
<location
109109
file="src/main/res/values/strings.xml"
110-
line="93"
110+
line="96"
111111
column="5"/>
112112
</issue>
113113

@@ -118,7 +118,7 @@
118118
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
119119
<location
120120
file="src/main/res/values/strings.xml"
121-
line="97"
121+
line="100"
122122
column="5"/>
123123
</issue>
124124

@@ -129,7 +129,7 @@
129129
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
130130
<location
131131
file="src/main/res/values/strings.xml"
132-
line="105"
132+
line="109"
133133
column="5"/>
134134
</issue>
135135

@@ -140,7 +140,7 @@
140140
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
141141
<location
142142
file="src/main/res/values/strings.xml"
143-
line="115"
143+
line="119"
144144
column="5"/>
145145
</issue>
146146

@@ -151,7 +151,7 @@
151151
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
152152
<location
153153
file="src/main/res/values/strings.xml"
154-
line="116"
154+
line="120"
155155
column="5"/>
156156
</issue>
157157

@@ -162,7 +162,7 @@
162162
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
163163
<location
164164
file="src/main/res/values/strings.xml"
165-
line="213"
165+
line="221"
166166
column="5"/>
167167
</issue>
168168

@@ -173,7 +173,7 @@
173173
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
174174
<location
175175
file="src/main/res/values/strings.xml"
176-
line="224"
176+
line="232"
177177
column="5"/>
178178
</issue>
179179

@@ -184,7 +184,7 @@
184184
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
185185
<location
186186
file="src/main/res/values/strings.xml"
187-
line="225"
187+
line="233"
188188
column="5"/>
189189
</issue>
190190

@@ -195,7 +195,18 @@
195195
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
196196
<location
197197
file="src/main/res/values/strings.xml"
198-
line="226"
198+
line="234"
199+
column="5"/>
200+
</issue>
201+
202+
<issue
203+
id="PluralsCandidate"
204+
message="Formatting %d followed by words (&quot;libraries&quot;): This should probably be a plural rather than a string"
205+
errorLine1=" &lt;string name=&quot;library_count&quot;>%1$d libraries detected&lt;/string>"
206+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
207+
<location
208+
file="src/main/res/values/strings.xml"
209+
line="302"
199210
column="5"/>
200211
</issue>
201212

@@ -206,22 +217,36 @@
206217
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
207218
<location
208219
file="src/main/res/values/strings.xml"
209-
line="316"
220+
line="328"
210221
column="5"/>
211222
</issue>
212223

213224
<issue
214225
id="TrustAllX509TrustManager"
215226
message="`checkClientTrusted` is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers">
216227
<location
217-
file="$GRADLE_USER_HOME/caches/9.5.0/transforms/ea489fcf7c341f9689e70eca78b09d17/transformed/out/jars/classes.jar"/>
228+
file="$GRADLE_USER_HOME/caches/9.5.0/transforms/2c8b6fcbe17ad4fb6471d7863d10de43/transformed/out/jars/classes.jar"/>
229+
</issue>
230+
231+
<issue
232+
id="TrustAllX509TrustManager"
233+
message="`checkServerTrusted` is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers">
234+
<location
235+
file="$GRADLE_USER_HOME/caches/9.5.0/transforms/2c8b6fcbe17ad4fb6471d7863d10de43/transformed/out/jars/classes.jar"/>
236+
</issue>
237+
238+
<issue
239+
id="TrustAllX509TrustManager"
240+
message="`checkClientTrusted` is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers">
241+
<location
242+
file="$GRADLE_USER_HOME/caches/modules-2/files-2.1/com.google.http-client/google-http-client/2.1.0/f4c08fa160a5199af19f81080fbaa921ae2193c7/google-http-client-2.1.0.jar"/>
218243
</issue>
219244

220245
<issue
221246
id="TrustAllX509TrustManager"
222247
message="`checkServerTrusted` is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers">
223248
<location
224-
file="$GRADLE_USER_HOME/caches/9.5.0/transforms/ea489fcf7c341f9689e70eca78b09d17/transformed/out/jars/classes.jar"/>
249+
file="$GRADLE_USER_HOME/caches/modules-2/files-2.1/com.google.http-client/google-http-client/2.1.0/f4c08fa160a5199af19f81080fbaa921ae2193c7/google-http-client-2.1.0.jar"/>
225250
</issue>
226251

227252
<issue
@@ -851,7 +876,7 @@
851876
errorLine2=" ~~~~~~~~~~">
852877
<location
853878
file="src/main/res/values-ja-rJP/strings.xml"
854-
line="87"
879+
line="89"
855880
column="31"/>
856881
</issue>
857882

@@ -862,7 +887,7 @@
862887
errorLine2=" ~~~~~~~~~~~~~">
863888
<location
864889
file="src/main/res/values-pt-rPT/strings.xml"
865-
line="291"
890+
line="304"
866891
column="28"/>
867892
</issue>
868893

app/src/main/java/in/hridayan/ashell/settings/data/repository/LicensesRepositoryImpl.kt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package `in`.hridayan.ashell.settings.data.repository
22

33
import android.content.Context
44
import com.mikepenz.aboutlibraries.Libs
5-
import com.mikepenz.aboutlibraries.util.withContext
5+
import com.mikepenz.aboutlibraries.util.withJson
6+
import `in`.hridayan.ashell.R
67
import `in`.hridayan.ashell.settings.domain.model.LibraryItem
78
import `in`.hridayan.ashell.settings.domain.repository.LicensesRepository
89
import kotlinx.coroutines.Dispatchers
@@ -11,19 +12,25 @@ import kotlinx.coroutines.withContext
1112
/**
1213
* Data-layer implementation of [LicensesRepository].
1314
*
14-
* Uses AboutLibraries as a pure metadata provider:
15-
* - [Libs.Builder().withContext()] reads the pre-generated `aboutlibraries.json`
16-
* that the Gradle plugin writes into the app's assets at build time.
17-
* - We then map the raw AboutLibraries model to our own clean [LibraryItem].
15+
* Uses AboutLibraries **only** as a metadata provider — no UI from the library is used.
1816
*
19-
* No UI from AboutLibraries is used anywhere in this class.
17+
* The Gradle plugin (`com.mikepenz.aboutlibraries.plugin`) auto-generates
18+
* `R.raw.aboutlibraries` during every build — no manual export step is needed.
19+
* We read the raw resource directly and feed its JSON string to [Libs.Builder.withJson],
20+
* which is explicit and immune to any resource-discovery quirks across build variants.
2021
*/
2122
class LicensesRepositoryImpl(
2223
private val context: Context,
2324
) : LicensesRepository {
2425

2526
override suspend fun getLibraries(): List<LibraryItem> = withContext(Dispatchers.IO) {
26-
val libs = Libs.Builder().withContext(context).build()
27+
val json = runCatching {
28+
context.resources.openRawResource(R.raw.aboutlibraries)
29+
.bufferedReader()
30+
.use { it.readText() }
31+
}.getOrNull() ?: return@withContext emptyList()
32+
33+
val libs = Libs.Builder().withJson(json).build()
2734

2835
libs.libraries
2936
.map { library ->

0 commit comments

Comments
 (0)