Commit Graph
99 Commits
Author SHA1 Message Date
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
Duy Tran Khanh 56f4ec73e9 Jailbroken, Java 8, IPA: fix check of libawt_xawt 2022-09-12 21:12:36 +07:00
khanhduytran0 c10e0af8ff Various fixes, some cleanup
Fixes:
- dlopen gets hooked no matter if installed in /Applications or container
- Jailbroken IPA installation always looked for /usr/lib/jvm instead of the internal one
- Metal returned 0 physical devices, caused all renderers to be broken
- Zink renderer tried to load VirGL stuff
2022-09-11 21:58:11 +07:00
Duy Tran Khanh e372df28dc Welcome to the new Settings UI
What's new?
- Settings are now categorized
- Re-designed Game Directory manager
- Moved help detail to subtitles, toggleable
- Some settings are now made accessible ingame
- Added Auto Renderer

Removed settings:
- Restart before launching: not needed anymore, also it would break JIT/debugger.
2022-09-09 19:08:27 +07:00
Duy Tran Khanh f26849f5f2 iOS 16(?), Java 8: disable compressed class space 2022-09-09 10:58:29 +07:00
Duy Tran Khanh 83c54845b8 Get more settings to function 2022-09-02 15:45:18 +07:00
Duy Tran Khanh b23678692a Merge commit 'e1bd237d69f7ad95b0fa01c629a62f5880cf9943'
Conflicts:
	.github/workflows/development.yml
	.github/workflows/release.yml
	Makefile
	Natives/main.m
2022-08-30 17:02:07 +07:00
Duy Tran Khanh 0783f2d43a Java 8: Fix awt_xawt and Caciocavallo 2022-08-25 07:14:31 +07:00
Duy Tran Khanh b7cc2d097e Added Caciocavallo17; Get JRE build from Actions 2022-08-24 12:34:06 +07:00
Eilionoir Tunnicliff 43de973bcc Only allocate memory when required
Attempts to fix issues where the JVM will crash due to memory restrictions
2022-08-19 16:16:10 -04:00
Duy Tran Khanh 9a5cee04c6 wip auto renderer 2022-08-18 08:09:46 +07:00
Duy Tran Khanh 028f2535e8 ipa build: added java 17 2022-08-17 20:45:45 +07:00
Duy Tran Khanh da75d569b1 Perform some entitlement checks 2022-08-15 18:22:00 +07:00
Duy Tran Khanh 57031041e2 MinecraftResourceUtils.m: fix unexpected states
Fix: could not find inhertisFrom, launch even when download fails.

Other changes: log shown dialog, fix compile warning
2022-08-12 19:27:01 +07:00
Duy Tran Khanh 44408a05af Update JavaLauncher.m 2022-08-12 12:14:37 +07:00
Duy Tran Khanh 1592d50f65 Attempt to unlock 120Hz for ProMotion display 2022-08-12 12:09:41 +07:00
Duy Tran Khanh 292fb8166f Custom controls: safe area is now customizable
Other changes:
- Cleanup unused functions
- Internal changes to access ViewController globally
- Moved ControlLayout to a separate file
2022-08-03 12:23:27 +07:00
Duy Tran Khanh ad9c6d482a Allow embedding JREs to PojavLauncher.app/jvm for IPA builds
The old IPA creation process: wrap every dylib files into framework;
this appears to be unnecessary, dylib files can be put outside without
breaking codesigning and validation (only tested with AltStore: it
scans and signs every Mach-O files).
Therefore, IPA builds now allow putting Java Runtimes to
`PojavLauncher.app/jvm`.
Makefile is yet tweaked to adapt this change, will be done later.

Other tweaks
- Disabled autocorrection for text fields in preferences
- The preferences now searches for installed JRE versions instead of
hardcoding them
- Bug fix: "accounts" folder was not created initially, leading to
"username.json does not exist" error
2022-07-25 20:54:41 +07:00
Duy Tran Khanh 47c8874cae Bug fix: UI completely freezes on launch
The root cause is that the JVM has taken away the main thread, caused the UIKit’s queue to stop. This env var exists in my dev environment but has never been added here.
2022-07-23 21:54:48 +07:00
khanhduytran0 97433a5596 Add support for mods that use Vulkan for rendering
Known mods: Blaze4D (untested), VulkanMod, more?
- VulkanMod: needs a tiny modification to get it work with LWJGL 3.2.3
2022-06-10 12:13:23 +07:00
Duy Tran Khanh a282074914 Handle ingame opening folder/link 2022-06-07 05:56:18 +07:00
Duy Tran Khanh 5d7c77d697 Forge 1.17+ support 2022-05-29 20:03:04 +07:00
Duy Tran Khanh 7337d90eee All options are now applied without restarting
Instances manager: cleanup, now explicitly state the error message
Moved init_loadCustomEnv() back to JavaLauncher.m
2022-05-27 09:56:06 +07:00
Duy Tran Khanh 85bc35f679 Automatically change the Java version if needed
Manually-specified Java version still applies to:
- Minecraft versions below 1.17 (default is Java 8)
- Minecraft version 1.17.x (allow choosing between Java 16 and 17)
2022-05-27 09:01:39 +07:00
khanhduytran0 bf12743457 Moved the JVM entry point to start when needed 2022-05-27 05:48:25 +07:00
Adam Tunnic 70c150af38 Make the debug logging switch actually do something
Pretty much disables everything except for [Pre-Init] and [Init], as well as Renderer Init Success. Toggle debug logging off to see.

