提交 cbd43fb7 编写于 作者: S Simon Fels

WIP android JNI ..

上级 327e525b
......@@ -3,13 +3,16 @@
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/../../android/gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/../../android/gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/../../android/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/../../android/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/../../android/assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/../../android/libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/../../android/proguard_logs" />
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/../gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/../gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/../AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/../res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/../assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/../libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/../proguard_logs" />
<proGuardCfgFiles>
<file>file:///usr/lib/jvm/java-1.7.0-openjdk-amd64/tools/proguard/proguard-android.txt</file>
</proGuardCfgFiles>
</configuration>
</facet>
</component>
......@@ -20,7 +23,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
......@@ -34,5 +37,5 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="Android API 23 Platform" project-jdk-type="Android SDK" />
</project>
\ No newline at end of file
此差异已折叠。
......@@ -3,12 +3,15 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES = \
jni/anbox_support.cpp
jni/anbox_support.cpp \
jni/application_manager.cpp \
jni/jni_helper.cpp
LOCAL_C_INCLUDES := \
$(JNI_H_INCLUDE) \
libcore/include
LOCAL_SHARED_LIBRARIES := \
liblog
liblog \
libnativehelper
LOCAL_MODULE := libanbox_support
include $(BUILD_SHARED_LIBRARY)
......@@ -16,19 +19,21 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/java
LOCAL_SRC_FILES := $(call all-java-files-under, java)
LOCAL_JAVA_LIBRARIES := telephony-common
LOCAL_JNI_SHARED_LIBRARIES := \
libanbox_support
# Block certain packages from being installed
LOCAL_OVERRIDES_PACKAGES := \
SystemUI \
Home \
Launcher2 \
Calculator \
BasicDreams \
Calendar \
PrintSpooler \
WallpaperCropper
# LOCAL_OVERRIDES_PACKAGES := \
# SystemUI \
# Home \
# Launcher2 \
# Calculator \
# BasicDreams \
# Calendar \
# PrintSpooler \
# WallpaperCropper
LOCAL_PACKAGE_NAME := anboxd
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
......
set(ANBOX_SUPPORT_SOURCES
jni/anbox_support.cpp)
set(ANBOXD_SOURCES
service/main.cpp)
include_directories(
${CMAKE_SOURCE_DIR}/external/jni)
# We're not going to ship this, just building here to add proper
# unit tests we can run in a integration system without having
# the Android build system around.
add_library(anbox-support ${ANBOX_SUPPORT_SOURCES})
add_executable(anboxd ${ANBOXD_SOURCES})
......@@ -15,19 +15,15 @@
*
*/
#include <JNIHelp.h>
#include <jni.h>
package org.anbox;
#define LOG_TAG "AnboxSupport"
import android.util.Log;
import java.lang.ref.WeakReference;
#ifdef ANDROID
#include <utils/Log.h>
#else
#define ALOGI(...)
#endif
public class ApplicationManager {
static final String TAG = "AnboxApplicationManager";
extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) {
ALOGI("Successfully loaded Anbox support library");
return JNI_VERSION_1_4;
public ApplicationManager() {
Log.i(TAG, "Starting up native part..");
}
}
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.anbox;
import android.content.BroadcastReceiver;
......
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.anbox;
import android.app.Activity;
......
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.anbox;
import android.app.Application;
public class MainApplication extends Application {
private ApplicationManager mApplicationManager;
private NavBar mNavBar;
static {
// Load our native support library on startup so we get
// access to several things from the Anbox host service.
System.loadLibrary("anbox_support");
public MainApplication() {
}
public void startServices() {
mApplicationManager = new ApplicationManager();
mNavBar = new NavBar(this);
}
}
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.anbox;
import android.app.ActivityManager;
......
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.anbox;
import android.content.Context;
......
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.anbox;
import android.app.Service;
......
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
int main(int, char**) {
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册