mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-11-05 02:11:13 +00:00
Strip native libraries in the app and keep light client line tables
The app module named no NDK, so AGP expected its default 27.0 against the 26.1 that CI installs, could not strip any native library and made no native-debug-symbols.zip for Play. Pin 26.1 in the app. The light client now keeps line tables for that symbol file; the packaged library is still stripped to 8.6 MB. Also adds an XCM encoding test for PezkuwiChain networks. This commit points WESTEND at Zagros to check that the test fails against that change.
This commit is contained in:
1 parent
8549501a62
commit
43ca9d6a7a
4 files changed
+51
-5
No files matched your search
@@ -6,6 +6,10 @@ apply from: "../scripts/versions.gradle"
|
||||
apply from: "../scripts/secrets.gradle"
|
||||
|
||||
android {
|
||||
// The NDK that CI installs and the bindings build with. Without it AGP expects its default NDK,
|
||||
// cannot strip the native libraries: they ship with their debug sections and no native-debug-symbols.zip is made.
|
||||
ndkVersion "26.1.10909125"
|
||||
|
||||
defaultConfig {
|
||||
applicationId rootProject.applicationId
|
||||
versionCode computeVersionCode()
|
||||
|
||||
@@ -31,11 +31,11 @@ android_logger = { version = "0.14", default-features = false }
|
||||
env_logger = { version = "0.11", default-features = false, features = ["humantime"] }
|
||||
tungstenite = "0.24"
|
||||
|
||||
# Stripped here, not left to the Android Gradle plugin: it packages a library it cannot strip as
|
||||
# it is, and with debug info this one is 147 MB per ABI instead of 8.6 MB.
|
||||
# Line tables only: enough for the Play native-debug-symbols.zip to give file and line, at 59 MB
|
||||
# per ABI before the app strips it to 8.6 MB. Full debug info (`debug = 2`) is 147 MB per ABI.
|
||||
[profile.release]
|
||||
strip = true
|
||||
debug = false
|
||||
strip = false
|
||||
debug = "line-tables-only"
|
||||
lto = true
|
||||
opt-level = "s"
|
||||
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package io.novafoundation.nova.feature_xcm_api.multiLocation
|
||||
|
||||
import io.novafoundation.nova.common.utils.HexString
|
||||
import io.novafoundation.nova.feature_xcm_api.multiLocation.MultiLocation.Junction.GlobalConsensus
|
||||
import io.novafoundation.nova.feature_xcm_api.multiLocation.MultiLocation.NetworkId
|
||||
import io.novafoundation.nova.feature_xcm_api.versions.XcmVersion
|
||||
import io.novasama.substrate_sdk_android.extensions.toHexString
|
||||
import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum
|
||||
import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class MultiLocationEncodingTest {
|
||||
|
||||
// PezkuwiChain runtimes declare `ThisNetwork = ByGenesis(..)`, and XCM v5 has no named variant for them
|
||||
@Test
|
||||
fun `zagros is encoded by its genesis`() {
|
||||
assertEncodedByGenesis(ZAGROS)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `pezkuwi is encoded by its genesis`() {
|
||||
assertEncodedByGenesis(PEZKUWI)
|
||||
}
|
||||
|
||||
private fun assertEncodedByGenesis(genesis: HexString) {
|
||||
val location = RelativeMultiLocation(parents = 1, interior = Junctions(GlobalConsensus(NetworkId.Substrate(genesis))))
|
||||
|
||||
val encoded = location.toEncodableInstanceExt(XcmVersion.V5) as Struct.Instance
|
||||
val junction = ((encoded["interior"] as DictEnum.Entry<*>).value as List<*>).single() as DictEnum.Entry<*>
|
||||
val network = junction.value as DictEnum.Entry<*>
|
||||
|
||||
assertEquals("GlobalConsensus", junction.name)
|
||||
assertEquals("ByGenesis", network.name)
|
||||
assertEquals(genesis, (network.value as ByteArray).toHexString(withPrefix = false))
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val ZAGROS = "1b0b4727bbb5e44ed587d1056b4ad537ffb330034509a58866a088d77e792cd5"
|
||||
const val PEZKUWI = "1aa94987791a5544e9667ec249d2cef1b8fdd6083c85b93fc37892d54a1156ca"
|
||||
}
|
||||
}
|
||||
@@ -462,7 +462,7 @@ object ChainGeneses {
|
||||
const val POLKADOT = "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"
|
||||
|
||||
// Westend constant now points to Zagros Testnet
|
||||
const val WESTEND = "96eb58af1bb7288115b5e4ff1590422533e749293f231974536dc6672417d06f"
|
||||
const val WESTEND = "1b0b4727bbb5e44ed587d1056b4ad537ffb330034509a58866a088d77e792cd5"
|
||||
|
||||
const val KUSAMA_ASSET_HUB = "48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a"
|
||||
|
||||
|
||||
Reference in new issue
Block a user