├── .gitignore ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── boat ├── src │ └── main │ │ ├── res │ │ └── drawable │ │ │ └── ic_boat.png │ │ ├── jni │ │ ├── CMakeLists.txt │ │ ├── loadme │ │ │ ├── CMakeLists.txt │ │ │ └── loadme.c │ │ └── boat │ │ │ ├── CMakeLists.txt │ │ │ ├── include │ │ │ ├── boat.h │ │ │ ├── boat_event.h │ │ │ └── boat_keycodes.h │ │ │ ├── boat_clipboard.c │ │ │ ├── boat.c │ │ │ ├── boat_internal.h │ │ │ └── boat_event.c │ │ ├── java │ │ ├── cosine │ │ │ └── boat │ │ │ │ ├── LoadMe.java │ │ │ │ ├── BoatTask.java │ │ │ │ ├── BoatService.java │ │ │ │ ├── BoatLib.java │ │ │ │ ├── BoatScript.java │ │ │ │ ├── BoatKeycodes.java │ │ │ │ └── BoatActivity.java │ │ └── com │ │ │ └── mojang │ │ │ └── minecraftpe │ │ │ └── TextInputProxyEditTextbox.java │ │ └── AndroidManifest.xml └── build.gradle ├── sample ├── src │ └── main │ │ ├── res │ │ ├── drawable │ │ │ ├── cursor.png │ │ │ ├── control_button.xml │ │ │ ├── control_button_normal.xml │ │ │ └── control_button_pressed.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── launcher_layout.xml │ │ │ └── minecraft_layout.xml │ │ ├── java │ │ └── cosine │ │ │ └── boat │ │ │ ├── VirglService.java │ │ │ ├── LauncherActivity.java │ │ │ ├── logcat │ │ │ ├── LogcatUtils.java │ │ │ ├── Logcat.java │ │ │ └── LogcatService.java │ │ │ └── MinecraftActivity.java │ │ └── AndroidManifest.xml └── build.gradle ├── .classpath ├── project.properties ├── gradle.properties ├── README-zh_CN.md ├── README.md ├── gradlew.bat ├── gradlew └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build 3 | .cxx 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':boat', ':sample' 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AOF-Dev/Boat/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /boat/src/main/res/drawable/ic_boat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AOF-Dev/Boat/HEAD/boat/src/main/res/drawable/ic_boat.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AOF-Dev/Boat/HEAD/sample/src/main/res/drawable/cursor.png -------------------------------------------------------------------------------- /boat/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | # include libs 4 | ADD_SUBDIRECTORY(boat/) 5 | ADD_SUBDIRECTORY(loadme/) 6 | -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ff468ef5 4 | 5 | -------------------------------------------------------------------------------- /boat/src/main/jni/loadme/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | # build loadme 4 | 5 | add_library(loadme SHARED loadme.c) 6 | 7 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -Wall -Werror") 8 | target_link_libraries(loadme dl log) 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 14 10:14:02 PST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip 7 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/control_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /boat/src/main/jni/boat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | # build libboat 4 | set(INCLUDE_DIR include/) 5 | 6 | add_library(boat SHARED boat.c boat_clipboard.c boat_event.c) 7 | include_directories(${INCLUDE_DIR}) 8 | 9 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -Wall -Werror -DBUILD_BOAT") 10 | target_link_libraries(boat dl android) 11 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/control_button_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/control_button_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-19 12 | -------------------------------------------------------------------------------- /boat/src/main/jni/boat/include/boat.h: -------------------------------------------------------------------------------- 1 | #ifndef BOAT_H 2 | #define BOAT_H 3 | 4 | #include 5 | #include 6 | 7 | ANativeWindow* boatGetNativeWindow(void); 8 | int boatWaitForEvent(int timeout); 9 | int boatPollEvent(BoatEvent* event); 10 | int boatGetEventFd(void); 11 | void boatSetCursorMode(int mode); 12 | void boatSetPrimaryClipString(const char* string); 13 | const char* boatGetPrimaryClipString(void); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /sample/src/main/java/cosine/boat/VirglService.java: -------------------------------------------------------------------------------- 1 | package cosine.boat; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.app.Notification; 6 | import android.content.Context; 7 | import android.os.IBinder; 8 | import android.app.PendingIntent; 9 | import java.util.Map; 10 | import java.util.HashMap; 11 | 12 | import cosine.boat.BoatService; 13 | import cosine.boat.BoatTask; 14 | 15 | public class VirglService extends BoatService 16 | { 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /boat/src/main/java/cosine/boat/LoadMe.java: -------------------------------------------------------------------------------- 1 | package cosine.boat; 2 | 3 | public class LoadMe { 4 | 5 | public static native int chdir(String path); 6 | public static native void redirectStdio(String file); 7 | public static native void setenv(String name, String value); 8 | public static native int dlopen(String name); 9 | public static native void patchLinker(); 10 | public static native int dlexec(String[] args); 11 | 12 | static { 13 | System.loadLibrary("loadme"); 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /boat/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 10 | 12 | 14 | 16 | 17 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/launcher_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 |