Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ jobs:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}

- name: Initialize submodules
run: |
git submodule update --init --recursive
ls -la app/src/main/jni/Openterface_Core/
ls -la app/src/main/jni/Openterface_Core/include/

- name: Set up Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -52,6 +58,29 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Set up Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r23b
local-cache: true

- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.22.1'

- name: Verify tools
run: |
echo "NDK: $ANDROID_NDK_HOME"
echo "CMake: $(cmake --version)"
ls -la $ANDROID_NDK_HOME/cmake/ 2>/dev/null || echo "No cmake in NDK"

- name: Clean Gradle cache
run: |
rm -rf ~/.gradle/caches/
rm -rf ~/.gradle/native/
rm -rf app/.cxx/ 2>/dev/null || true

- name: Bump Version
if: github.event.inputs.version_bump != 'none' && github.event.inputs.version_bump != ''
id: bump_version
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "Openterface_WebUI"]
path = Openterface_WebUI
url = https://github.com/TechxArtisanStudio/Openterface_WebUI.git
[submodule "app/src/main/jni/Openterface_Core"]
path = app/src/main/jni/Openterface_Core
url = https://github.com/TechxArtisanStudio/Openterface_Core.git
14 changes: 14 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@ android {
assets.srcDirs += ['src/main/assets', '../Openterface_WebUI/packages/webrtc/dist/webrtc-android']
}
}

// Build Openterface_Core native library
externalNativeBuild {
cmake {
path "src/main/jni/CMakeLists.txt"
}
}

// Package native libraries
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
}

// Task to build WebRTC client from WebUI submodule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@

import com.openterface.AOS.R;
import com.openterface.AOS.activity.MainActivity;
import com.openterface.AOS.target.KeyBoardManager;
import com.openterface.AOS.target.HidManager;
// import com.openterface.AOS.target.KeyBoardManager;
import com.openterface.AOS.target.KeyBoardMapping;

import java.util.HashMap;
Expand Down Expand Up @@ -208,10 +209,10 @@ private void handleShortcut(String Function_buttonId) {
// String FunctionKeyCtrlPress;
// if (KeyBoard_ShIft_Press_state){
// FunctionKeyCtrlPress = "Shift";
// KeyBoardManager.sendKeyBoardFunction(FunctionKeyCtrlPress, Function_buttonId);
// HidManager.sendKeyBoardFunction(FunctionKeyCtrlPress, Function_buttonId);
// }else{
// FunctionKeyCtrlPress = "ShortCutKeyNull";
// KeyBoardManager.sendKeyBoardFunction(FunctionKeyCtrlPress, Function_buttonId);
// HidManager.sendKeyBoardFunction(FunctionKeyCtrlPress, Function_buttonId);
// }
// System.out.println("Shift State: " + KeyBoard_ShIft_Press_state);

Expand Down Expand Up @@ -242,7 +243,7 @@ private void handleShortcut(String Function_buttonId) {
}else{
FunctionKeyWinPress = "ShortCutKeyWinNull";
}
KeyBoardManager.sendKeyBoardFunction(FunctionKeyCtrlPress, FunctionKeyShiftPress, FunctionKeyAltPress, FunctionKeyWinPress, Function_buttonId);
HidManager.sendKeyBoardFunction(FunctionKeyCtrlPress, FunctionKeyShiftPress, FunctionKeyAltPress, FunctionKeyWinPress, Function_buttonId);
System.out.println("Shift State: " + KeyBoard_ShIft_Press_state);

}
Expand Down Expand Up @@ -281,15 +282,15 @@ private void handleKeyPress(String Function_buttonId) {
}

// Send key press without automatic release
KeyBoardManager.sendKeyBoardFunctionPress(FunctionKeyCtrlPress, FunctionKeyShiftPress, FunctionKeyAltPress, FunctionKeyWinPress, Function_buttonId);
HidManager.sendKeyBoardFunctionPress(FunctionKeyCtrlPress, FunctionKeyShiftPress, FunctionKeyAltPress, FunctionKeyWinPress, Function_buttonId);
Log.d("KeyBoardFunction", "Key press sent - Shift State: " + KeyBoard_ShIft_Press_state);
}

