Skip to content

Commit

Permalink
Added Terra Luna Classic coin.
Browse files Browse the repository at this point in the history
Fixed Terra Luna 2.0.
Refreshed coin lists.
  • Loading branch information
hwki committed Oct 10, 2022
1 parent e3c5a7b commit eb86d24
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bitcoin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.brentpanther.bitcoinwidget"
minSdk 23
targetSdk 33
versionCode 303
versionName "8.2.6"
versionCode 304
versionName "8.2.7"

javaCompileOptions {
annotationProcessorOptions {
Expand Down Expand Up @@ -72,7 +72,7 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.fragment:fragment-ktx:1.5.2'
implementation 'androidx.fragment:fragment-ktx:1.5.3'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ enum class Coin(val coinName: String, vararg val themes: IconTheme) : Parcelable
},
LTO("LTO Network", IconTheme(SOLID, ic_lto)),
LUNA("Terra", IconTheme(SOLID, ic_luna)),
LUNC("Terra Luna Classic", IconTheme(SOLID, ic_lunc)),
MANA("Decentraland", IconTheme(SOLID, ic_mana)),
MATIC("Polygon", IconTheme(SOLID, ic_matic)),
MCO("MCO", IconTheme(SOLID, ic_mco, ic_mco_white)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ enum class Exchange(val exchangeName: String, shortName: String? = null) {
"LSK" to "lisk",
"LTC" to "litecoin",
"LTO" to "lto-network",
"LUNA" to "terra-luna",
"LUNA" to "terra-luna-2",
"LUNC" to "terra-luna",
"MANA" to "decentraland",
"MATIC" to "matic-network",
"MCO" to "monaco",
Expand Down
Binary file modified bitcoin/src/main/res/drawable-nodpi/ic_luna.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bitcoin/src/main/res/drawable-nodpi/ic_lunc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bitcoin/src/main/res/raw/cryptowidgetcoins_v2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bitcoin/src/main/res/raw/othercoins.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import com.jayway.jsonpath.JsonPath
import okhttp3.OkHttpClient
import okhttp3.Request
import org.junit.Test
import java.security.SecureRandom
import java.security.cert.X509Certificate
import java.util.*
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager

class GenerateSupportedCoinsJson {

Expand Down Expand Up @@ -211,7 +216,24 @@ class GenerateSupportedCoinsJson {

private fun parseKeys(url: String, path: String) = (JsonPath.read(get(url), path) as Map<String, *>).keys.map { it }
private fun parse(url: String, path: String) = JsonPath.read(get(url), path) as List<String>
private fun get(value: String): String = OkHttpClient().newCall(Request.Builder().url(value).build()).execute().body!!.string()
private fun get(value: String): String = OkHttpClient.Builder().ignoreAllSSLErrors().build().newCall(Request.Builder().url(value).build()).execute().body!!.string()

fun OkHttpClient.Builder.ignoreAllSSLErrors(): OkHttpClient.Builder {
val naiveTrustManager = object : X509TrustManager {
override fun getAcceptedIssuers(): Array<X509Certificate> = arrayOf()
override fun checkClientTrusted(certs: Array<X509Certificate>, authType: String) = Unit
override fun checkServerTrusted(certs: Array<X509Certificate>, authType: String) = Unit
}

val insecureSocketFactory = SSLContext.getInstance("TLSv1.2").apply {
val trustAllCerts = arrayOf<TrustManager>(naiveTrustManager)
init(null, trustAllCerts, SecureRandom())
}.socketFactory

sslSocketFactory(insecureSocketFactory, naiveTrustManager)
hostnameVerifier { _, _ -> true }
return this
}

//endregion

Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added Terra Luna Classic coin.
Fixed Terra Luna 2.0.
Refreshed coin lists.

0 comments on commit eb86d24

Please sign in to comment.