Skip to content

Cross-compile an ELF in Go that uses gopacket to run on an ARM Android device...for science!

Notifications You must be signed in to change notification settings

spitfire55/gopacket_android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gopacket for Android

Introduction

Gopacket for Android is a project that enables cross-compiling Go code that uses Google's gopacket library for ARM Android devices on rooted devices.

Technical Notes

  • To dynamically compile ELF binaries for Android, you have to use the Native Development Kit (NDK). The NDK is designed for C/C++ code.
  • The Go build tools provide a lot of functionality. Cgo and a variety of Go environment variables allows devlopers to gain greater control over how Go compiles their code.
  • Libpcap does not exist on Android. We need to cross-compile both libpcap from source and our Go code together in order for gopacket to work on Android.

Instructions

1. Root your Android Device and Enable ADB in Developer Options

Consult XDA-Developers and the Googlez for assistance if you are unfamiliar. Difficulty varies across devices and OS versions.

2. Run the gopacket for Android build system

  • Simply run make to build, copy, deploy, and run your Go code. Your Go code should be placed in the go/ folder. An example main.go file has been provided.

About

Cross-compile an ELF in Go that uses gopacket to run on an ARM Android device...for science!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published