Skip to content

Web3j fix android #2122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 114 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
a6c727e
minSDKversion updated
shashankiitbhu Sep 19, 2024
660a66e
change default branch to main
NickSneo Apr 5, 2024
11e7c7e
update secrets
gtebrean Apr 11, 2024
f0d0c9e
update changelog
gtebrean Apr 11, 2024
657d148
update build
gtebrean Apr 11, 2024
131ffdf
fix yaml
gtebrean Apr 11, 2024
0b44508
update signature
gtebrean Apr 11, 2024
f2678b9
update changelog
gtebrean Apr 11, 2024
c4103ab
revert changes
gtebrean Apr 11, 2024
34d369d
update changelog
gtebrean Apr 11, 2024
561a712
update secrets
gtebrean Apr 11, 2024
98cd600
main branch configs
NickSneo Apr 11, 2024
8da85dd
changelog entry
NickSneo Apr 11, 2024
86b6d61
web3j release fix
NickSneo Apr 12, 2024
48453f0
web3j release fix
NickSneo Apr 12, 2024
9cc22f3
add contributtor call
gtebrean Apr 17, 2024
ce21072
update links
gtebrean Apr 17, 2024
ec394e0
update contributing
gtebrean Apr 18, 2024
5b56061
Fix typos in class FullDebugTraceInfo
hanmz Apr 23, 2024
98e128e
Fix typos in class FullDebugTraceInfo
hanmz Apr 24, 2024
53e67e4
[bug] Fix two typos in package org.web3j.abi
hanmz Apr 23, 2024
bbc5c89
update signature
gtebrean Apr 11, 2024
cb9404f
update changelog
gtebrean Apr 11, 2024
b07aac7
revert changes
gtebrean Apr 11, 2024
e86b10a
update secrets
gtebrean Apr 11, 2024
224767e
encodePacked DynamicBytes
xutruth Apr 18, 2024
2cb6b1f
add changelog for fix encodePacked DynamicBytes
xutruth Apr 22, 2024
5ab3540
modify encodePacked Utf8String
xutruth Apr 23, 2024
e099d52
Repo owner change (#2048)
NickSneo Apr 30, 2024
d477550
bump version 4.11.4 (#2049)
NickSneo May 1, 2024
8575237
Upgrade gradle to v8.5
bradbown May 7, 2024
8c026bf
Upgrade gradle to 8.7
NickSneo May 20, 2024
6747968
added back integration test dependency
NickSneo May 20, 2024
6822796
jacoco fix, snapshot version to 4.12.0
NickSneo May 20, 2024
6e04ff0
Fixed DefaultFunctionEncoder calculating offset for nested StaticArra…
penuel-leo May 23, 2024
65bcfec
Bump snapshot to 4.12.1 (#2058)
NickSneo May 24, 2024
1c5df03
update maintainers.md
gtebrean Jun 10, 2024
e7d1e83
update
gtebrean Jun 10, 2024
8447077
update
gtebrean Jun 11, 2024
1d70c46
add missing LFID
gtebrean Jun 11, 2024
46df8bc
Bug fix: Same inner struct name of different libraries result in fail…
tonykwok1992 Jun 14, 2024
9efb07b
Bug fix for detecting struct only being used as array of struct (#2061)
tonykwok1992 Jun 14, 2024
f688679
chore: fix some comments (#2067)
cangqiaoyuzhuo Jun 14, 2024
aeb1473
Remove registration of bouncy castle as JCE provider (#2066)
killergerbah Jun 26, 2024
8338c77
Bug fix for Int256 decode range [2^248, type(int256).max] and [ type(…
tonykwok1992 Jun 26, 2024
7cbd37b
Big fix for codegen when Array of struct and struct used together
tonykwok1992 Jun 14, 2024
055902d
separate array type handling
tonykwok1992 Jun 16, 2024
c155231
Fix normalizedType
tonykwok1992 Jun 17, 2024
74d286e
Add test for fixing more issue
tonykwok1992 Jun 17, 2024
d6d1229
Document the minimum required Java version for the target project to …
kaygorodov Jun 27, 2024
f0d26cd
Make getABI_* calls static (#2079)
tonykwok1992 Jul 22, 2024
46d0755
fix for new URL (web3j to hyperledger) including one branch fix (mast…
Julius278 Jul 30, 2024
d93aa03
Updated TypeReference object to support nested types to support truly…
Mar 26, 2024
264c03c
Support decoding of DynamicArray of DynamicStruct (with corresponding…
Antlion12 Jul 10, 2024
44a7da2
Return extraneous 'else { return ... }' from decodeDynamicStruct().
Antlion12 Jul 16, 2024
238a058
Run spotless.
Antlion12 Jul 16, 2024
87f97dc
Factor out offset-computation and parameter-extraction from decodeDyn…
Antlion12 Jul 16, 2024
8267cff
move test
gtebrean Aug 1, 2024
f37e7aa
spotless
gtebrean Aug 1, 2024
1b8ee47
fix naming
gtebrean Aug 4, 2024
a39fb25
add DynamicStructOfStaticStruct
gtebrean Aug 4, 2024
d229a9a
Support building StaticStruct using innerTypes. Add testBuildDynamicA…
Antlion12 Aug 5, 2024
a8257ce
Rename numNestedFields() to countNestedFields().
Antlion12 Aug 8, 2024
7e7a7b2
Run spotless.
Antlion12 Aug 8, 2024
8843a0e
Update CHANGELOG.md.
Antlion12 Aug 8, 2024
7112a9c
add fix
gtebrean Aug 8, 2024
a1f1bea
update changelog
gtebrean Aug 8, 2024
f14e038
Bug fix for FastRawTransactionManager.resetNonce (#2084)
junsung-cho Aug 10, 2024
3b1e426
Release 4.12.1
gtebrean Aug 13, 2024
510d2db
Release 4.12.1
gtebrean Aug 13, 2024
d6b45c3
fix licence
gtebrean Aug 14, 2024
4d1e213
update changelog
gtebrean Aug 14, 2024
00759b6
fix licence
gtebrean Aug 14, 2024
2797793
bump version
gtebrean Aug 15, 2024
0938a16
bump version
gtebrean Aug 15, 2024
c3efcde
added Linea ENS Support
NickSneo Aug 19, 2024
a45ce45
added Linea Sepolia support too
NickSneo Aug 19, 2024
c2c540c
added test and changelog
NickSneo Aug 19, 2024
df8699d
Upgrade jc-kzg-4844 to 2.0.0
StefanBratanov Aug 29, 2024
43f1c83
fix spotless
StefanBratanov Aug 29, 2024
43f4189
Bump snapshot version to 4.12.3 (#2101)
NickSneo Sep 19, 2024
a067110
updated dependencies
shashankiitbhu Sep 23, 2024
1d73c50
Web3j implements AutoClosable Interface (#2102)
steffenboe Sep 25, 2024
fa14aa1
add kms implementation
gtebrean Oct 1, 2024
e18679d
update changelog
gtebrean Oct 2, 2024
85f3ae8
migrating to android
shashankiitbhu Oct 9, 2024
6993b7a
fixing build issues
shashankiitbhu Oct 14, 2024
943e093
Rename .java to .kt
shashankiitbhu Oct 22, 2024
8c5d8f4
fixing build issues
shashankiitbhu Oct 22, 2024
cc63051
fixing build issues in codegen
shashankiitbhu Oct 24, 2024
2351af7
fix codegen build issues
shashankiitbhu Oct 25, 2024
c420a1a
fix codegen build issues
shashankiitbhu Oct 26, 2024
c1bd261
fix codegen build issues
shashankiitbhu Oct 29, 2024
7d8748c
fix codegen build issues
shashankiitbhu Nov 25, 2024
b28c51b
Rename .java to .kt
shashankiitbhu Nov 25, 2024
314de43
codegen module test fix
shashankiitbhu Nov 25, 2024
56517b8
crypto module test fix
shashankiitbhu Nov 26, 2024
f5a0b8b
Integration Test Fix
shashankiitbhu Nov 27, 2024
c56f29c
Integration Test Fix
shashankiitbhu Dec 2, 2024
5d442a4
Integration Test Fix
shashankiitbhu Dec 3, 2024
2c9104d
Merge remote-tracking branch 'upstream/web3j-android' into web3j-fix-…
shashankiitbhu Dec 3, 2024
af4c671
Typedecoder android fix
shashankiitbhu Dec 5, 2024
3d5c51e
pom configuaration added
shashankiitbhu Dec 6, 2024
7202562
Build Fixes
shashankiitbhu Dec 6, 2024
c4865a9
build fix
shashankiitbhu Dec 6, 2024
4fb1a26
Add lint-baseline.xml to gitignore
shashankiitbhu Dec 10, 2024
fdb2e62
remove crypto test comments
shashankiitbhu Dec 10, 2024
f299234
gradle publish signing fix
shashankiitbhu Dec 10, 2024
a79f25a
gradle published comments removed
shashankiitbhu Dec 10, 2024
9bf62de
build workflow modified
shashankiitbhu Dec 11, 2024
cee6462
workflows added
shashankiitbhu Dec 11, 2024
b7cbf7f
codegen fixed
shashankiitbhu Dec 11, 2024
7258070
Integration test build fix
shashankiitbhu Dec 11, 2024
9ce2517
Integration-tests fix
shashankiitbhu Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .kotlin/errors/errors-1732031657319.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.21
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

4 changes: 4 additions & 0 deletions .kotlin/errors/errors-1733489503716.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin version: 2.0.21
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

30 changes: 28 additions & 2 deletions abi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
plugins {
id 'com.android.library'
id 'maven-publish'
}

publishing {
publications {
release(MavenPublication) {
groupId = group
artifactId = project.name
version = version

artifact("$buildDir/outputs/aar/${project.name}-release.aar")

pom {
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.api.allDependencies.each { dependency ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
}
}
}
repositories {
mavenLocal()
}
}

android {
Expand All @@ -9,8 +37,6 @@ android {
defaultConfig {
minSdkVersion 24
targetSdkVersion 33


}

lint {
Expand Down
158 changes: 158 additions & 0 deletions abi/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.5.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.5.1)" variant="all" version="8.5.1">

<issue
id="DefaultLocale"
message="Implicitly using the default locale is a common source of bugs: Use `toLowerCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`."
errorLine1=" return type.getSimpleName().toLowerCase();"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/datatypes/AbiTypes.java"
line="389"
column="41"/>
</issue>

<issue
id="DefaultLocale"
message="Implicitly using the default locale is a common source of bugs: Use `toLowerCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`."
errorLine1=" this.type = getClass().getSimpleName().toLowerCase();"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/datatypes/primitive/PrimitiveType.java"
line="26"
column="48"/>
</issue>

<issue
id="DefaultLocale"
message="Implicitly using the default locale is a common source of bugs: Use `toLowerCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`."
errorLine1=" String simpleName = type.getSimpleName().toLowerCase();"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/Utils.java"
line="125"
column="50"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 26 (current min is 24): `java.lang.reflect.Constructor#getParameterCount`"
errorLine1=" final int length = constructor.getParameterCount();"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/TypeDecoder.java"
line="452"
column="44"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 26 (current min is 24): `java.lang.reflect.Executable#getParameters`"
errorLine1=" .getParameters()"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/TypeDecoder.java"
line="465"
column="46"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 26 (current min is 24): `java.lang.reflect.Constructor#getParameterCount`"
errorLine1=" final int length = constructor.getParameterCount();"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/TypeDecoder.java"
line="666"
column="44"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 28 (current min is 24): `java.lang.reflect.Type#getTypeName`"
errorLine1=" .getActualTypeArguments()[0].getTypeName());"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/Utils.java"
line="209"
column="62"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 28 (current min is 24): `java.lang.reflect.Type#getTypeName`"
errorLine1=" return type.getTypeName();"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/abi/Utils.java"
line="305"
column="25"/>
</issue>

<issue
id="OldTargetApi"
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the `android.os.Build.VERSION_CODES` javadoc for details."
errorLine1=" targetSdkVersion 33"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="39"
column="9"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of `compileSdkVersion` than 33 is available: 34"
errorLine1=" compileSdkVersion 33"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="35"
column="5"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.junit.jupiter:junit-jupiter-api than 5.10.0 is available: 5.11.0"
errorLine1=" testImplementation &apos;org.junit.jupiter:junit-jupiter-api:5.10.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="68"
column="24"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.junit.jupiter:junit-jupiter-engine than 5.10.0 is available: 5.11.0"
errorLine1=" testRuntimeOnly &apos;org.junit.jupiter:junit-jupiter-engine:5.10.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="69"
column="21"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of androidx.test.ext:junit than 1.1.5 is available: 1.2.1"
errorLine1=" androidTestImplementation &apos;androidx.test.ext:junit:1.1.5&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="70"
column="31"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of androidx.test.espresso:espresso-core than 3.5.1 is available: 3.6.1"
errorLine1=" androidTestImplementation &apos;androidx.test.espresso:espresso-core:3.5.1&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="71"
column="31"/>
</issue>

</issues>
4 changes: 2 additions & 2 deletions abi/src/main/java/org/web3j/abi/TypeDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ public static <T extends NumericType> T decodeNumeric(String input, Class<T> typ

BigInteger numericValue;
if (Uint.class.isAssignableFrom(type) || Ufixed.class.isAssignableFrom(type)) {
numericValue = new BigInteger(1, inputByteArray, valueOffset, typeLengthAsBytes);
numericValue = new BigInteger(1, Arrays.copyOfRange(inputByteArray, valueOffset, valueOffset + typeLengthAsBytes));
} else {
numericValue = new BigInteger(inputByteArray, valueOffset, typeLengthAsBytes);
numericValue = new BigInteger(Arrays.copyOfRange(inputByteArray, valueOffset, valueOffset + typeLengthAsBytes));
}
return type.getConstructor(BigInteger.class).newInstance(numericValue);

Expand Down
33 changes: 33 additions & 0 deletions android-test-utils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
plugins {
id 'com.android.library'
id 'maven-publish'
}

publishing {
publications {
release(MavenPublication) {
groupId = group
artifactId = project.name
version = version

artifact("$buildDir/outputs/aar/${project.name}-release.aar")

pom {
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.api.allDependencies.each { dependency ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
}
}
}
repositories {
mavenLocal()
}
}

android {
Expand All @@ -19,6 +47,11 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

lint {
baseline = file("lint-baseline.xml")
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
103 changes: 103 additions & 0 deletions android-test-utils/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.5.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.5.1)" variant="all" version="8.5.1">

<issue
id="NewApi"
message="Call requires API level 26, or core library desugaring (current min is 24): `java.nio.file.Files#createTempDirectory`"
errorLine1=" tempDir = Files.createTempDirectory(TempFileProvider.class.getSimpleName()).toFile();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/org/web3j/android_test_utils/TempFileProvider.java"
line="28"
column="25"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 26, or core library desugaring (current min is 24): `java.nio.file.Path#toFile`"
errorLine1=" tempDir = Files.createTempDirectory(TempFileProvider.class.getSimpleName()).toFile();"
errorLine2=" ~~~~~~">
<location
file="src/main/java/org/web3j/android_test_utils/TempFileProvider.java"
line="28"
column="85"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.java-websocket:Java-WebSocket than 1.5.6 is available: 1.5.7"
errorLine1=" api &quot;org.java-websocket:Java-WebSocket:$javaWebSocketVersion&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="46"
column="9"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.slf4j:slf4j-api than 2.0.13 is available: 2.0.16"
errorLine1=" api &quot;org.slf4j:slf4j-api:$slf4jVersion&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="49"
column="9"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.junit.jupiter:junit-jupiter than 5.8.1 is available: 5.11.0"
errorLine1=" implementation &apos;org.junit.jupiter:junit-jupiter:5.8.1&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="55"
column="20"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.junit.jupiter:junit-jupiter-api than 5.10.0 is available: 5.11.0"
errorLine1=" testImplementation &apos;org.junit.jupiter:junit-jupiter-api:5.10.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="57"
column="24"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.junit.jupiter:junit-jupiter-engine than 5.10.0 is available: 5.11.0"
errorLine1=" testRuntimeOnly &apos;org.junit.jupiter:junit-jupiter-engine:5.10.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="58"
column="21"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.mockito:mockito-core than 5.5.0 is available: 5.13.0"
errorLine1=" testImplementation &apos;org.mockito:mockito-core:5.5.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="59"
column="24"/>
</issue>

<issue
id="GradleDependency"
message="A newer version of org.mockito:mockito-junit-jupiter than 5.5.0 is available: 5.13.0"
errorLine1=" testImplementation &apos;org.mockito:mockito-junit-jupiter:5.5.0&apos;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="build.gradle"
line="60"
column="24"/>
</issue>

</issues>
Loading