PeernetOfficial / core

Core library. Use this to create a new Peernet application.
MIT License
36 stars 5 forks source link

[gomobile] Api level 30 Calling net.Interface fails (Android 11) #83

Open Akilan1999 opened 2 years ago

Akilan1999 commented 2 years ago

Open Go issue: https://github.com/golang/go/issues/40569

Reason for the issue:

The following is a list of the ways that apps are affected by this change (from Api level 30 onwards):

source (https://developer.android.com/training/articles/user-data-ids#mac-11-plus)

Possible solution

" SDK 30 prohibits syscall.NetlinkRIB(syscall.RTM_GETADDR, ...) which Go's net.Interfaces uses. Implement an Android specific version of net.Interfaces to use instead.

Passing primitive types across JNI is relatively straightforward, passing a single object of a complex class is annoying but still possible, but passing lists and other more complex data structures is way harder. As such, this commit added a Java routine to render the interface information to a string and pass that across JNI as a primitive type for Go code to parse. " PR with a solution: https://github.com/tailscale/tailscale-android/pull/21

Akilan1999 commented 2 years ago

This issue has been addressed by creating a new Peernet core repository for Android 11 onwards and supporting potentially changes needed for IOS as well.

Repo link: https://github.com/PeernetOfficial/Core-Mobile

Change log