aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-08-14 21:40:16 +1200
committerArslaan Pathan <[email protected]>2026-08-14 21:40:16 +1200
commit0c8f073917f39499b770c57886df1db6e3358b15 (patch)
tree8b2995afc4f6acce0f2b7b98f0d15b32c8ac7899
parent49e1af00eead09f2d436d38320ce4d6e46a7cef4 (diff)
downloadmoku-assistant-0c8f073917f39499b770c57886df1db6e3358b15.tar.xz
moku-assistant-0c8f073917f39499b770c57886df1db6e3358b15.zip
Change color to red and add vosk to the build system
-rw-r--r--.gitignore4
-rw-r--r--AndroidManifest.xml2
-rw-r--r--Makefile16
-rw-r--r--README.md2
-rw-r--r--jni/Android.mk7
-rw-r--r--jni/Application.mk2
-rw-r--r--jni/main.c7
7 files changed, 32 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 9837d7a..aba59d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,10 @@
libs/
obj/
apk/
+vosk/
+tmp/
+vosk-android*
+*.aar
moku-assistant.apk
moku-assistant.apk.idsig
debug.keystore
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d6724c5..c9e7cbb 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.arslaancodes.mokuassistant">
- <uses-sdk android:minSdkVersion="25" android:targetSdkVersion="34"/>
+ <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34"/>
<application android:label="moku Assistant" android:hasCode="false">
<activity android:name="android.app.NativeActivity" android:exported="true">
<meta-data android:name="android.app.lib_name"
diff --git a/Makefile b/Makefile
index e292718..dc3ca43 100644
--- a/Makefile
+++ b/Makefile
@@ -3,17 +3,27 @@
moku-assistant.apk: AndroidManifest.xml libs/arm64-v8a/libmoku.so debug.keystore
rm -rf apk
mkdir -p apk/lib/arm64-v8a
- cp libs/arm64-v8a/libmoku.so apk/lib/arm64-v8a
+ cp libs/arm64-v8a/libmoku.so apk/lib/arm64-v8a/
+ cp vosk/libvosk.so apk/lib/arm64-v8a/
aapt package -f -M AndroidManifest.xml -I $(ANDROID_SDK_ROOT)/platforms/android-34/android.jar -F moku-assistant.apk apk/
apksigner sign --ks debug.keystore --ks-pass pass:android moku-assistant.apk
-libs/arm64-v8a/libmoku.so:
+libs/arm64-v8a/libmoku.so: vosk/libvosk.so
ndk-build
+vosk/libvosk.so:
+ rm -rf tmp/vosk vosk.zip
+ wget https://repo1.maven.org/maven2/com/alphacephei/vosk-android/0.3.75/vosk-android-0.3.75.aar
+ mkdir -p ./tmp/vosk
+ mv vosk-android-0.3.75.aar ./tmp/vosk/vosk.zip
+ cd ./tmp/vosk && unzip ./vosk.zip
+ mkdir vosk
+ cp ./tmp/vosk/jni/arm64-v8a/libvosk.so vosk/libvosk.so
+
all: moku-assistant.apk
clean:
- rm -rf apk libs obj moku-assistant.apk moku-assistant.apk.idsig debug.keystore
+ rm -rf apk libs obj moku-assistant.apk moku-assistant.apk.idsig debug.keystore vosk-android-0.3.75.aar tmp vosk
debug.keystore:
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug, O=Android, C=US" -storepass android -keypass android
diff --git a/README.md b/README.md
index b7b94cf..6c7e6eb 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
# moku Assistant
+
+A lightweight Google Assistant replacement for Android, written in C and the Android NDK.
diff --git a/jni/Android.mk b/jni/Android.mk
index b3ef284..ef9d9a9 100644
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -1,12 +1,17 @@
LOCAL_PATH := $(call my-dir)
+
include $(CLEAR_VARS)
+LOCAL_MODULE := vosk
+LOCAL_SRC_FILES := ../vosk/libvosk.so
+include $(PREBUILT_SHARED_LIBRARY)
+include $(CLEAR_VARS)
LOCAL_MODULE := moku
+# _eventually_ add lvgl source files to here when i feel like making the UI
LOCAL_SRC_FILES := main.c
# LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
LOCAL_LDLIBS := -llog -landroid
LOCAL_STATIC_LIBRARIES := android_native_app_glue
-
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
diff --git a/jni/Application.mk b/jni/Application.mk
index 5c3422c..67a4e98 100644
--- a/jni/Application.mk
+++ b/jni/Application.mk
@@ -1,2 +1,2 @@
APP_ABI := arm64-v8a
-APP_PLATFORM := android-25
+APP_PLATFORM := android-26
diff --git a/jni/main.c b/jni/main.c
index 4b30090..64bb65c 100644
--- a/jni/main.c
+++ b/jni/main.c
@@ -1,3 +1,4 @@
+#include <aaudio/AAudio.h>
#include <android_native_app_glue.h>
#include <android/log.h>
#include <android/sensor.h>
@@ -32,6 +33,7 @@ struct engine {
int window_initialized;
int running;
uint64_t last_update;
+ int color;
};
struct engine *engine_new(struct android_app* app) {
@@ -46,6 +48,7 @@ struct engine *engine_new(struct android_app* app) {
engine->window_initialized = 0;
engine->app = app;
engine->running = 0;
+ engine->color = COLOR_RED;
engine->last_update = (uint64_t)0;
return engine;
@@ -78,7 +81,7 @@ static void engine_draw_frame(struct engine *engine) {
for (y = 0; y < buffer.height; y++) {
for (x = 0; x < buffer.width; x++) {
pixel_idx = y * buffer.stride + x;
- ((uint32_t*)(buffer.bits))[pixel_idx] = (uint32_t)COLOR_GREEN;
+ ((uint32_t*)(buffer.bits))[pixel_idx] = (uint32_t)engine->color;
}
}
@@ -108,7 +111,7 @@ static void engine_update(struct engine *engine) {
static void engine_real_tick(struct engine *engine) {
if (!engine->running) return;
- LOGI("tick");
+ // LOGI("tick");
engine_schedule_tick(engine);
engine_update(engine);
engine_draw_frame(engine);