├── demo ├── .gitignore ├── debug.keystore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── kopirealm │ │ │ └── androidethernetadapter │ │ │ └── demo │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── kopirealm │ │ │ └── androidethernetadapter │ │ │ └── demo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── kopirealm │ │ └── androidethernetadapter │ │ └── demo │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── android-ethernet-adapter ├── consumer-rules.pro ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── kopirealm │ │ │ ├── androidethernetadapter │ │ │ ├── IEthernetFunctions.java │ │ │ ├── EthernetAdapter.java │ │ │ ├── EthernetConfig.java │ │ │ └── EthernetFunctions.java │ │ │ └── reflection │ │ │ └── ReflectionFunctions.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── kopirealm │ │ │ └── androidethernetadapter │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── kopirealm │ │ └── androidethernetadapter │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── gradle.properties ├── build.gradle └── publish-bintray.gradle ├── settings.gradle ├── website └── static │ └── demo_preview.gif ├── photoshop ├── res │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ └── mipmap-xxxhdpi │ │ └── ic_launcher.png ├── android-ethernet-adapter-logo.png └── android-ethernet-adapter-logo.psd ├── gradle.properties ├── .gitignore ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android-ethernet-adapter/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':demo' 2 | include ':android-ethernet-adapter' -------------------------------------------------------------------------------- /android-ethernet-adapter/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | secring.gpg 3 | gradle.properties -------------------------------------------------------------------------------- /android-ethernet-adapter/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /demo/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/debug.keystore -------------------------------------------------------------------------------- /android-ethernet-adapter/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /website/static/demo_preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/website/static/demo_preview.gif -------------------------------------------------------------------------------- /demo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Android Ethernet Adapter 3 | 4 | -------------------------------------------------------------------------------- /photoshop/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /photoshop/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /photoshop/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /photoshop/android-ethernet-adapter-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/android-ethernet-adapter-logo.png -------------------------------------------------------------------------------- /photoshop/android-ethernet-adapter-logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/android-ethernet-adapter-logo.psd -------------------------------------------------------------------------------- /photoshop/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /photoshop/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/photoshop/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopihao/android-ethernet-adapter/HEAD/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /demo/src/test/java/com/kopirealm/androidethernetadapter/demo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.kopirealm.androidethernetadapter.demo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /android-ethernet-adapter/src/test/java/com/kopirealm/androidethernetadapter/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.kopirealm.androidethernetadapter; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /android-ethernet-adapter/src/main/java/com/kopirealm/androidethernetadapter/IEthernetFunctions.java: -------------------------------------------------------------------------------- 1 | package com.kopirealm.androidethernetadapter; 2 | 3 | public interface IEthernetFunctions { 4 | 5 | String ETH_NETWORK_INTERFACE = "eth0"; 6 | String ETH_CONN_MODE_DHCP = "dhcp"; 7 | String ETH_CONN_MODE_MANUAL = "manual"; 8 | 9 | boolean isSupported(); 10 | 11 | boolean isEthEnabled(); 12 | 13 | void setEthEnabled(boolean enable); 14 | 15 | void updateEthDevInfo(boolean dhcp, String ip, String gateway, String subnetmask, String dns); 16 | 17 | EthernetConfig getSavedEthConfig(); 18 | } 19 | -------------------------------------------------------------------------------- /demo/src/androidTest/java/com/kopirealm/androidethernetadapter/demo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.kopirealm.androidethernetadapter.demo; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.kopirealm.androidethernetadapter.demo", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android-ethernet-adapter/src/androidTest/java/com/kopirealm/androidethernetadapter/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.kopirealm.androidethernetadapter; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.kopirealm.androidethernetadapter.test", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android-ethernet-adapter/src/main/java/com/kopirealm/androidethernetadapter/EthernetAdapter.java: -------------------------------------------------------------------------------- 1 | package com.kopirealm.androidethernetadapter; 2 | 3 | import android.content.Context; 4 | 5 | public class EthernetAdapter extends EthernetFunctions { 6 | 7 | public EthernetAdapter(Context context) { 8 | super(context); 9 | } 10 | 11 | @Override 12 | public boolean isSupported() { 13 | return super.isSupported(); 14 | } 15 | 16 | @Override 17 | public boolean isEthEnabled() { 18 | return super.isEthEnabled(); 19 | } 20 | 21 | @Override 22 | public void setEthEnabled(boolean enable) { 23 | super.setEthEnabled(enable); 24 | } 25 | 26 | @Override 27 | public void updateEthDevInfo(boolean dhcp, String ip, String gateway, String subnetmask, String dns) { 28 | super.updateEthDevInfo(dhcp, ip, gateway, subnetmask, dns); 29 | } 30 | 31 | @Override 32 | public EthernetConfig getSavedEthConfig() { 33 | return super.getSavedEthConfig(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /demo/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep public class com.kopirealm.androidethernetadapter.EthernetConfig 23 | -keep public class com.kopirealm.androidethernetadapter.EthernetAdapter 24 | -keep public class com.kopirealm.androidethernetadapter.IEthernetFunctions 25 | -------------------------------------------------------------------------------- /android-ethernet-adapter/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep public class com.kopirealm.androidethernetadapter.EthernetConfig 23 | -keep public class com.kopirealm.androidethernetadapter.EthernetAdapter 24 | -keep public class com.kopirealm.androidethernetadapter.IEthernetFunctions -------------------------------------------------------------------------------- /android-ethernet-adapter/gradle.properties: -------------------------------------------------------------------------------- 1 | # POM Properties#0 2 | ANDROID_ARTIFACT_ID=android-ethernet-adapter 3 | # POM Properties#1 4 | # 5 | POM_URL=https://github.com/kopihao/android-ethernet-adapter 6 | POM_GIT_URL=https://github.com/kopihao/android-ethernet-adapter.git 7 | POM_CONNECTION=scm:git@github.com:kopihao/android-ethernet-adapter.git 8 | POM_LICENSE_ALL=["GPL-3.0"] 9 | POM_LICENSE_NAME=The GNU General Public License, Version 2.0 10 | POM_LICENSE_URL=https://github.com/kopihao/android-ethernet-adapter/blob/master/LICENSE 11 | # 12 | # POM Properties#2 13 | # 14 | POM_DEVELOPER_ID=kopihao.my 15 | POM_DEVELOPER_NAME=Kopihao 16 | POM_DEVELOPER_EMAIL=kopihao@gmail.com 17 | # 18 | # POM Properties#3 19 | # 20 | POM_NAME=android-ethernet-adapter 21 | POM_ARTIFACT_ID=android-ethernet-adapter 22 | POM_GROUP_ID=com.github.kopihao 23 | POM_PACKAGING=aar' 24 | # 25 | # GPG Signing 26 | signing.keyId= 27 | signing.password= 28 | signing.secretKeyRingFile=secring.gpg 29 | # 30 | # Sonatype OSSRH 31 | OSSRH_USN=kopihao@gmail.com 32 | OSSRH_PWD= 33 | # 34 | # Bintray 35 | BINTRAY_USER=kopihao 36 | BINTRAY_API_KEY= 37 | # -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | 21 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 24 | 25 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /demo/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 23 | 24 | 27 | 28 |