duningwei / ping-for-android

JNI 实现ping、traceroute命令,实现android网络诊断功能

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

traceroute-for-android Download

Easy way to use traceroute on Android.

Description

Traceroute tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.

Rendering Image

images/1.png

Simple usage

synchronous way

val traceResult = TraceRoute.traceRoute("www.google.com")

asynchronous way

TraceRoute.setCallback {
    success { Log.d("tag", "\ntraceroute finish") }
    update { text -> Log.d("tag", text) }
    failed { code, reason -> Log.d("tag", """\ntraceroute failed.code:$code, reason:$reason""") }
}
TraceRoute.traceRoute("www.google.com", true)

Proguard

-keepclassmembers com.wandroid.traceroute.TraceRoute {
    void clearResult();
    void appendResult(***);
    int execute(***);
}

About

JNI 实现ping、traceroute命令,实现android网络诊断功能


Languages

Language:C 84.9%Language:Roff 9.5%Language:Kotlin 4.6%Language:Java 0.6%Language:Makefile 0.5%