Commit Graph

33 Commits

Author SHA1 Message Date
Mis012
bcd2617c9e add -Xcheck:jni, fix some errors it finds 2024-01-23 22:32:09 +01:00
Mis012
529f5f1168 main-executable: error out if apk path doesn't exist 2023-12-07 14:56:04 +01:00
Mis012
9ef2151c5e GLSurfaceView: remove old implementation, import the one from AOSP
Now that we have a reasonably well working SurfaceView implementation,
it is actually cleaner to just implement GLSurfaceView the way AOSP
does. In fact, their code doesn't have any weird dependencies, and
can mostly be used as-is.

The AOSP code is pure Java, which means we had to implement some
EGL wrappers.

This change fixes issues with Wayland (it only ever worked because
the pbuffers were allocated using an XWayland EGLDisplay), and
with resizing (which we simply didn't support), all while getting
rid of quite some (arguably not very readable) LoC.
2023-10-20 20:54:37 +02:00
Julian Winkler
299a474aa0 move startActivity function to Context class
This way it can also be called on Application Context
2023-10-14 18:29:33 +02:00
Julian Winkler
55a1ff2cc5 create ContentProvider from AndroidManifest.xml
This is required for androidx startup library.
Only onCreate method is called for now.
2023-10-14 18:29:33 +02:00
Mis012
8b7b02d81f src/main-executable/main.c: change the naming scheme for app data dirs to fix Unity
Unity can't comprehend that a directory name could end in .apk, and will not handle
obb files properly if the path to the obb file includes such a folder.

To convert your existing app data dirs to the new scheme, simply `cd` into
the app_data_dir (`~/.local/share/android_translation_layer` by default)
and run `find . -maxdepth 1 -exec mv {} {}_ \;`
2023-10-06 21:17:11 +02:00
Mis012
4e22428a27 api-impl-jni/app/android_app_Activity.c: call OnWindowFocusChanged in activity_update_current
also rename apk_main_activity to activity since that's the class it's now for
2023-09-25 19:54:25 +02:00
Julian Winkler
029b26beb2 main.c: window size needs to be set before calling set_up_handle_cache()
the Context class init creates a static DisplayMetric
2023-08-23 14:52:56 +02:00
Julian Winkler
a8e39cd613 get Application class from AndroidManifest.xml and call onCreate() 2023-08-22 15:53:09 +02:00
Mis012
c936333c74 src/main-executable: show actual package name as window title, preparation for showing app icon, re-add some missing stuff 2023-08-12 13:05:34 +02:00
Julian Winkler
18ca242096 support multiple Activities 2023-08-11 18:15:19 +02:00
Julian Winkler
0282e9fbcb build and install framework-res.apk from source
fall back to prebuilt if aapt command is not available
2023-08-09 12:22:16 +02:00
Julian Winkler
4491de7f63 MessageQueue: integrate with glib main loop
Adds a special treatment for the main Looper to not block in java code,
but instead return to glib managed thread loop. Timeouts in the mainloop
are now handled using g_timeout_add_full().

Also defer Activity construction, so that every thing is set up properly
when the constructor runs.
2023-08-08 14:18:20 +02:00
Julian Winkler
64cbb17a67 add support for loading framework-res.apk for system resources 2023-08-08 14:18:20 +02:00
Julian Winkler
514e1e0e79 auto create app data dir 2023-06-21 22:38:08 +02:00
Julian Winkler
334274c9e5 auto extract native libraries and detect lib name for NativeActivity 2023-06-21 22:38:08 +02:00
Julian Winkler
997642d93a auto find main activity using AndroidManifest.xml 2023-06-21 22:38:08 +02:00
Julian Winkler
12e9e9788a load assets and bitmaps directly from apk 2023-06-21 22:38:08 +02:00
Julian Winkler
3709e30f64 load layout XMLs directly from apk file 2023-06-21 22:38:08 +02:00
Julian Winkler
0baddd9fe8 fixes for android-8 rebase of dalvik_standalone
detect bootclasspath jar path automatically from dalvik_standalone
2023-06-21 22:38:07 +02:00
Mis012
55098136dc src/main-executable/main.c: fix possible stray : at the end of classpath
apparently this can cause a crash in art
2023-06-21 18:36:48 +02:00
Mis012
8ca8124ff1 main-executable/main.c: fix missing NULL initialization 2023-06-07 13:25:36 +02:00
Mis012
f8beaa4a7d update --help text, remove outdated README entries 2023-01-12 13:26:18 +01:00
Mis012
34858d2fa6 remove incorrect offset correction from GLSurfaceView; handle ATL_DISABLE_WINDOW_DECORATIONS env 2023-01-09 14:50:17 +01:00
Mis012
d37af8183d main-executable/main.c: set LC_ALL to en_US to fix weird locale-related issues; check for exceptions when running onDestroy 2023-01-05 19:01:40 +01:00