regLog(message) -> logs all the time
debugLog(message) -> logs only when debug logging is enabled
2022-03-13 21:23:02 -04:00
Adam Tunnic 80ba038c15 Fix POJAV_RENDERER, also add a7_allow now because why not 2022-02-20 00:22:41 -05:00
Adam Tunnic 959a4e2290 Merge branch 'backend-virgl' into main 2022-02-14 08:52:10 -05:00
Duy Tran Khanh bd6ba67745 Bug fix: Arc DNS injector breaks on Java 16+
This is caused by a missing function in our class loader.

Error:
System class loader does not define the
appendToClassPathForInstrumentation method
Unable to add
/Applications/PojavLauncher.app/libs/arc_dns_injector.jar to system
class path - the system class loader does not define the
appendToClassPathForInstrumentation method or the method failed
FATAL ERROR in native method: processing of -javaagent failed,
appending to system class path failed
2022-02-07 05:20:05 +07:00
Adam Tunnic 372831bc9e Add Arc capes 2022-02-05 11:28:51 -05:00
Duy Tran Khanh e5018cc094 Bug fix: Fabric 1.17+ crash at startup(fixes #304)
Microsoft account now set accountType to msa.
Minor change in custom control view controller.
2022-02-05 16:47:04 +07:00
3105c754a4 Merge unjailbroken changes with main (#313)
* fix that lol

* IPABuilder moment

* typo moment

* Hooking changes
Now hook only dladdr and realpath, JRE works now. However, need to obtain libffi.

* Sole more changes

Add RPATH to libraries
Hook dlopen since loading libawt_headless somehow point to Frameworks
directory.

* Update development.yml

* Update development.yml

Co-authored-by: Duy Tran Khanh <[email protected]>
Co-authored-by: Duy Tran Khanh <[email protected]>
2022-01-28 17:42:22 -05:00
khanhduytran0 fbde4948d5 Various bug fixes
- Input cursor movement seems too fast, attempt to reduce it by setting larger font size in the hidden text field.
- latestlog.txt doesn't log in 1.12+ since Log4j patch. Fixed by adding some config lines.
- Makefile: building is broken when run make from a path with space(s). Fixed by handling spaces with backslashes.
- text2speech is not overridden properly. Fixed by excluding it from download list and adding launcher.jar itself to the classpath.
- XML log output in < 1.12 since Log4j patch. Fixed by using our own configuration file.

Some more changes:
- Commented out a debug line in LWJGLX
- Fix a typo.
- JavaLauncher: use (ObjC)BOOL instead of (std)bool.
2022-01-17 08:18:06 +07:00
Adam Tunnic 3084243fec Fix undeclared identifier 2022-01-12 11:15:55 -05:00
Adam Tunnic 08b94c340d Merge remote-tracking branch 'refs/remotes/origin/main' 2022-01-12 09:56:53 -05:00
Adam Tunnic 77a817d937 Consolidate some code 2022-01-12 09:56:40 -05:00
Duy Tran Khanh 93b146d65a Use the old jvm arguments parser back for now
There’s no handling for backslash yet, or ignoring spaces inside delimiters.
2022-01-04 10:06:34 +07:00
khanhduytran0 b6f552df85 Keyboard + Mouse input handling; some cleanups
* Keyboard input: KeyboardInput.m
- Requires iOS 13.4. Used pressesBegan and pressesEnded.
- Not all keys are handled, these will be handled later.

* Mouse input
- Requires iOS 13.0 for hovering. Used UIHoverGestureRecognizer.
- Requires iOS 14.0 for L/R mouse buttons and scroll handling. Used GCMouse for now. We will use iOS 13.4(?)'s API later.
- Pointer lock is not yet handled.

These above apply to iPadOS aswell, not sure about tvOS. iPhone users need to disable "Perform Touch Gestures" in the AssistiveTouch Accessibility settings in order to get the pointer hovering to work.

* Cleanups
- Use asprintf instead of sprintf when possible
- CallbackBridge functions: removed unnecessary JNI fields.
- Condition cleanup (managing virtual mouse position).
2022-01-04 09:55:47 +07:00
Duy Tran Khanh 1b0d564379 New toggle option: Restart before launching game
This option allows the launcher to restart itself before launching the
game, therefore all changes are applied such as JVM Arguments and Java
version. The restart mechanism doesn't always work, so a toggle is
here for now.
2021-12-17 21:13:50 +07:00
Adam Tunnic ec0ec560a3 Mitigation for the Apache Log4j RCE in 1.8.x-1.18 2021-12-10 13:13:30 -05:00