34 Commits
Author SHA1 Message Date
khanhduytran0 7d8203b257 Fix[JNA]: use bitshift for packing version number
When using a char array, a non-zero patch version will break the check.
Changed it to bitshift.
2025-02-05 20:37:09 +07:00
khanhduytran0 879f852277 Workaround: ignore jna and stub new function
Fix a check on replacing JNA, add a missing function.
These are sufficient for 1.21-pre1 for now as it's requiring LWJGL
3.3.3, which will be updated later.
2024-05-31 13:26:31 +07:00
khanhduytran0 0f518de850 Fix[parser]: remove bad args specified by custom version metadata 2024-03-01 14:22:06 +07:00
khanhduytran0 a0f535d05e Cleanup in installer, remove unexpectedly added includes 2024-02-10 19:10:41 +07:00
khanhduytran0 d7302326b9 Feat+Refactor[MCDL]: rewrite to allow download libraries in parallel 2024-02-10 18:20:07 +07:00
khanhduytran0 921babed4b Feat[lib]: replace ASM <5 with ASM 5.0.4 2023-08-27 15:30:03 +07:00
khanhduytran0 2ae408f5dd Fix: stack queue check
Now explicitly check the caller class
2023-07-30 12:06:55 +01:00
Duy Tran Khanh 72edd15dfb Fix: potential crashes in profile mgr, wrong debug_logging category 2023-07-09 14:34:04 +07:00
khanhduytran0 12cca8506a Fix: null assets index 2023-07-06 14:08:04 +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 477d49d6b9 Fix(MSA): better URL parsing
This commit fixes #568: unexpected parameter "&state=" in "code"
parameter
M.C103_BAY.2.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&state=XXXXXXXXXXX

Another change includes a fix for not explicitly showing MSA error
message (also see #568)
2023-06-02 05:48:26 +07:00
Duy Tran Khanh fa58188c1f Fix(1.20): skip icons/snapshot/minecraft.icns
Same issue as 1.19, but the icon path changed.
Now it will skip downloading any files ending with "/minecraft.icns".
Fix the incorrectly provided icon path to delete.
Cleaner log by excluding "file doesn't exist" messages (assets)
2023-05-17 16:59:57 +07:00
Duy Tran Khanh cf44af927c Perf: speed up assets verification
- Log is cleaner, now prints "SHA1 passed for N/total asset files"
instead of individual files
- Removed redundant calls to the callback
2023-03-27 19:13:26 +07:00
Duy Tran Khanh 83b43238c9 Fix(JNA): snprintf() output has been truncated
Update JNA to 5.13.0:
https://github.com/java-native-access/jna/blob/767662a/lib/native/darwi
n-aarch64.jar
$ vtool -arch arm64 -set-build-version 2 12.0 16.0 -replace -output
libjnidispatch.dylib libjnidispatch.dylib
$ install_name_tool -change
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
/System/Library/Frameworks/Foundation.framework/Foundation
libjnidispatch.dylib
2023-03-19 16:04:15 +07:00
Duy Tran Khanh be528eb08a Fix #511: fixes for Spiral Knights 2023-02-23 18:17:26 +07:00
Duy Tran Khanh cdd4d3908b Fix(MCDL): multiple debug prints of call stack
Fix(local,Makefile) : @ldid: command not found, why?
2023-01-26 12:52:03 +07:00
Duy Tran Khanh ab597ba745 Fix: unset jna-5.8 SHA1 leading to verify failure
Fix: proper split display mode when autohide enabled
2023-01-05 22:07:50 +07:00
Duy Tran Khanh 7c6c986b68 Fix: missing JNA version override 2023-01-05 11:59:47 +07:00
khanhduytran0 78b788262c Move LoginViewController to parts
- The account selector now has Add Account item
- Last selected account is kept
- Account token refreshment is done on startup and on select if need
- Moved JIT status to LauncherMenuViewController's toolbar
- Primary View Controller is now LauncherSplitViewController
- More unmentioned(?), see diff.
2022-12-04 11:41:54 +07:00
Duy Tran Khanh 0868c48195 Fix launching of modded versions
A wrong parameter was passed to parseJSONAsFile for loading inheritsFrom version
2022-11-22 19:14:37 +07:00
Duy Tran Khanh cac0bbbf87 Fix: handle inheritsFrom when offline without cache
wip included: localization
2022-11-20 08:11:29 +07:00
Duy Tran Khanh 5c8d2f9cdc Bug fix: SHA1 mismatch because old file was not removed
This occurred after 1.19.x had got assets update for the upcoming
1.19.3 release.
2022-10-20 11:18:14 +07:00
Duy Tran Khanh 8789a7e9a7 MCDownloader: fallback for json with missing client info
Download failures now include call stack.
2022-10-15 19:00:55 +07:00
Duy Tran Khanh c616cb152f Moved toolbar code, added WIP News tab 2022-09-25 11:13:59 +07:00
Duy Tran Khanh b806c5df3c Many changes and fixes
Changes:
- Decreased multithreaded download max threads to 10
- Moved launcher buttons to match Android UI
- Moved UIKit hooking code to separate file
- The Launcher tab is now marked as under construction.
- Updated README.md to avoid confusion between self-JIT and auto-JIT.

New settings section: UI debugging
- Unlock iPadOS UI: allow iPhone users to unlock every iPadOS-only
features (floating keyboard, popover alert, sheet-styled view
controllers, etc.)
- Show layout bounds, like the one in Android's developer setting
- Show layout overlapping

Fixes:
- App container data is not shown in the Files app due to
`no-container` entitlement, replaced it with `no-sandbox`.
- Ignore jinput-platform libraries to avoid download error
- Multithreaded assets download breaks
- `Send your logs` crashes on iPadOS
2022-09-22 09:52:56 +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 ae1c86b113 Various fixes
- GLFW display mode array, fix 0x0 resolution bug
- OSMesa library (copied back 64f4042)
- Hacks for getting Spiral Knights to launch
- Error is now logged properly
2022-08-12 11:53:02 +07:00
Duy Tran Khanh 1c033a6e50 findNearestVersion: avoid negative index 2022-08-08 10:08:11 +07:00
Duy Tran Khanh 3db2926743 Moved type selections to segments in picker view
The version picker view now only display the selected type in one of
(Installed, Releases, Snapshot, Old-beta, Old-alpha). Toggling between
Releases and Snapshots allows jumping to the corresponding release or
the latest snapshot of the version.
2022-08-08 09:37:32 +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
khanhduytran0 5d8a136470 SurfaceViewController is now always the root vc
Before launching game, SurfaceViewController is set to UIWindow.rootViewController, making it similar to "Restart before launching" in order to *attempt* to find out why touchscreen input does not work on certain devices. The restart option is still kept for debugging purpose.

Some other tiny code tweaks
2022-07-16 13:27:25 +07:00
Duy Tran Khanh 6ba1c6773b Added back a forgotten continue 2022-07-01 08:19:46 +07:00
Duy Tran Khanh ee2c68fb98 Fixes
Makefile: fix path
Moved GameSurfaceView to a separate class
Renamed MinecraftDownloader to MinecraftResourceUtils

Fix: Some versions fails because GLFW_CLIENT_API is not set
2022-07-01 07:02:25 +07:00