138 Commits
Author SHA1 Message Date
khanhduytran0 c74491a05a Fix: add missing size conversion 2025-04-16 18:45:55 +07:00
khanhduytran0 9ce90315ab Feat: pre-validate if there is sufficient memory 2025-04-16 18:28:35 +07:00
khanhduytran0 6eb7ecdde3 Fix[JNA]: use agent to replace class at runtime
Fixes duplicate module package on recent Forge versions.
2025-01-25 11:47:27 +07:00
khanhduytran0 563f25c2e7 Fix: always bypass validation to load external dylib 2024-07-13 18:47:09 +07:00
khanhduytran0 ec04885ce5 Feat: patch dylib for game dlopen calls
Now that game can directly load macOS's JNA native library,
libjnidispatch is removed.
2024-06-09 21:53:15 +07:00
khanhduytran0 7829917534 Refactor[jar launcher]: rework swap thread & classpath 2024-01-28 14:26:42 +07:00
khanhduytran0 8bf56d7443 Feat[jar launcher]: add log output
- rename 'Install .jar' to 'Execute .jar'
2023-11-15 05:56:17 +07:00
khanhduytran0 b48cecad94 Cleanup 2023-11-11 17:38:58 +07:00
khanhduytran0 0862f32f5e Fix[JavaLauncher]: null check for glLibName
Add missing null check for be86b5f
Fixes #615
2023-10-01 21:13:40 +07:00
khanhduytran0 be86b5f940 Fix[1.20.2]: preset OpenGL libname
Somewhere in 1.20.2 Blaze3D changed to init OpenGL before GLFW, breaking the usual init flow.
2023-09-27 14:48:07 +07:00
khanhduytran0 abf8b6359e Fix[JavaLauncher]: don't patch dyld in LiveContainer 2023-09-15 17:29:04 +07:00
Duy Tran Khanh 181bd4afa6 Fix[args parser]: trim redundant spaces
Disable NoChecks due to no sound issue in Forge
2023-08-16 17:02:13 +07:00
khanhduytran0 5709c3ac9e Fix: jvm args parser skipped checking first arg 2023-08-03 08:18:12 +07:00
Duy Tran Khanh 017c07d9d0 Fix[jvm]: purge faulty args 2023-07-25 14:46:54 +07:00
Duy Tran Khanh 286f66452e Fix: settings crashes ingame, loses transparency
Fix: profile version key
2023-07-06 18:33:26 +07:00
khanhduytran0 aa90bea89c Fixes: local version list not reloaded; version name in error 2023-07-06 17:47:17 +07:00
khanhduytran0 6cf61e62c0 Feats: preference isolation & profile management
- Rewrote LauncherPreferences -> PLPreferences
 + Now the file layout is the same as UI layout
 + (get/set)Preference are replaced with corresponding get/set types + Getting/setting is now done through keyPath instead of manually iterating over subdictionaries.
 + Implemented an isolation layer, allowing an instance to have its own settings. This is off by default

- Implemented launcher_profiles
 + Added Profile manager that can be accessed from the sidebar
 + Moved "Game directory (instances)" to this screen
 + Replaced version selector with profile selector. Version selector is moved into profile editor.

- Other changes
 + Cleanup code by using NSPredicate instead of huge for loops
 + Titles in settings are made multilined
 + Controller config: replaced bar button items with localized ones

