Xorg: load x11 libs from usr/lib
This commit is contained in:
parent
9008a04350
commit
963d4cfe75
@ -22,124 +22,130 @@ freely, subject to the following restrictions:
|
||||
|
||||
package io.neoterm;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import java.util.Vector;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
class Globals
|
||||
{
|
||||
// These config options are modified by ChangeAppsettings.sh script - see the detailed descriptions there
|
||||
public static String ApplicationName = "XServerXSDL-NeoTerm";
|
||||
public static String AppLibraries[] = { "sdl_native_helpers", "sdl-1.2", "sdl_ttf", "crypto" };
|
||||
public static String AppMainLibraries[] = { "application", "sdl_main" };
|
||||
public static String LibraryNamesMap[][] = { { "crypto", "crypto.so.sdl.1" }, { "ssl", "ssl.so.sdl.1" }, { "curl", "curl-sdl" } }; // Because some libraries are named differently to not clash with system libs
|
||||
public static final boolean Using_SDL_1_3 = false;
|
||||
public static final boolean Using_SDL_2_0 = false;
|
||||
public static String[] DataDownloadUrl = { "!!Data files|:data.tar.gz:data-1.tgz", "!!Data files|:DroidSansMono.ttf:DroidSansMono.ttf", "Additional fonts (90Mb)|:xfonts.tar.gz:http://sourceforge.net/projects/libsdl-android/files/apk/XServer-XSDL/xfonts.tgz/download", };
|
||||
public static boolean SwVideoMode = true;
|
||||
public static boolean NeedDepthBuffer = false;
|
||||
public static boolean NeedStencilBuffer = false;
|
||||
public static boolean NeedGles2 = false;
|
||||
public static boolean NeedGles3 = false;
|
||||
public static boolean CompatibilityHacksVideo = false;
|
||||
public static boolean CompatibilityHacksForceScreenUpdateMouseClick = true;
|
||||
public static boolean CompatibilityHacksStaticInit = false;
|
||||
public static boolean CompatibilityHacksTextInputEmulatesHwKeyboard = true;
|
||||
public static int TextInputKeyboard = 0;
|
||||
public static boolean KeepAspectRatioDefaultSetting = false;
|
||||
public static boolean InhibitSuspend = true;
|
||||
public static boolean CreateService = true;
|
||||
public static String ReadmeText = "";
|
||||
public static String CommandLine = "XSDL";
|
||||
public static boolean AppUsesMouse = true;
|
||||
public static boolean AppNeedsTwoButtonMouse = true;
|
||||
public static boolean RightMouseButtonLongPress = false;
|
||||
public static boolean ForceRelativeMouseMode = true; // If both on-screen keyboard and mouse are needed, this will only set the default setting, user may override it later
|
||||
public static boolean ShowMouseCursor = false; // Draw system mouse cursor, if the app does not do it
|
||||
public static boolean ScreenFollowsMouse = true; // Move app screen make mouse cursor always visible, when soft keyboard is shown
|
||||
public static boolean AppNeedsArrowKeys = false;
|
||||
public static boolean AppNeedsTextInput = false;
|
||||
public static boolean AppUsesJoystick = false;
|
||||
public static boolean AppUsesSecondJoystick = false;
|
||||
public static boolean AppUsesThirdJoystick = false;
|
||||
public static boolean AppUsesAccelerometer = false;
|
||||
public static boolean AppUsesGyroscope = false;
|
||||
public static boolean AppUsesOrientationSensor = false;
|
||||
public static boolean AppUsesMultitouch = true;
|
||||
public static boolean NonBlockingSwapBuffers = false;
|
||||
public static boolean ResetSdlConfigForThisVersion = false;
|
||||
public static String DeleteFilesOnUpgrade = "%";
|
||||
public static int AppTouchscreenKeyboardKeysAmount = 3;
|
||||
public static String[] AppTouchscreenKeyboardKeysNames = "LCTRL LALT LSHIFT RETURN SPACE DELETE KP_PLUS KP_MINUS 1 2".split(" ");
|
||||
public static int StartupMenuButtonTimeout = 3000;
|
||||
public static int AppMinimumRAM = 0;
|
||||
public static SettingsMenu.Menu HiddenMenuOptions [] = { }; // If you see error here - update HiddenMenuOptions in your AndroidAppSettings.cfg: change OptionalDownloadConfig to SettingsMenuMisc.OptionalDownloadConfig etc.
|
||||
public static SettingsMenu.Menu FirstStartMenuOptions [] = { new SettingsMenuMisc.GyroscopeCalibration(), new SettingsMenuMisc.OptionalDownloadConfig(), };
|
||||
public static String AdmobPublisherId = "";
|
||||
public static String AdmobTestDeviceId = "";
|
||||
public static String AdmobBannerSize = "";
|
||||
public static String GooglePlayGameServicesId = "";
|
||||
class Globals {
|
||||
public static String XLIB_DIR = "/data/data/io.neoterm/files/usr/lib/";
|
||||
public static String XLIBS[] = {
|
||||
"x11_sdl_native_helpers",
|
||||
"x11_sdl-1.2",
|
||||
"x11_sdl_ttf",
|
||||
"x11_sdl_main",
|
||||
"x11_crypto",
|
||||
"x11_application",
|
||||
};
|
||||
|
||||
// Phone-specific config, modified by user in "Change phone config" startup dialog
|
||||
public static int VideoDepthBpp = 16;
|
||||
public static boolean HorizontalOrientation = true;
|
||||
public static boolean AutoDetectOrientation = false;
|
||||
public static boolean ImmersiveMode = true;
|
||||
public static boolean HideSystemMousePointer = false;
|
||||
public static boolean DownloadToSdcard = true;
|
||||
public static boolean PhoneHasArrowKeys = false;
|
||||
public static boolean UseAccelerometerAsArrowKeys = false;
|
||||
public static boolean UseTouchscreenKeyboard = true;
|
||||
public static int TouchscreenKeyboardSize = 1;
|
||||
public static final int TOUCHSCREEN_KEYBOARD_CUSTOM = 4;
|
||||
public static int TouchscreenKeyboardDrawSize = 2;
|
||||
public static int TouchscreenKeyboardTheme = 0;
|
||||
public static int TouchscreenKeyboardTransparency = 2;
|
||||
public static boolean FloatingScreenJoystick = false;
|
||||
public static int AccelerometerSensitivity = 2;
|
||||
public static int AccelerometerCenterPos = 2;
|
||||
public static int AudioBufferConfig = 0;
|
||||
public static boolean OptionalDataDownload[] = null;
|
||||
public static int LeftClickMethod = ForceRelativeMouseMode ? Mouse.LEFT_CLICK_WITH_TAP_OR_TIMEOUT : Mouse.LEFT_CLICK_NORMAL;
|
||||
public static int LeftClickKey = KeyEvent.KEYCODE_DPAD_CENTER;
|
||||
public static int LeftClickTimeout = 3;
|
||||
public static int RightClickTimeout = 4;
|
||||
public static int RightClickMethod = AppNeedsTwoButtonMouse ? Mouse.RIGHT_CLICK_WITH_MULTITOUCH : Mouse.RIGHT_CLICK_NONE;
|
||||
public static int RightClickKey = KeyEvent.KEYCODE_MENU;
|
||||
public static boolean MoveMouseWithJoystick = false;
|
||||
public static int MoveMouseWithJoystickSpeed = 1;
|
||||
public static int MoveMouseWithJoystickAccel = 0;
|
||||
public static boolean MoveMouseWithGyroscope = true;
|
||||
public static int MoveMouseWithGyroscopeSpeed = 2;
|
||||
public static boolean ClickMouseWithDpad = false;
|
||||
public static boolean RelativeMouseMovement = ForceRelativeMouseMode; // Laptop touchpad mode
|
||||
public static boolean ForceHardwareMouse = false;
|
||||
public static int RelativeMouseMovementSpeed = 2;
|
||||
public static int RelativeMouseMovementAccel = 0;
|
||||
public static int ShowScreenUnderFinger = Mouse.ZOOM_NONE;
|
||||
public static int ClickScreenPressure = 0;
|
||||
public static int ClickScreenTouchspotSize = 0;
|
||||
public static boolean FingerHover = true;
|
||||
public static boolean HoverJitterFilter = true;
|
||||
public static boolean GenerateSubframeTouchEvents = false;
|
||||
public static boolean KeepAspectRatio = KeepAspectRatioDefaultSetting;
|
||||
public static boolean TvBorders = true;
|
||||
public static int RemapHwKeycode[] = new int[SDL_Keys.JAVA_KEYCODE_LAST];
|
||||
public static int RemapScreenKbKeycode[] = new int[6];
|
||||
public static int ScreenKbControlsLayout[][] = AppUsesThirdJoystick ? // Values for 800x480 resolution
|
||||
new int[][] { { 0, 303, 177, 480 }, { 0, 0, 48, 48 }, { 400, 392, 488, 480 }, { 312, 392, 400, 480 }, { 400, 304, 488, 392 }, { 312, 304, 400, 392 }, { 400, 216, 488, 304 }, { 312, 216, 400, 304 }, { 623, 303, 800, 480 }, { 623, 126, 800, 303 } } :
|
||||
AppUsesSecondJoystick ?
|
||||
new int[][] { { 0, 303, 177, 480 }, { 0, 0, 48, 48 }, { 400, 392, 488, 480 }, { 312, 392, 400, 480 }, { 400, 304, 488, 392 }, { 312, 304, 400, 392 }, { 400, 216, 488, 304 }, { 312, 216, 400, 304 }, { 623, 303, 800, 480 } } :
|
||||
new int[][] { { 0, 303, 177, 480 }, { 0, 0, 48, 48 }, { 712, 392, 800, 480 }, { 624, 392, 712, 480 }, { 712, 304, 800, 392 }, { 624, 304, 712, 392 }, { 712, 216, 800, 304 }, { 624, 216, 712, 304 } };
|
||||
public static boolean ScreenKbControlsShown[] = new boolean[ScreenKbControlsLayout.length]; /* Also joystick and text input button added */
|
||||
public static int RemapMultitouchGestureKeycode[] = new int[4];
|
||||
public static boolean MultitouchGesturesUsed[] = new boolean[4];
|
||||
public static int MultitouchGestureSensitivity = 1;
|
||||
public static int TouchscreenCalibration[] = new int[4];
|
||||
public static String DataDir = new String("");
|
||||
public static boolean VideoLinearFilter = true;
|
||||
public static boolean MultiThreadedVideo = false;
|
||||
// These config options are modified by ChangeAppsettings.sh script - see the detailed descriptions there
|
||||
public static String ApplicationName = "XServerXSDL-NeoTerm";
|
||||
public static String AppLibraries[] = {"sdl_native_helpers", "sdl-1.2", "sdl_ttf", "crypto"};
|
||||
public static String AppMainLibraries[] = {"application", "sdl_main"};
|
||||
public static String LibraryNamesMap[][] = {{"crypto", "crypto.so.sdl.1"}, {"ssl", "ssl.so.sdl.1"}, {"curl", "curl-sdl"}}; // Because some libraries are named differently to not clash with system libs
|
||||
public static final boolean Using_SDL_1_3 = false;
|
||||
public static final boolean Using_SDL_2_0 = false;
|
||||
public static String[] DataDownloadUrl = {"!!Data files|:data.tar.gz:data-1.tgz", "!!Data files|:DroidSansMono.ttf:DroidSansMono.ttf", "Additional fonts (90Mb)|:xfonts.tar.gz:http://sourceforge.net/projects/libsdl-android/files/apk/XServer-XSDL/xfonts.tgz/download",};
|
||||
public static boolean SwVideoMode = true;
|
||||
public static boolean NeedDepthBuffer = false;
|
||||
public static boolean NeedStencilBuffer = false;
|
||||
public static boolean NeedGles2 = false;
|
||||
public static boolean NeedGles3 = false;
|
||||
public static boolean CompatibilityHacksVideo = false;
|
||||
public static boolean CompatibilityHacksForceScreenUpdateMouseClick = true;
|
||||
public static boolean CompatibilityHacksStaticInit = false;
|
||||
public static boolean CompatibilityHacksTextInputEmulatesHwKeyboard = true;
|
||||
public static int TextInputKeyboard = 0;
|
||||
public static boolean KeepAspectRatioDefaultSetting = false;
|
||||
public static boolean InhibitSuspend = true;
|
||||
public static boolean CreateService = true;
|
||||
public static String ReadmeText = "";
|
||||
public static String CommandLine = "XSDL";
|
||||
public static boolean AppUsesMouse = true;
|
||||
public static boolean AppNeedsTwoButtonMouse = true;
|
||||
public static boolean RightMouseButtonLongPress = false;
|
||||
public static boolean ForceRelativeMouseMode = true; // If both on-screen keyboard and mouse are needed, this will only set the default setting, user may override it later
|
||||
public static boolean ShowMouseCursor = false; // Draw system mouse cursor, if the app does not do it
|
||||
public static boolean ScreenFollowsMouse = true; // Move app screen make mouse cursor always visible, when soft keyboard is shown
|
||||
public static boolean AppNeedsArrowKeys = false;
|
||||
public static boolean AppNeedsTextInput = false;
|
||||
public static boolean AppUsesJoystick = false;
|
||||
public static boolean AppUsesSecondJoystick = false;
|
||||
public static boolean AppUsesThirdJoystick = false;
|
||||
public static boolean AppUsesAccelerometer = false;
|
||||
public static boolean AppUsesGyroscope = false;
|
||||
public static boolean AppUsesOrientationSensor = false;
|
||||
public static boolean AppUsesMultitouch = true;
|
||||
public static boolean NonBlockingSwapBuffers = false;
|
||||
public static boolean ResetSdlConfigForThisVersion = false;
|
||||
public static String DeleteFilesOnUpgrade = "%";
|
||||
public static int AppTouchscreenKeyboardKeysAmount = 3;
|
||||
public static String[] AppTouchscreenKeyboardKeysNames = "LCTRL LALT LSHIFT RETURN SPACE DELETE KP_PLUS KP_MINUS 1 2".split(" ");
|
||||
public static int StartupMenuButtonTimeout = 3000;
|
||||
public static int AppMinimumRAM = 0;
|
||||
public static SettingsMenu.Menu HiddenMenuOptions[] = {}; // If you see error here - update HiddenMenuOptions in your AndroidAppSettings.cfg: change OptionalDownloadConfig to SettingsMenuMisc.OptionalDownloadConfig etc.
|
||||
public static SettingsMenu.Menu FirstStartMenuOptions[] = {new SettingsMenuMisc.GyroscopeCalibration(), new SettingsMenuMisc.OptionalDownloadConfig(),};
|
||||
public static String AdmobPublisherId = "";
|
||||
public static String AdmobTestDeviceId = "";
|
||||
public static String AdmobBannerSize = "";
|
||||
public static String GooglePlayGameServicesId = "";
|
||||
|
||||
public static boolean OuyaEmulation = false; // For debugging
|
||||
// Phone-specific config, modified by user in "Change phone config" startup dialog
|
||||
public static int VideoDepthBpp = 16;
|
||||
public static boolean HorizontalOrientation = true;
|
||||
public static boolean AutoDetectOrientation = false;
|
||||
public static boolean ImmersiveMode = true;
|
||||
public static boolean HideSystemMousePointer = false;
|
||||
public static boolean DownloadToSdcard = true;
|
||||
public static boolean PhoneHasArrowKeys = false;
|
||||
public static boolean UseAccelerometerAsArrowKeys = false;
|
||||
public static boolean UseTouchscreenKeyboard = true;
|
||||
public static int TouchscreenKeyboardSize = 1;
|
||||
public static final int TOUCHSCREEN_KEYBOARD_CUSTOM = 4;
|
||||
public static int TouchscreenKeyboardDrawSize = 2;
|
||||
public static int TouchscreenKeyboardTheme = 0;
|
||||
public static int TouchscreenKeyboardTransparency = 2;
|
||||
public static boolean FloatingScreenJoystick = false;
|
||||
public static int AccelerometerSensitivity = 2;
|
||||
public static int AccelerometerCenterPos = 2;
|
||||
public static int AudioBufferConfig = 0;
|
||||
public static boolean OptionalDataDownload[] = null;
|
||||
public static int LeftClickMethod = ForceRelativeMouseMode ? Mouse.LEFT_CLICK_WITH_TAP_OR_TIMEOUT : Mouse.LEFT_CLICK_NORMAL;
|
||||
public static int LeftClickKey = KeyEvent.KEYCODE_DPAD_CENTER;
|
||||
public static int LeftClickTimeout = 3;
|
||||
public static int RightClickTimeout = 4;
|
||||
public static int RightClickMethod = AppNeedsTwoButtonMouse ? Mouse.RIGHT_CLICK_WITH_MULTITOUCH : Mouse.RIGHT_CLICK_NONE;
|
||||
public static int RightClickKey = KeyEvent.KEYCODE_MENU;
|
||||
public static boolean MoveMouseWithJoystick = false;
|
||||
public static int MoveMouseWithJoystickSpeed = 1;
|
||||
public static int MoveMouseWithJoystickAccel = 0;
|
||||
public static boolean MoveMouseWithGyroscope = true;
|
||||
public static int MoveMouseWithGyroscopeSpeed = 2;
|
||||
public static boolean ClickMouseWithDpad = false;
|
||||
public static boolean RelativeMouseMovement = ForceRelativeMouseMode; // Laptop touchpad mode
|
||||
public static boolean ForceHardwareMouse = false;
|
||||
public static int RelativeMouseMovementSpeed = 2;
|
||||
public static int RelativeMouseMovementAccel = 0;
|
||||
public static int ShowScreenUnderFinger = Mouse.ZOOM_NONE;
|
||||
public static int ClickScreenPressure = 0;
|
||||
public static int ClickScreenTouchspotSize = 0;
|
||||
public static boolean FingerHover = true;
|
||||
public static boolean HoverJitterFilter = true;
|
||||
public static boolean GenerateSubframeTouchEvents = false;
|
||||
public static boolean KeepAspectRatio = KeepAspectRatioDefaultSetting;
|
||||
public static boolean TvBorders = true;
|
||||
public static int RemapHwKeycode[] = new int[SDL_Keys.JAVA_KEYCODE_LAST];
|
||||
public static int RemapScreenKbKeycode[] = new int[6];
|
||||
public static int ScreenKbControlsLayout[][] = AppUsesThirdJoystick ? // Values for 800x480 resolution
|
||||
new int[][]{{0, 303, 177, 480}, {0, 0, 48, 48}, {400, 392, 488, 480}, {312, 392, 400, 480}, {400, 304, 488, 392}, {312, 304, 400, 392}, {400, 216, 488, 304}, {312, 216, 400, 304}, {623, 303, 800, 480}, {623, 126, 800, 303}} :
|
||||
AppUsesSecondJoystick ?
|
||||
new int[][]{{0, 303, 177, 480}, {0, 0, 48, 48}, {400, 392, 488, 480}, {312, 392, 400, 480}, {400, 304, 488, 392}, {312, 304, 400, 392}, {400, 216, 488, 304}, {312, 216, 400, 304}, {623, 303, 800, 480}} :
|
||||
new int[][]{{0, 303, 177, 480}, {0, 0, 48, 48}, {712, 392, 800, 480}, {624, 392, 712, 480}, {712, 304, 800, 392}, {624, 304, 712, 392}, {712, 216, 800, 304}, {624, 216, 712, 304}};
|
||||
public static boolean ScreenKbControlsShown[] = new boolean[ScreenKbControlsLayout.length]; /* Also joystick and text input button added */
|
||||
public static int RemapMultitouchGestureKeycode[] = new int[4];
|
||||
public static boolean MultitouchGesturesUsed[] = new boolean[4];
|
||||
public static int MultitouchGestureSensitivity = 1;
|
||||
public static int TouchscreenCalibration[] = new int[4];
|
||||
public static String DataDir = new String("");
|
||||
public static boolean VideoLinearFilter = true;
|
||||
public static boolean MultiThreadedVideo = false;
|
||||
|
||||
public static boolean OuyaEmulation = false; // For debugging
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ freely, subject to the following restrictions:
|
||||
package io.neoterm;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.KeyguardManager;
|
||||
import android.app.ProgressDialog;
|
||||
@ -739,7 +740,7 @@ public class MainActivity extends Activity {
|
||||
_parent.hideScreenKeyboard();
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
if (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_CLEAR)
|
||||
{
|
||||
// EditText deletes two characters at a time, here's a hacky fix
|
||||
@ -974,6 +975,7 @@ public class MainActivity extends Activity {
|
||||
setIntent(i);
|
||||
}
|
||||
|
||||
@SuppressLint("UnsafeDynamicallyLoadedCode")
|
||||
public void LoadLibraries() {
|
||||
try {
|
||||
if (Globals.NeedGles3) {
|
||||
@ -989,27 +991,17 @@ public class MainActivity extends Activity {
|
||||
|
||||
// Load all libraries
|
||||
try {
|
||||
for (String l_unmapped : Globals.AppLibraries) {
|
||||
String l = GetMappedLibraryName(l_unmapped);
|
||||
for (String libname : Globals.XLIBS) {
|
||||
String soPath = Globals.XLIB_DIR + libname;
|
||||
Log.i("SDL", "libSDL: loading lib " + soPath);
|
||||
try {
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(getFilesDir().getAbsolutePath() + "/../lib/" + libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
System.load(libpath.getPath());
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
Log.i("SDL", "libSDL: error loading lib " + l + ": " + e.toString());
|
||||
try {
|
||||
String libname = System.mapLibraryName(l);
|
||||
File libpath = new File(getFilesDir().getAbsolutePath() + "/" + libname);
|
||||
Log.i("SDL", "libSDL: loading lib " + libpath.getAbsolutePath());
|
||||
System.load(libpath.getPath());
|
||||
} catch (UnsatisfiedLinkError ee) {
|
||||
Log.i("SDL", "libSDL: error loading lib " + l + ": " + ee.toString());
|
||||
System.loadLibrary(l);
|
||||
}
|
||||
System.load(soPath);
|
||||
} catch (UnsatisfiedLinkError error) {
|
||||
Log.i("SDL", "libSDL: error loading lib " + soPath
|
||||
+ ", reason: " + error.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
} catch (UnsatisfiedLinkError ignore) {
|
||||
}
|
||||
|
||||
String[] binaryZipNames = new String[]{"binaries-" + android.os.Build.CPU_ABI + "-pie.zip", "binaries-" + android.os.Build.CPU_ABI2 + "-pie.zip", "binaries-" + android.os.Build.CPU_ABI + ".zip", "binaries-" + android.os.Build.CPU_ABI2 + ".zip", "binaries.zip"};
|
||||
|
Loading…
x
Reference in New Issue
Block a user