[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-akono] branch master updated (731ac695 -> 307baaf5)
From: |
gnunet |
Subject: |
[taler-akono] branch master updated (731ac695 -> 307baaf5) |
Date: |
Thu, 14 Nov 2019 19:36:20 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a change to branch master
in repository akono.
discard 731ac695 less logging, various tweaks
This update removed existing revisions from the reference, leaving the
reference pointing at a previous point in the repository history.
* -- * -- N refs/heads/master (307baaf5)
\
O -- O -- O (731ac695)
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
No new revisions were added by this update.
Summary of changes:
akono/akono-akono.iml | 249 ++++++++++++++++++++++++++--------
akono/build.gradle.kts | 4 +-
akono/src/main/cpp/akono-jni.cpp | 190 ++++++++++++++------------
akono/src/main/java/akono/AkonoJni.kt | 66 +++++----
4 files changed, 331 insertions(+), 178 deletions(-)
diff --git a/akono/akono-akono.iml b/akono/akono-akono.iml
index 4ea461bc..6f731674 100644
--- a/akono/akono-akono.iml
+++ b/akono/akono-akono.iml
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<module external.linked.project.id=":akono"
external.linked.project.path="$MODULE_DIR$"
external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE"
type="JAVA_MODULE" version="4">
+<module external.linked.project.id=":akono"
external.linked.project.path="$MODULE_DIR$/../../../akono"
external.root.project.path="$MODULE_DIR$/../../.." external.system.id="GRADLE"
type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":akono" />
- <option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.3.2" />
- <option name="LAST_KNOWN_AGP_VERSION" value="3.3.2" />
</configuration>
</facet>
<facet type="native-android-gradle" name="Native-Android-Gradle">
@@ -24,17 +22,17 @@
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH"
value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
- <option name="RES_FOLDERS_RELATIVE_PATH"
value="file://$MODULE_DIR$/build/generated/res/rs/debug;file://$MODULE_DIR$/build/generated/res/resValues/debug"
/>
- <option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
+ <option name="RES_FOLDERS_RELATIVE_PATH"
value="file://$MODULE_DIR$/../../../akono/build/generated/res/rs/debug;file://$MODULE_DIR$/../../../akono/build/generated/res/resValues/debug"
/>
+ <option name="TEST_RES_FOLDERS_RELATIVE_PATH"
value="file://$MODULE_DIR$/../../../akono/build/generated/res/rs/androidTest/debug;file://$MODULE_DIR$/../../../akono/build/generated/res/resValues/androidTest/debug"
/>
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="PROJECT_TYPE" value="1" />
</configuration>
</facet>
<facet type="kotlin-language" name="Kotlin">
- <configuration version="3" platform="JVM 1.6" allPlatforms="JVM [1.6]"
useProjectSettings="false"
pureKotlinSourceFolders="$MODULE_DIR$/src/debug/kotlin;/home/dold/repos/akono/akono/src/debug/java;/home/dold/repos/akono/akono/src/release/kotlin;/home/dold/repos/akono/akono/src/release/java;/home/dold/repos/akono/akono/src/debugAndroidTest/kotlin;/home/dold/repos/akono/akono/src/debugUnitTest/kotlin;/home/dold/repos/akono/akono/src/releaseUnitTest/kotlin">
+ <configuration version="3" platform="JVM 1.6" useProjectSettings="false">
<compilerSettings />
<compilerArguments>
- <option name="destination"
value="$MODULE_DIR$/build/tmp/kotlin-classes/debug" />
+ <option name="destination"
value="$MODULE_DIR$/../../../akono/build/tmp/kotlin-classes/debug" />
<option name="classpath"
value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.21/d207ce2c9bcf17dc8e51bab4dbfdac4d013e7138/kotlin-stdlib-jdk7-1.3.21.jar:/home/dold/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.21/4bcc2012b84840e19e1e28074284cac908be0295/kotlin-stdlib-1.3.21.jar:/home/dold/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.21/f30e4a9897913e53d778f564110bafa1fef4
[...]
<option name="noStdlib" value="true" />
<option name="noReflect" value="true" />
@@ -61,23 +59,23 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
- <output
url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes"
/>
- <output-test
url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes"
/>
+ <output
url="file://$MODULE_DIR$/../../../akono/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes"
/>
+ <output-test
url="file://$MODULE_DIR$/../../../akono/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes"
/>
<exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/cpp"
isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug"
isTestSource="false" generated="true" />
+ <content url="file://$MODULE_DIR$/../../../akono">
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/cpp"
isTestSource="false" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/source/apt/debug"
isTestSource="false" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out"
isTestSource="false" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug"
isTestSource="false" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out"
isTestSource="false" generated="true" />
- <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug"
type="java-resource" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/res/resValues/debug"
type="java-resource" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug"
isTestSource="true" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/source/buildConfig/debug"
isTestSource="false" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out"
isTestSource="false" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/res/rs/debug"
type="java-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/res/resValues/debug"
type="java-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/source/apt/androidTest/debug"
isTestSource="true" generated="true" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out"
isTestSource="true" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug"
isTestSource="true" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out"
isTestSource="true" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug"
type="java-test-resource" generated="true" />
- <sourceFolder
url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug"
type="java-test-resource" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/source/buildConfig/androidTest/debug"
isTestSource="true" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out"
isTestSource="true" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/res/rs/androidTest/debug"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/res/resValues/androidTest/debug"
type="java-test-resource" />
<sourceFolder
url="file://$MODULE_DIR$/build/generated/source/apt/test/debug"
isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res"
type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources"
type="java-resource" />
@@ -87,14 +85,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders"
isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res"
type="java-test-resource" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources"
type="java-test-resource" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets"
type="java-test-resource" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl"
isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java"
isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/jni"
isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs"
isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets"
type="java-test-resource" />
@@ -103,11 +93,19 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/jni"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res"
type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources"
type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets"
type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl"
isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/java"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni"
isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false"
/>
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders"
isTestSource="false" />
@@ -115,7 +113,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl"
isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource="true" />
@@ -123,46 +121,181 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/resources"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets"
type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl"
isTestSource="true" />
- <sourceFolder url="file://$MODULE_DIR$/src/test/java"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/java"
isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true"
/>
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true"
/>
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders"
isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/.cxx" />
- <excludeFolder url="file://$MODULE_DIR$/.externalNativeBuild" />
- <excludeFolder url="file://$MODULE_DIR$/build" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out"
isTestSource="false" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out"
isTestSource="true" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/build/generated/source/apt/test/debug"
isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/res"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/resources"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/assets"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/aidl"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/jni"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/rs"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/debug/shaders"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/testDebug/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/testDebug/resources"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/testDebug/assets"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/testDebug/aidl"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/testDebug/java"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/testDebug/jni"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/testDebug/rs"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/testDebug/shaders" isTestSource="true"
/>
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/resources"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/assets"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/aidl"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/java"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/jni"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/rs"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTestDebug/shaders"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/res"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/resources"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/assets"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/aidl"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/jni"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/rs"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/main/shaders"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/androidTest/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTest/resources"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTest/assets"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/androidTest/aidl"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/androidTest/jni"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/androidTest/rs"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../akono/src/androidTest/shaders"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/res"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/resources"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/assets"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/aidl"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/jni"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/rs"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../akono/src/test/shaders"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out"
isTestSource="false" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out"
isTestSource="true" generated="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/source/apt/test/debug"
isTestSource="true" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/res"
type="java-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/debug/resources"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/assets"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/aidl"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/jni"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/rs"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/debug/shaders"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/testDebug/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/testDebug/resources"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/testDebug/assets"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/testDebug/aidl" isTestSource="true"
/>
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/testDebug/java" isTestSource="true"
/>
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/testDebug/jni"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/testDebug/rs"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/testDebug/shaders"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/resources"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/assets"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/aidl"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/java"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/jni"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/rs"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTestDebug/shaders"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/res"
type="java-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/main/resources"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/assets"
type="java-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/aidl"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/jni"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/rs"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/main/shaders"
isTestSource="false" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/resources"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/assets"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/aidl"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/jni"
isTestSource="true" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/rs" isTestSource="true"
/>
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/androidTest/shaders"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/res"
type="java-test-resource" />
+ <sourceFolder
url="file://$MODULE_DIR$/../../../akono/src/test/resources"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/assets"
type="java-test-resource" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/aidl"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/jni"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/rs"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/../../../akono/src/test/shaders"
isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/build/generated/source/r" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../akono/build/generated/source/r" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/.externalNativeBuild" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/not_namespaced_r_class_sources"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/generated/source/r" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/aapt_friendly_merged_manifests"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/annotation_processor_list"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/annotations_typedef_file"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/annotations_zip" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/apk_list" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/blame" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/check_manifest_result"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/cmake" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/compile_only_not_namespaced_r_class_jar"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/dex" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/incremental" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/intermediate-jars"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/javac" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/jniLibs" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/library_and_local_jars_jni"
/>
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/library_assets" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/library_manifest" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/merged_assets" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/merged_manifests" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/packaged-classes" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/packaged_res" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/processed_res" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/public_res" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/res" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/rs" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/shader_assets" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/shaders" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/signing_config" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/symbols" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/tmp" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/transforms" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/intermediates/validate_signing_config"
/>
+ <excludeFolder url="file://$MODULE_DIR$/../../../akono/build/kotlin" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../akono/build/outputs" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../akono/build/reports" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../akono/build/test-results" />
+ <excludeFolder url="file://$MODULE_DIR$/../../../akono/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android
SDK" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.truth:truth:0.44@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test.ext:junit:1.1.0@aar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.guava:failureaccess:1.0.1@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.errorprone:error_prone_annotations:2.3.1@jar" level="project" />
+ <orderEntry type="library" name="Gradle:
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:monitor:1.1.1@aar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test-junit:1.3.21@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test:1.3.21@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:rules:1.1.1@aar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test.ext:truth:1.1.0@aar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
org.checkerframework:checker-compat-qual:2.5.5@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:runner:1.1.1@aar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.truth:truth:0.44@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle:
androidx.lifecycle:lifecycle-common:2.0.0@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.annotation:annotation:1.0.0@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.auto.value:auto-value-annotations:1.6.3@jar" level="project" />
+ <orderEntry type="library" name="Gradle:
org.jetbrains:annotations:13.0@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test-common:1.3.21@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.j2objc:j2objc-annotations:1.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle:
junit:junit:4.12@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.googlecode.java-diff-utils:diffutils:1.3.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle:
org.hamcrest:hamcrest-core:1.3@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
net.sf.kxml:kxml2:2.3.0@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.guava:guava:27.0.1-android@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.guava:failureaccess:1.0.1@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava@jar"
level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:core:1.1.0@aar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
androidx.annotation:annotation:1.0.0@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test:1.3.21@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test-annotations-common:1.3.21@jar" level="project"
/>
<orderEntry type="library" scope="TEST" name="Gradle:
com.google.code.findbugs:jsr305:3.0.2@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
org.checkerframework:checker-compat-qual:2.5.5@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.errorprone:error_prone_annotations:2.3.1@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.j2objc:j2objc-annotations:1.1@jar" level="project" />
+ <orderEntry type="library" name="Gradle:
org.jetbrains.kotlin:kotlin-stdlib:1.3.21@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle:
org.codehaus.mojo:animal-sniffer-annotations:1.17@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.googlecode.java-diff-utils:diffutils:1.3.0@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
com.google.auto.value:auto-value-annotations:1.6.3@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test-common:1.3.21@jar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
org.jetbrains.kotlin:kotlin-test-annotations-common:1.3.21@jar" level="project"
/>
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test.ext:junit:1.1.0@aar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test.ext:truth:1.1.0@aar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:core:1.1.0@aar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:rules:1.1.1@aar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:runner:1.1.1@aar" level="project" />
- <orderEntry type="library" scope="TEST" name="Gradle:
androidx.test:monitor:1.1.1@aar" level="project" />
<orderEntry type="library" name="Gradle:
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21@jar" level="project" />
- <orderEntry type="library" name="Gradle:
org.jetbrains.kotlin:kotlin-stdlib:1.3.21@jar" level="project" />
- <orderEntry type="library" name="Gradle:
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.21@jar" level="project" />
- <orderEntry type="library" name="Gradle:
org.jetbrains:annotations:13.0@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava@jar"
level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
com.google.guava:guava:27.0.1-android@jar" level="project" />
+ <orderEntry type="library" scope="TEST" name="Gradle:
net.sf.kxml:kxml2:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: android.test.mock-android-28"
level="project" />
<orderEntry type="library" name="Gradle: android.test.base-android-28"
level="project" />
<orderEntry type="library" name="Gradle: android.test.runner-android-28"
level="project" />
diff --git a/akono/build.gradle.kts b/akono/build.gradle.kts
index 1fdda41d..b98510db 100644
--- a/akono/build.gradle.kts
+++ b/akono/build.gradle.kts
@@ -8,11 +8,11 @@ plugins {
android {
compileSdkVersion(28)
defaultConfig {
- minSdkVersion(17)
+ minSdkVersion(26)
targetSdkVersion(28)
versionCode = 1
- versionName = "0.0.1"
+ versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// Specifies the application ID for the test APK.
diff --git a/akono/src/main/cpp/akono-jni.cpp b/akono/src/main/cpp/akono-jni.cpp
index 069f3774..0480eea5 100644
--- a/akono/src/main/cpp/akono-jni.cpp
+++ b/akono/src/main/cpp/akono-jni.cpp
@@ -3,10 +3,6 @@
#include <libplatform/libplatform.h>
#include <v8.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-
-
#define NODE_WANT_INTERNALS 1
#include <node.h>
@@ -18,9 +14,6 @@
#include <node_native_module_env.h>
-pthread_mutex_t node_loop_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-
// Provide stubs so that libnode.so links properly
namespace node {
@@ -42,12 +35,12 @@ namespace node {
static int pfd[2];
static pthread_t thr;
-static const char *tag = "akono";
+static const char *tag = "myapp";
static void *thread_func(void *) {
ssize_t rdsz;
- char buf[1024];
+ char buf[128];
while ((rdsz = read(pfd[0], buf, sizeof buf - 1)) > 0) {
if (buf[rdsz - 1] == '\n') --rdsz;
buf[rdsz] = 0; /* add null-terminator */
@@ -60,7 +53,8 @@ static void mylog(const char *msg) {
__android_log_write(ANDROID_LOG_DEBUG, tag, msg);
}
-int start_logger() {
+int start_logger(const char *app_name) {
+ tag = app_name;
/* make stdout line-buffered and stderr unbuffered */
setvbuf(stdout, 0, _IOLBF, 0);
@@ -121,24 +115,28 @@ static void loadModuleCallback(const
v8::FunctionCallbackInfo<v8::Value> &args);
static void getDataCallback(const v8::FunctionCallbackInfo<v8::Value> &args);
static const char *main_code = "global.__akono_run = (x) => {"
- " setImmediate(() => global.eval(x));"
- " return; "
+ " console.log('running code', x);"
+ " global.eval(x);"
"};"
""
"global.__akono_onMessage = (x) => {"
- " console.log('got unhandled
__akono_onMessage', x);"
+ " console.log('got __akono_onMessage', x);"
"};"
""
"mod = require('module');"
"mod._saved_findPath = mod._findPath;"
"mod._akonoMods = {};"
"mod._findPath = (request, paths, isMain) => {"
+ " console.log('in _findPath');"
" const res = mod._saved_findPath(request,
paths, isMain);"
" if (res !== false) return res;"
" const args = JSON.stringify({ request,
paths});"
" const loadResult =
JSON.parse(global.__akono_loadModule(args));"
+ " console.log('got loadModule result');"
" if (!loadResult) return false;"
+ " console.log('loadModule path is',
loadResult.path);"
" mod._akonoMods[loadResult.path] =
loadResult;"
+ " console.log('returning path',
loadResult.path);"
" return loadResult.path;"
"};"
""
@@ -151,19 +149,24 @@ static const char *main_code = "global.__akono_run = (x)
=> {"
""
"mod._saved_js_extension =
mod._extensions[\".js\"];"
"mod._extensions[\".js\"] = (module, filename)
=> {"
+ " console.log('handling js extension',
[module, filename]);"
" if (mod._akonoMods.hasOwnProperty(filename))
{"
" const akmod = mod._akonoMods[filename];"
+ " console.log('found mod');"
" const content = akmod.content;"
" module._compile(stripBOM(content),
filename);"
" return;"
" }"
+ " console.log('falling back');"
" return mod._saved_js_extension(module,
filename);"
"};"
""
"mod._saved_json_extension =
mod._extensions[\".json\"];"
"mod._extensions[\".json\"] = (module,
filename) => {"
+ " console.log('handling json extension',
[module, filename]);"
" if (mod._akonoMods.hasOwnProperty(filename))
{"
" const akmod = mod._akonoMods[filename];"
+ " console.log('found mod');"
" const content = akmod.content;"
" try {"
" module.exports =
JSON.parse(stripBOM(content));"
@@ -173,6 +176,7 @@ static const char *main_code = "global.__akono_run = (x) =>
{"
" throw err;"
" }"
" }"
+ " console.log('falling back');"
" return mod._saved_json_extension(module,
filename);"
"};"
"";
@@ -182,8 +186,8 @@ class NativeAkonoInstance {
private:
static bool logInitialized;
static bool v8Initialized;
+ //static std::unique_ptr<v8::Platform> platform;
static node::MultiIsolatePlatform *platform;
- static NativeAkonoInstance *singleton_instance;
public:
v8::Isolate *isolate;
node::Environment *environment;
@@ -191,17 +195,16 @@ public:
uv_async_t async_notify;
uv_loop_t *loop;
bool breakRequested = false;
+ JNIEnv *currentJniEnv = nullptr;
jobject currentJniThiz = nullptr;
- JavaVM *javaVm = nullptr;
-
- static NativeAkonoInstance *getInstance();
NativeAkonoInstance() : globalContext() {
loop = uv_default_loop();
uv_async_init(loop, &async_notify, notifyCb);
+ async_notify.data = this;
if (!logInitialized) {
- start_logger();
+ start_logger("myapp");
logInitialized = true;
}
@@ -302,18 +305,17 @@ public:
* @param env JNI env of the thread we're running in.
*/
void runNode() {
- v8::Locker v8Locker(isolate);
- v8::Isolate::Scope isolate_scope(isolate);
- v8::HandleScope handle_scope(isolate);
- v8::Local<v8::Context> context = globalContext.Get(isolate);
- v8::Context::Scope context_scope(context);
- this->breakRequested = false;
- while (1) {
- uv_run(uv_default_loop(), UV_RUN_ONCE);
- platform->DrainTasks(isolate);
- if (this->breakRequested)
- break;
- }
+ v8::Isolate::Scope isolate_scope(isolate);
+ v8::HandleScope handle_scope(isolate);
+ v8::Local<v8::Context> context = globalContext.Get(isolate);
+ v8::Context::Scope context_scope(context);
+ this->breakRequested = false;
+ while (1) {
+ uv_run(uv_default_loop(), UV_RUN_ONCE);
+ platform->DrainTasks(isolate);
+ if (this->breakRequested)
+ break;
+ }
}
/**
@@ -322,7 +324,7 @@ public:
* Must not be called from a different thread.
*/
void makeCallback(const char *code) {
- v8::Locker v8Locker(isolate);
+ mylog("in makeCallback");
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = globalContext.Get(isolate);
@@ -332,6 +334,7 @@ public:
v8::String::NewFromUtf8(isolate, code,
v8::NewStringType::kNormal).ToLocalChecked()
};
+ mylog("calling node::MakeCallback");
node::MakeCallback(isolate, global, "__akono_run", 1, argv, {0, 0});
}
@@ -340,6 +343,8 @@ public:
}
jstring evalJs(JNIEnv *env, jstring sourceString) {
+ mylog("begin evalJs");
+
JStringValue jsv(env, sourceString);
v8::Isolate::Scope isolate_scope(isolate);
@@ -365,10 +370,14 @@ public:
// Compile the source code.
v8::Local<v8::Script> script;
+ mylog("about to compile script");
+
if (!v8::Script::Compile(context, source).ToLocal(&script)) {
return nullptr;
}
+ mylog("about to run script");
+
// Run the script to get the result.
v8::Local<v8::Value> result;
if (!script->Run(context).ToLocal(&result)) {
@@ -376,9 +385,13 @@ public:
return nullptr;
}
+ mylog("converting script result value");
+
// Convert the result to an UTF8 string and print it.
v8::String::Utf8Value utf8(isolate, result);
+ mylog("about to return value");
+
return env->NewStringUTF(*utf8);
}
}
@@ -388,45 +401,35 @@ public:
bool NativeAkonoInstance::v8Initialized = false;
bool NativeAkonoInstance::logInitialized = false;
node::MultiIsolatePlatform *NativeAkonoInstance::platform = nullptr;
-NativeAkonoInstance *NativeAkonoInstance::singleton_instance = nullptr;
-
-NativeAkonoInstance *NativeAkonoInstance::getInstance() {
- if (nullptr == NativeAkonoInstance::singleton_instance) {
- NativeAkonoInstance::singleton_instance = new NativeAkonoInstance();
- }
- return NativeAkonoInstance::singleton_instance;
-
-}
void notifyCb(uv_async_t *async) {
- NativeAkonoInstance *akono = NativeAkonoInstance::getInstance();
- v8::Locker v8Locker(akono->isolate);
+ NativeAkonoInstance *akono = (NativeAkonoInstance *) async->data;
+ mylog("async notifyCb called!");
akono->breakRequested = true;
}
-
static void sendMessageCallback(const v8::FunctionCallbackInfo<v8::Value>
&args) {
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
- v8::Locker v8Locker(myInstance->isolate);
if (args.Length() < 1) return;
v8::Isolate *isolate = args.GetIsolate();
v8::HandleScope scope(isolate);
v8::Local<v8::Value> arg = args[0];
v8::String::Utf8Value value(isolate, arg);
+ mylog("sendMessageCallback called, yay!");
- JNIEnv *env;
+ v8::Local<v8::Object> data = v8::Local<v8::Object>::Cast(args.Data());
- if (JNI_OK != myInstance->javaVm->GetEnv((void **) &env, JNI_VERSION_1_6))
{
- mylog("FATAL ERROR: could not get JVM env handle");
- return;
- }
+ mylog("getting instance");
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
data->GetAlignedPointerFromInternalField(0);
+
+ JNIEnv *env = myInstance->currentJniEnv;
if (env == nullptr) {
mylog("FATAL: JNI env is nullptr");
return;
}
+ mylog("finding class");
jclass clazz = env->FindClass("akono/AkonoJni");
if (clazz == nullptr) {
@@ -434,35 +437,46 @@ static void sendMessageCallback(const
v8::FunctionCallbackInfo<v8::Value> &args)
return;
}
- jstring jstr = env->NewStringUTF(*value);
+ mylog("creating strings");
+ jstring jstr1 = env->NewStringUTF("message");
+ jstring jstr2 = env->NewStringUTF(*value);
+
+ mylog("getting method");
- jmethodID meth = env->GetMethodID(clazz, "internalOnNotify",
"(Ljava/lang/String;)V");
+ jmethodID meth = env->GetMethodID(clazz, "internalOnNotify",
"(Ljava/lang/String;Ljava/lang/String;)V");
if (meth == nullptr) {
mylog("FATAL: method not found");
return;
}
- env->CallVoidMethod(myInstance->currentJniThiz, meth, jstr);
+ mylog("calling method");
+
+ env->CallVoidMethod(myInstance->currentJniThiz, meth, jstr1, jstr2);
}
static void loadModuleCallback(const v8::FunctionCallbackInfo<v8::Value>
&args) {
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
- v8::Locker v8Locker(myInstance->isolate);
if (args.Length() < 1) return;
v8::Isolate *isolate = args.GetIsolate();
v8::HandleScope scope(isolate);
v8::Local<v8::Value> arg = args[0];
v8::String::Utf8Value value(isolate, arg);
+ mylog("sendMessageCallback called, yay!");
- JNIEnv *env;
+ v8::Local<v8::Object> data = v8::Local<v8::Object>::Cast(args.Data());
+
+ mylog("getting instance");
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
data->GetAlignedPointerFromInternalField(0);
+
+ JNIEnv *env = myInstance->currentJniEnv;
- if (JNI_OK != myInstance->javaVm->GetEnv((void **) &env, JNI_VERSION_1_6))
{
- mylog("FATAL ERROR: could not get JVM env handle");
+ if (env == nullptr) {
+ mylog("FATAL: JNI env is nullptr");
return;
}
+ mylog("finding class");
jclass clazz = env->FindClass("akono/AkonoJni");
if (clazz == nullptr) {
@@ -470,8 +484,11 @@ static void loadModuleCallback(const
v8::FunctionCallbackInfo<v8::Value> &args)
return;
}
+ mylog("creating strings");
jstring jstr1 = env->NewStringUTF(*value);
+ mylog("getting method");
+
jmethodID meth = env->GetMethodID(clazz, "internalOnModuleLoad",
"(Ljava/lang/String;)Ljava/lang/String;");
if (meth == nullptr) {
@@ -479,6 +496,8 @@ static void loadModuleCallback(const
v8::FunctionCallbackInfo<v8::Value> &args)
return;
}
+ mylog("calling method");
+
jstring jresult = (jstring)
env->CallObjectMethod(myInstance->currentJniThiz, meth, jstr1);
JStringValue resultStringValue(env, jresult);
@@ -494,24 +513,24 @@ static void loadModuleCallback(const
v8::FunctionCallbackInfo<v8::Value> &args)
static void getDataCallback(const v8::FunctionCallbackInfo<v8::Value> &args) {
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
- v8::Locker v8Locker(myInstance->isolate);
if (args.Length() < 1) return;
v8::Isolate *isolate = args.GetIsolate();
v8::HandleScope scope(isolate);
v8::Local<v8::Value> arg = args[0];
v8::String::Utf8Value value(isolate, arg);
+ mylog("getDataCallback called");
v8::Local<v8::Object> data = v8::Local<v8::Object>::Cast(args.Data());
+ mylog("getting instance");
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
data->GetAlignedPointerFromInternalField(0);
- JNIEnv *env;
-
- if (JNI_OK != myInstance->javaVm->GetEnv((void **) &env, JNI_VERSION_1_6))
{
- mylog("FATAL ERROR: could not get JVM env handle");
+ JNIEnv *env = myInstance->currentJniEnv;
+ if (env == nullptr) {
+ mylog("FATAL: JNI env is nullptr");
return;
}
-
+ mylog("finding class");
jclass clazz = env->FindClass("akono/AkonoJni");
if (clazz == nullptr) {
@@ -519,8 +538,11 @@ static void getDataCallback(const
v8::FunctionCallbackInfo<v8::Value> &args) {
return;
}
+ mylog("creating strings");
jstring jstr1 = env->NewStringUTF(*value);
+ mylog("getting method");
+
jmethodID meth = env->GetMethodID(clazz, "internalOnGetData",
"(Ljava/lang/String;)Ljava/lang/String;");
if (meth == nullptr) {
@@ -528,6 +550,8 @@ static void getDataCallback(const
v8::FunctionCallbackInfo<v8::Value> &args) {
return;
}
+ mylog("calling method");
+
jstring jresult = (jstring)
env->CallObjectMethod(myInstance->currentJniThiz, meth, jstr1);
JStringValue resultStringValue(env, jresult);
@@ -542,45 +566,45 @@ static void getDataCallback(const
v8::FunctionCallbackInfo<v8::Value> &args) {
}
-extern "C" JNIEXPORT void JNICALL
+extern "C" JNIEXPORT jobject JNICALL
Java_akono_AkonoJni_initNative(JNIEnv *env, jobject thiz) {
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
- if (nullptr != myInstance->currentJniThiz) {
- env->DeleteGlobalRef(myInstance->currentJniThiz);
- }
- myInstance->currentJniThiz = env->NewGlobalRef(thiz);
- if (0 != env->GetJavaVM(&myInstance->javaVm))
- mylog("FATAL ERROR: could not get Java VM");
+ NativeAkonoInstance *myInstance = new NativeAkonoInstance();
+ return env->NewDirectByteBuffer(myInstance, 0);
}
extern "C" JNIEXPORT void JNICALL
-Java_akono_AkonoJni_destroyNative(JNIEnv *env, jobject thiz) {
- // FIXME: not implemented
+Java_akono_AkonoJni_destroyNative(JNIEnv *env, jobject thiz, jobject buf) {
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
env->GetDirectBufferAddress(buf);
+ delete myInstance;
}
extern "C" JNIEXPORT jstring JNICALL
-Java_akono_AkonoJni_evalJs(JNIEnv *env, jobject thiz, jstring sourceStr) {
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
+Java_akono_AkonoJni_evalJs(JNIEnv *env, jobject thiz, jstring sourceStr,
jobject buf) {
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
env->GetDirectBufferAddress(buf);
return myInstance->evalJs(env, sourceStr);
}
extern "C" JNIEXPORT void JNICALL
-Java_akono_AkonoJni_notifyNative(JNIEnv *env, jobject thiz) {
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
+Java_akono_AkonoJni_notifyNative(JNIEnv *env, jobject thiz, jobject buf) {
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
env->GetDirectBufferAddress(buf);
uv_async_send(&myInstance->async_notify);
}
extern "C" JNIEXPORT void JNICALL
-Java_akono_AkonoJni_runNode(JNIEnv *env, jobject thiz) {
- NativeAkonoInstance *myInstance =NativeAkonoInstance::getInstance();
+Java_akono_AkonoJni_runNode(JNIEnv *env, jobject thiz, jobject buf) {
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
env->GetDirectBufferAddress(buf);
+ myInstance->currentJniEnv = env;
+ myInstance->currentJniThiz = thiz;
myInstance->runNode();
}
extern "C" JNIEXPORT void JNICALL
-Java_akono_AkonoJni_makeCallbackNative(JNIEnv *env, jobject thiz, jstring
sourceStr) {
+Java_akono_AkonoJni_makeCallbackNative(JNIEnv *env, jobject thiz, jstring
sourceStr, jobject buf) {
JStringValue jsv(env, sourceStr);
- NativeAkonoInstance *myInstance = NativeAkonoInstance::getInstance();
+ NativeAkonoInstance *myInstance = (NativeAkonoInstance *)
env->GetDirectBufferAddress(buf);
+ myInstance->currentJniEnv = env;
+ myInstance->currentJniThiz = thiz;
return myInstance->makeCallback(*jsv);
}
diff --git a/akono/src/main/java/akono/AkonoJni.kt
b/akono/src/main/java/akono/AkonoJni.kt
index ef867a85..0ba31ee8 100644
--- a/akono/src/main/java/akono/AkonoJni.kt
+++ b/akono/src/main/java/akono/AkonoJni.kt
@@ -3,13 +3,15 @@ package akono
import android.util.Base64
import android.util.Log
import org.json.JSONObject
+import java.lang.Exception
+import java.nio.ByteBuffer
import java.util.concurrent.CountDownLatch
import java.util.concurrent.LinkedBlockingDeque
import kotlin.concurrent.thread
-data class ModuleResult(val path: String, val contents: String)
+typealias AkonoNativePointer = ByteBuffer
-const val TAG = "AkonoJni"
+data class ModuleResult(val path: String, val contents: String)
class AkonoJni(vararg nodeArgv: String) {
private var getDataHandler: GetDataHandler? = null
@@ -19,15 +21,16 @@ class AkonoJni(vararg nodeArgv: String) {
private val workQueue = LinkedBlockingDeque<() -> Unit>()
- private external fun evalJs(source: String): String
- private external fun runNode()
+ private external fun evalJs(source: String, p: AkonoNativePointer): String
+ private external fun runNode(p: AkonoNativePointer)
- private external fun makeCallbackNative(source: String)
+ private external fun makeCallbackNative(source: String, p:
AkonoNativePointer)
- private external fun destroyNative()
- private external fun initNative(nodeArgv: Array<out String>)
- private external fun notifyNative()
+ private external fun destroyNative(b: AkonoNativePointer)
+ private external fun initNative(nodeArgv: Array<out String>):
AkonoNativePointer
+ private external fun notifyNative(b: AkonoNativePointer)
+ private lateinit var internalNativePointer: AkonoNativePointer
private val jniThread: Thread
@@ -46,22 +49,19 @@ class AkonoJni(vararg nodeArgv: String) {
* Called by node/v8 from its thread.
*/
@Suppress("unused")
- private fun internalOnNotify(payload: String) {
- try {
- messageHandler?.handleMessage(payload)
- } catch (e: Throwable) {
- Log.e(TAG, "unexpected exception in message handler", e)
- }
+ private fun internalOnNotify(type: String, payload: String) {
+ messageHandler?.handleMessage(payload)
}
/**
* Called by node/v8 from its thread.
*/
@Suppress("unused")
- private fun internalOnModuleLoad(loadInfoStr: String): String? {
+ private fun internalOnModuleLoad(loadInfoStr: String): String {
try {
val loadInfo = JSONObject(loadInfoStr)
val request: String = loadInfo.getString("request")
+ Log.i("myapp", "request is $request")
val paths = ArrayList<String>()
val pathsJson = loadInfo.getJSONArray("paths")
for (i in 0 until pathsJson.length()) {
@@ -79,12 +79,12 @@ class AkonoJni(vararg nodeArgv: String) {
result.put("content", modResult.contents)
return result.toString()
} else {
- Log.w(TAG, "no module load handler registered")
- return null
+ Log.w("myapp", "no module load handler registered")
+ return "null"
}
- } catch (e: Throwable) {
- Log.e(TAG, "exception during internalOnModuleLoad", e)
- return null
+ } catch (e: Exception) {
+ Log.e("myapp", "exception during internalOnModuleLoad: $e")
+ return "null"
}
}
@@ -93,18 +93,13 @@ class AkonoJni(vararg nodeArgv: String) {
*/
@Suppress("unused")
private fun internalOnGetData(what: String): String? {
- try {
- val data = getDataHandler?.handleGetData(what) ?: return null
- return Base64.encodeToString(data, Base64.NO_WRAP)
- } catch (e: Throwable) {
- Log.e(TAG, "exception during internalOnGetData", e)
- }
- return null
+ val data = getDataHandler?.handleGetData(what) ?: return null
+ return Base64.encodeToString(data, Base64.NO_WRAP)
}
- fun sendNotify() {
+ fun notifyNative() {
initializedLatch.await()
- notifyNative()
+ notifyNative(internalNativePointer)
}
/**
@@ -114,7 +109,7 @@ class AkonoJni(vararg nodeArgv: String) {
val latch = CountDownLatch(1)
var result: String? = null
scheduleNodeThread {
- result = evalJs(source)
+ result = evalJs(source, internalNativePointer)
latch.countDown()
}
latch.await()
@@ -123,7 +118,7 @@ class AkonoJni(vararg nodeArgv: String) {
fun evalNodeCode(source: String) {
scheduleNodeThread {
- makeCallbackNative(source)
+ makeCallbackNative(source, internalNativePointer)
}
}
@@ -147,7 +142,7 @@ class AkonoJni(vararg nodeArgv: String) {
*
*/
fun waitStopped(): Unit {
- Log.i(TAG, "waiting for stop")
+ Log.i("myapp", "waiting for stop")
scheduleNodeThread {
stopped = true
}
@@ -175,15 +170,15 @@ class AkonoJni(vararg nodeArgv: String) {
@Override
protected fun finalize() {
- destroyNative()
+ destroyNative(internalNativePointer)
}
init {
jniThread = thread {
- initNative(nodeArgv)
+ internalNativePointer = initNative(nodeArgv)
initializedLatch.countDown()
while (true) {
- runNode()
+ runNode(internalNativePointer)
while (true) {
val w = workQueue.poll() ?: break
w()
@@ -196,6 +191,7 @@ class AkonoJni(vararg nodeArgv: String) {
}
companion object {
+
init {
System.loadLibrary("akono-jni")
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-akono] branch master updated (731ac695 -> 307baaf5),
gnunet <=