Due to how large the changes are, this is committed directly to the mainline branch. Bugs are expected to be found (although I did enough tests for this locally)
2023-07-06 13:59:07 +07:00
Duy Tran KhanhandDuy Tran Khanh 8d6d66dd94 Feats: external runtime, update LWJGL to 3.3.1 (#579)
* Feat: external runtime manager

Currently missing: mmap hook

* we're past this ui todo

* feat: Bypass Library Validation (untested)

This bypass works because of JIT enabled, so the process can patch
anything loaded in the memory. Unsigned dylib works with JIT too.

* Fix `could not get real path` on iOS 14.x

iOS 15+ is untested, it may need patching in dyld instead of libSystem

* Make redirectFunction syscall-friendly

Replaced builtin_mprotect and vm_protect with a simple syscall to
_kernelrpc_mach_vm_protect_trap

* Add dyld hook back for iOS 15+, auto symlink xawt lib

* Cleanup Tools.java:showError+comments

Use System.exit(1) to drop to Game Exited screen instead of presenting
alert dialog on exception handled.

* Patch both to bypass codesigning at best

* Proper way of ignoring SIGBUS during patch

Turns out other background thread might also be calling inside dirty
page, so let's SIG_IGN them all until page permission is back to RX.

* Feat(install jar): auto detect java version

Rename Default version to Preferred version to match the behavior or
Install .jar detection: only override if selected version > required
version.
Add UnzipKit just to check jar file

Refactor(showDialog): remove viewController parameter, now use its own
ViewController to present.

* Feat: update LWJGL to 3.3.1
(tinygl4angle) add alias for GL_KHR_debug functions
Include nanovg for OneConfig mod
Move all LWJGLX classes to lwjgl3 repo
Set org.lwjgl.util.NoChecks=true to improve performance

* Fix: Forge 1.20 crashes (wrong artifact path)
Now use json-provided artifact path instead of generating one
Make lwjgl fat jar again

* Fix: handle null library artifact

* Fix: fatal glfw callback cleanup

* Build: fix copying LWJGL libraries

* Perf: set default settings

* Fix: incorrect SolClient useStackQueue check

* Feat: builtin runtime installer

Refactor parts of LauncherNavigationController.m
Workaround(LogView): disable animation on update to mitigate overload

* Fix: random game directory failures

This is caused by having current working directory unchanged after
re-making symlink.

* Fixes: TL-style artifact, update arc_dns_injector

Change pojavInit names

* Fix: 1.13+ isUseStackQueueCall check

* Build: update liblwjgl.dylib in attempt to fix ffi_closure_alloc

* Fix and improvements to the logger

- Dynamically get stdout/stderr fileno instead of fixed value
- Improve file migration logging
- Improve dyld bypass logging

* Fix(pickers): file permission issue

---------

Co-authored-by: Duy Tran Khanh <[email protected]>
2023-06-28 21:49:15 +07:00
Duy Tran Khanh 8aa3983bee Use UIMenu for presenting settings' picker view
Enforce compiling for Apple A8
Fix -fcommon cflag
Unset LIBGL_MIPMAP=3
2023-05-15 07:26:53 +07:00
Duy Tran Khanh 6b3d66a33f Workaround: stack guard allocation failures leading to crashes
Enable DisablePrimordialThreadGuardPages by default
2023-05-13 15:53:56 +07:00
Eilionoir Tunnicliff 4cff4dc949 Migrate environment variables to preferences view controller
Also, remove some more legacy code + make the migration code better
2023-05-08 13:49:52 -04:00
Duy Tran Khanh bb588ca7e6 Add missing LIBGL env vars 2023-04-26 11:09:41 +07:00
Duy Tran Khanh bcfc13a4f1 Major cleanup for the controller config vc
- Cleanup unused parts
- Cleanup complicated dictionary constructions
- Fix lag spikes during scrolling in this screen

Allow audio settings to be changed ingame
2023-04-19 19:12:32 +07:00
Eilionoir Tunnicliff 43123158a4 (WIP) Enable usage of JREs in Documents/
If there is no java_runtimes/ folder in the bundle, PojavLauncher will look for runtimes in Documents/jvm. Not currently working with my tests as this isn't the code I used before.
Also changes the slimmed ipas to not include any runtimes at all.
2023-03-27 09:41:19 -04:00
Duy Tran Khanh ac22507085 another fix for the last commit because iforgor 2023-03-25 20:16:09 +07:00
Duy Tran Khanh 7668f3cb9a Fix: audio output issues due to misplaced pref key
Issue introduced in 8d4a223257
2023-03-25 20:13:35 +07:00
Eilionoir Tunnicliff 8646bc779d Me when we don't need this anymore 2023-03-23 22:09:49 -04:00
Eilionoir Tunnicliff 8d4a223257 Add switch for customizing AVAudioSession (untested) 2023-03-23 21:50:57 -04:00
Eilionoir Tunnicliff 62d7bfe425 Remove support for external JREs
Users can use the built-in JREs for PojavLauncher, and (if I can manage to make it work easily) JREs in the Documents directory
2023-03-23 10:21:13 -04:00
Duy Tran Khanh cf2ea1f478 Fix: regression in custom_env parser ignoring lines after comment 2023-03-03 21:49:35 +07:00
Duy Tran Khanh c431f9eb6f Fix #512: move spiral gamedir properties 2023-02-24 04:56:57 +07:00
Duy Tran Khanh be528eb08a Fix #511: fixes for Spiral Knights 2023-02-23 18:17:26 +07:00
Duy Tran Khanh aa4bbc90c6 Workaround: set back AVAudioSessionCategoryPlayback
Because microphone input is not currently working, audio session category is set back to its previous value to fix low volume issue.
2023-02-20 21:09:04 +07:00
Duy Tran Khanh 4e2a62d24b Move strings to InfoPlist.strings, change AVAudioSession category
Change AVAudioSession category to AVAudioSessionCategoryPlayAndRecord
2023-01-30 08:40:27 +07:00
Eilionoir Tunnicliff 7cb7578c17 Remove java-16-openjdk from environmentFailsafes()
Versions that use 16 can use 17 as well. Instead of wasting storage and installing both, use just 17 instead.
2023-01-26 09:45:55 -05:00
Duy Tran Khanh fcc7d8b2d4 Fix(iOS 12): fatal issues: dlopen, entitlement
* dlopening the main executable fails
* dlopening dylib fails due to codesign
* Installing PojavLauncher with AppSync causing
extended-virtual-addressing entitlement to be checked improperly

Current issue: it seems that Java 8 is broken on iOS 12
2023-01-20 21:42:51 +07:00
khanhduytran0 b0203d6fc7 Text input for jar launcher, update lib, fixes
News
- Added text input support for jar launcher.
- Updated MoltenVK to https://github.com/KhronosGroup/MoltenVK/commit/d880f4c

Internal changes
- Added more handling cases to avoid missing call to pojav_initOpenGL()
- Moved custom control’s global functions and properties to ControlLayout.
- Moved dylib framework outside its folder, as it’s not necessary to be bundled in framework.
- Reusing custom controls to produce flexible buttons in jar launcher, which might be extended in the future.

Fixes
- Multistage text input (Japanese, Chinese, etc) should now work again.
- Pointer lock should now function properly again.

- Updated README.md to reflect current stuff
2023-01-19 09:54:55 +07:00
Eilionoir Tunnicliff 92ff02a1ad Fix delegate set issue
Using code from an old project and forgor 💀
2023-01-16 19:34:37 -05:00
Eilionoir Tunnicliff 6013bf8a2a Change AVAudioSession category + options
This allows PojavLauncher to mix its audio with other applications.
Playback was chosen so that audio is not disabled with the ringer
switch - toggle to be added later.

Code untested - might break/not compile.
2023-01-16 19:32:01 -05:00
Duy Tran Khanh 495e8cb9d0 Fix: Timezone is now set properly 2023-01-15 05:12:10 +07:00
Duy Tran Khanh 652316e8f6 Various fixes and enhancements
- Change setNeedsUpdateOfPrefersPointerLocked logic to hopefully fix
issues with mouse not recognizing on iPhones
- Change reloadVersionList logic to load Installed version list
instantly at startup
- Enable game's CALayer opaque and drawsAsynchronously to improve
rendering performance
- Handle natives_directory variable for legacy modded versions
- Set LD_LIBRARY_PATH to silent Caciocavallo NPE error in locating
Android-only code
- Tapping Play when no version selected will now bring up the version
picker instead of doing nothing
2023-01-13 20:11:50 +07:00
Duy Tran Khanh 30e0529658 Internal fixes 2022-12-30 06:06:35 +07:00
Eilionoir Tunnicliff 37b479bbe1 Fix warnings, drop 1GB devices 2022-12-18 13:40:51 -05:00
Duy Tran Khanh d0279af8aa Internal changes
- First changes for tvOS (very WIP) this will be a challenge to use
remote storage as ATV doesn't allow persistent storage (at least
without jailbreak). Low priority for now.
- Change regLog, debugLog to NSLog, NSDebugLog
- Rewrite most of JavaLauncher.m to ObjC
- Update README.md
2022-12-17 21:25:23 +07:00
Duy Tran Khanh 5eae6015d6 Rearranged UI layout
* Moved account selection to the secondary NavigationController
* Added logo to fill in the primary one
* Moved buttons to the sidebar:
- Custom controls
- Install jar
- Send logs
* Fixed object memory leakage in LauncherNavigationController
* Set fullscreen=false on startup, workaround < 1.13 resizing issue
* Reduced mouse_pointer size

