13 Commits
Author SHA1 Message Date
khanhduytran0 28df9fcc68 Feat[auth]: move tokens to keychain
Previously, tokens were saved in json under plain text, making it
insecure. Now, they are stored in iOS's keychian with the hope of
making it more secure.
2024-04-04 19:12:32 +07:00
khanhduytran0 b48cecad94 Cleanup 2023-11-11 17:38:58 +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
Eilionoir Tunnicliff dc22673b06 Remove iOS 12/13 supporting code + Alderis
PojavLauncher 3.0 will require heavy modifications in order to work on those two iOS versions now.
2023-05-08 11:15:52 -04:00
Duy Tran Khanh 2a40ccaae1 Fix: demo account warning was not shown
Removed demo_warn preference as the warning is only displayed after
logging in with demo account.
2022-12-05 19:07:21 +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 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
Eilionoir Tunnicliff ab5bd8469e Changes
- Removed FAQ, About Launcher, and Update History buttons
- Moved *.png to Assets.xcassets
- Moved LPVC2 to LPVC
2022-11-10 00:03:37 -05:00
Duy Tran Khanh d8459effc0 WIP: New User interface
UISplitViewController is being used to create split menu.
Currently, autolayout is not yet done.
Added account switcher to the split view.

Fixes:
- auth_session parameter for legacy Minecraft versions
- Updating self.view background color is now automated by
UIColor.systemBackgroundColor
2022-07-22 08:02:40 +07:00
khanhduytran0 0041edcc87 Bundle AFNetworking into the main executable
Trying to fix the following crash:

Exception type: EXC_BAD_ACCESS (SIGBUS)
Exception subtype: KERN_PROTECTION_FAILURE: 0x100fe76e8
Exception codes: 0x0000000000000002, 0x0000000100fe76e8
Culprit: Unknown
VM Protection: ---

Triggered by thread: 0
Thread name: Dispatch queue: com.apple.main-thread
Call stack:
0   AFNetworking                  	0x0000000100fe76e8 0x100fc8000 + 128744     	// +[_AFURLSessionTaskSwizzling load]
1   libobjc.A.dylib               	0x00000001a1b9321c 0x1a1b82000 + 70172      	// load_images
2   dyld                          	0x00000001012ee320 0x1012ec000 + 8992       	// dyld::notifySingle(dyld_image_states, ImageLoader const*, ImageLoader::InitializerTimingList*)
3   dyld                          	0x0000000101300c4c 0x1012ec000 + 85068      	// ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&)
4   dyld                          	0x0000000101300bb0 0x1012ec000 + 84912      	// ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&)
5   dyld                          	0x00000001012febb8 0x1012ec000 + 76728      	// ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&)
6   dyld                          	0x00000001012fec84 0x1012ec000 + 76932      	// ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&)
7   dyld                          	0x00000001012ee7f4 0x1012ec000 + 10228      	// dyld::initializeMainExecutable()
8   dyld                          	0x00000001012f3d88 0x1012ec000 + 32136      	// dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*)
9   dyld                          	0x00000001012ed258 0x1012ec000 + 4696       	// dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*)
10  dyld                          	0x00000001012ed038 0x1012ec000 + 4152       	// _dyld_start
2022-06-30 14:28:41 +07:00
khanhduytran0 2a9d3909f8 Internal, renderer and UI changes + 1.19-pre1 support
Minecraft 1.19 support:
- Since 1.19-pre1, LWJGL 3.3.1 is used. However, LWJGL 3.2.3 still works with it, at least for this Minecraft release.
- Added a hack to skip calling to ObjC codes (skipped an asset file to skip setting the icon)
- JNA version replacing: now only change to 5.8.0 if version < 5.8.0

Internal changes:
- Cleanup: moved global functions to a new place
- Handle demo user correctly: actually authenticate the game with demo's access token and use the Xbox gamertag as the username
- Start moving strings to Localizable.strings (WIP)
- Re-wrote the Microsoft authentication and account management to Objective-C
- Assets downloading: added a tiny sleep call so that the UI won’t be frozen when too many tasks are executed at the same time

Renderers changes
- gl4es: `init_constructor` is now enabled, therefore moved the preload part to before `eglInitialize` (or EGL will be de-init after gl4es's hardware test).
- gl4es-extra (aka holy gl4es 1.1.4) is now used to replace the regular gl4es. This fixes VBO issue on version < 1.13 and some extra stuff. https://github.com/PojavLauncherTeam/gl4es-114-extra/commit/d6cf5c4
- Removed gl4es 1.1.5 and `Disable gl4es shaderconv` as it's unnecessary for now
- Removed vgpu, as it requires some missing extensions when come to shaders

User interface:
- The account selection list now displays the skin head (or the Xbox gamerpic if demo) and the account type
2022-05-22 11:31:14 +07:00