├── app ├── .gitignore ├── 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 │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── penguin │ │ │ │ └── opencore │ │ │ │ └── tester │ │ │ │ ├── LeakMemory.java │ │ │ │ ├── TesterApp.java │ │ │ │ └── MainActivity.java │ │ └── cpp │ │ │ ├── native-lib.cpp │ │ │ └── CMakeLists.txt │ ├── test │ │ └── java │ │ │ └── penguin │ │ │ └── opencore │ │ │ └── tester │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── penguin │ │ └── opencore │ │ └── tester │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── opencore ├── .gitignore ├── src │ ├── main │ │ ├── cpp │ │ │ ├── VERSION │ │ │ ├── eajni │ │ │ │ ├── include │ │ │ │ │ └── eajnis │ │ │ │ │ │ ├── Log.h │ │ │ │ │ │ ├── Thread.h │ │ │ │ │ │ └── AndroidJNI.h │ │ │ │ ├── Thread.cpp │ │ │ │ └── AndroidJNI.cpp │ │ │ ├── opencore │ │ │ │ ├── arm │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── x86 │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── riscv64 │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── arm64 │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── x86_64 │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── lp32 │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── lp64 │ │ │ │ │ ├── opencore.h │ │ │ │ │ └── opencore.cpp │ │ │ │ ├── opencore.h │ │ │ │ └── opencore.cpp │ │ │ ├── CMakeLists.txt │ │ │ └── opencore_jni.cpp │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── penguin │ │ │ └── opencore │ │ │ └── sdk │ │ │ └── Coredump.java │ ├── test │ │ └── java │ │ │ └── penguin │ │ │ └── opencore │ │ │ └── sdk │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── penguin │ │ └── opencore │ │ └── sdk │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── jitpack.yml ├── script ├── build.sh └── build_opencore.sh ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew ├── README.md └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /opencore/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/VERSION: -------------------------------------------------------------------------------- 1 | MAJOR=1 2 | MINOR=4 3 | PATCH=16 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name='OpenCoreSDK' 2 | include ':app', ':opencore' 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | OpenCoreSDK 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | - sdk install java 11.0.10-open 3 | - sdk use java 11.0.10-open 4 | 5 | jdk: 6 | - openjdk11 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Penguin38/OpenCoreSDK/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /opencore/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #6200EE 4 | #3700B3 5 | #03DAC5 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 04 02:10:22 CST 2023 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-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /script/build.sh: -------------------------------------------------------------------------------- 1 | if [ -z $JAVA_HOME ];then 2 | echo "JAVA_HOME is not set" 3 | echo "Example:" 4 | echo " export JAVA_HOME=JDK_DIR" 5 | echo " ./script/build.sh" 6 | exit 7 | fi 8 | ./gradlew clean -Pgroup=com.github.Penguin38 -Pversion=opencore-1.4.16 -xtest -xlint assemble publishToMavenLocal 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea 4 | /local.properties 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | mybuild.sh 17 | clocline.sh 18 | /output 19 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/penguin/opencore/tester/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package penguin.opencore.tester; 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 | } -------------------------------------------------------------------------------- /opencore/src/test/java/penguin/opencore/sdk/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package penguin.opencore.sdk; 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 | } -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /opencore/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 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /opencore/src/androidTest/java/penguin/opencore/sdk/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package penguin.opencore.sdk; 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("penguin.opencore.sdk", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/penguin/opencore/tester/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package penguin.opencore.tester; 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("penguin.opencore.tester", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/penguin/opencore/tester/LeakMemory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-present, Guanyou.Chen. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package penguin.opencore.tester; 18 | 19 | public class LeakMemory { 20 | private byte[] data = new byte[65536]; 21 | 22 | public LeakMemory() { 23 | for (int i = 0; i < data.length; i++) { 24 | data[i] = (byte) 0xaa; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/cpp/native-lib.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-present, Guanyou.Chen. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | extern "C" 22 | JNIEXPORT void JNICALL 23 | Java_penguin_opencore_tester_MainActivity_nativeCrashJNI(JNIEnv *env, jobject thiz) { 24 | int *p = nullptr; 25 | *p = 1; 26 | } 27 | 28 | extern "C" 29 | JNIEXPORT void JNICALL 30 | Java_penguin_opencore_tester_MainActivity_nativeAbortJNI(JNIEnv *env, jobject thiz) { 31 | abort(); 32 | } 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/eajni/include/eajnis/Log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef EAJNI_LOG_H 18 | #define EAJNI_LOG_H 19 | 20 | #include 21 | 22 | #ifndef LOG_TAG 23 | #define LOG_TAG "JNI" 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif //__cplusplus 29 | 30 | #define JNI_LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__) 31 | #define JNI_LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) 32 | #define JNI_LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__) 33 | #define JNI_LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) 34 | #define JNI_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) 35 | #define JNI_LOGF(...) __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, __VA_ARGS__) 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif //__cplusplus 40 | 41 | #endif //EAJNI_LOG_H 42 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/eajni/include/eajnis/Thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef EAJNI_THREAD_H 18 | #define EAJNI_THREAD_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | typedef void* android_thread_id_t; 27 | typedef int (*android_thread_func_t)(void*); 28 | 29 | #ifdef __cplusplus 30 | } // extern "C" 31 | #endif 32 | 33 | #ifdef __cplusplus 34 | enum { 35 | ANDROID_PRIORITY_BACKGROUND = 10, 36 | ANDROID_PRIORITY_NORMAL = 0, 37 | ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, 38 | }; 39 | 40 | class Thread { 41 | public: 42 | static int androidCreateRawThreadEtc( 43 | android_thread_func_t entryFunction, 44 | void *userData, 45 | const char* threadName, 46 | int32_t threadPriority, 47 | size_t threadStackSize, 48 | int32_t threadCreate, 49 | android_thread_id_t *threadId); 50 | }; 51 | 52 | #endif // __cplusplus 53 | 54 | #endif //EAJNI_THREAD_H 55 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion "30.0.3" 6 | 7 | defaultConfig { 8 | applicationId "penguin.opencore.tester" 9 | minSdkVersion 21 10 | targetSdkVersion 30 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | 16 | externalNativeBuild { 17 | cmake { 18 | abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86" 19 | cppFlags "-std=gnu++17" 20 | } 21 | } 22 | 23 | ndk{ 24 | abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86" 25 | } 26 | 27 | ndkVersion "22.1.7171670" 28 | } 29 | 30 | buildTypes { 31 | release { 32 | minifyEnabled false 33 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 34 | } 35 | } 36 | 37 | externalNativeBuild { 38 | cmake { 39 | path "src/main/cpp/CMakeLists.txt" 40 | version "3.10.2" 41 | } 42 | } 43 | } 44 | 45 | dependencies { 46 | implementation fileTree(dir: 'libs', include: ['*.jar']) 47 | 48 | implementation 'androidx.appcompat:appcompat:1.1.0' 49 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 50 | testImplementation 'junit:junit:4.12' 51 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 52 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 53 | implementation project(path: ':opencore') 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/eajni/Thread.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | 23 | typedef void* (*android_pthread_entry)(void*); 24 | 25 | int Thread::androidCreateRawThreadEtc(android_thread_func_t entryFunction, void *userData, 26 | const char *threadName, int32_t threadPriority, size_t threadStackSize, 27 | int32_t threadCreate, android_thread_id_t *threadId) { 28 | pthread_attr_t attr; 29 | pthread_attr_init(&attr); 30 | pthread_attr_setdetachstate(&attr, threadCreate); 31 | 32 | if (threadStackSize) { 33 | pthread_attr_setstacksize(&attr, threadStackSize); 34 | } 35 | 36 | errno = 0; 37 | pthread_t thread; 38 | int result = pthread_create(&thread, &attr, (android_pthread_entry)entryFunction, userData); 39 | 40 | pthread_attr_destroy(&attr); 41 | if (result != 0) { 42 | JNI_LOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d, threadPriority=%d)", 43 | entryFunction, result, errno, threadPriority); 44 | return 0; 45 | } 46 | 47 | if (threadId != NULL) { 48 | *threadId = (android_thread_id_t)thread; 49 | } 50 | return 1; 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | 8 | # Creates and names a library, sets it as either STATIC 9 | # or SHARED, and provides the relative paths to its source code. 10 | # You can define multiple libraries, and CMake builds them for you. 11 | # Gradle automatically packages shared libraries with your APK. 12 | 13 | add_library( # Sets the name of the library. 14 | native-lib 15 | 16 | # Sets the library as a shared library. 17 | SHARED 18 | 19 | # Provides a relative path to your source file(s). 20 | native-lib.cpp ) 21 | 22 | # Searches for a specified prebuilt library and stores the path as a 23 | # variable. Because CMake includes system libraries in the search path by 24 | # default, you only need to specify the name of the public NDK library 25 | # you want to add. CMake verifies that the library exists before 26 | # completing its build. 27 | 28 | find_library( # Sets the name of the path variable. 29 | log-lib 30 | 31 | # Specifies the name of the NDK library that 32 | # you want CMake to locate. 33 | log ) 34 | 35 | # Specifies libraries CMake should link to your target library. You 36 | # can link multiple libraries, such as libraries you define in this 37 | # build script, prebuilt third-party libraries, or system libraries. 38 | 39 | target_link_libraries( # Specifies the target library. 40 | native-lib 41 | 42 | # Links the target library to the log library 43 | # included in the NDK. 44 | ${log-lib} ) 45 | 46 | set_target_properties(native-lib PROPERTIES LINK_FLAGS "-Wl,-z,max-page-size=16384") 47 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/eajni/include/eajnis/AndroidJNI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef EAJNI_ANDROIDJNI_H 18 | #define EAJNI_ANDROIDJNI_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #define ANDROID_JNI_VERSION "1.1" 25 | 26 | #ifdef __cplusplus 27 | namespace android { 28 | 29 | class AndroidJNI { 30 | public: 31 | static std::string getVersion() { return ANDROID_JNI_VERSION; } 32 | 33 | static void init(JavaVM *vm) { mJavaVM = vm; } 34 | 35 | static JavaVM *getJavaVM() { return mJavaVM; } 36 | 37 | static JNIEnv *getJNIEnv(); 38 | 39 | static android_thread_id_t 40 | createJavaThread(const char *name, void (*start)(void *), void *arg); 41 | static android_thread_id_t 42 | createJavaThread(const char *name, void (*start)(void *), void *arg, bool canwait); 43 | 44 | private: 45 | static JavaVM *mJavaVM; 46 | 47 | static int javaCreateThreadEtc( 48 | android_thread_func_t entryFunction, 49 | void *userData, 50 | const char *threadName, 51 | int32_t threadPriority, 52 | size_t threadStackSize, 53 | int32_t threadCreate, 54 | android_thread_id_t *threadId); 55 | 56 | static int javaThreadShell(void *args); 57 | }; 58 | } 59 | #endif // __cplusplus 60 | 61 | #endif //EAJNI_ANDROIDJNI_H 62 | -------------------------------------------------------------------------------- /opencore/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | id 'maven-publish' 4 | } 5 | 6 | android { 7 | compileSdkVersion 30 8 | buildToolsVersion "30.0.3" 9 | 10 | defaultConfig { 11 | //applicationId "penguin.opencore.sdk" 12 | //minSdkVersion 29 13 | //targetSdkVersion 30 14 | versionCode 1 15 | versionName "1.0" 16 | 17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 | 19 | externalNativeBuild { 20 | cmake { 21 | abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86" 22 | cppFlags "-std=gnu++17" 23 | } 24 | } 25 | 26 | ndk{ 27 | abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86" 28 | } 29 | 30 | ndkVersion "22.1.7171670" 31 | } 32 | 33 | buildTypes { 34 | release { 35 | minifyEnabled false 36 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 37 | } 38 | } 39 | 40 | externalNativeBuild { 41 | cmake { 42 | path "src/main/cpp/CMakeLists.txt" 43 | version "3.10.2" 44 | } 45 | } 46 | } 47 | 48 | dependencies { 49 | implementation fileTree(dir: 'libs', include: ['*.jar']) 50 | 51 | testImplementation 'junit:junit:4.12' 52 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 53 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 54 | } 55 | 56 | task androidSourcesJar(type: Jar) { 57 | classifier 'sources' 58 | from android.sourceSets.main.java.srcDirs 59 | } 60 | 61 | afterEvaluate { 62 | publishing { 63 | publications { 64 | release(MavenPublication) { 65 | from components.release 66 | artifact androidSourcesJar 67 | groupId = 'penguin.opencore.sdk' 68 | artifactId = 'opencore' 69 | version = '1.4.16' 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /script/build_opencore.sh: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025-present, Guanyou.Chen. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | if [ -z "$BUILD_ANDROID_ABIS" ];then 16 | export BUILD_ANDROID_ABIS="arm64-v8a armeabi-v7a x86_64 x86" 17 | fi 18 | if [ -z $BUILD_TYPE ];then 19 | export BUILD_TYPE="Debug" 20 | fi 21 | if [ -z $BUILD_ANDROID_PLATFORM ];then 22 | export BUILD_ANDROID_PLATFORM="android-30" 23 | fi 24 | export BUILD_PRODUCT="aosp" 25 | export BUILD_TARGET_PAGESIZE_4K="4K" 26 | export BUILD_TARGET_PAGESIZE_16K="16K" 27 | export BUILD_TARGET_PAGESIZE_ANDROID=$BUILD_TARGET_PAGESIZE_16K 28 | export INSTALL_OUTPUT=output/$BUILD_PRODUCT/"$(echo $BUILD_TYPE | tr '[:upper:]' '[:lower:]')" 29 | 30 | if [ $BUILD_PRODUCT == "aosp" ];then 31 | if [ -z $ANDROID_NDK_HOME ];then 32 | echo "ANDROID_NDK_HOME is not set" 33 | echo "Example:" 34 | echo " export ANDROID_NDK_HOME=NDK_DIR" 35 | echo " ./script/build_opencore.sh" 36 | exit 37 | fi 38 | for CURRENT_ANDROID_ABI in $BUILD_ANDROID_ABIS 39 | do 40 | # build open-monitor 41 | cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ 42 | -DANDROID_ABI=$CURRENT_ANDROID_ABI \ 43 | -DANDROID_NDK=$ANDROID_NDK_HOME \ 44 | -DANDROID_PLATFORM=$BUILD_ANDROID_PLATFORM \ 45 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ 46 | opencore/src/main/cpp/CMakeLists.txt \ 47 | -B $INSTALL_OUTPUT/android/$CURRENT_ANDROID_ABI/lib 48 | 49 | make -C $INSTALL_OUTPUT/android/$CURRENT_ANDROID_ABI/lib -j8 50 | done 51 | fi 52 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/opencore/arm/opencore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-present, Guanyou.Chen. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OPENCORE_ARM_OPENCORE_IMPL_H_ 18 | #define OPENCORE_ARM_OPENCORE_IMPL_H_ 19 | 20 | #include "opencore/lp32/opencore.h" 21 | 22 | namespace arm { 23 | 24 | struct pt_regs { 25 | uint32_t regs[13]; 26 | uint32_t sp; 27 | uint32_t lr; 28 | uint32_t pc; 29 | uint32_t cpsr; 30 | }; 31 | 32 | typedef struct elf32_prstatus { 33 | uint32_t pr_si_signo; 34 | uint32_t pr_si_code; 35 | uint32_t pr_si_errno; 36 | uint16_t pr_cursig; 37 | uint16_t __padding1; 38 | uint32_t pr_sigpend; 39 | uint32_t pr_sighold; 40 | uint32_t pr_pid; 41 | uint32_t pr_ppid; 42 | uint32_t pr_pgrp; 43 | uint32_t pd_sid; 44 | uint64_t pr_utime; 45 | uint64_t pr_stime; 46 | uint64_t pr_cutime; 47 | uint64_t pr_cstime; 48 | struct pt_regs pr_reg; 49 | uint32_t pr_fpvalid; 50 | uint32_t __padding2; 51 | } __attribute__((packed, aligned(1))) Elf32_prstatus; 52 | 53 | class Opencore : public lp32::OpencoreImpl { 54 | public: 55 | Opencore() : lp32::OpencoreImpl(), 56 | prnum(0), prstatus(nullptr) {} 57 | void Finish(); 58 | void CreateCorePrStatus(int pid); 59 | void WriteCorePrStatus(FILE* fp); 60 | int IsSpecialFilterSegment(Opencore::VirtualMemoryArea& vma); 61 | int getMachine() { return EM_ARM; } 62 | private: 63 | int prnum; 64 | Elf32_prstatus *prstatus; 65 | }; 66 | 67 | } // namespace arm 68 | 69 | #endif // OPENCORE_ARM_OPENCORE_IMPL_H_ 70 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/opencore/x86/opencore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-present, Guanyou.Chen. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef OPENCORE_X86_OPENCORE_IMPL_H_ 18 | #define OPENCORE_X86_OPENCORE_IMPL_H_ 19 | 20 | #include "opencore/lp32/opencore.h" 21 | 22 | namespace x86 { 23 | 24 | struct pt_regs { 25 | uint32_t ebx, ecx, edx, esi, edi, ebp, eax; 26 | uint16_t ds, __ds, es, __es; 27 | uint16_t fs, __fs, gs, __gs; 28 | uint32_t orig_eax, eip; 29 | uint16_t cs, __cs; 30 | uint32_t eflags, esp; 31 | uint16_t ss, __ss; 32 | }; 33 | 34 | typedef struct elf32_prstatus { 35 | uint32_t pr_si_signo; 36 | uint32_t pr_si_code; 37 | uint32_t pr_si_errno; 38 | uint16_t pr_cursig; 39 | uint16_t __padding1; 40 | uint32_t pr_sigpend; 41 | uint32_t pr_sighold; 42 | uint32_t pr_pid; 43 | uint32_t pr_ppid; 44 | uint32_t pr_pgrp; 45 | uint32_t pd_sid; 46 | uint64_t pr_utime; 47 | uint64_t pr_stime; 48 | uint64_t pr_cutime; 49 | uint64_t pr_cstime; 50 | struct pt_regs pr_reg; 51 | uint32_t pr_fpvalid; 52 | } Elf32_prstatus; 53 | 54 | class Opencore : public lp32::OpencoreImpl { 55 | public: 56 | Opencore() : lp32::OpencoreImpl(), 57 | prnum(0), prstatus(nullptr) {} 58 | void Finish(); 59 | void CreateCorePrStatus(int pid); 60 | void WriteCorePrStatus(FILE* fp); 61 | int IsSpecialFilterSegment(Opencore::VirtualMemoryArea& vma); 62 | int getMachine() { return EM_386; } 63 | private: 64 | int prnum; 65 | Elf32_prstatus *prstatus; 66 | }; 67 | 68 | } // namespace x86 69 | 70 | #endif // OPENCORE_X86_OPENCORE_IMPL_H_ 71 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /opencore/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2024-present, Guanyou.Chen. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | cmake_minimum_required(VERSION 3.10.2) 17 | project("opencore") 18 | 19 | file(READ ${CMAKE_SOURCE_DIR}/VERSION version_contents) 20 | string(REGEX MATCH "MAJOR=([0-9]+)" _ ${version_contents}) 21 | set(MAJOR ${CMAKE_MATCH_1}) 22 | string(REGEX MATCH "MINOR=([0-9]+)" _ ${version_contents}) 23 | set(MINOR ${CMAKE_MATCH_1}) 24 | string(REGEX MATCH "PATCH=([0-9]+)" _ ${version_contents}) 25 | set(PATCH ${CMAKE_MATCH_1}) 26 | add_definitions(-D__OPENCORE_VERSION__="opencore-${MAJOR}.${MINOR}.${PATCH}") 27 | 28 | include_directories(.) 29 | include_directories(eajni/include/) 30 | aux_source_directory(eajni SRC_LIST) 31 | add_library(eajni STATIC ${SRC_LIST}) 32 | find_library(log-lib log) 33 | target_link_libraries(eajni ${log-lib}) 34 | 35 | if (ANDROID_ABI STREQUAL "arm64-v8a") 36 | set(OPENCORE_IMPL 37 | opencore/lp64/opencore.cpp 38 | opencore/arm64/opencore.cpp) 39 | elseif(ANDROID_ABI STREQUAL "armeabi-v7a") 40 | set(OPENCORE_IMPL 41 | opencore/lp32/opencore.cpp 42 | opencore/arm/opencore.cpp) 43 | elseif(ANDROID_ABI STREQUAL "armeabi") 44 | set(OPENCORE_IMPL 45 | opencore/lp32/opencore.cpp 46 | opencore/arm/opencore.cpp) 47 | elseif(ANDROID_ABI STREQUAL "x86_64") 48 | set(OPENCORE_IMPL 49 | opencore/lp64/opencore.cpp 50 | opencore/x86_64/opencore.cpp) 51 | elseif(ANDROID_ABI STREQUAL "x86") 52 | set(OPENCORE_IMPL 53 | opencore/lp32/opencore.cpp 54 | opencore/x86/opencore.cpp) 55 | elseif(ANDROID_ABI STREQUAL "riscv64") 56 | set(OPENCORE_IMPL 57 | opencore/lp64/opencore.cpp 58 | opencore/riscv64/opencore.cpp) 59 | endif() 60 | 61 | add_library(opencore SHARED 62 | opencore/opencore.cpp 63 | ${OPENCORE_IMPL} 64 | opencore_jni.cpp) 65 | target_link_libraries(opencore eajni) 66 | set_target_properties(opencore PROPERTIES LINK_FLAGS "-Wl,-z,max-page-size=16384") 67 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |