Recover suspend ABI without kotlin.Metadata - #25
Merged
Conversation
R8 often strips @kotlin.Metadata but leaves the DEX SourceFile (.kt), the same attribute JADX uses to recover Kotlin file names. Treat that as Kotlin, then recognize the Continuation-last / Object-return JVM shape so unused continuation parameters become suspend instead of a raw Java Continuation argument. Skip ContinuationImpl create/invoke bridges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Language selection used only
@kotlin.Metadata. R8 often strips that annotation but leaves the DEXSourceFile(.kt), the same attribute JADX uses to recover Kotlin file names. Those classes were decompiled as Java and kept a rawContinuationlast parameter.SourceFileending in.kt/.ktsas Kotlin when metadata is absentObject foo(..., Continuation)when the continuation parameter is unused in the bodyContinuationImplbridges (create,invokeSuspend, andinvokeon classes that declareinvokeSuspend)This does not reconstruct
switch(label)/COROUTINE_SUSPENDEDstate-machine bodies. Methods that still pass the continuation through keep the parameter on purpose.Validation
cargo fmt --all -- --checkcargo test -p dexdec --lib(language + ABI unit tests)cargo test -p dexdec --test expected_testSourceFilesuspendkept; one extra unused-continuationemitrecoveredfinally/synchronized/goto/ brace-balance unchanged vsmainReview notes
Standalone. No overlap with the FunctionN or naming PRs. Merge order is free; the three were also verified stacked together.