/**
* Handle key release event - send key release command
*/
private void handleKeyRelease() {
KeyBoardManager.sendKeyBoardRelease();
HidManager.sendKeyBoardRelease();
Log.d("KeyBoardFunction", "Key released");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

import com.openterface.AOS.R;
import com.openterface.AOS.activity.MainActivity;
import com.openterface.AOS.target.KeyBoardManager;
import com.openterface.AOS.target.HidManager;
// import com.openterface.AOS.target.KeyBoardManager;

public class KeyBoardShortCut {
private final Button[] ShortCutButtons;
Expand Down Expand Up @@ -77,7 +78,7 @@ public KeyBoardShortCut(MainActivity activity) {

private void ShortCutButtonListeners() {
ShortCutButtons[ShortCutButtons.length - 1].setOnClickListener(v -> {
KeyBoardManager.sendKeyBoardFunctionCtrlAltDel();
HidManager.sendKeyBoardFunctionCtrlAltDel();
});

for (Button button : ShortCutButtons) {
Expand Down Expand Up @@ -136,7 +137,7 @@ private String getKey(int buttonId) {
}

private void handleShortcut(String modifier, String key) {
KeyBoardManager.sendKeyBoardShortCut(modifier, key);
HidManager.sendKeyBoardShortCut(modifier, key);
}

public void setShortCutButtonsClickColor(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

import com.openterface.AOS.R;
import com.openterface.AOS.activity.MainActivity;
import com.openterface.AOS.target.KeyBoardManager;
import com.openterface.AOS.target.HidManager;
// import com.openterface.AOS.target.KeyBoardManager;
import com.openterface.AOS.target.KeyBoardMapping;

import java.util.ArrayList;
Expand Down Expand Up @@ -364,31 +365,31 @@ private void activateModifier(View v, boolean[] isLocked) {
if (id == R.id.Key_Ctrl) {
KeyBoard_Ctrl_Press(true);
KeyBoardFunction.KeyBoard_Ctrl_Press(true);
KeyBoardManager.sendModifierPress("Ctrl");
HidManager.sendModifierPress("Ctrl");
} else if (id == R.id.Key_CtrlGr) {
KeyBoard_Ctrl_Press(true);
KeyBoardFunction.KeyBoard_Ctrl_Press(true);
KeyBoardManager.sendModifierPress("CtrlR");
HidManager.sendModifierPress("CtrlR");
} else if (id == R.id.Key_Alt) {
KeyBoard_Alt_Press(true);
KeyBoardFunction.KeyBoard_Alt_Press(true);
KeyBoardManager.sendModifierPress("Alt");
HidManager.sendModifierPress("Alt");
} else if (id == R.id.Key_AltGr) {
KeyBoard_Alt_Press(true);
KeyBoardFunction.KeyBoard_Alt_Press(true);
KeyBoardManager.sendModifierPress("AltR");
HidManager.sendModifierPress("AltR");
} else if (id == R.id.Key_Win) {
KeyBoard_Win_Press(true);
KeyBoardFunction.KeyBoard_Win_Press(true);
KeyBoardManager.sendModifierPress("Win");
HidManager.sendModifierPress("Win");
} else if (id == R.id.Key_LeftShift) {
KeyBoard_ShIft_Press(true);
KeyBoardFunction.KeyBoard_ShIft_Press(true);
KeyBoardManager.sendModifierPress("Shift");
HidManager.sendModifierPress("Shift");
} else if (id == R.id.Key_RightShift) {
KeyBoard_ShIft_Press(true);
KeyBoardFunction.KeyBoard_ShIft_Press(true);
KeyBoardManager.sendModifierPress("ShiftR");
HidManager.sendModifierPress("ShiftR");
}
}

Expand All @@ -401,19 +402,19 @@ private void deactivateModifier(View v, boolean[] isLocked) {
if (id == R.id.Key_Ctrl || id == R.id.Key_CtrlGr) {
KeyBoard_Ctrl_Press(false);
KeyBoardFunction.KeyBoard_Ctrl_Press(false);
KeyBoardManager.sendModifierRelease();
HidManager.sendModifierRelease();
} else if (id == R.id.Key_Alt || id == R.id.Key_AltGr) {
KeyBoard_Alt_Press(false);
KeyBoardFunction.KeyBoard_Alt_Press(false);
KeyBoardManager.sendModifierRelease();
HidManager.sendModifierRelease();
} else if (id == R.id.Key_Win) {
KeyBoard_Win_Press(false);
KeyBoardFunction.KeyBoard_Win_Press(false);
KeyBoardManager.sendModifierRelease();
HidManager.sendModifierRelease();
} else if (id == R.id.Key_LeftShift || id == R.id.Key_RightShift) {
KeyBoard_ShIft_Press(false);
KeyBoardFunction.KeyBoard_ShIft_Press(false);
KeyBoardManager.sendModifierRelease();
HidManager.sendModifierRelease();
}
}

Expand Down Expand Up @@ -453,7 +454,7 @@ private void handleShortcut(String System_buttonId) {
}else{
SystemKeyWinPress = "ShortCutKeyWinNull";
}
KeyBoardManager.sendKeyBoardFunction(SystemKeyCtrlPress, SystemKeyShiftPress, SystemKeyAltPress, SystemKeyWinPress, System_buttonId);
HidManager.sendKeyBoardFunction(SystemKeyCtrlPress, SystemKeyShiftPress, SystemKeyAltPress, SystemKeyWinPress, System_buttonId);
System.out.println("Shift State: " + KeyBoard_ShIft_Press_state);

}
Expand Down Expand Up @@ -499,7 +500,7 @@ private void handleKeyPress(String System_buttonId) {
", Win:" + SystemKeyWinPress);

// Send key press without automatic release
KeyBoardManager.sendKeyBoardFunctionPress(SystemKeyCtrlPress, SystemKeyShiftPress, SystemKeyAltPress, SystemKeyWinPress, System_buttonId);
HidManager.sendKeyBoardFunctionPress(SystemKeyCtrlPress, SystemKeyShiftPress, SystemKeyAltPress, SystemKeyWinPress, System_buttonId);
Log.e("KeyBoardSystem", "🟢 Key press command sent - Shift State: " + KeyBoard_ShIft_Press_state);
}

Expand All @@ -508,7 +509,7 @@ private void handleKeyPress(String System_buttonId) {
*/
private void handleKeyRelease() {
Log.e("KeyBoardSystem", "🔴 handleKeyRelease called");
KeyBoardManager.sendKeyBoardRelease();
HidManager.sendKeyBoardRelease();
Log.e("KeyBoardSystem", "🔴 Key release command sent");
}

Expand Down
Loading
Loading