TODOs:
* Add icons for new items, will prefer copying from the Android
version.
* Remove LoginViewController: integrate add account to the account
selector, move Techno text+check to sidebar, etc..
* Instead of separate Microsoft, Demo login; display demo warning
before MS login.
2022-11-21 22:03:59 +07:00
Duy Tran Khanh 1af09ca02d Tweak NSLocalizedString; Keep split display mode
Tweak NSLocalizedString to return English if not yet localized.
Keep Split display mode between rotations.
New debug option: skip JIT wait, for #423
2022-11-17 21:46:38 +07:00
Duy Tran Khanh b5af92d0f5 JVM crash dump: now shown, disable some Cr4shed handler
When Cr4shed crash handler is on, chaining to it will eventually crash
instead of returning so that JVM can continue perform dump. For now,
signal handlers are reset to default.

abort() is now caught and shown in the launcher.

Temporarily disabled safe area when windowed, until I can properly set
it up, in order to workaround buttons going out of bounds.
2022-11-03 21:12:55 +07:00
Duy Tran Khanh 8ca77a1b73 Support resizable for iPadOS Stage Manager
On iPadOS, PojavLauncher can be launched in portrait mode
Declare controller support in Info.plist
Sync LWJGL changes from Android repo
2022-10-31 11:13:03 +07:00
Duy Tran Khanh 9aa7095ca1 Auto RAM tweaks
- It is now accessible for everyone (sandboxed, TrollStored, jailbroken)
- Enabled by default if Jetsam can't be controlled
- Default ratio: 25% (sandboxed), 40% (TrollStored or jailbroken)
2022-09-16 21:29:12 +07:00
Duy Tran Khanh d5540fd4a5 Correct Cosmetica preference key 2022-09-14 05:50:47 +07:00