Navigation Menu

Skip to content
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

question: how to get go code from .aar file #29718

Closed
tonifirnandes opened this issue Jan 13, 2019 · 2 comments
Closed

question: how to get go code from .aar file #29718

tonifirnandes opened this issue Jan 13, 2019 · 2 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile

Comments

@tonifirnandes
Copy link

Dear team,

I have built .aar file from gomobile by command such as = ... gomobile bind -x -v -target=android successfully, thanks for this great tool ...

Then i wanna update my .aar / Go code. Unfortunately, i miss the source code file. Is there anyway, i can extract/get my Go code back again form my .aar file ?.

I have tried to decompile the file by extract .aar and decompiled file classes.jar via jd-gui but i only got unnecessary java file which not my real Go code.

screenshot 2019-01-13 at 18 24 13

Thanks.

@bradfitz bradfitz added mobile Android, iOS, and x/mobile Question labels Jan 14, 2019
@bradfitz bradfitz changed the title How to get go code from .aar file question: how to get go code from .aar file Jan 14, 2019
@upperwal
Copy link

upperwal commented Apr 3, 2019

If by "miss the source code file" you meant that you lost it then unfortunately you can't get it back. Your code is compiled and packed into somethinglib.so file which is a shared object file. At best you can get back the assembly code by using some disassembler. What you see here is the JNI binding, some of it generated for GO and the rest for your code.

@julieqiu
Copy link
Member

A better place to ask this kind of question is golang-nuts. See https://golang.org/wiki/Questions.

@golang golang locked and limited conversation to collaborators May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

5 participants