Skip to content

Commit

Permalink
Update Android SDK 31 astubx models (#1054)
Browse files Browse the repository at this point in the history
I did not have the artifacts from building SDK 31 from source available
to me, so I couldn't run JarInfer on them directly. Instead, I wrote
[this
code](master...msridhar:NullAway:tmp-sdk-31-hacks)
to convert our extant astubx file to the new format. The main change is
that now method signatures use qualified type names. To do the
conversion, I looked up methods from the astubx file in the android.jar
stubs file (using WALA) and then got the qualified type names from
there.

Not every method present in the previous astubx file is present in the
android.jar stubs, as many methods in AOSP are hidden and cannot be
invoked (at least not easily), but those methods were included in our
previous astubx. This explains why the new astubx is smaller. I did my
best to carefully debug and make sure we weren't missing other methods
unnecessarily.

This is not a long-term solution. We will probably want to continue to
evolve the astubx format, and we'll need a new conversion script each
time. Eventually we should create a new astubx for the latest Android
SDK and possibly deprecate these artifacts for older SDKs. But, this
solution unblocks us, as our current astubx for SDK 31 is unusable with
the main branch astubx parsing code.
  • Loading branch information
msridhar authored Oct 13, 2024
1 parent 0f6f3d2 commit 2a9188b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file not shown.
4 changes: 2 additions & 2 deletions jar-infer/nullaway-integration-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ dependencies {
// one of the following lines should be uncommented
//testImplementation project(":jar-infer:android-jarinfer-models-sdk28")
//testImplementation project(":jar-infer:android-jarinfer-models-sdk29")
testImplementation project(":jar-infer:android-jarinfer-models-sdk30")
//testImplementation project(":jar-infer:android-jarinfer-models-sdk31")
//testImplementation project(":jar-infer:android-jarinfer-models-sdk30")
testImplementation project(":jar-infer:android-jarinfer-models-sdk31")
}

0 comments on commit 2a9188b

Please sign in to comment.