├── .github └── dependabot.yml ├── .gitignore ├── LICENSE ├── README.md ├── app └── compose-wallet │ ├── .gitignore │ ├── build.gradle.kts │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── wallet │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── wallet │ │ │ ├── App.kt │ │ │ ├── MainActivity.kt │ │ │ ├── data │ │ │ ├── IWalletRepository.kt │ │ │ ├── bean │ │ │ │ ├── Account.kt │ │ │ │ ├── IChain.kt │ │ │ │ └── Wallet.kt │ │ │ ├── database │ │ │ │ ├── AppDatabase.kt │ │ │ │ ├── converter │ │ │ │ │ ├── ChainTypeConverter.kt │ │ │ │ │ ├── DateConverter.kt │ │ │ │ │ └── StringArrayConverter.kt │ │ │ │ ├── dao │ │ │ │ │ ├── AccountDao.kt │ │ │ │ │ ├── BaseDao.kt │ │ │ │ │ ├── ChainDao.kt │ │ │ │ │ ├── ConfigDao.kt │ │ │ │ │ └── WalletDao.kt │ │ │ │ ├── dataSource │ │ │ │ │ ├── IWalletDataBaseDataSource.kt │ │ │ │ │ └── impl │ │ │ │ │ │ └── WalletLocalDataSource.kt │ │ │ │ ├── databaseView │ │ │ │ │ └── WalletEmbedDO.kt │ │ │ │ └── entity │ │ │ │ │ ├── AccountDO.kt │ │ │ │ │ ├── ChainDO.kt │ │ │ │ │ ├── ChainRpcURLDO.kt │ │ │ │ │ ├── ConfigDO.kt │ │ │ │ │ ├── WalletDO.kt │ │ │ │ │ ├── coinEth │ │ │ │ │ ├── TokenEthDO.kt │ │ │ │ │ └── WalletTokenEthDO.kt │ │ │ │ │ └── embed │ │ │ │ │ ├── BaseEntity.kt │ │ │ │ │ └── DigitalAssetUnitDO.kt │ │ │ └── repository │ │ │ │ └── WalletRepository.kt │ │ │ ├── designsystem │ │ │ ├── component │ │ │ │ ├── BackgroundSurface.kt │ │ │ │ └── PanelSurface.kt │ │ │ └── theme │ │ │ │ ├── Background.kt │ │ │ │ ├── Color.kt │ │ │ │ ├── Gradient.kt │ │ │ │ ├── Theme.kt │ │ │ │ ├── Type.kt │ │ │ │ └── Typography.kt │ │ │ ├── di │ │ │ ├── AppModule.kt │ │ │ ├── CommonModule.kt │ │ │ ├── CoroutineModule.kt │ │ │ └── WalletRepositoryModule.kt │ │ │ ├── feature │ │ │ └── wallets │ │ │ │ ├── WalletSelectListFragment.kt │ │ │ │ ├── WalletSelectListViewModel.kt │ │ │ │ └── bean │ │ │ │ └── AccountWalletListBean.kt │ │ │ └── ui │ │ │ ├── CoinListView.kt │ │ │ ├── WalletListView.kt │ │ │ ├── components │ │ │ ├── AsyncImage.kt │ │ │ ├── JankStatsExtensions.kt │ │ │ └── UnreadIndicator.kt │ │ │ ├── kit │ │ │ ├── WidgetAccountListItem.kt │ │ │ ├── WidgetChainCategory.kt │ │ │ └── WidgetWalletListItem.kt │ │ │ ├── navigation │ │ │ ├── AppNavHost.kt │ │ │ ├── NavigationDestination.kt │ │ │ └── Screens.kt │ │ │ └── screen │ │ │ ├── AccountManager.kt │ │ │ ├── CreateWallet.kt │ │ │ ├── Welcome.kt │ │ │ ├── app │ │ │ ├── AppHome.kt │ │ │ ├── AppState.kt │ │ │ └── AppViewModel.kt │ │ │ └── home │ │ │ ├── Home.kt │ │ │ └── HomeViewModel.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_gradle_logo.png │ │ ├── ic_launcher_background.xml │ │ ├── ic_select_coin_cursor.xml │ │ ├── vector_ic_add_chain.xml │ │ ├── vector_ic_bitcoin.xml │ │ ├── vector_ic_select_coin_help.xml │ │ └── vector_ic_setting.xml │ │ ├── layouts │ │ ├── main │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ └── wallets │ │ │ ├── drawable │ │ │ ├── shape_bg_division_line_white.xml │ │ │ └── shape_bg_top_corner_white.xml │ │ │ └── layout │ │ │ └── fragment_select_wallet.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── smallraw │ └── chain │ └── wallet │ └── ExampleUnitTest.kt ├── build-logic ├── README.md ├── convention │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ ├── AndroidApplicationComposeConventionPlugin.kt │ │ ├── AndroidApplicationConventionPlugin.kt │ │ ├── AndroidApplicationFirebaseConventionPlugin.kt │ │ ├── AndroidApplicationFlavorsConventionPlugin.kt │ │ ├── AndroidApplicationJacocoConventionPlugin.kt │ │ ├── AndroidFeatureConventionPlugin.kt │ │ ├── AndroidHiltConventionPlugin.kt │ │ ├── AndroidLibraryComposeConventionPlugin.kt │ │ ├── AndroidLibraryConventionPlugin.kt │ │ ├── AndroidLibraryJacocoConventionPlugin.kt │ │ ├── AndroidLibraryNativeConventionPlugin.kt │ │ ├── AndroidLintConventionPlugin.kt │ │ ├── AndroidRoomConventionPlugin.kt │ │ ├── AndroidTestConventionPlugin.kt │ │ ├── DependencyUpdatesPlugin.kt │ │ ├── JvmLibraryConventionPlugin.kt │ │ └── com │ │ └── smallraw │ │ └── convention │ │ └── apps │ │ ├── AndroidCompose.kt │ │ ├── AndroidInstrumentedTests.kt │ │ ├── AppBuildType.kt │ │ ├── AppFlavor.kt │ │ ├── GradleManagedDevices.kt │ │ ├── Jacoco.kt │ │ ├── KotlinAndroid.kt │ │ ├── NativeCMake.kt │ │ ├── PrintTestApks.kt │ │ └── ProjectExtensions.kt ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle.kts ├── build.gradle.kts ├── chain ├── bitcoin-core │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── bitcoincore │ │ │ ├── address │ │ │ ├── AddressUnitTest.kt │ │ │ ├── ScriptAddressUnitTest.kt │ │ │ └── ScriptChunkUnitTest.kt │ │ │ ├── stream │ │ │ └── SerializeTimeUnitTest.kt │ │ │ └── transaction │ │ │ ├── Bitcoin 各类型签字.xlsx │ │ │ ├── README.md │ │ │ ├── SpendP2PKHTransactionUnitTest.kt │ │ │ ├── SpendP2PKTransactionUnitTest.kt │ │ │ ├── SpendP2SHMultipleTransactionUnitTest.kt │ │ │ ├── SpendP2SHP2WPKHTransactionUnitTest.kt │ │ │ ├── SpendP2SHP2WSHTransactionUnitTest.kt │ │ │ ├── SpendP2WPKHTransactionUnitTest.kt │ │ │ └── SpendP2WSHTransactionUnitTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── bitcoincore │ │ │ ├── KeyPair.kt │ │ │ ├── PrivateKey.kt │ │ │ ├── PublicKey.kt │ │ │ ├── Signature.kt │ │ │ ├── WalletImportFormat.kt │ │ │ ├── address │ │ │ ├── Address.kt │ │ │ ├── LegacyAddress.kt │ │ │ └── SegwitAddress.kt │ │ │ ├── addressConvert │ │ │ ├── AddressConverter.kt │ │ │ ├── Base58AddressConverter.kt │ │ │ ├── Bech32AddressConverter.kt │ │ │ ├── IAddressConverter.kt │ │ │ └── README.md │ │ │ ├── crypto │ │ │ ├── Bech32.kt │ │ │ ├── Bech32Segwit.kt │ │ │ └── Secp256k1Signer.kt │ │ │ ├── execptions │ │ │ ├── BitcoinException.kt │ │ │ └── ScriptParsingException.kt │ │ │ ├── network │ │ │ ├── BaseNetwork.kt │ │ │ ├── MainNet.kt │ │ │ └── TestNet.kt │ │ │ ├── script │ │ │ ├── OpCodes.kt │ │ │ ├── Script.kt │ │ │ ├── ScriptChunk.kt │ │ │ └── ScriptType.kt │ │ │ ├── stream │ │ │ ├── BitcoinInputStream.java │ │ │ └── BitcoinOutputStream.java │ │ │ └── transaction │ │ │ ├── Transaction.kt │ │ │ └── serializers │ │ │ ├── InputSerializer.kt │ │ │ ├── OutputSerializer.kt │ │ │ └── TransactionSerializer.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── bitcoincore │ │ └── ExampleUnitTest.kt ├── bitcoin │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── bitcoin │ │ │ ├── BitcoinAccountUnitTest.kt │ │ │ ├── BitcoinKeysUnitTest.kt │ │ │ ├── BitcoinTestUnitTest.kt │ │ │ ├── provider │ │ │ ├── UnitTestMultiPrivateKeyPairProvider.kt │ │ │ └── UnitTestPrivateKeyPairProvider.kt │ │ │ └── transaction │ │ │ └── build │ │ │ ├── P2pkhTransferBuild.kt │ │ │ ├── P2shTransferBuild.kt │ │ │ ├── P2wpkhTransferBuild.kt │ │ │ └── P2wshTransferBuild.kt │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── bitcoin │ │ ├── Bitcoin.kt │ │ ├── BitcoinKit.kt │ │ ├── convert │ │ └── WalletImportFormat.kt │ │ ├── execptions │ │ └── AddressFormatException.kt │ │ ├── models │ │ └── UnspentOutput.kt │ │ ├── transaction │ │ ├── DustCalculator.kt │ │ ├── TransactionSizeCalculator.kt │ │ ├── build │ │ │ ├── EmptyTransactionSigner.kt │ │ │ ├── InputSetter.kt │ │ │ ├── MutableTransaction.kt │ │ │ ├── OutputSetter.kt │ │ │ ├── TransactionBuilder.kt │ │ │ ├── TransactionSigner.kt │ │ │ ├── inputSigner │ │ │ │ ├── InputSignerAbstract.kt │ │ │ │ ├── InputSignerChain.kt │ │ │ │ ├── P2PKHInputSigner.kt │ │ │ │ ├── P2SHMultiInputSigner.kt │ │ │ │ ├── P2WPKHInputSigner.kt │ │ │ │ └── P2WSHMultiInputSigner.kt │ │ │ └── interface │ │ │ │ ├── IChangeSetter.kt │ │ │ │ ├── IPrivateKeyPairProvider.kt │ │ │ │ ├── IRecipientSetter.kt │ │ │ │ └── ITransactionSigner.kt │ │ └── serializer │ │ │ ├── InputSerializer.kt │ │ │ ├── MutableTransactionSerializer.kt │ │ │ └── OutputSerializer.kt │ │ └── unspentOutput │ │ ├── IUnspentOutputProvider.kt │ │ └── UnspentOutputSelector.kt ├── eos │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── eos │ │ │ ├── AccountUnitTest.kt │ │ │ └── SignatureUnitTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── eos │ │ │ ├── KeyPair.kt │ │ │ ├── PrivateKey.kt │ │ │ ├── PublicKey.kt │ │ │ ├── Signature.kt │ │ │ ├── api │ │ │ ├── exception │ │ │ │ ├── ApiError.kt │ │ │ │ ├── ApiException.kt │ │ │ │ ├── Error.kt │ │ │ │ └── ErrorDetails.kt │ │ │ ├── service │ │ │ │ └── RpcService.kt │ │ │ └── utils │ │ │ │ └── Generator.kt │ │ │ ├── crypto │ │ │ └── Secp256k1Signer.kt │ │ │ ├── execptions │ │ │ └── EOSException.kt │ │ │ ├── model │ │ │ ├── BaseVo.kt │ │ │ ├── Block.kt │ │ │ ├── ChainInfo.kt │ │ │ ├── JsonToBin.kt │ │ │ ├── JsonToBinReq.kt │ │ │ ├── SignParam.kt │ │ │ ├── TableRows.kt │ │ │ ├── TableRowsReq.kt │ │ │ ├── Transfer.kt │ │ │ ├── UpTransfer.kt │ │ │ ├── account │ │ │ │ ├── Account.kt │ │ │ │ ├── CpuLimit.kt │ │ │ │ ├── Key.kt │ │ │ │ ├── NetLimit.kt │ │ │ │ ├── Permission.kt │ │ │ │ └── RequiredAuth.kt │ │ │ ├── serializer │ │ │ │ └── ObjectUtils.kt │ │ │ └── transaction │ │ │ │ ├── Processed.kt │ │ │ │ ├── Receipt.kt │ │ │ │ ├── Transaction.kt │ │ │ │ └── push │ │ │ │ ├── Tx.kt │ │ │ │ ├── TxAction.kt │ │ │ │ ├── TxActionAuth.kt │ │ │ │ ├── TxExtenstions.kt │ │ │ │ ├── TxRequest.kt │ │ │ │ └── TxSign.kt │ │ │ └── utils │ │ │ ├── ByteBuffer.kt │ │ │ ├── ByteUtils.java │ │ │ └── EException.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── eos │ │ └── ExampleUnitTest.kt └── ethereum │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── ethereum │ │ ├── AddressUnitTest.kt │ │ ├── TransactionUnitTest.kt │ │ └── abi │ │ └── AbiUnitTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── ethereum │ │ ├── Address.kt │ │ ├── AddressValidator.kt │ │ ├── KeyPair.kt │ │ ├── PrivateKey.kt │ │ ├── PublicKey.kt │ │ ├── Signature.kt │ │ ├── abi │ │ ├── Abi.kt │ │ └── MethodAbi.kt │ │ ├── contract │ │ └── IContractMethod.kt │ │ ├── crypto │ │ └── Secp256k1Signer.kt │ │ ├── execptions │ │ └── EthereumException.kt │ │ ├── extensions │ │ ├── ByteArray.kt │ │ └── String.kt │ │ ├── network │ │ ├── BaseNetwork.kt │ │ ├── MainNet.kt │ │ └── Ropsten.kt │ │ ├── rlp │ │ ├── RLPDecoder.kt │ │ ├── RLPEncoder.kt │ │ └── RLPModel.kt │ │ ├── solidity │ │ └── SolidityType.kt │ │ ├── supplement │ │ ├── EIP191.kt │ │ ├── EIP55.kt │ │ └── ERC1191.kt │ │ └── transaction │ │ ├── Transaction.kt │ │ └── serializers │ │ └── TransactionSerializer.kt │ └── test │ └── java │ └── com │ └── smallraw │ └── chain │ └── ethereum │ └── ExampleUnitTest.kt ├── core ├── authority-ckeck │ ├── .gitignore │ ├── CMakeLists.txt │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── authority │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ ├── authority-lib.c │ │ │ ├── keys.c │ │ │ ├── valid.c │ │ │ └── valid.h │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── authority │ │ │ └── AuthorityKey.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── authority │ │ └── ExampleUnitTest.kt ├── database │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── schemas │ │ └── index.sql │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── core │ │ └── chain │ │ └── database │ │ ├── DaosModule.kt │ │ ├── DatabaseModule.kt │ │ ├── WalletDatabase.kt │ │ ├── dao │ │ ├── AccountDao.kt │ │ ├── AddressDao.kt │ │ ├── BaseDao.kt │ │ ├── CurrencyDao.kt │ │ ├── EncryptedSecretDao.kt │ │ ├── TransactionDao.kt │ │ └── WalletDao.kt │ │ ├── model │ │ ├── AccountEntity.kt │ │ ├── AddressEntity.kt │ │ ├── CurrencyEntity.kt │ │ ├── EncryptedSecretEntity.kt │ │ ├── TransactionEntity.kt │ │ └── WalletEntity.kt │ │ └── util │ │ └── Converters.kt └── testing │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── smallraw │ └── apps │ └── chain │ └── core │ └── testing │ ├── AppTestRunner.kt │ ├── di │ └── TestDispatcherModule.kt │ └── util │ └── MainDispatcherRule.kt ├── crypto ├── aes │ ├── .gitignore │ ├── CMakeLists.txt │ ├── CMakeLists1.txt │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── crypto │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ └── aes-wrapper.c │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── crypto │ │ │ ├── Aes.kt │ │ │ └── paddings │ │ │ ├── BlockCipherPadding.kt │ │ │ ├── ISO10126d2Padding.kt │ │ │ ├── ISO7816d4Padding.kt │ │ │ ├── NoPadding.kt │ │ │ ├── PKCS7Padding.kt │ │ │ ├── TBCPadding.kt │ │ │ ├── X923Padding.kt │ │ │ └── ZeroBytePadding.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── crypto │ │ ├── AesUnitTest.kt │ │ └── ExampleUnitTest.kt ├── core-java │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── chain │ │ │ └── lib │ │ │ ├── extensions │ │ │ ├── ByteArray.kt │ │ │ └── String.kt │ │ │ └── utils │ │ │ └── ByteUtils.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── chain │ │ └── lib │ │ ├── DEREncodeUnitTest.kt │ │ └── ExampleUnitTest.kt ├── core │ ├── .gitignore │ ├── CMakeLists.txt │ ├── build.gradle.kts │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── crypto │ │ │ └── core │ │ │ ├── CryptoUnitTest.kt │ │ │ └── DEREncodeUnitTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ └── crypto-wrapper.c │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── crypto │ │ │ └── core │ │ │ ├── Address.kt │ │ │ ├── BaseKeyPair.kt │ │ │ ├── PublicGenerator.kt │ │ │ ├── Signature.kt │ │ │ ├── crypto │ │ │ ├── Base32.kt │ │ │ ├── Base58.kt │ │ │ ├── Blake.kt │ │ │ ├── DEREncode.kt │ │ │ ├── HmacSha2.kt │ │ │ ├── Keccak.kt │ │ │ ├── Pbkdf2.kt │ │ │ ├── Ripemd160.kt │ │ │ ├── Sha256.kt │ │ │ ├── Sha3.kt │ │ │ └── Sha512.kt │ │ │ ├── execptions │ │ │ ├── JNICallException.kt │ │ │ ├── PrivateKeyException.kt │ │ │ └── PublicKeyException.kt │ │ │ ├── extensions │ │ │ ├── BigInteger.kt │ │ │ ├── Byte.kt │ │ │ ├── ByteArray.kt │ │ │ ├── Int.kt │ │ │ ├── Long.kt │ │ │ └── String.kt │ │ │ ├── jni │ │ │ └── CryptoJNI.kt │ │ │ ├── random │ │ │ ├── AndroidRandom.kt │ │ │ └── RandomGenerator.kt │ │ │ ├── stream │ │ │ ├── ByteReaderStream.java │ │ │ └── ByteWriterStream.java │ │ │ └── util │ │ │ └── TimeDiffUtil.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── crypto │ │ └── core │ │ └── stream │ │ └── ByteReaderStreamAndWriterUnitTest.kt ├── ed25519 │ ├── .gitignore │ ├── CMakeLists.txt │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── crypto │ │ │ ├── Curve25519UnitTest.kt │ │ │ └── Ed25519UnitTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ └── ed25519-wrapper.c │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── crypto │ │ │ ├── Curve25519.kt │ │ │ ├── Ed25519.kt │ │ │ └── jni │ │ │ └── Ed25519JNI.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── crypto │ │ └── ExampleUnitTest.kt └── secp256k1 │ ├── .gitignore │ ├── CMakeLists.txt │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── smallraw │ │ └── crypto │ │ ├── CryptoExampleUnitTest.kt │ │ └── Secp256k1Test.kt │ ├── main │ ├── AndroidManifest.xml │ ├── cpp │ │ └── secp256k1-wrapper.c │ └── java │ │ └── com │ │ └── smallraw │ │ └── crypto │ │ ├── Secp256K1.kt │ │ ├── Secp256k1KeyPair.kt │ │ ├── Secp256k1PrivateKey.kt │ │ ├── Secp256k1PublicKey.kt │ │ └── jni │ │ └── Secp256k1JNI.kt │ └── test │ └── java │ └── com │ └── smallraw │ └── crypto │ └── ExampleUnitTest.kt ├── flag ├── feature-kit │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── smallraw │ │ │ └── lib │ │ │ └── featureflag │ │ │ └── kit │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── smallraw │ │ │ │ └── lib │ │ │ │ └── featureflag │ │ │ │ └── kit │ │ │ │ ├── FeatureSelectFragment.kt │ │ │ │ ├── TestSettingsActivity.kt │ │ │ │ └── TestSettingsFragment.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── ic_testlauncher_foreground.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── activity_testsettings.xml │ │ │ ├── fragment_featureflag.xml │ │ │ ├── fragment_testsettings.xml │ │ │ └── item_featureflag.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_testlauncher.xml │ │ │ └── ic_testlauncher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_testlauncher.png │ │ │ └── ic_testlauncher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_testlauncher.png │ │ │ └── ic_testlauncher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_testlauncher.png │ │ │ └── ic_testlauncher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_testlauncher.png │ │ │ └── ic_testlauncher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_testlauncher.png │ │ │ └── ic_testlauncher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_testlauncher_background.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── smallraw │ │ └── lib │ │ └── featureflag │ │ └── kit │ │ └── ExampleUnitTest.kt └── feature │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── smallraw │ │ └── lib │ │ └── featureflag │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── smallraw │ │ └── lib │ │ └── featureflag │ │ ├── Feature.kt │ │ ├── FeatureFlagProvider.kt │ │ ├── FeatureFlagTestHelper.kt │ │ ├── QiniuConfigFeatureFlagProvider.kt │ │ ├── RuntimeBehavior.kt │ │ ├── RuntimeBehaviorExt.kt │ │ ├── RuntimeFeatureFlagProvider.kt │ │ ├── StoreFeatureFlagProvider.kt │ │ └── TestFeatureFlagProvider.kt │ └── test │ └── java │ └── com │ └── smallraw │ └── lib │ └── featureflag │ └── ExampleUnitTest.kt ├── gradle.properties ├── gradle ├── init.gradle.kts ├── libs.versions.toml └── wrapper │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib-multiplatform-crypto ├── build.gradle.kts ├── build │ ├── .transforms │ │ └── 385e42b53fd20a214dc44488f4e2e70f │ │ │ ├── results.bin │ │ │ └── transformed │ │ │ └── classes │ │ │ └── classes.dex │ ├── generated │ │ └── source │ │ │ └── buildConfig │ │ │ ├── androidTest │ │ │ └── debug │ │ │ │ └── com │ │ │ │ └── smallraw │ │ │ │ └── kmm │ │ │ │ └── crypto │ │ │ │ └── test │ │ │ │ └── BuildConfig.java │ │ │ └── debug │ │ │ └── com │ │ │ └── smallraw │ │ │ └── kmm │ │ │ └── crypto │ │ │ └── BuildConfig.java │ ├── intermediates │ │ ├── aapt_friendly_merged_manifests │ │ │ └── debug │ │ │ │ └── aapt │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── output-metadata.json │ │ ├── aar_metadata │ │ │ └── debug │ │ │ │ └── aar-metadata.properties │ │ ├── annotation_processor_list │ │ │ ├── debug │ │ │ │ └── annotationProcessors.json │ │ │ └── debugAndroidTest │ │ │ │ └── annotationProcessors.json │ │ ├── annotations_typedef_file │ │ │ └── debug │ │ │ │ └── typedefs.txt │ │ ├── apk_ide_redirect_file │ │ │ └── debugAndroidTest │ │ │ │ └── redirect.txt │ │ ├── compile_symbol_list │ │ │ └── debug │ │ │ │ └── R.txt │ │ ├── desugar_graph │ │ │ └── debugAndroidTest │ │ │ │ └── out │ │ │ │ └── currentProject │ │ │ │ ├── dirs_bucket_0 │ │ │ │ └── graph.bin │ │ │ │ ├── dirs_bucket_1 │ │ │ │ └── graph.bin │ │ │ │ ├── dirs_bucket_2 │ │ │ │ └── graph.bin │ │ │ │ ├── dirs_bucket_3 │ │ │ │ └── graph.bin │ │ │ │ ├── jar_635b5c3c6ad952de97f9e5de7a9546a30d61ea6c47325c558b6b2201b3e5837d_bucket_0 │ │ │ │ └── graph.bin │ │ │ │ ├── jar_635b5c3c6ad952de97f9e5de7a9546a30d61ea6c47325c558b6b2201b3e5837d_bucket_1 │ │ │ │ └── graph.bin │ │ │ │ ├── jar_635b5c3c6ad952de97f9e5de7a9546a30d61ea6c47325c558b6b2201b3e5837d_bucket_2 │ │ │ │ └── graph.bin │ │ │ │ └── jar_635b5c3c6ad952de97f9e5de7a9546a30d61ea6c47325c558b6b2201b3e5837d_bucket_3 │ │ │ │ └── graph.bin │ │ ├── dex │ │ │ └── debugAndroidTest │ │ │ │ ├── mergeExtDexDebugAndroidTest │ │ │ │ └── classes.dex │ │ │ │ ├── mergeLibDexDebugAndroidTest │ │ │ │ └── 0 │ │ │ │ │ └── classes.dex │ │ │ │ └── mergeProjectDexDebugAndroidTest │ │ │ │ ├── 0 │ │ │ │ └── classes.dex │ │ │ │ ├── 6 │ │ │ │ └── classes.dex │ │ │ │ └── 11 │ │ │ │ └── classes.dex │ │ ├── dex_archive_input_jar_hashes │ │ │ └── debugAndroidTest │ │ │ │ └── out │ │ ├── dex_number_of_buckets_file │ │ │ └── debugAndroidTest │ │ │ │ └── out │ │ ├── incremental │ │ │ ├── debug-mergeJavaRes │ │ │ │ └── merge-state │ │ │ ├── debug │ │ │ │ └── packageDebugResources │ │ │ │ │ ├── compile-file-map.properties │ │ │ │ │ └── merger.xml │ │ │ ├── debugAndroidTest-mergeJavaRes │ │ │ │ ├── merge-state │ │ │ │ └── zip-cache │ │ │ │ │ ├── 0wthXLGXMzXztPqj8IIymn8ibAM= │ │ │ │ │ ├── KfWFyh6i0YCSoB5U6kGKwHVb8Rw= │ │ │ │ │ ├── TalyhU+2TOJr4pt0YA9uz88IQHQ= │ │ │ │ │ ├── VqBt_p9BygJQVQeeaMCaCR6qzI8= │ │ │ │ │ ├── a7+Im36yJIwvQMx1UNx2k2jxxYE= │ │ │ │ │ ├── bmT7wLf4tEYWbUmaHZWD8mW3lkg= │ │ │ │ │ ├── er3icjK4H9a55yfMUE7a7v7mBvI= │ │ │ │ │ ├── gezcFkKCpaYB6Fyy9Wy45vZWp2M= │ │ │ │ │ ├── gflQDKMZtJQdxHp5tdNG8U2pkCw= │ │ │ │ │ └── rAKGBhyjylB9+auFg1OuCIM6CPw= │ │ │ ├── debugAndroidTest │ │ │ │ └── mergeDebugAndroidTestResources │ │ │ │ │ ├── compile-file-map.properties │ │ │ │ │ └── merger.xml │ │ │ ├── mergeDebugJniLibFolders │ │ │ │ └── merger.xml │ │ │ ├── mergeDebugShaders │ │ │ │ └── merger.xml │ │ │ ├── packageDebugAndroidTest │ │ │ │ └── tmp │ │ │ │ │ └── debugAndroidTest │ │ │ │ │ ├── dex-renamer-state.txt │ │ │ │ │ └── zip-cache │ │ │ │ │ ├── androidResources │ │ │ │ │ └── javaResources0 │ │ │ └── packageDebugAssets │ │ │ │ └── merger.xml │ │ ├── local_only_symbol_list │ │ │ └── debug │ │ │ │ └── R-def.txt │ │ ├── manifest_merge_blame_file │ │ │ ├── debug │ │ │ │ └── manifest-merger-blame-debug-report.txt │ │ │ └── debugAndroidTest │ │ │ │ └── manifest-merger-blame-debug-androidTest-report.txt │ │ ├── merged_manifest │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── navigation_json │ │ │ └── debug │ │ │ │ └── navigation.json │ │ ├── packaged_manifests │ │ │ ├── debug │ │ │ │ └── output-metadata.json │ │ │ └── debugAndroidTest │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── output-metadata.json │ │ ├── processed_res │ │ │ └── debugAndroidTest │ │ │ │ └── out │ │ │ │ ├── output-metadata.json │ │ │ │ └── resources-debugAndroidTest.ap_ │ │ ├── project_dex_archive │ │ │ └── debugAndroidTest │ │ │ │ └── out │ │ │ │ └── com │ │ │ │ └── smallraw │ │ │ │ └── kmm │ │ │ │ └── crypto │ │ │ │ ├── CommonGreetingTest.dex │ │ │ │ └── test │ │ │ │ └── BuildConfig.dex │ │ ├── runtime_symbol_list │ │ │ └── debugAndroidTest │ │ │ │ └── R.txt │ │ ├── signing_config_versions │ │ │ └── debugAndroidTest │ │ │ │ └── signing-config-versions.json │ │ ├── source_set_path_map │ │ │ └── debugAndroidTest │ │ │ │ └── file-map.txt │ │ ├── symbol_list_with_package_name │ │ │ ├── debug │ │ │ │ └── package-aware-r.txt │ │ │ └── debugAndroidTest │ │ │ │ └── package-aware-r.txt │ │ └── variant_model │ │ │ └── debug │ │ │ └── out │ ├── kotlin │ │ ├── compileDebugAndroidTestKotlinAndroid │ │ │ ├── cacheable │ │ │ │ ├── caches-jvm │ │ │ │ │ ├── inputs │ │ │ │ │ │ ├── source-to-output.tab │ │ │ │ │ │ ├── source-to-output.tab.keystream │ │ │ │ │ │ ├── source-to-output.tab.keystream.len │ │ │ │ │ │ ├── source-to-output.tab.len │ │ │ │ │ │ ├── source-to-output.tab.values.at │ │ │ │ │ │ ├── source-to-output.tab_i │ │ │ │ │ │ └── source-to-output.tab_i.len │ │ │ │ │ ├── jvm │ │ │ │ │ │ └── kotlin │ │ │ │ │ │ │ ├── class-attributes.tab │ │ │ │ │ │ │ ├── class-attributes.tab.keystream │ │ │ │ │ │ │ ├── class-attributes.tab.keystream.len │ │ │ │ │ │ │ ├── class-attributes.tab.len │ │ │ │ │ │ │ ├── class-attributes.tab.values.at │ │ │ │ │ │ │ ├── class-attributes.tab_i │ │ │ │ │ │ │ ├── class-attributes.tab_i.len │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream.len │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab.len │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab.values.at │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab_i │ │ │ │ │ │ │ ├── class-fq-name-to-source.tab_i.len │ │ │ │ │ │ │ ├── internal-name-to-source.tab │ │ │ │ │ │ │ ├── internal-name-to-source.tab.keystream │ │ │ │ │ │ │ ├── internal-name-to-source.tab.keystream.len │ │ │ │ │ │ │ ├── internal-name-to-source.tab.len │ │ │ │ │ │ │ ├── internal-name-to-source.tab.values.at │ │ │ │ │ │ │ ├── internal-name-to-source.tab_i │ │ │ │ │ │ │ ├── internal-name-to-source.tab_i.len │ │ │ │ │ │ │ ├── proto.tab │ │ │ │ │ │ │ ├── proto.tab.keystream │ │ │ │ │ │ │ ├── proto.tab.keystream.len │ │ │ │ │ │ │ ├── proto.tab.len │ │ │ │ │ │ │ ├── proto.tab.values.at │ │ │ │ │ │ │ ├── proto.tab_i │ │ │ │ │ │ │ ├── proto.tab_i.len │ │ │ │ │ │ │ ├── source-to-classes.tab │ │ │ │ │ │ │ ├── source-to-classes.tab.keystream │ │ │ │ │ │ │ ├── source-to-classes.tab.keystream.len │ │ │ │ │ │ │ ├── source-to-classes.tab.len │ │ │ │ │ │ │ ├── source-to-classes.tab.values.at │ │ │ │ │ │ │ ├── source-to-classes.tab_i │ │ │ │ │ │ │ └── source-to-classes.tab_i.len │ │ │ │ │ └── lookups │ │ │ │ │ │ ├── counters.tab │ │ │ │ │ │ ├── file-to-id.tab │ │ │ │ │ │ ├── file-to-id.tab.keystream │ │ │ │ │ │ ├── file-to-id.tab.keystream.len │ │ │ │ │ │ ├── file-to-id.tab.len │ │ │ │ │ │ ├── file-to-id.tab.values.at │ │ │ │ │ │ ├── file-to-id.tab_i │ │ │ │ │ │ ├── file-to-id.tab_i.len │ │ │ │ │ │ ├── id-to-file.tab │ │ │ │ │ │ ├── id-to-file.tab.keystream │ │ │ │ │ │ ├── id-to-file.tab.keystream.len │ │ │ │ │ │ ├── id-to-file.tab.len │ │ │ │ │ │ ├── id-to-file.tab.values.at │ │ │ │ │ │ ├── lookups.tab │ │ │ │ │ │ ├── lookups.tab.keystream │ │ │ │ │ │ ├── lookups.tab.keystream.len │ │ │ │ │ │ ├── lookups.tab.len │ │ │ │ │ │ ├── lookups.tab.values.at │ │ │ │ │ │ ├── lookups.tab_i │ │ │ │ │ │ └── lookups.tab_i.len │ │ │ │ └── last-build.bin │ │ │ └── local-state │ │ │ │ └── build-history.bin │ │ └── compileDebugKotlinAndroid │ │ │ ├── cacheable │ │ │ ├── caches-jvm │ │ │ │ ├── inputs │ │ │ │ │ ├── source-to-output.tab │ │ │ │ │ ├── source-to-output.tab.keystream │ │ │ │ │ ├── source-to-output.tab.keystream.len │ │ │ │ │ ├── source-to-output.tab.len │ │ │ │ │ ├── source-to-output.tab.values.at │ │ │ │ │ ├── source-to-output.tab_i │ │ │ │ │ └── source-to-output.tab_i.len │ │ │ │ ├── jvm │ │ │ │ │ └── kotlin │ │ │ │ │ │ ├── class-attributes.tab │ │ │ │ │ │ ├── class-attributes.tab.keystream │ │ │ │ │ │ ├── class-attributes.tab.keystream.len │ │ │ │ │ │ ├── class-attributes.tab.len │ │ │ │ │ │ ├── class-attributes.tab.values.at │ │ │ │ │ │ ├── class-attributes.tab_i │ │ │ │ │ │ ├── class-attributes.tab_i.len │ │ │ │ │ │ ├── class-fq-name-to-source.tab │ │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream │ │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream.len │ │ │ │ │ │ ├── class-fq-name-to-source.tab.len │ │ │ │ │ │ ├── class-fq-name-to-source.tab.values.at │ │ │ │ │ │ ├── class-fq-name-to-source.tab_i │ │ │ │ │ │ ├── class-fq-name-to-source.tab_i.len │ │ │ │ │ │ ├── complementary-files.tab │ │ │ │ │ │ ├── complementary-files.tab.keystream │ │ │ │ │ │ ├── complementary-files.tab.keystream.len │ │ │ │ │ │ ├── complementary-files.tab.len │ │ │ │ │ │ ├── complementary-files.tab.values.at │ │ │ │ │ │ ├── complementary-files.tab_i │ │ │ │ │ │ ├── complementary-files.tab_i.len │ │ │ │ │ │ ├── internal-name-to-source.tab │ │ │ │ │ │ ├── internal-name-to-source.tab.keystream │ │ │ │ │ │ ├── internal-name-to-source.tab.keystream.len │ │ │ │ │ │ ├── internal-name-to-source.tab.len │ │ │ │ │ │ ├── internal-name-to-source.tab.values.at │ │ │ │ │ │ ├── internal-name-to-source.tab_i │ │ │ │ │ │ ├── internal-name-to-source.tab_i.len │ │ │ │ │ │ ├── package-parts.tab │ │ │ │ │ │ ├── package-parts.tab.keystream │ │ │ │ │ │ ├── package-parts.tab.keystream.len │ │ │ │ │ │ ├── package-parts.tab.len │ │ │ │ │ │ ├── package-parts.tab.values.at │ │ │ │ │ │ ├── package-parts.tab_i │ │ │ │ │ │ ├── package-parts.tab_i.len │ │ │ │ │ │ ├── proto.tab │ │ │ │ │ │ ├── proto.tab.keystream │ │ │ │ │ │ ├── proto.tab.keystream.len │ │ │ │ │ │ ├── proto.tab.len │ │ │ │ │ │ ├── proto.tab.values.at │ │ │ │ │ │ ├── proto.tab_i │ │ │ │ │ │ ├── proto.tab_i.len │ │ │ │ │ │ ├── source-to-classes.tab │ │ │ │ │ │ ├── source-to-classes.tab.keystream │ │ │ │ │ │ ├── source-to-classes.tab.keystream.len │ │ │ │ │ │ ├── source-to-classes.tab.len │ │ │ │ │ │ ├── source-to-classes.tab.values.at │ │ │ │ │ │ ├── source-to-classes.tab_i │ │ │ │ │ │ ├── source-to-classes.tab_i.len │ │ │ │ │ │ ├── subtypes.tab │ │ │ │ │ │ ├── subtypes.tab.keystream │ │ │ │ │ │ ├── subtypes.tab.keystream.len │ │ │ │ │ │ ├── subtypes.tab.len │ │ │ │ │ │ ├── subtypes.tab.values.at │ │ │ │ │ │ ├── subtypes.tab_i │ │ │ │ │ │ ├── subtypes.tab_i.len │ │ │ │ │ │ ├── supertypes.tab │ │ │ │ │ │ ├── supertypes.tab.keystream │ │ │ │ │ │ ├── supertypes.tab.keystream.len │ │ │ │ │ │ ├── supertypes.tab.len │ │ │ │ │ │ ├── supertypes.tab.values.at │ │ │ │ │ │ ├── supertypes.tab_i │ │ │ │ │ │ └── supertypes.tab_i.len │ │ │ │ └── lookups │ │ │ │ │ ├── counters.tab │ │ │ │ │ ├── file-to-id.tab │ │ │ │ │ ├── file-to-id.tab.keystream │ │ │ │ │ ├── file-to-id.tab.keystream.len │ │ │ │ │ ├── file-to-id.tab.len │ │ │ │ │ ├── file-to-id.tab.values.at │ │ │ │ │ ├── file-to-id.tab_i │ │ │ │ │ ├── file-to-id.tab_i.len │ │ │ │ │ ├── id-to-file.tab │ │ │ │ │ ├── id-to-file.tab.keystream │ │ │ │ │ ├── id-to-file.tab.keystream.len │ │ │ │ │ ├── id-to-file.tab.len │ │ │ │ │ ├── id-to-file.tab.values.at │ │ │ │ │ ├── id-to-file.tab_i │ │ │ │ │ ├── id-to-file.tab_i.len │ │ │ │ │ ├── lookups.tab │ │ │ │ │ ├── lookups.tab.keystream │ │ │ │ │ ├── lookups.tab.keystream.len │ │ │ │ │ ├── lookups.tab.len │ │ │ │ │ ├── lookups.tab.values.at │ │ │ │ │ ├── lookups.tab_i │ │ │ │ │ └── lookups.tab_i.len │ │ │ └── last-build.bin │ │ │ └── local-state │ │ │ └── build-history.bin │ ├── outputs │ │ ├── aar │ │ │ └── lib-multiplatform-crypto-debug.aar │ │ ├── apk │ │ │ └── androidTest │ │ │ │ └── debug │ │ │ │ ├── lib-multiplatform-crypto-debug-androidTest.apk │ │ │ │ └── output-metadata.json │ │ └── logs │ │ │ └── manifest-merger-debug-report.txt │ └── tmp │ │ ├── compileDebugAndroidTestJavaWithJavac │ │ └── previous-compilation-data.bin │ │ ├── compileDebugJavaWithJavac │ │ └── previous-compilation-data.bin │ │ └── kotlin-classes │ │ ├── debug │ │ └── META-INF │ │ │ └── lib-multiplatform-crypto_debug.kotlin_module │ │ └── debugAndroidTest │ │ └── META-INF │ │ └── lib-multiplatform-crypto_debug.kotlin_module └── src │ ├── androidMain │ └── kotlin │ │ └── com │ │ └── smallraw │ │ └── kmm │ │ └── crypto │ │ └── Platform.kt │ ├── androidTest │ └── kotlin │ │ └── com │ │ └── smallraw │ │ └── kmm │ │ └── crypto │ │ └── androidTest.kt │ ├── commonMain │ └── kotlin │ │ └── com │ │ └── smallraw │ │ └── kmm │ │ └── crypto │ │ ├── Hash.kt │ │ ├── Platform.kt │ │ └── PlatformInfo.kt │ ├── commonTest │ └── kotlin │ │ └── com │ │ └── smallraw │ │ └── kmm │ │ └── crypto │ │ └── commonTest.kt │ ├── iosArm64Main │ └── kotlin │ │ └── com │ │ └── smallraw │ │ └── kmm │ │ └── crypto │ │ └── define │ │ └── getPlatform.kt │ ├── iosMain │ └── kotlin │ │ └── com │ │ └── smallraw │ │ └── kmm │ │ └── crypto │ │ └── Platform.kt │ └── iosTest │ └── kotlin │ └── com │ └── smallraw │ └── kmm │ └── crypto │ └── iosTest.kt ├── native-crypto ├── .gitignore ├── CMakeLists.txt ├── CMakeLists1.txt ├── README.md ├── aes │ ├── aes.h │ ├── aes_modes.c │ ├── aescrypt.c │ ├── aeskey.c │ ├── aesopt.h │ ├── aestab.c │ ├── aestab.h │ ├── aestst.c │ └── aestst.h ├── base32.c ├── base58.c ├── bignum.c ├── blake256.c ├── blake2b.c ├── blake2s.c ├── chacha20poly1305 │ ├── chacha20poly1305.c │ ├── chacha20poly1305.h │ ├── chacha_merged.c │ ├── ecrypt-config.h │ ├── ecrypt-machine.h │ ├── ecrypt-portable.h │ ├── ecrypt-sync.h │ ├── ecrypt-types.h │ ├── poly1305-donna-32.h │ ├── poly1305-donna.c │ ├── poly1305-donna.h │ ├── rfc7539.c │ └── rfc7539.h ├── curves.c ├── der.c ├── ecdsa.c ├── ed25519-donna │ ├── curve25519-donna-32bit.c │ ├── curve25519-donna-32bit.h │ ├── curve25519-donna-helpers.c │ ├── curve25519-donna-helpers.h │ ├── curve25519-donna-scalarmult-base.c │ ├── curve25519-donna-scalarmult-base.h │ ├── ed25519-donna-32bit-tables.c │ ├── ed25519-donna-32bit-tables.h │ ├── ed25519-donna-basepoint-table.c │ ├── ed25519-donna-basepoint-table.h │ ├── ed25519-donna-impl-base.c │ ├── ed25519-donna-impl-base.h │ ├── ed25519-donna-portable.h │ ├── ed25519-donna.h │ ├── ed25519-hash-custom-keccak.h │ ├── ed25519-hash-custom-sha3.h │ ├── ed25519-hash-custom.h │ ├── ed25519-keccak.c │ ├── ed25519-keccak.h │ ├── ed25519-sha3.c │ ├── ed25519-sha3.h │ ├── ed25519.c │ ├── ed25519.h │ ├── modm-donna-32bit.c │ └── modm-donna-32bit.h ├── groestl.c ├── hasher.c ├── hexstring.c ├── hmac.c ├── hmac_drbg.c ├── include │ ├── base32.h │ ├── base58.h │ ├── bignum.h │ ├── blake256.h │ ├── blake2_common.h │ ├── blake2b.h │ ├── blake2s.h │ ├── byte_order.h │ ├── curve.h │ ├── curves.h │ ├── der.h │ ├── ecdsa.h │ ├── groestl.h │ ├── groestl_internal.h │ ├── hasher.h │ ├── hexstring.h │ ├── hmac.h │ ├── hmac_drbg.h │ ├── jni_method.h │ ├── memzero.h │ ├── nist256p1.h │ ├── options.h │ ├── pbkdf2.h │ ├── rand.h │ ├── rfc6979.h │ ├── ripemd160.h │ ├── secp256k1.h │ ├── sha2.h │ └── sha3.h ├── jni_method.c ├── memzero.c ├── native-crypto.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── quincysx.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── quincysx.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── nist256p1.c ├── nist256p1.table ├── options.h ├── pbkdf2.c ├── rand.c ├── rfc6979.c ├── ripemd160.c ├── secp256k1.c ├── secp256k1.table ├── sha2.c └── sha3.c ├── settings.gradle.kts └── standard ├── hd-derivation ├── .gitignore ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── smallraw │ │ └── wallet │ │ └── hd │ │ └── HDKeyDerivationUnitTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── smallraw │ │ └── wallet │ │ └── hd │ │ ├── ECKey.kt │ │ ├── HDDerivationException.kt │ │ ├── HDKey.kt │ │ └── HDKeyDerivation.kt │ └── test │ └── java │ └── com │ └── smallraw │ └── wallet │ └── hd │ └── ExampleUnitTest.kt └── mnemonic ├── .gitignore ├── CMakeLists.txt ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src ├── androidTest └── java │ └── com │ └── smallraw │ └── wallet │ └── mnemonic │ ├── MnemonicModelUnitTest.kt │ └── MnemonicUnitTest.kt ├── main ├── AndroidManifest.xml ├── assets │ ├── chinese_simplified.txt │ ├── chinese_traditional.txt │ ├── czech.txt │ ├── english.txt │ ├── french.txt │ ├── italian.txt │ ├── japanese.txt │ ├── korean.txt │ └── spanish.txt └── java │ └── com │ └── smallraw │ └── wallet │ └── mnemonic │ ├── CharSequenceComparators.kt │ ├── CharSequenceSplitter.kt │ ├── MnemonicBuild.kt │ ├── MnemonicGenerator.kt │ ├── MnemonicValidator.kt │ ├── Normalization.kt │ ├── RandomSeed.kt │ ├── SeedCalculator.kt │ ├── SeedCalculatorByWordListLookUp.kt │ ├── SoftHashMap.kt │ ├── WordCount.kt │ ├── WordList.kt │ ├── WordListMapNormalization.kt │ ├── exception │ ├── MnemonicException.kt │ └── MnemonicValidatorException.kt │ └── extensions │ ├── ByteArray.kt │ └── CharArray.kt └── test └── java └── com └── smallraw └── wallet └── mnemonic └── ExampleUnitTest.kt /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | # android 26 | 27 | *.iml 28 | .gradle 29 | .idea 30 | /local.properties 31 | /.idea/caches 32 | /.idea/libraries 33 | /.idea/modules.xml 34 | /.idea/workspace.xml 35 | /.idea/navEditor.xml 36 | /.idea/assetWizardSettings.xml 37 | .DS_Store 38 | /build 39 | build/ 40 | /captures 41 | .externalNativeBuild 42 | .cxx 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 严正声明 2 | ## 本项目没有参加任何募捐,请勿上当受骗。 3 | ## 本项目只用于学习研究。 4 | 5 | # 这个搞募捐的是挂着我的名号在诈骗,各位不要上当。 6 | 7 | https://www.pinksale.finance/?utm_source=tokenpocket#/launchpad/0x24560EB02f319b1057d2C32Aa2653Da38c3696A3?chain=BSC 8 | 9 | https://chainwallet.store/ 10 | 11 | 12 | # A solemn statement 13 | ## This project has not participated in any fundraising, please do not be deceived. 14 | ## This project is for study only. 15 | 16 | # This fundraiser is using my name to defraud. Don't be fooled. 17 | https://www.pinksale.finance/?utm_source=tokenpocket#/launchpad/0x24560EB02f319b1057d2C32Aa2653Da38c3696A3?chain=BSC 18 | 19 | https://chainwallet.store/ 20 | 21 | # ChainWallet 22 | 一个以研究技术为目地的基础项目,也只有最基本 Bitcoin、Ethereum 、EOS 相关的加密算法。并不是一个钱包。也不用绞尽脑汁加我 QQ、微信勒索我,不给钱就报警之类的。 23 | -------------------------------------------------------------------------------- /app/compose-wallet/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import com.smallraw.chain.wallet.ui.screen.app.AppHome 7 | import dagger.hilt.android.AndroidEntryPoint 8 | 9 | @AndroidEntryPoint 10 | class MainActivity : ComponentActivity() { 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | 15 | setContent { 16 | AppHome() 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/data/bean/Account.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.data.bean 2 | 3 | data class Account( 4 | var id: Long? = null, 5 | var walletId: Long? = null, 6 | var name: String, 7 | private var derivedPath: String = "", 8 | var address: String 9 | ) 10 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/data/database/converter/ChainTypeConverter.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.data.database.converter 2 | 3 | import androidx.room.TypeConverter 4 | import com.smallraw.chain.wallet.App 5 | 6 | class ChainTypeConverter { 7 | @TypeConverter 8 | fun toChainType(type: Int?): App.ChainType { 9 | return App.ChainType.values().find { it.ordinal == type } ?: App.ChainType.ETH 10 | } 11 | 12 | @TypeConverter 13 | fun toInt(date: App.ChainType?): Int { 14 | return date?.ordinal ?: App.ChainType.ETH.ordinal 15 | } 16 | } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/data/database/databaseView/WalletEmbedDO.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.data.database.databaseView 2 | 3 | import androidx.room.Embedded 4 | import androidx.room.Relation 5 | import com.smallraw.chain.wallet.data.database.entity.AccountDO 6 | import com.smallraw.chain.wallet.data.database.entity.WalletDO 7 | 8 | data class WalletEmbedDO( 9 | @Embedded 10 | val account: WalletDO, 11 | 12 | @Relation( 13 | parentColumn = "wallet_id", 14 | entityColumn = "id" 15 | ) 16 | val accounts: AccountDO, 17 | ) -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/data/database/entity/embed/BaseEntity.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.data.database.entity.embed 2 | 3 | import androidx.room.ColumnInfo 4 | import androidx.room.TypeConverters 5 | import com.smallraw.time.database.converter.DateConverter 6 | import java.util.* 7 | 8 | 9 | open class BaseEntity( 10 | open val id: Long? = null, 11 | 12 | @ColumnInfo(name = "created_at", defaultValue = "CURRENT_TIMESTAMP") 13 | @TypeConverters(DateConverter::class) 14 | var createdAt: Date? = null, 15 | 16 | @ColumnInfo(name = "updated_at", defaultValue = "CURRENT_TIMESTAMP") 17 | @TypeConverters(DateConverter::class) 18 | var updatedAt: Date? = null 19 | ) { 20 | constructor() : this(null) 21 | } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/data/database/entity/embed/DigitalAssetUnitDO.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.data.database.entity.embed 2 | 3 | import androidx.room.ColumnInfo 4 | 5 | data class DigitalAssetUnitDO( 6 | @ColumnInfo(name = "currency_name") 7 | val currencyName: String = "", 8 | 9 | @ColumnInfo(name = "currency_symbol") 10 | val currencySymbol: String = "", 11 | 12 | @ColumnInfo(name = "currency_decimals") 13 | val currencyDecimals: Int = 0, 14 | ) -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/designsystem/component/PanelSurface.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.ui.components 2 | 3 | import androidx.compose.foundation.layout.fillMaxSize 4 | import androidx.compose.material3.MaterialTheme 5 | import androidx.compose.material3.Surface 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | 9 | @Composable 10 | fun PanelSurface( 11 | modifier: Modifier = Modifier, 12 | content: @Composable () -> Unit, 13 | ) { 14 | Surface( 15 | modifier = modifier.fillMaxSize(), 16 | color = MaterialTheme.colorScheme.background, 17 | content = content 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/designsystem/theme/Background.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.designsystem.theme 2 | 3 | import androidx.compose.runtime.Immutable 4 | import androidx.compose.runtime.staticCompositionLocalOf 5 | import androidx.compose.ui.graphics.Color 6 | import androidx.compose.ui.unit.Dp 7 | 8 | @Immutable 9 | data class BackgroundTheme( 10 | val color: Color = Color.Unspecified, 11 | val tonalElevation: Dp = Dp.Unspecified 12 | ) 13 | 14 | val LocalBackgroundTheme = staticCompositionLocalOf { BackgroundTheme() } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/designsystem/theme/Gradient.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.designsystem.theme 2 | 3 | import androidx.compose.runtime.Immutable 4 | import androidx.compose.runtime.staticCompositionLocalOf 5 | import androidx.compose.ui.graphics.Color 6 | 7 | @Immutable 8 | data class GradientColors( 9 | val primary: Color = Color.Unspecified, 10 | val secondary: Color = Color.Unspecified, 11 | val tertiary: Color = Color.Unspecified, 12 | val neutral: Color = Color.Unspecified 13 | ) 14 | 15 | /** 16 | * A composition local for [GradientColors]. 17 | */ 18 | val LocalGradientColors = staticCompositionLocalOf { GradientColors() } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/di/CommonModule.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.di 2 | 3 | import javax.inject.Qualifier 4 | 5 | @Retention(AnnotationRetention.RUNTIME) 6 | @Qualifier 7 | annotation class ApplicationScope -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/feature/wallets/WalletSelectListViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.feature.wallets 2 | 3 | import androidx.lifecycle.SavedStateHandle 4 | import androidx.lifecycle.ViewModel 5 | import com.smallraw.chain.wallet.data.IWalletRepository 6 | import dagger.hilt.android.lifecycle.HiltViewModel 7 | import javax.inject.Inject 8 | 9 | @HiltViewModel 10 | class WalletSelectListViewModel @Inject constructor( 11 | private val savedStateHandle: SavedStateHandle, 12 | private val walletRepository: IWalletRepository 13 | ) : ViewModel() { 14 | 15 | } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/feature/wallets/bean/AccountWalletListBean.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.feature.wallets.bean 2 | 3 | import com.smallraw.chain.wallet.data.bean.Account 4 | import com.smallraw.chain.wallet.data.bean.Wallet 5 | 6 | data class WalletAccountListBean( 7 | val wallet: Wallet, 8 | val accounts: List 9 | ) -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/ui/navigation/NavigationDestination.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.ui.navigation 2 | 3 | interface NavigationDestination { 4 | val route: String 5 | 6 | val destination: String? 7 | } 8 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/ui/navigation/Screens.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.ui.navigation 2 | 3 | sealed class Screens(override val route: String, override val destination: String? = "") : 4 | NavigationDestination { 5 | object Home : Screens("home") 6 | object Welcome : Screens("welcome") 7 | object CreateWallet : Screens("CreateWallet") 8 | } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/java/com/smallraw/chain/wallet/ui/screen/home/HomeViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet.ui.screen.home 2 | 3 | import androidx.lifecycle.ViewModel 4 | import com.smallraw.chain.wallet.data.IWalletRepository 5 | import dagger.hilt.android.lifecycle.HiltViewModel 6 | import javax.inject.Inject 7 | 8 | @HiltViewModel 9 | class HomeViewModel @Inject constructor( 10 | walletRepository: IWalletRepository 11 | ) : ViewModel() { 12 | 13 | } -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/drawable/ic_gradle_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/drawable/ic_gradle_logo.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/drawable/ic_select_coin_cursor.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/drawable/vector_ic_select_coin_help.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/layouts/wallets/drawable/shape_bg_division_line_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/layouts/wallets/drawable/shape_bg_top_corner_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/app/compose-wallet/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #6200EE 4 | #3700B3 5 | #03DAC5 6 | 7 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ChainWallet 3 | 4 | -------------------------------------------------------------------------------- /app/compose-wallet/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/compose-wallet/src/test/java/com/smallraw/chain/wallet/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.wallet 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt: -------------------------------------------------------------------------------- 1 | import com.smallraw.convention.apps.configureKotlinJvm 2 | import org.gradle.api.Plugin 3 | import org.gradle.api.Project 4 | 5 | class JvmLibraryConventionPlugin : Plugin { 6 | override fun apply(target: Project) { 7 | with(target) { 8 | with(pluginManager) { 9 | apply("org.jetbrains.kotlin.jvm") 10 | apply("smallraw.android.lint") 11 | } 12 | configureKotlinJvm() 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/com/smallraw/convention/apps/ProjectExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.convention.apps 2 | 3 | import org.gradle.api.Project 4 | import org.gradle.api.artifacts.VersionCatalog 5 | import org.gradle.api.artifacts.VersionCatalogsExtension 6 | import org.gradle.kotlin.dsl.getByType 7 | 8 | val Project.libs 9 | get(): VersionCatalog = extensions.getByType().named("libs") 10 | 11 | val appCompileSdk 12 | get(): Int = 34 13 | 14 | val appBuildToolsVersion 15 | get(): String = "34.0.0" 16 | 17 | val appTargetSdk 18 | get(): Int = 33 19 | 20 | val appMinSdk 21 | get(): Int = 21 -------------------------------------------------------------------------------- /build-logic/gradle.properties: -------------------------------------------------------------------------------- 1 | # Gradle properties are not passed to included builds https://github.com/gradle/gradle/issues/2534 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.configureondemand=true 5 | -------------------------------------------------------------------------------- /build-logic/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /chain/bitcoin-core/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /chain/bitcoin-core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | } 4 | 5 | android { 6 | namespace = "com.smallraw.chain.bitcoincore" 7 | } 8 | 9 | dependencies { 10 | implementation(libs.kotlin.stdlib) 11 | implementation(libs.androidx.core.ktx) 12 | implementation(libs.androidx.appcompat) 13 | implementation(libs.android.material.material) 14 | 15 | api(project(":crypto:core")) 16 | implementation(project(":crypto:secp256k1")) 17 | } -------------------------------------------------------------------------------- /chain/bitcoin-core/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/chain/bitcoin-core/consumer-rules.pro -------------------------------------------------------------------------------- /chain/bitcoin-core/src/androidTest/java/com/smallraw/chain/bitcoincore/transaction/Bitcoin 各类型签字.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/chain/bitcoin-core/src/androidTest/java/com/smallraw/chain/bitcoincore/transaction/Bitcoin 各类型签字.xlsx -------------------------------------------------------------------------------- /chain/bitcoin-core/src/androidTest/java/com/smallraw/chain/bitcoincore/transaction/README.md: -------------------------------------------------------------------------------- 1 | # 名词解释 2 | 3 | ## scriptPubKey 4 | 又称锁定脚本。Locking Script 5 | 是一个输出中的脚本,它定义了花费该 UTXO 资金必须满足的条件。 6 | 对于区块链而言,根本没有比特币地址的说法。区块链使用 ScriptPubKey 识别接收者,这种 ScriptPubKey 可以从地址生成。(反过来也一样) 7 | 8 | ## scriptSig 9 | 又称解锁脚本。Unlocking Script 10 | 是一个用于输入中解锁 UTXO 的脚本,它包含一个或多个签名以及满足输出中定义的支出条件所需的其他信息。 11 | 12 | ## RedeemScript 13 | RedeemScript 与 scriptPubKey 作用类似,因为在 P2SH、P2WSH 等交易中,由于是向一个脚本支付的,RedeemScript 就是这个锁定脚本。 14 | 15 | ## witnessScript 16 | 隔离见证脚本 17 | 18 | 19 | # 注意事项 20 | ## P2SH 使用注意 21 | P2SH 的地址由 [支付脚本] HASH160 得来,由于花费 P2SH 地址上的 UTXO 时,所以 [支付脚本] 需要自行保存。 22 | -------------------------------------------------------------------------------- /chain/bitcoin-core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /chain/bitcoin-core/src/main/java/com/smallraw/chain/bitcoincore/Signature.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoincore 2 | 3 | open class Signature(private val byteArray: ByteArray) { 4 | // 获取签名就会复制一份,不会被修改 5 | open fun signature() = byteArray.copyOf() 6 | } -------------------------------------------------------------------------------- /chain/bitcoin-core/src/main/java/com/smallraw/chain/bitcoincore/crypto/Secp256k1Signer.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoincore.crypto 2 | 3 | import com.smallraw.chain.bitcoincore.Signature 4 | import com.smallraw.crypto.core.execptions.JNICallException 5 | import com.smallraw.lib.crypto.Secp256K1 6 | import java.security.PrivateKey 7 | 8 | class Secp256k1Signer { 9 | @Throws(JNICallException::class) 10 | fun sign(privateKey: PrivateKey, message: ByteArray): Signature { 11 | return Signature(Secp256K1.sign(privateKey.encoded, message)) 12 | } 13 | 14 | @Throws(JNICallException::class) 15 | fun verify(publicKey: ByteArray, signature: ByteArray, message: ByteArray): Boolean { 16 | return Secp256K1.verify(publicKey, signature, message) 17 | } 18 | } -------------------------------------------------------------------------------- /chain/bitcoin-core/src/main/java/com/smallraw/chain/bitcoincore/execptions/ScriptParsingException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoincore.execptions 2 | 3 | import com.smallraw.crypto.core.extensions.toHex 4 | 5 | class ScriptParsingException : java.lang.Exception { 6 | constructor(script: ByteArray?) : super("Unable to parse script: " + script?.toHex()) {} 7 | constructor(message: String?) : super(message) {} 8 | 9 | companion object { 10 | private const val serialVersionUID = 1L 11 | } 12 | } -------------------------------------------------------------------------------- /chain/bitcoin-core/src/main/java/com/smallraw/chain/bitcoincore/network/MainNet.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoincore.network 2 | 3 | class MainNet : BaseNetwork() { 4 | override var bip32HeaderPub: Int = 5 | 0x0488B21E // The 4 byte header that serializes in base58 to "xpub". 6 | override var bip32HeaderPriv: Int = 7 | 0x0488ADE4 // The 4 byte header that serializes in base58 to "xprv" 8 | override var addressVersion: Int = 0 //0x00 9 | override var addressWifVersion: Int = 128 //0x80 10 | override var addressSegwitHrp: String = "bc" 11 | override var addressScriptVersion: Int = 5 //0x05 12 | override var coinType: Int = 0 13 | 14 | override val dustRelayTxFee = 3000 // https://github.com/bitcoin/bitcoin/blob/c536dfbcb00fb15963bf5d507b7017c241718bf6/src/policy/policy.h#L50 15 | } -------------------------------------------------------------------------------- /chain/bitcoin-core/src/main/java/com/smallraw/chain/bitcoincore/network/TestNet.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoincore.network 2 | 3 | class TestNet : BaseNetwork() { 4 | override var bip32HeaderPub: Int = 0x043587CF 5 | override var bip32HeaderPriv: Int = 0x04358394 6 | override var addressVersion: Int = 111 //0x6F 7 | override var addressWifVersion: Int = 239 //0xEf 8 | override var addressSegwitHrp: String = "tb" 9 | override var addressScriptVersion: Int = 196 //0xC4 10 | override var coinType: Int = 1 11 | 12 | override val dustRelayTxFee = 3000 13 | } -------------------------------------------------------------------------------- /chain/bitcoin-core/src/test/java/com/smallraw/chain/bitcoincore/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoincore 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /chain/bitcoin/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /chain/bitcoin/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | } 4 | 5 | android { 6 | namespace = "com.smallraw.chain.bitcoin" 7 | 8 | defaultConfig { 9 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 10 | } 11 | } 12 | 13 | dependencies { 14 | implementation(libs.kotlin.stdlib) 15 | implementation(project(":chain:bitcoin-core")) 16 | implementation(project(":crypto:secp256k1")) 17 | } -------------------------------------------------------------------------------- /chain/bitcoin/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/chain/bitcoin/consumer-rules.pro -------------------------------------------------------------------------------- /chain/bitcoin/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chain/bitcoin/src/main/java/com/smallraw/chain/bitcoin/execptions/AddressFormatException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoin.execptions 2 | 3 | import java.lang.RuntimeException 4 | 5 | class AddressFormatException(msg: String) : RuntimeException(msg) -------------------------------------------------------------------------------- /chain/bitcoin/src/main/java/com/smallraw/chain/bitcoin/models/UnspentOutput.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoin.models 2 | 3 | import com.smallraw.chain.bitcoincore.address.Address 4 | import com.smallraw.chain.bitcoincore.script.ScriptType 5 | 6 | data class UnspentOutput( 7 | val address: Address, 8 | val confirmations: Long, 9 | val height: Long, 10 | val txid: String, 11 | val value: Long, 12 | val vout: Int, 13 | var scriptType: ScriptType = ScriptType.UNKNOWN, 14 | // output 赎回脚本:ScriptInput 15 | var redeemScript: ByteArray? = null 16 | ) -------------------------------------------------------------------------------- /chain/bitcoin/src/main/java/com/smallraw/chain/bitcoin/transaction/build/EmptyTransactionSigner.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoin.transaction.build 2 | 3 | import com.smallraw.chain.bitcoin.transaction.build.`interface`.ITransactionSigner 4 | 5 | class EmptyTransactionSigner : ITransactionSigner { 6 | override fun sign(mutableTransaction: MutableTransaction) {} 7 | } -------------------------------------------------------------------------------- /chain/bitcoin/src/main/java/com/smallraw/chain/bitcoin/transaction/build/interface/IPrivateKeyPairProvider.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoin.transaction.build.`interface` 2 | 3 | import com.smallraw.chain.bitcoin.Bitcoin 4 | import com.smallraw.chain.bitcoincore.PublicKey 5 | import com.smallraw.chain.bitcoincore.address.Address 6 | 7 | interface IPrivateKeyPairProvider { 8 | fun findByPublicKey(publicKey: PublicKey): Bitcoin.KeyPair? 9 | fun findByAddress(address: Address): Bitcoin.KeyPair? 10 | } 11 | -------------------------------------------------------------------------------- /chain/bitcoin/src/main/java/com/smallraw/chain/bitcoin/transaction/build/interface/ITransactionSigner.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoin.transaction.build.`interface` 2 | 3 | import com.smallraw.chain.bitcoin.transaction.build.MutableTransaction 4 | 5 | interface ITransactionSigner { 6 | fun sign(mutableTransaction: MutableTransaction) 7 | } -------------------------------------------------------------------------------- /chain/bitcoin/src/main/java/com/smallraw/chain/bitcoin/unspentOutput/IUnspentOutputProvider.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.bitcoin.unspentOutput 2 | 3 | import com.smallraw.chain.bitcoin.models.UnspentOutput 4 | 5 | /** 6 | * 未使用的 UTXO 提供器 7 | */ 8 | interface IUnspentOutputProvider { 9 | fun nextUtxoList(): List 10 | } -------------------------------------------------------------------------------- /chain/eos/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /chain/eos/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | } 4 | 5 | android { 6 | namespace = "com.smallraw.chain.eos" 7 | } 8 | 9 | dependencies { 10 | implementation(libs.kotlin.stdlib) 11 | implementation(libs.androidx.core.ktx) 12 | implementation(libs.androidx.appcompat) 13 | implementation(libs.android.material.material) 14 | 15 | implementation(libs.retrofit.core) 16 | implementation(libs.retrofit.converter.jackson) 17 | implementation(libs.okhttp.logging) 18 | 19 | api(project(":crypto:core")) 20 | implementation(project(":crypto:secp256k1")) 21 | } -------------------------------------------------------------------------------- /chain/eos/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/chain/eos/consumer-rules.pro -------------------------------------------------------------------------------- /chain/eos/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/Signature.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos 2 | 3 | import com.smallraw.crypto.core.crypto.Base58 4 | import com.smallraw.crypto.core.crypto.Ripemd160 5 | 6 | class Signature(private val byteArray: ByteArray) { 7 | // 获取签名就会复制一份,不会被修改 8 | fun signBytes() = byteArray.copyOf() 9 | 10 | fun signature(): String { 11 | val checksum = Ripemd160.ripemd160(byteArray + "K1".toByteArray()).copyOfRange(0, 4) 12 | return "SIG_K1_" + Base58.encode(byteArray + checksum) 13 | } 14 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/api/exception/ApiError.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.api.exception 2 | 3 | class ApiError { 4 | var message: String? = null 5 | var code: String? = null 6 | var error: Error? = null 7 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/api/exception/ApiException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.api.exception 2 | 3 | class ApiException : RuntimeException { 4 | var error: ApiError? = null 5 | 6 | constructor(apiError: ApiError?) { 7 | error = apiError 8 | } 9 | 10 | constructor(cause: Throwable?) : super(cause) {} 11 | 12 | override val message: String 13 | get() = if (error != null) { 14 | error!!.message!! 15 | } else super.message!! 16 | 17 | companion object { 18 | private const val serialVersionUID = 1L 19 | } 20 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/api/exception/Error.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.api.exception 2 | 3 | class Error private constructor() { 4 | var code: String? = null 5 | var name: String? = null 6 | var what: String? = null 7 | var details: Array? = null 8 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/api/exception/ErrorDetails.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.api.exception 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty 4 | 5 | class ErrorDetails private constructor() { 6 | var message: String? = null 7 | var file: String? = null 8 | 9 | @set:JsonProperty("line_number") 10 | var lineNumber: Int? = null 11 | var method: String? = null 12 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/BaseVo.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | open class BaseVo -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/JsonToBin.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import java.util.* 5 | 6 | @JsonIgnoreProperties(ignoreUnknown = true) 7 | class JsonToBin { 8 | var binargs: String? = null 9 | get() = if (field == null) "" else field 10 | var required_scope: List? = null 11 | get() = if (field == null) { 12 | ArrayList() 13 | } else field 14 | var required_auth: List? = null 15 | get() = if (field == null) { 16 | ArrayList() 17 | } else field 18 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/JsonToBinReq.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class JsonToBinReq(var code: String, var action: String, var args: UpTransfer) -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/SignParam.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import java.util.* 4 | 5 | class SignParam { 6 | /** 7 | * 最新区块时间 8 | */ 9 | var headBlockTime: Date? = null 10 | 11 | /** 12 | * 链ID 13 | */ 14 | var chainId: String? = null 15 | 16 | /** 17 | * 不可逆区块 18 | */ 19 | var lastIrreversibleBlockNum: Long? = null 20 | 21 | /** 22 | * 上一个区块hash前缀 23 | */ 24 | var refBlockPrefix: Long? = null 25 | 26 | /** 27 | * 过期时间 28 | */ 29 | var exp: Long? = null 30 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/TableRows.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class TableRows { 7 | var more: Boolean? = null 8 | var rows: List>? = null 9 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/TableRowsReq.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class TableRowsReq { 7 | var code = "eosio" 8 | var scope: String? = null 9 | var table: String? = null 10 | var json = true 11 | var limit = 10 12 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/Transfer.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class Transfer( 7 | /** 8 | * quantity : 6.0000 EOS 9 | * memo : 恭喜发财,大吉大利 10 | * from : lucan222 11 | * to : eosio.token 12 | */ 13 | var quantity: String, var memo: String, var from: String, var to: String 14 | ) -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/UpTransfer.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class UpTransfer(var upfrom: String, var upto: String, var value: String) -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/account/CpuLimit.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.account 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class CpuLimit { 7 | var used: Long? = null 8 | var available: Long? = null 9 | var max: Long? = null 10 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/account/Key.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.account 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class Key { 7 | var key: String? = null 8 | var weight: Long? = null 9 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/account/NetLimit.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.account 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class NetLimit { 7 | var used: Long? = null 8 | var available: Long? = null 9 | var max: Long? = null 10 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/account/Permission.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.account 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import com.fasterxml.jackson.annotation.JsonProperty 5 | 6 | @JsonIgnoreProperties(ignoreUnknown = true) 7 | class Permission { 8 | @JsonProperty("perm_name") 9 | var permName: String? = null 10 | 11 | @JsonProperty("parent") 12 | var parent: String? = null 13 | 14 | @JsonProperty("required_auth") 15 | var requiredAuth: RequiredAuth? = null 16 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/account/RequiredAuth.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.account 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | 5 | @JsonIgnoreProperties(ignoreUnknown = true) 6 | class RequiredAuth { 7 | var accounts: List>? = null 8 | var keys: List? = null 9 | var threshold: Long? = null 10 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/Processed.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import com.fasterxml.jackson.annotation.JsonProperty 5 | 6 | @JsonIgnoreProperties(ignoreUnknown = true) 7 | class Processed { 8 | @JsonProperty("id") 9 | var id: String? = null 10 | 11 | @JsonProperty("receipt") 12 | var receipt: Receipt? = null 13 | 14 | @JsonProperty("elapsed") 15 | var elapsed: Long? = null 16 | 17 | @JsonProperty("net_usage") 18 | var netUsage: Long? = null 19 | 20 | @JsonProperty("scheduled") 21 | var scheduled: Boolean? = null 22 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/Receipt.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import com.fasterxml.jackson.annotation.JsonProperty 5 | 6 | @JsonIgnoreProperties(ignoreUnknown = true) 7 | class Receipt { 8 | @JsonProperty("status") 9 | var status: String? = null 10 | 11 | @JsonProperty("cpu_usage_us") 12 | var cpuUsageUs: Long? = null 13 | 14 | @JsonProperty("net_usage_words") 15 | var netUsageWords: Long? = null 16 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/Transaction.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import com.fasterxml.jackson.annotation.JsonProperty 5 | import com.fasterxml.jackson.databind.deser.Deserializers 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | class Transaction : Deserializers.Base() { 9 | @JsonProperty("transaction_id") 10 | var transactionId: String? = null 11 | 12 | @JsonProperty("processed") 13 | var processed: Processed? = null 14 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/push/Tx.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction.push 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import com.smallraw.chain.eos.model.BaseVo 5 | import java.util.* 6 | 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | class Tx : BaseVo() { 9 | var expiration: Any? = null 10 | var ref_block_num: Long? = null 11 | var ref_block_prefix: Long? = null 12 | var net_usage_words: Long? = null 13 | var max_cpu_usage_ms: Long? = null 14 | var delay_sec: Long? = null 15 | var context_free_actions: List = ArrayList() 16 | var actions: List? = null 17 | var transaction_extensions: List = ArrayList() 18 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/push/TxAction.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction.push 2 | 3 | import com.smallraw.chain.eos.model.BaseVo 4 | import java.util.* 5 | 6 | class TxAction(val actor: String?, val account: String?, val name: String?, val data: Any?) : 7 | BaseVo() { 8 | private var authorization: MutableList = ArrayList() 9 | 10 | init { 11 | authorization.add(TxActionAuth(actor, "active")) 12 | } 13 | 14 | fun getAuthorization(): List? { 15 | return authorization 16 | } 17 | 18 | fun setAuthorization(authorization: MutableList) { 19 | this.authorization = authorization 20 | } 21 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/push/TxActionAuth.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction.push 2 | 3 | import com.smallraw.chain.eos.model.BaseVo 4 | 5 | class TxActionAuth(var actor: String?, var permission: String?) : BaseVo() -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/push/TxExtenstions.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction.push 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties 4 | import com.smallraw.chain.eos.model.BaseVo 5 | 6 | @JsonIgnoreProperties(ignoreUnknown = true) 7 | class TxExtenstions : BaseVo() -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/push/TxRequest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction.push 2 | 3 | import com.smallraw.chain.eos.model.BaseVo 4 | 5 | class TxRequest(var compression: String?, var transaction: Tx?, var signatures: Array) : 6 | BaseVo() -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/model/transaction/push/TxSign.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.model.transaction.push 2 | 3 | import com.smallraw.chain.eos.model.BaseVo 4 | 5 | class TxSign(var chain_id: String?, var transaction: Tx?) : BaseVo() -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/utils/ByteBuffer.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.utils 2 | 3 | class ByteBuffer { 4 | var buffer = byteArrayOf() 5 | fun concat(b: ByteArray?) { 6 | buffer = ByteUtils.concat(buffer, b) 7 | } 8 | } -------------------------------------------------------------------------------- /chain/eos/src/main/java/com/smallraw/chain/eos/utils/EException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos.utils 2 | 3 | class EException(var code: String, var msg: String) : RuntimeException() { 4 | 5 | companion object { 6 | private const val serialVersionUID = 1L 7 | } 8 | } -------------------------------------------------------------------------------- /chain/eos/src/test/java/com/smallraw/chain/eos/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.eos 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /chain/ethereum/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /chain/ethereum/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | } 4 | 5 | android { 6 | namespace = "com.smallraw.chain.ethereum" 7 | } 8 | 9 | dependencies { 10 | implementation(libs.kotlin.stdlib) 11 | implementation(libs.androidx.core.ktx) 12 | implementation(libs.androidx.appcompat) 13 | implementation(libs.android.material.material) 14 | 15 | api(project(":crypto:core")) 16 | implementation(project(":crypto:secp256k1")) 17 | } -------------------------------------------------------------------------------- /chain/ethereum/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/chain/ethereum/consumer-rules.pro -------------------------------------------------------------------------------- /chain/ethereum/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/PublicKey.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum 2 | 3 | import com.smallraw.chain.ethereum.execptions.EthereumException 4 | import com.smallraw.crypto.core.extensions.hexToByteArray 5 | 6 | class PublicKey(private val key: ByteArray) { 7 | companion object { 8 | @Throws(EthereumException.KeyWrongLengthException::class) 9 | fun ofHex(hexString: String): PublicKey { 10 | return PublicKey(hexString.hexToByteArray()) 11 | } 12 | } 13 | 14 | private val _address by lazy { 15 | Address.ofPublicKey(this) 16 | } 17 | 18 | // 防止外部修改公钥 19 | fun getKey() = key.copyOf() 20 | 21 | fun getAddress() = _address 22 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/Signature.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum 2 | 3 | class Signature(private val r: ByteArray, private val s: ByteArray, private val v: Int) { 4 | // 获取签名就会复制一份,不会被修改 5 | fun r() = r.copyOf() 6 | fun s() = s.copyOf() 7 | fun v() = v 8 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/abi/MethodAbi.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.abi 2 | 3 | class MethodAbi(private val methodName: String, private val params: Array) { 4 | fun getMethodId(): ByteArray { 5 | return Abi.encodeMethodId(methodName, params) 6 | } 7 | 8 | fun encode(args: Array): ByteArray { 9 | return getMethodId() + Abi.encodeParams(params, args) 10 | } 11 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/contract/IContractMethod.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.contract 2 | 3 | import com.smallraw.chain.ethereum.abi.Abi 4 | 5 | abstract class IContractMethod { 6 | protected abstract val methodName: String 7 | protected abstract val methodParams: Array 8 | 9 | val methodId: ByteArray by lazy { 10 | Abi.encodeMethodId(methodName, methodParams) 11 | } 12 | 13 | fun encodedABI(): ByteArray { 14 | return methodId + Abi.encodeParams(methodParams, getArguments()) 15 | } 16 | 17 | protected abstract fun getArguments(): Array 18 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/extensions/ByteArray.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.extensions 2 | 3 | import com.smallraw.crypto.core.extensions.toHex 4 | import com.smallraw.crypto.core.stream.ByteWriterStream 5 | 6 | fun ByteArray?.toHexPrefix(): String { 7 | return this?.toHex()?.compleHexPrefix() ?: "" 8 | } 9 | 10 | fun Array.merge(): ByteArray { 11 | val byteWriterStream = ByteWriterStream(64) 12 | this.forEach { 13 | it?.let { 14 | byteWriterStream.writeBytes(it) 15 | } 16 | } 17 | return byteWriterStream.toBytes() 18 | } 19 | 20 | fun ByteArray.removeLeadingZero() = if (first() == 0.toByte()) copyOfRange(1, size) else this -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/extensions/String.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.extensions 2 | 3 | fun String.stripHexPrefix(): String { 4 | return if (this.startsWith("0x", true)) { 5 | this.substring(2) 6 | } else { 7 | this 8 | } 9 | } 10 | 11 | fun String.compleHexPrefix(): String { 12 | return if (this.startsWith("0x", true)) { 13 | this 14 | } else { 15 | "0x$this" 16 | } 17 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/network/BaseNetwork.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.network 2 | 3 | abstract class BaseNetwork { 4 | abstract val id: Long 5 | abstract val genesisBlockHash: ByteArray 6 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/network/MainNet.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.network 2 | 3 | import com.smallraw.crypto.core.extensions.hexToByteArray 4 | 5 | class MainNet : BaseNetwork() { 6 | override val id: Long = 1 7 | override val genesisBlockHash: ByteArray = 8 | "d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3".hexToByteArray() 9 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/network/Ropsten.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.network 2 | 3 | import com.smallraw.crypto.core.extensions.hexToByteArray 4 | 5 | class Ropsten : BaseNetwork() { 6 | override val id: Long = 3 7 | override val genesisBlockHash: ByteArray = 8 | "41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d".hexToByteArray() 9 | } -------------------------------------------------------------------------------- /chain/ethereum/src/main/java/com/smallraw/chain/ethereum/supplement/EIP191.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum.supplement 2 | 3 | import com.smallraw.chain.ethereum.PrivateKey 4 | import com.smallraw.crypto.core.extensions.toByteArray 5 | 6 | /** 7 | * Signed Data Standard 8 | * see http://eips.ethereum.org/EIPS/eip-191 9 | */ 10 | fun PrivateKey.signWithEIP191(version: Byte, versionSpecificData: ByteArray, message: ByteArray) = 11 | sign(0x19.toByte().toByteArray() + version.toByteArray() + versionSpecificData + message) 12 | 13 | fun PrivateKey.signWithPersonalSign(message: ByteArray) = 14 | signWithEIP191( 15 | 0x45 /* 0x45 is "E" */, 16 | ("thereum Signed Message:\n" + message.size).toByteArray(), 17 | message 18 | ) -------------------------------------------------------------------------------- /chain/ethereum/src/test/java/com/smallraw/chain/ethereum/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.ethereum 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /core/authority-ckeck/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/authority-ckeck/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | id("smallraw.android.library.native") 4 | } 5 | 6 | android { 7 | namespace = "com.smallraw.authority" 8 | defaultConfig { 9 | externalNativeBuild { 10 | cmake { 11 | cFlags += "-std=gnu99 -frtti -fexceptions" 12 | cppFlags += "-std=c++11 -frtti -fexceptions" 13 | } 14 | } 15 | } 16 | externalNativeBuild { 17 | cmake { 18 | path = file("CMakeLists.txt") 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation(libs.kotlin.stdlib) 25 | implementation(libs.androidx.core.ktx) 26 | implementation(libs.androidx.appcompat) 27 | implementation(libs.android.material.material) 28 | } -------------------------------------------------------------------------------- /core/authority-ckeck/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/core/authority-ckeck/consumer-rules.pro -------------------------------------------------------------------------------- /core/authority-ckeck/src/androidTest/java/com/smallraw/authority/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.authority 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.smallraw.authority.test", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /core/authority-ckeck/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/authority-ckeck/src/main/cpp/keys.c: -------------------------------------------------------------------------------- 1 | // 查看签名信息:gradlew sR 2 | // 签名信息 3 | const char *auth_app_sha1[] = {"9E08CE4C3F5D243197AFA53DD9E2255C825CAD3E", 4 | "81BA0CF9134C6415F34C3BCC854913A53C71415E"}; 5 | 6 | const int auth_app_sha1_size = 2; -------------------------------------------------------------------------------- /core/authority-ckeck/src/main/cpp/valid.h: -------------------------------------------------------------------------------- 1 | #ifndef VALID_H_ 2 | #define VALID_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define TAG "AuthorityKey Jni Log" 11 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG,__VA_ARGS__) 12 | 13 | char *getSignatureSha1(JNIEnv *env, jobject context_object); 14 | 15 | jboolean checkValidity(char *sha1, char * app_sha1[], size_t size); 16 | 17 | jboolean checkSecurityPermission(JNIEnv *env, jobject context_object, char * app_sha1[], size_t size); 18 | 19 | #endif /* VALID_H_ */ -------------------------------------------------------------------------------- /core/authority-ckeck/src/main/java/com/smallraw/authority/AuthorityKey.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.authority 2 | 3 | import android.content.Context 4 | 5 | class AuthorityKey { 6 | companion object { 7 | init { 8 | System.loadLibrary("dexinterpret") 9 | } 10 | } 11 | 12 | external fun checkValidity(context: Context?): Boolean 13 | external fun getAuthorityKey(context: Context?): String? 14 | } -------------------------------------------------------------------------------- /core/authority-ckeck/src/test/java/com/smallraw/authority/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.authority 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /core/database/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /schemas/ 3 | -------------------------------------------------------------------------------- /core/database/README.md: -------------------------------------------------------------------------------- 1 | # :core:testing module 2 | 3 | ![Dependency graph](../../docs/images/graphs/dep_graph_core_testing.png) 4 | -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/DatabaseModule.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database 2 | 3 | import android.content.Context 4 | import androidx.room.Room 5 | import dagger.Module 6 | import dagger.Provides 7 | import dagger.hilt.InstallIn 8 | import dagger.hilt.android.qualifiers.ApplicationContext 9 | import dagger.hilt.components.SingletonComponent 10 | import javax.inject.Singleton 11 | 12 | @Module 13 | @InstallIn(SingletonComponent::class) 14 | object DatabaseModule { 15 | @Provides 16 | @Singleton 17 | fun providesWalletDatabase( 18 | @ApplicationContext context: Context, 19 | ): WalletDatabase = Room.databaseBuilder( 20 | context, 21 | WalletDatabase::class.java, 22 | "wallet-database", 23 | ).build() 24 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/AccountDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import com.smallraw.core.chain.database.model.AccountEntity 5 | 6 | @Dao 7 | interface AccountDao : BaseDao { 8 | 9 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/AddressDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import com.smallraw.core.chain.database.model.AddressEntity 5 | 6 | @Dao 7 | interface AddressDao : BaseDao { 8 | 9 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/BaseDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import androidx.room.Delete 5 | import androidx.room.Insert 6 | import androidx.room.OnConflictStrategy 7 | import androidx.room.Update 8 | 9 | @Dao 10 | interface BaseDao { 11 | 12 | @Insert(onConflict = OnConflictStrategy.REPLACE) 13 | suspend fun insert(obj: T): Long 14 | 15 | @Insert(onConflict = OnConflictStrategy.REPLACE) 16 | suspend fun insertAll(objList: List) 17 | 18 | @Update 19 | suspend fun update(obj: T) 20 | 21 | @Delete 22 | suspend fun delete(obj: T) 23 | } 24 | -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/CurrencyDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import com.smallraw.core.chain.database.model.CurrencyEntity 5 | 6 | @Dao 7 | interface CurrencyDao : BaseDao { 8 | 9 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/EncryptedSecretDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import com.smallraw.core.chain.database.model.EncryptedSecretEntity 5 | 6 | @Dao 7 | interface EncryptedSecretDao : BaseDao { 8 | 9 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/TransactionDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import com.smallraw.core.chain.database.model.TransactionEntity 5 | 6 | @Dao 7 | interface TransactionDao : BaseDao { 8 | 9 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/dao/WalletDao.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.dao 2 | 3 | import androidx.room.Dao 4 | import com.smallraw.core.chain.database.model.WalletEntity 5 | 6 | @Dao 7 | interface WalletDao : BaseDao { 8 | 9 | } -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/model/AddressEntity.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.model 2 | 3 | import androidx.room.Entity 4 | import androidx.room.ForeignKey 5 | import androidx.room.PrimaryKey 6 | import java.math.BigInteger 7 | 8 | @Entity( 9 | tableName = "addresses", 10 | foreignKeys = [ForeignKey( 11 | entity = WalletEntity::class, 12 | parentColumns = ["walletId"], 13 | childColumns = ["walletId"], 14 | onDelete = ForeignKey.CASCADE 15 | )] 16 | ) 17 | data class AddressEntity( 18 | @PrimaryKey(autoGenerate = true) val addressId: Long = 0, 19 | val walletId: Long, 20 | val address: String, 21 | val addressIndex: Int, 22 | val balance: BigInteger 23 | ) -------------------------------------------------------------------------------- /core/database/src/main/java/com/smallraw/core/chain/database/model/CurrencyEntity.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.core.chain.database.model 2 | 3 | import androidx.room.Entity 4 | import androidx.room.PrimaryKey 5 | 6 | @Entity(tableName = "currencies") 7 | data class CurrencyEntity( 8 | @PrimaryKey(autoGenerate = true) val currencyId: Long = 0, 9 | val ticker: String, 10 | val name: String, 11 | val bip32Version: String, 12 | val bip44CoinType: Int 13 | ) -------------------------------------------------------------------------------- /core/testing/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/testing/README.md: -------------------------------------------------------------------------------- 1 | # :core:testing module 2 | 3 | ![Dependency graph](../../docs/images/graphs/dep_graph_core_testing.png) 4 | -------------------------------------------------------------------------------- /core/testing/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /crypto/aes/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | .externalNativeBuild 3 | .cxx -------------------------------------------------------------------------------- /crypto/aes/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/crypto/aes/consumer-rules.pro -------------------------------------------------------------------------------- /crypto/aes/src/androidTest/java/com/smallraw/crypto/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.smallraw.crypto.test", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /crypto/aes/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /crypto/aes/src/test/java/com/smallraw/crypto/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import org.junit.Assert.assertEquals 4 | import org.junit.Test 5 | 6 | /** 7 | * Example local unit test, which will execute on the development machine (host). 8 | * 9 | * See [testing documentation](http://d.android.com/tools/testing). 10 | */ 11 | class ExampleUnitTest { 12 | @Test 13 | fun addition_isCorrect() { 14 | assertEquals(4, 2 + 2) 15 | } 16 | } -------------------------------------------------------------------------------- /crypto/core-java/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /crypto/core-java/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.jvm.library") 3 | } 4 | 5 | dependencies { 6 | implementation(libs.kotlin.stdlib) 7 | 8 | // https://mvnrepository.com/artifact/com.madgag.spongycastle/core 9 | api(libs.spongycastle.core) 10 | // https://mvnrepository.com/artifact/com.madgag.spongycastle/prov 11 | api(libs.spongycastle.prov) 12 | } -------------------------------------------------------------------------------- /crypto/core-java/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/crypto/core-java/consumer-rules.pro -------------------------------------------------------------------------------- /crypto/core-java/src/main/java/com/smallraw/chain/lib/extensions/ByteArray.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.lib.extensions 2 | 3 | import com.smallraw.chain.lib.utils.toHEX 4 | 5 | /** 6 | * 16 进制数组转成 16 进制字符串 7 | */ 8 | fun ByteArray.toHex() = toHEX(this) -------------------------------------------------------------------------------- /crypto/core-java/src/main/java/com/smallraw/chain/lib/extensions/String.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.lib.extensions 2 | 3 | import com.smallraw.chain.lib.utils.hexToBytes 4 | 5 | /** 6 | * 16 进制字符串转换16 进制数组 7 | */ 8 | fun String.hexToBytes() = hexToBytes(this) -------------------------------------------------------------------------------- /crypto/core-java/src/test/java/com/smallraw/chain/lib/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.chain.lib 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /crypto/core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /crypto/core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | id("smallraw.android.library.native") 4 | } 5 | 6 | android { 7 | namespace = "com.smallraw.crypto.core" 8 | 9 | defaultConfig { 10 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 11 | } 12 | } 13 | 14 | dependencies { 15 | implementation(libs.kotlin.stdlib) 16 | 17 | implementation(libs.bundles.androidx.lifecycle.ktx) 18 | } -------------------------------------------------------------------------------- /crypto/core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/Address.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core 2 | 3 | interface Address { 4 | fun getFormat(): String 5 | fun getAddress(): ByteArray 6 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/PublicGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core 2 | 3 | import java.security.KeyPair 4 | import java.security.PrivateKey 5 | 6 | interface PublicGenerator { 7 | fun generate(privateKey: PrivateKey): KeyPair 8 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/Signature.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core 2 | 3 | class Signature(private val byteArray: ByteArray) { 4 | fun signature() = byteArray 5 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/Base32.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object Base32 { 7 | fun encode(byteArray: ByteArray, padding: Boolean = true) = 8 | CryptoJNI().base32Encode(byteArray, padding) ?: throw JNICallException() 9 | 10 | fun decode(str: String, padding: Boolean = true) = CryptoJNI().base32Decode(str,padding) ?: throw JNICallException() 11 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/Base58.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object Base58 { 7 | fun encode(byteArray: ByteArray) = 8 | CryptoJNI().base58Encode(byteArray) ?: throw JNICallException() 9 | 10 | fun decode(str: String) = CryptoJNI().base58Decode(str) ?: throw JNICallException() 11 | 12 | fun encodeCheck(byteArray: ByteArray) = 13 | CryptoJNI().base58EncodeCheck(byteArray) ?: throw JNICallException() 14 | 15 | fun decodeCheck(str: String) = 16 | CryptoJNI().base58DecodeCheck(str) ?: throw JNICallException() 17 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/DEREncode.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object DEREncode { 7 | fun sigToDer(sign: ByteArray): ByteArray { 8 | return CryptoJNI().sig_to_der(sign) ?: throw JNICallException() 9 | } 10 | 11 | fun derToSig(sign: ByteArray): ByteArray { 12 | return CryptoJNI().der_to_sig(sign) ?: throw JNICallException() 13 | } 14 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/HmacSha2.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object HmacSha2 { 7 | fun sha256(key: ByteArray, message: ByteArray) = 8 | CryptoJNI().hmac_sha256(key, message) ?: throw JNICallException() 9 | 10 | fun sha512(key: ByteArray, message: ByteArray) = 11 | CryptoJNI().hmac_sha512(key, message) ?: throw JNICallException() 12 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/Pbkdf2.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object Pbkdf2 { 7 | fun hmacSha256( 8 | password: ByteArray, 9 | salt: ByteArray, 10 | iterations: Int = 2048, 11 | bitCount: Int = 256, 12 | ) = CryptoJNI().pbkdf2_hmac_sha256(password, salt, iterations, bitCount / 8) ?: throw JNICallException() 13 | 14 | fun hmacSha512( 15 | password: ByteArray, 16 | salt: ByteArray, 17 | iterations: Int = 2048, 18 | bitCount: Int = 512, 19 | ) = CryptoJNI().pbkdf2_hmac_sha512(password, salt, iterations, bitCount / 8) ?: throw JNICallException() 20 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/Ripemd160.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object Ripemd160 { 7 | fun ripemd160(byteArray: ByteArray) = 8 | CryptoJNI().ripemd160(byteArray) ?: throw JNICallException() 9 | 10 | fun hash160(byteArray: ByteArray): ByteArray { 11 | return ripemd160(Sha256.sha256(byteArray)) 12 | } 13 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/Sha256.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object Sha256 { 7 | fun sha256(byteArray: ByteArray) = CryptoJNI().sha256(byteArray) ?: throw JNICallException() 8 | 9 | fun doubleSha256( 10 | byteArray: ByteArray, 11 | ) = CryptoJNI().doubleSha256(byteArray) ?: throw JNICallException() 12 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/crypto/Sha512.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | object Sha512 { 7 | fun sha512(byteArray: ByteArray) = CryptoJNI().sha512(byteArray) ?: throw JNICallException() 8 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/execptions/JNICallException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.execptions 2 | 3 | class JNICallException : RuntimeException() -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/execptions/PrivateKeyException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.execptions 2 | 3 | class PrivateKeyException : RuntimeException() { 4 | class AbnormalLength() : IllegalArgumentException() 5 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/execptions/PublicKeyException.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.execptions 2 | 3 | class PublicKeyException : RuntimeException() { 4 | class CreateException() : RuntimeException() 5 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/extensions/Byte.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.extensions 2 | 3 | fun Byte.toByteArray(): ByteArray { 4 | return ByteArray(1) { this } 5 | } 6 | 7 | operator fun Byte.plus(bytes: ByteArray): ByteArray { 8 | val arraySize = bytes.size 9 | val result = ByteArray(arraySize + 1) 10 | result[0] = this 11 | System.arraycopy(bytes, 0, result, 1, arraySize) 12 | return result 13 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/extensions/Long.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.extensions 2 | 3 | fun Long.toByteArray(): ByteArray { 4 | var array = this.toBigInteger().toByteArray() 5 | if (array[0].toInt() == 0) { 6 | val tmp = ByteArray(array.size - 1) 7 | System.arraycopy(array, 1, tmp, 0, tmp.size) 8 | array = tmp 9 | } 10 | return array 11 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/extensions/String.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.extensions 2 | 3 | import com.smallraw.crypto.core.execptions.JNICallException 4 | import com.smallraw.crypto.core.jni.CryptoJNI 5 | 6 | fun String.hexToByteArray(): ByteArray { 7 | val str = if (this.startsWith("0x", true)) { 8 | this.substring(2) 9 | } else { 10 | this 11 | } 12 | return CryptoJNI().strToHex(str) ?: throw JNICallException() 13 | } -------------------------------------------------------------------------------- /crypto/core/src/main/java/com/smallraw/crypto/core/random/RandomGenerator.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.core.random 2 | 3 | import java.util.* 4 | 5 | object RandomGenerator { 6 | fun getRandom(): Random { 7 | return AndroidRandom() 8 | } 9 | } -------------------------------------------------------------------------------- /crypto/ed25519/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /crypto/ed25519/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | id("smallraw.android.library.native") 4 | } 5 | 6 | android { 7 | namespace = "com.smallraw.crypto" 8 | 9 | defaultConfig { 10 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 11 | } 12 | } 13 | 14 | dependencies { 15 | implementation(libs.kotlin.stdlib) 16 | implementation(libs.androidx.core.ktx) 17 | implementation(libs.android.material.material) 18 | 19 | implementation(project(":crypto:core")) 20 | } -------------------------------------------------------------------------------- /crypto/ed25519/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/crypto/ed25519/consumer-rules.pro -------------------------------------------------------------------------------- /crypto/ed25519/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | / 4 | -------------------------------------------------------------------------------- /crypto/ed25519/src/test/java/com/smallraw/crypto/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import org.junit.Assert.assertEquals 4 | import org.junit.Test 5 | 6 | /** 7 | * Example local unit test, which will execute on the development machine (host). 8 | * 9 | * See [testing documentation](http://d.android.com/tools/testing). 10 | */ 11 | class ExampleUnitTest { 12 | @Test 13 | fun addition_isCorrect() { 14 | assertEquals(4, 2 + 2) 15 | } 16 | } -------------------------------------------------------------------------------- /crypto/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /crypto/secp256k1/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | id("smallraw.android.library.native") 4 | } 5 | 6 | android { 7 | namespace = "com.smallraw.crypto" 8 | 9 | defaultConfig { 10 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 11 | } 12 | } 13 | 14 | dependencies { 15 | implementation(libs.kotlin.stdlib) 16 | 17 | implementation(project(":crypto:core")) 18 | } -------------------------------------------------------------------------------- /crypto/secp256k1/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/crypto/secp256k1/consumer-rules.pro -------------------------------------------------------------------------------- /crypto/secp256k1/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /crypto/secp256k1/src/main/java/com/smallraw/crypto/Secp256k1KeyPair.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import com.smallraw.crypto.core.BaseKeyPair 4 | import com.smallraw.lib.crypto.Secp256K1 5 | import java.security.PrivateKey 6 | import java.security.PublicKey 7 | 8 | open class Secp256k1KeyPair( 9 | privateKey: PrivateKey?, 10 | publicKey: PublicKey? = null, 11 | val compressed: Boolean = true 12 | ) : BaseKeyPair(privateKey, publicKey) { 13 | 14 | override fun generatorPrivateKey(): PrivateKey { 15 | return Secp256k1PrivateKey(Secp256K1.createPrivateKey()) 16 | } 17 | 18 | override fun generatorPublicKey(): PublicKey { 19 | val bytes = Secp256K1.createPublicKey(getPrivateKey().encoded, compressed) 20 | return Secp256k1PublicKey(bytes) 21 | } 22 | } -------------------------------------------------------------------------------- /crypto/secp256k1/src/main/java/com/smallraw/crypto/Secp256k1PrivateKey.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import com.smallraw.crypto.core.execptions.PrivateKeyException 4 | import com.smallraw.crypto.core.extensions.toHex 5 | import java.security.PrivateKey 6 | 7 | class Secp256k1PrivateKey 8 | @Throws(PrivateKeyException.AbnormalLength::class) 9 | constructor(private val secretKey: ByteArray) : 10 | PrivateKey { 11 | 12 | init { 13 | if (secretKey.size != 32) throw PrivateKeyException.AbnormalLength() 14 | } 15 | 16 | override fun getAlgorithm(): String { 17 | return "secp256k1" 18 | } 19 | 20 | override fun getEncoded(): ByteArray { 21 | return secretKey 22 | } 23 | 24 | override fun getFormat(): String { 25 | return encoded.toHex() 26 | } 27 | } -------------------------------------------------------------------------------- /crypto/secp256k1/src/main/java/com/smallraw/crypto/Secp256k1PublicKey.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import com.smallraw.crypto.core.extensions.toHex 4 | import java.security.PublicKey 5 | 6 | class Secp256k1PublicKey(private val publicKey: ByteArray) : PublicKey { 7 | override fun getAlgorithm(): String { 8 | return "secp256k1" 9 | } 10 | 11 | override fun getEncoded(): ByteArray { 12 | return publicKey 13 | } 14 | 15 | override fun getFormat(): String { 16 | return encoded.toHex() 17 | } 18 | } -------------------------------------------------------------------------------- /crypto/secp256k1/src/main/java/com/smallraw/crypto/jni/Secp256k1JNI.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto.jni 2 | 3 | class Secp256k1JNI { 4 | companion object { 5 | init { 6 | System.loadLibrary("secp256k1-wrapper") 7 | } 8 | } 9 | 10 | external fun createPublicKey(privateKey: ByteArray, compressed: Boolean): ByteArray? 11 | 12 | external fun sign( 13 | privateKey: ByteArray, 14 | message: ByteArray, 15 | ): ByteArray? 16 | 17 | external fun ethSign( 18 | privateKey: ByteArray, 19 | message: ByteArray, 20 | compressed: Boolean = false, 21 | ): Array? 22 | 23 | external fun verify( 24 | publicKey: ByteArray, signature: ByteArray, message: ByteArray 25 | ): Boolean 26 | 27 | } -------------------------------------------------------------------------------- /crypto/secp256k1/src/test/java/com/smallraw/crypto/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.smallraw.crypto 2 | 3 | import org.junit.Assert.assertEquals 4 | import org.junit.Test 5 | 6 | /** 7 | * Example local unit test, which will execute on the development machine (host). 8 | * 9 | * See [testing documentation](http://d.android.com/tools/testing). 10 | */ 11 | class ExampleUnitTest { 12 | @Test 13 | fun addition_isCorrect() { 14 | assertEquals(4, 2 + 2) 15 | } 16 | } -------------------------------------------------------------------------------- /flag/feature-kit/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /flag/feature-kit/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("smallraw.android.library") 3 | } 4 | 5 | android { 6 | namespace = "com.smallraw.lib.featureflag.kit" 7 | } 8 | 9 | dependencies { 10 | implementation(libs.androidx.core.ktx) 11 | implementation(libs.androidx.appcompat) 12 | implementation(libs.android.material.material) 13 | implementation(project(":flag:feature")) 14 | } -------------------------------------------------------------------------------- /flag/feature-kit/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/consumer-rules.pro -------------------------------------------------------------------------------- /flag/feature-kit/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/layout/activity_testsettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/layout/fragment_featureflag.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-anydpi-v26/ic_testlauncher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-anydpi-v26/ic_testlauncher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-hdpi/ic_testlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-hdpi/ic_testlauncher.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-hdpi/ic_testlauncher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-hdpi/ic_testlauncher_round.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-mdpi/ic_testlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-mdpi/ic_testlauncher.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-mdpi/ic_testlauncher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-mdpi/ic_testlauncher_round.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-xhdpi/ic_testlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-xhdpi/ic_testlauncher.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-xhdpi/ic_testlauncher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-xhdpi/ic_testlauncher_round.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-xxhdpi/ic_testlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-xxhdpi/ic_testlauncher.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-xxhdpi/ic_testlauncher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-xxhdpi/ic_testlauncher_round.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-xxxhdpi/ic_testlauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-xxxhdpi/ic_testlauncher.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/mipmap-xxxhdpi/ic_testlauncher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuincySx/ChainWallet/ffde6cb630a9bda2826ae75c5700e9e7b75536e7/flag/feature-kit/src/main/res/mipmap-xxxhdpi/ic_testlauncher_round.png -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #D28445 4 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/values/ic_testlauncher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #D28445 4 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ChainWallet Feature 3 | ChainWallet Feature 🚀 4 | 5 | -------------------------------------------------------------------------------- /flag/feature-kit/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |