Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81c6813a6b | ||
|
|
d713fe52ea |
No files matched your search
@@ -18,24 +18,28 @@ jobs:
|
||||
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "recursive"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 21
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
java-version: '8'
|
||||
|
||||
- name: Get LTW
|
||||
run: |
|
||||
apt update && apt install wget
|
||||
cd app_pojavlauncher/libs
|
||||
wget https://github.com/PojavLauncherTeam/LTW/releases/latest/download/ltw-release.aar
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.LTW_CLONER_SECRET}}
|
||||
repo: PojavLauncherTeam/BigTinyWrapper
|
||||
workflow: android.yml
|
||||
workflow_conclusion: success
|
||||
name: output-aar
|
||||
path: app_pojavlauncher/libs
|
||||
allow_forks: false
|
||||
|
||||
- name: Get JRE 8
|
||||
uses: dawidd6/action-download-artifact@v9
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: build.yml
|
||||
path: app_pojavlauncher/src/main/assets/components/jre
|
||||
@@ -45,7 +49,7 @@ jobs:
|
||||
name: jre8-pojav
|
||||
|
||||
- name: Get JRE17
|
||||
uses: dawidd6/action-download-artifact@v9
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: build.yml
|
||||
path: app_pojavlauncher/src/main/assets/components/jre-new
|
||||
@@ -55,7 +59,7 @@ jobs:
|
||||
name: jre17-pojav
|
||||
|
||||
- name: Get JRE21
|
||||
uses: dawidd6/action-download-artifact@v9
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
workflow: build.yml
|
||||
path: app_pojavlauncher/src/main/assets/components/jre-21
|
||||
|
||||
@@ -1,151 +1,135 @@
|
||||
<h1 align="center">PojavLauncher</h1>
|
||||
<H1 align="center">PojavLauncher</H1>
|
||||
|
||||
<img src="https://github.com/PojavLauncherTeam/PojavLauncher/blob/v3_openjdk/app_pojavlauncher/src/main/assets/pojavlauncher.png" align="left" width="130" height="150" alt="PojavLauncher logo">
|
||||
|
||||
[](https://github.com/PojavLauncherTeam/PojavLauncher/actions)
|
||||
[](https://github.com/PojavLauncherTeam/PojavLauncher/actions)
|
||||
[](https://crowdin.com/project/pojavlauncher)
|
||||
[](https://discord.com/invite/aenk3EUvER)
|
||||
[](https://discord.com/invite/aenk3EUvER)
|
||||
[](https://twitter.com/PLaunchTeam)
|
||||
|
||||
*From [Boardwalk](https://github.com/zhuowei/Boardwalk)'s ashes here comes PojavLauncher!*
|
||||
* From [Boardwalk](https://github.com/zhuowei/Boardwalk)'s ashes here comes PojavLauncher!
|
||||
|
||||
PojavLauncher is a launcher that allows you to play Minecraft: Java Edition on your Android and [iOS](https://github.com/PojavLauncherTeam/PojavLauncher_iOS) devices.
|
||||
* PojavLauncher is a launcher that allows you to play Minecraft: Java Edition on your Android device!
|
||||
|
||||
For more details, check out our [wiki](https://pojavlauncher.app/)!
|
||||
* It can run almost every version of Minecraft, allowing you to use .jar only installers to install modloaders such as [Forge](https://files.minecraftforge.net/) and [Fabric](http://fabricmc.net/), mods like [OptiFine](https://optifine.net) and [LabyMod](https://www.labymod.net/en), as well as hack clients like [Wurst](https://www.wurstclient.net/), and much more!
|
||||
|
||||
## Important Notes
|
||||
* For more details [check out our wiki](https://pojavlauncherteam.github.io/)
|
||||
## Some notes to start with
|
||||
- We do not have an official TikTok account. No one from the dev team makes TikTok videos.
|
||||
- The official Twitter for PojavLauncher is [@PLaunchTeam](https://twitter.com/PLaunchTeam). Any others (most notably @PojavLauncher) are fake.
|
||||
|
||||
**PojavLauncher has been discontinued** and is no longer supported. Its successor is available [here](https://github.com/AngelAuraMC/Amethyst-Android).
|
||||
## Navigation
|
||||
- [Introduction](#introduction)
|
||||
- [Getting PojavLauncher](#getting-pojavlauncher)
|
||||
- [Building](#building)
|
||||
- [Current status](#current-status)
|
||||
- [License](#license)
|
||||
- [Contributing](#contributing)
|
||||
- [Credits & Third party components and their licenses](#credits--third-party-components-and-their-licenses-if-available)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Introduction](#introduction)
|
||||
* [Getting PojavLauncher](#getting-pojavlauncher)
|
||||
* [Building](#building)
|
||||
* [Quick Build (Recommended)](#quick-build-recommended)
|
||||
* [Detailed Build](#detailed-build)
|
||||
* [Current Status](#current-status)
|
||||
* [Known Issues](#known-issues)
|
||||
* [FAQ](#faq)
|
||||
* [Contributing](#contributing)
|
||||
* [Support](#support)
|
||||
* [License](#license)
|
||||
* [Credits & Dependencies](#credits--dependencies)
|
||||
* [Roadmap](#roadmap)
|
||||
|
||||
## Introduction
|
||||
|
||||
* PojavLauncher is a Minecraft: Java Edition launcher for Android and iOS based on [Boardwalk](https://github.com/zhuowei/Boardwalk)
|
||||
* This launcher can launch almost all available Minecraft versions ranging from rd-132211 to 1.21 snapshots (including Combat Test versions)
|
||||
* Modding via Forge and Fabric are also supported.
|
||||
* This repository contains source code for Android. For iOS/iPadOS, check out [PojavLauncher_iOS](https://github.com/PojavLauncherTeam/PojavLauncher_iOS).
|
||||
## Introduction
|
||||
* PojavLauncher is a Minecraft: Java Edition launcher for Android and iOS based on [Boardwalk](https://github.com/zhuowei/Boardwalk).
|
||||
* This launcher can launch almost all available Minecraft versions ranging from rd-132211 to 1.21 snapshots (including Combat Test versions).
|
||||
* Modding via Forge and Fabric are also supported.
|
||||
* This repository contains source code for Android.
|
||||
* For iOS/iPadOS, check out [PojavLauncher_iOS](https://github.com/PojavLauncherTeam/PojavLauncher_iOS).
|
||||
|
||||
## Getting PojavLauncher
|
||||
|
||||
You can get PojavLauncher via three methods:
|
||||
|
||||
1. **Releases:** Download the prebuilt app from our [stable releases](https://github.com/PojavLauncherTeam/PojavLauncher/releases) or [automatic builds](https://github.com/PojavLauncherTeam/PojavLauncher/actions).
|
||||
2. **Google Play:** Get it from Google Play by clicking on this badge: [](https://play.google.com/store/apps/details?id=net.kdt.pojavlaunch)
|
||||
3. **Build from Source:** Follow the [building instructions](#building) below.
|
||||
1. You can get the prebuilt app from [stable releases](https://github.com/PojavLauncherTeam/PojavLauncher/releases) or [automatic builds](https://github.com/PojavLauncherTeam/PojavLauncher/actions).
|
||||
|
||||
2. You can get it from Google Play by clicking on this badge:
|
||||
[](https://play.google.com/store/apps/details?id=net.kdt.pojavlaunch)
|
||||
|
||||
3. You can [build](#building) from source.
|
||||
## Building
|
||||
If you want to build from source code, follow the steps below.
|
||||
### Java Runtime Environment (JRE)
|
||||
- JRE for Android is [here](https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u), and the build script is [here](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch).
|
||||
- Follow build instruction on build script [README.md](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch/blob/buildjre8/README.md).
|
||||
- You can also get [CI auto builds](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch/actions) if you are lazy or are failing to build it for some reason.
|
||||
* Either get the `jre8-pojav` artifact from auto builds, or split all artifacts by yourself:</br>
|
||||
- Get JREs for all of 4 supported architectures (arm, arm64, x86, x86_64) </br>
|
||||
- Split JRE into parts:</br>
|
||||
Platform-independent: .jar files, libraries, configs, etc...</br>
|
||||
Platform-dependent: .so files, etc...</br>
|
||||
- Create:</br>
|
||||
A file named `universal.tar.xz` with all platform-independent files</br>
|
||||
4 files named `bin-<arch>.tar.xz` with all platform-dependent files per-architecture</br>
|
||||
- Put these in the `assets/components/jre/` folder</br>
|
||||
- (If needed) update the Version file with the current date</br>
|
||||
|
||||
### Quick Build (Recommended)
|
||||
### LWJGL
|
||||
The build instructions for the custom LWJGL are available over the [LWJGL repository](https://github.com/PojavLauncherTeam/lwjgl3)
|
||||
|
||||
The easiest way to build PojavLauncher is to use the pre-built JREs provided by our CI.
|
||||
### The Launcher
|
||||
- Because languages are auto-added by Crowdin, you need to run the language list generator before building. In the project directory, run:
|
||||
|
||||
1. Clone the repository: `git clone https://github.com/PojavLauncherTeam/PojavLauncher.git`
|
||||
2. Build the launcher: `./gradlew :app_pojavlauncher:assembleDebug` (Use `gradlew.bat` on Windows)
|
||||
* On Linux, Mac OS:
|
||||
```
|
||||
chmod +x scripts/languagelist_updater.sh
|
||||
bash scripts/languagelist_updater.sh
|
||||
```
|
||||
* On Windows:
|
||||
```
|
||||
scripts\languagelist_updater.bat
|
||||
```
|
||||
Then, run these commands ~~or build using Android Studio~~.
|
||||
|
||||
The built APK will be located in `app_pojavlauncher/build/outputs/apk/debug/`.
|
||||
* Build GLFW stub:
|
||||
```
|
||||
./gradlew :jre_lwjgl3glfw:build
|
||||
```
|
||||
* Build the launcher
|
||||
```
|
||||
./gradlew :app_pojavlauncher:assembleDebug
|
||||
```
|
||||
(Replace `gradlew` with `gradlew.bat` if you are building on Windows).
|
||||
|
||||
### Detailed Build
|
||||
|
||||
If you need more control over the build process, follow these steps:
|
||||
|
||||
1. **Java Runtime Environment (JRE):** Download the `jre8-pojav` artifact from our [CI auto builds](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch/actions). This package contains pre-built JREs for all supported architectures. If you need to build the JRE yourself, follow the instructions in the [android-openjdk-build-multiarch](https://github.com/PojavLauncherTeam/android-openjdk-build-multiarch) repository.
|
||||
|
||||
2. **LWJGL:** The build instructions for the custom LWJGL are available over the [LWJGL repository](https://github.com/PojavLauncherTeam/lwjgl3).
|
||||
|
||||
3. **Language List:** Because languages are auto-added by Crowdin, you need to run the language list generator before building. In the project directory, run:
|
||||
* Linux/macOS:
|
||||
```bash
|
||||
chmod +x scripts/languagelist_updater.sh
|
||||
bash scripts/languagelist_updater.sh
|
||||
```
|
||||
* Windows:
|
||||
```batch
|
||||
scripts\languagelist_updater.bat
|
||||
```
|
||||
|
||||
4. **Build GLFW stub:** `./gradlew :jre_lwjgl3glfw:build`
|
||||
|
||||
5. **Build the launcher:** `./gradlew :app_pojavlauncher:assembleDebug` (Replace `gradlew` with `gradlew.bat` on Windows).
|
||||
|
||||
## Current Status
|
||||
|
||||
* [x] OpenJDK 8 Mobile port: ARM32, ARM64, x86, x86_64
|
||||
* [x] OpenJDK 17 Mobile port: ARM32, ARM64, x86, x86_64
|
||||
* [x] OpenJDK 21 Mobile port: ARM32, ARM64, x86, x86_64
|
||||
* [x] Headless mod installer
|
||||
* [x] Mod installer with GUI
|
||||
* [x] OpenGL in OpenJDK environment
|
||||
* [x] OpenAL (works on most devices)
|
||||
* [x] Support for Minecraft 1.12.2 and below
|
||||
* [x] Support for Minecraft 1.13 and above
|
||||
* [x] Support for Minecraft 1.17 (22w13a) and above
|
||||
* [x] Game surface zooming
|
||||
* [x] New input pipe rewritten to native code
|
||||
* [x] Rewritten entire controls system
|
||||
* [ ] More to come!
|
||||
## Current status
|
||||
- [x] ~~OpenJDK 9 Mobile port: ARM32, ARM64, x86, x86_64.~~ Replaced by JRE8.
|
||||
- [x] OpenJDK 8 Mobile port: ARM32, ARM64, x86, x86_64
|
||||
- [x] OpenJDK 17 Mobile port: ARM32, ARM64, x86, x86_64
|
||||
- [x] Headless mod installer
|
||||
- [x] Mod installer with GUI. Used `Caciocavallo` project for AWT without X11.
|
||||
- [x] OpenGL in OpenJDK environment
|
||||
- [x] OpenAL (works on most devices)
|
||||
- [x] Support for Minecraft 1.12.2 and below. Used [lwjglx](https://github.com/PojavLauncherTeam/lwjglx), a LWJGL2 compatibility layer for LWJGL3.
|
||||
- [x] Support for Minecraft 1.13 and above. Used [GLFW stub](https://github.com/PojavLauncherTeam/lwjgl3-glfw-java).
|
||||
- [x] Support for Minecraft 1.17 (22w13a to be exact) and above. Used [Holy GL4ES](https://github.com/PojavLauncherTeam/gl4es-114-extra)
|
||||
- [x] Game surface zooming.
|
||||
- [x] New input pipe rewritten to native code to boost performance.
|
||||
- [x] Rewritten entire controls system (thanks to @Mathias-Boulay)
|
||||
- [ ] More to come!
|
||||
|
||||
## Known Issues
|
||||
|
||||
See our [issue tracker](https://github.com/PojavLauncherTeam/PojavLauncher/issues) for a list of known issues and their current status.
|
||||
|
||||
## FAQ
|
||||
|
||||
See our [wiki](https://pojavlauncherteam.github.io/) for more information.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! We welcome any type of contribution, not only code. For example, you can help improve the [wiki](https://pojavlauncherteam.github.io/), contribute to the [translations](https://crowdin.com/project/pojavlauncher), or submit bug reports and feature requests.
|
||||
|
||||
Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it.
|
||||
|
||||
## Support
|
||||
|
||||
For support, please join our [Discord server](https://discord.com/invite/aenk3EUvER).
|
||||
- Controller mods aren't working.
|
||||
- Random crashes could happen very often on Android 5.x when loading the game or joining a world.
|
||||
- With big modpacks textures could be messed up
|
||||
- Probably more, that's why we have a bug tracker ;)
|
||||
|
||||
## License
|
||||
- PojavLauncher is licensed under [GNU LGPLv3](https://github.com/PojavLauncherTeam/PojavLauncher/blob/v3_openjdk/LICENSE).
|
||||
|
||||
PojavLauncher is licensed under [GNU LGPLv3](https://github.com/PojavLauncherTeam/PojavLauncher/blob/v3_openjdk/LICENSE).
|
||||
## Contributing
|
||||
Contributions are welcome! We welcome any type of contribution, not only code. For example, you can help the wiki shape up. You can help the [translation](https://crowdin.com/project/pojavlauncher) too!
|
||||
|
||||
## Credits & Dependencies
|
||||
|
||||
* [Boardwalk](https://github.com/zhuowei/Boardwalk) (JVM Launcher): Unknown License/[Apache License 2.0](https://github.com/zhuowei/Boardwalk/blob/master/LICENSE) or GNU GPLv2.
|
||||
* Android Support Libraries: [Apache License 2.0](https://android.googlesource.com/platform/prebuilts/maven_repo/android/+/master/NOTICE.txt).
|
||||
* [GL4ES](https://github.com/PojavLauncherTeam/gl4es): [MIT License](https://github.com/ptitSeb/gl4es/blob/master/LICENSE).
|
||||
* [OpenJDK](https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u): [GNU GPLv2 License](https://openjdk.java.net/legal/gplv2+ce.html).
|
||||
* [LWJGL3](https://github.com/PojavLauncherTeam/lwjgl3): [BSD-3 License](https://github.com/LWJGL/lwjgl3/blob/master/LICENSE.md).
|
||||
* [LWJGLX](https://github.com/PojavLauncherTeam/lwjglx) (LWJGL2 API compatibility layer for LWJGL3): unknown license.
|
||||
* [Mesa 3D Graphics Library](https://gitlab.freedesktop.org/mesa/mesa): [MIT License](https://docs.mesa3d.org/license.html).
|
||||
* [pro-grade](https://github.com/pro-grade/pro-grade) (Java sandboxing security manager): [Apache License 2.0](https://github.com/pro-grade/pro-grade/blob/master/LICENSE.txt).
|
||||
* [bhook](https://github.com/bytedance/bhook) (Used for exit code trapping): [MIT license](https://github.com/bytedance/bhook/blob/main/LICENSE).
|
||||
* [libepoxy](https://github.com/anholt/libepoxy): [MIT License](https://github.com/anholt/libepoxy/blob/master/COPYING).
|
||||
* [virglrenderer](https://github.com/PojavLauncherTeam/virglrenderer): [MIT License](https://gitlab.freedesktop.org/virgl/virglrenderer/-/blob/master/COPYING).
|
||||
* Thanks to [MCHeads](https://mc-heads.net) for providing Minecraft avatars.
|
||||
Any code change to this repository (or iOS) should be submitted as a pull request. The description should explain what the code does and give steps to execute it.
|
||||
|
||||
## Roadmap
|
||||
|
||||
We are currently focusing on:
|
||||
|
||||
* Exploring new rendering technologies.
|
||||
|
||||
Future plans include:
|
||||
|
||||
* Improving stability and performance.
|
||||
* Enhancing the mod installation experience.
|
||||
|
||||
We welcome community feedback and suggestions for our roadmap. Please feel free to open a feature request in our [issue tracker](https://github.com/PojavLauncherTeam/PojavLauncher/issues).
|
||||
## Credits & Third party components and their licenses (if available)
|
||||
- [Boardwalk](https://github.com/zhuowei/Boardwalk) (JVM Launcher): Unknown License/[Apache License 2.0](https://github.com/zhuowei/Boardwalk/blob/master/LICENSE) or GNU GPLv2.
|
||||
- Android Support Libraries: [Apache License 2.0](https://android.googlesource.com/platform/prebuilts/maven_repo/android/+/master/NOTICE.txt).
|
||||
- [GL4ES](https://github.com/PojavLauncherTeam/gl4es): [MIT License](https://github.com/ptitSeb/gl4es/blob/master/LICENSE).<br>
|
||||
- [OpenJDK](https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u): [GNU GPLv2 License](https://openjdk.java.net/legal/gplv2+ce.html).<br>
|
||||
- [LWJGL3](https://github.com/PojavLauncherTeam/lwjgl3): [BSD-3 License](https://github.com/LWJGL/lwjgl3/blob/master/LICENSE.md).
|
||||
- [LWJGLX](https://github.com/PojavLauncherTeam/lwjglx) (LWJGL2 API compatibility layer for LWJGL3): unknown license.<br>
|
||||
- [Mesa 3D Graphics Library](https://gitlab.freedesktop.org/mesa/mesa): [MIT License](https://docs.mesa3d.org/license.html).
|
||||
- [pro-grade](https://github.com/pro-grade/pro-grade) (Java sandboxing security manager): [Apache License 2.0](https://github.com/pro-grade/pro-grade/blob/master/LICENSE.txt).
|
||||
- [bhook](https://github.com/bytedance/bhook) (Used for exit code trapping): [MIT license](https://github.com/bytedance/bhook/blob/main/LICENSE).
|
||||
- [libepoxy](https://github.com/anholt/libepoxy): [MIT License](https://github.com/anholt/libepoxy/blob/master/COPYING).
|
||||
- [virglrenderer](https://github.com/PojavLauncherTeam/virglrenderer): [MIT License](https://gitlab.freedesktop.org/virgl/virglrenderer/-/blob/master/COPYING).
|
||||
- Thanks to [MCHeads](https://mc-heads.net) for providing Minecraft avatars.
|
||||
@@ -1 +1 @@
|
||||
98947f23d338012c5869dc13de31cb39dadba333
|
||||
1738839797928
|
||||
@@ -1 +1 @@
|
||||
98947f23d338012c5869dc13de31cb39dadba333
|
||||
1738839797913
|
||||
@@ -1 +1 @@
|
||||
98947f23d338012c5869dc13de31cb39dadba333
|
||||
1738839797921
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="SysOut" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg{nolookups}%n" />
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy />
|
||||
<OnStartupTriggeringPolicy />
|
||||
</Policies>
|
||||
</Console>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg{nolookups}%n" />
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy />
|
||||
<OnStartupTriggeringPolicy />
|
||||
</Policies>
|
||||
</RollingRandomAccessFile>
|
||||
<Listener name="Tracy">
|
||||
<PatternLayout pattern="(%F:%L): %msg{nolookups}%n"/>
|
||||
</Listener>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="info">
|
||||
<filters>
|
||||
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
||||
</filters>
|
||||
<AppenderRef ref="SysOut"/>
|
||||
<AppenderRef ref="File"/>
|
||||
<AppenderRef ref="Tracy"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -1 +1 @@
|
||||
2
|
||||
1
|
||||
@@ -43,13 +43,11 @@ import net.kdt.pojavlaunch.services.ProgressServiceKeeper;
|
||||
import net.kdt.pojavlaunch.tasks.AsyncMinecraftDownloader;
|
||||
import net.kdt.pojavlaunch.tasks.AsyncVersionList;
|
||||
import net.kdt.pojavlaunch.tasks.MinecraftDownloader;
|
||||
import net.kdt.pojavlaunch.utils.DateUtils;
|
||||
import net.kdt.pojavlaunch.utils.NotificationUtils;
|
||||
import net.kdt.pojavlaunch.value.launcherprofiles.LauncherProfiles;
|
||||
import net.kdt.pojavlaunch.value.launcherprofiles.MinecraftProfile;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.text.ParseException;
|
||||
|
||||
public class LauncherActivity extends BaseActivity {
|
||||
public static final String SETTING_FRAGMENT_TAG = "SETTINGS_FRAGMENT";
|
||||
@@ -127,23 +125,6 @@ public class LauncherActivity extends BaseActivity {
|
||||
}
|
||||
String normalizedVersionId = AsyncMinecraftDownloader.normalizeVersionId(prof.lastVersionId);
|
||||
JMinecraftVersionList.Version mcVersion = AsyncMinecraftDownloader.getListedVersion(normalizedVersionId);
|
||||
|
||||
// Do not load when is a modded version or older than minecraft 1.3 on demo account
|
||||
if (mAccountSpinner.getSelectedAccount().isDemo()) {
|
||||
boolean isOlderThan13 = true;
|
||||
|
||||
if (mcVersion != null) {
|
||||
try {
|
||||
isOlderThan13 = DateUtils.dateBefore(DateUtils.parseReleaseDate(mcVersion.releaseTime), 2012, 6, 22);
|
||||
} catch (ParseException ignored) {}
|
||||
}
|
||||
|
||||
if (isOlderThan13) {
|
||||
Toast.makeText(this, R.string.toast_not_available_demo, Toast.LENGTH_LONG).show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
new MinecraftDownloader().start(
|
||||
this,
|
||||
mcVersion,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||
import static net.kdt.pojavlaunch.Tools.dialogForceClose;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_ENABLE_GYRO;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_SUSTAINED_PERFORMANCE;
|
||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_USE_ALTERNATE_SURFACE;
|
||||
@@ -191,11 +190,10 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
||||
android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.menu_ingame));
|
||||
gameActionClickListener = (parent, view, position, id) -> {
|
||||
switch(position) {
|
||||
case 0: dialogForceClose(MainActivity.this); break;
|
||||
case 1: openLogOutput(); break;
|
||||
case 2: dialogSendCustomKey(); break;
|
||||
case 3: openQuickSettings(); break;
|
||||
case 4: openCustomControls(); break;
|
||||
case 0: openLogOutput(); break;
|
||||
case 1: dialogSendCustomKey(); break;
|
||||
case 2: openQuickSettings(); break;
|
||||
case 3: openCustomControls(); break;
|
||||
}
|
||||
drawerLayout.closeDrawers();
|
||||
};
|
||||
|
||||
@@ -118,7 +118,6 @@ public final class Tools {
|
||||
public static String DIR_ACCOUNT_NEW;
|
||||
public static String DIR_GAME_HOME = Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/PojavLauncher";
|
||||
public static String DIR_GAME_NEW;
|
||||
public static String GAME_PROFILES_FILE;
|
||||
|
||||
// New since 3.0.0
|
||||
public static String DIRNAME_HOME_JRE = "lib";
|
||||
@@ -201,8 +200,6 @@ public final class Tools {
|
||||
OBSOLETE_RESOURCES_PATH = DIR_GAME_NEW + "/resources";
|
||||
CTRLMAP_PATH = DIR_GAME_HOME + "/controlmap";
|
||||
CTRLDEF_FILE = DIR_GAME_HOME + "/controlmap/default.json";
|
||||
GAME_PROFILES_FILE = Tools.DIR_GAME_NEW + "/launcher_profiles.json";
|
||||
switchDemo(isDemoProfile(ctx));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -464,7 +461,7 @@ public final class Tools {
|
||||
}
|
||||
|
||||
public static String[] getMinecraftClientArgs(MinecraftAccount profile, JMinecraftVersionList.Version versionInfo, File gameDir) {
|
||||
String username = profile.username.replace("Demo.", "");
|
||||
String username = profile.username;
|
||||
String versionName = versionInfo.id;
|
||||
if (versionInfo.inheritsFrom != null) {
|
||||
versionName = versionInfo.inheritsFrom;
|
||||
@@ -509,13 +506,13 @@ public final class Tools {
|
||||
}
|
||||
}
|
||||
|
||||
String mcArguments = versionInfo.minecraftArguments == null ?
|
||||
fromStringArray(minecraftArgs.toArray(new String[0])):
|
||||
versionInfo.minecraftArguments;
|
||||
|
||||
if(profile.isDemo()) mcArguments += " --demo";
|
||||
|
||||
return JSONUtils.insertJSONValueList(splitAndFilterEmpty(mcArguments), varArgMap);
|
||||
return JSONUtils.insertJSONValueList(
|
||||
splitAndFilterEmpty(
|
||||
versionInfo.minecraftArguments == null ?
|
||||
fromStringArray(minecraftArgs.toArray(new String[0])):
|
||||
versionInfo.minecraftArguments
|
||||
), varArgMap
|
||||
);
|
||||
}
|
||||
|
||||
public static String fromStringArray(String[] strArr) {
|
||||
@@ -1416,26 +1413,4 @@ public final class Tools {
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
public static void switchDemo(boolean isDemo){
|
||||
if(isDemo) {
|
||||
DIR_GAME_NEW = DIR_DATA + "/demo/.minecraft";
|
||||
} else {
|
||||
DIR_GAME_NEW = DIR_GAME_HOME + "/.minecraft";
|
||||
}
|
||||
DIR_HOME_VERSION = DIR_GAME_NEW + "/versions";
|
||||
DIR_HOME_LIBRARY = DIR_GAME_NEW + "/libraries";
|
||||
ASSETS_PATH = DIR_GAME_NEW + "/assets";
|
||||
OBSOLETE_RESOURCES_PATH = DIR_GAME_NEW + "/resources";
|
||||
}
|
||||
|
||||
public static boolean isDemoProfile(Context ctx){
|
||||
MinecraftAccount currentProfile = PojavProfile.getCurrentProfileContent(ctx, null);
|
||||
return currentProfile != null && currentProfile.isDemo();
|
||||
}
|
||||
|
||||
public static boolean isLocalProfile(Context ctx){
|
||||
MinecraftAccount currentProfile = PojavProfile.getCurrentProfileContent(ctx, null);
|
||||
return currentProfile == null || currentProfile.isLocal();
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -87,15 +87,17 @@ public class MicrosoftBackgroundLogin {
|
||||
|
||||
MinecraftAccount acc = MinecraftAccount.load(mcName);
|
||||
if(acc == null) acc = new MinecraftAccount();
|
||||
acc.xuid = xsts[0];
|
||||
acc.clientToken = "0"; /* FIXME */
|
||||
acc.accessToken = mcToken;
|
||||
acc.username = mcName;
|
||||
acc.profileId = mcUuid;
|
||||
acc.isMicrosoft = true;
|
||||
acc.msaRefreshToken = msRefreshToken;
|
||||
acc.expiresAt = expiresAt;
|
||||
acc.updateSkinFace();
|
||||
if (doesOwnGame) {
|
||||
acc.xuid = xsts[0];
|
||||
acc.clientToken = "0"; /* FIXME */
|
||||
acc.accessToken = mcToken;
|
||||
acc.username = mcName;
|
||||
acc.profileId = mcUuid;
|
||||
acc.isMicrosoft = true;
|
||||
acc.msaRefreshToken = msRefreshToken;
|
||||
acc.expiresAt = expiresAt;
|
||||
acc.updateSkinFace();
|
||||
}
|
||||
acc.save();
|
||||
|
||||
if(doneListener != null) {
|
||||
@@ -296,9 +298,7 @@ public class MicrosoftBackgroundLogin {
|
||||
}else{
|
||||
Log.i("MicrosoftLogin","It seems that this Microsoft Account does not own the game.");
|
||||
doesOwnGame = false;
|
||||
mcName = "Demo.Player";
|
||||
mcUuid = "00000000-0000-0000-0000-000000000000";
|
||||
//throw new PresentedException(new RuntimeException(conn.getResponseMessage()), R.string.minecraft_not_owned);
|
||||
throw new PresentedException(new RuntimeException(conn.getResponseMessage()), R.string.minecraft_not_owned);
|
||||
//throwResponseError(conn);
|
||||
}
|
||||
}
|
||||
|
||||
+51
-2
@@ -2,12 +2,61 @@ package net.kdt.pojavlaunch.customcontrols.gamepad;
|
||||
|
||||
import static android.view.InputDevice.KEYBOARD_TYPE_ALPHABETIC;
|
||||
import static android.view.InputDevice.SOURCE_GAMEPAD;
|
||||
import static android.view.KeyEvent.KEYCODE_DPAD_CENTER;
|
||||
import static android.view.KeyEvent.KEYCODE_DPAD_DOWN;
|
||||
import static android.view.KeyEvent.KEYCODE_DPAD_LEFT;
|
||||
import static android.view.KeyEvent.KEYCODE_DPAD_RIGHT;
|
||||
import static android.view.KeyEvent.KEYCODE_DPAD_UP;
|
||||
|
||||
import android.view.InputDevice;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
|
||||
public class GamepadDpad {
|
||||
public static boolean isDpadEvent(KeyEvent event) {
|
||||
return event.isFromSource(SOURCE_GAMEPAD) && (event.getDevice() == null || event.getDevice().getKeyboardType() != KEYBOARD_TYPE_ALPHABETIC);
|
||||
private int mLastKeycode = KEYCODE_DPAD_CENTER;
|
||||
|
||||
/**
|
||||
* Convert the event to a 2 int array: keycode and keyAction, similar to a keyEvent
|
||||
* @param event The motion to convert
|
||||
* @return int[0] keycode, int[1] keyAction
|
||||
*/
|
||||
public int[] convertEvent(MotionEvent event){
|
||||
// Use the hat axis value to find the D-pad direction
|
||||
float xaxis = event.getAxisValue(MotionEvent.AXIS_HAT_X);
|
||||
float yaxis = event.getAxisValue(MotionEvent.AXIS_HAT_Y);
|
||||
int action = KeyEvent.ACTION_DOWN;
|
||||
|
||||
// Check if the AXIS_HAT_X value is -1 or 1, and set the D-pad
|
||||
// LEFT and RIGHT direction accordingly.
|
||||
if (Float.compare(xaxis, -1.0f) == 0) {
|
||||
mLastKeycode = KEYCODE_DPAD_LEFT;
|
||||
} else if (Float.compare(xaxis, 1.0f) == 0) {
|
||||
mLastKeycode = KEYCODE_DPAD_RIGHT;
|
||||
}
|
||||
// Check if the AXIS_HAT_Y value is -1 or 1, and set the D-pad
|
||||
// UP and DOWN direction accordingly.
|
||||
else if (Float.compare(yaxis, -1.0f) == 0) {
|
||||
mLastKeycode = KEYCODE_DPAD_UP;
|
||||
} else if (Float.compare(yaxis, 1.0f) == 0) {
|
||||
mLastKeycode = KEYCODE_DPAD_DOWN;
|
||||
}else {
|
||||
//No keycode change
|
||||
action = KeyEvent.ACTION_UP;
|
||||
}
|
||||
|
||||
return new int[]{mLastKeycode, action};
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused") public static boolean isDpadEvent(MotionEvent event) {
|
||||
// Check that input comes from a device with directional pads.
|
||||
// And... also the joystick since it declares sometimes as a joystick.
|
||||
return (event.getSource() & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK;
|
||||
}
|
||||
|
||||
public static boolean isDpadEvent(KeyEvent event){
|
||||
//return ((event.getSource() & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) && (event.getDevice().getKeyboardType() == KEYBOARD_TYPE_NON_ALPHABETIC);
|
||||
return event.isFromSource(SOURCE_GAMEPAD) && event.getDevice().getKeyboardType() != KEYBOARD_TYPE_ALPHABETIC;
|
||||
}
|
||||
}
|
||||
+1
-15
@@ -64,15 +64,7 @@ public class MainMenuFragment extends Fragment {
|
||||
|
||||
mShareLogsButton.setOnClickListener((v) -> shareLog(requireContext()));
|
||||
|
||||
mOpenDirectoryButton.setOnClickListener((v)-> {
|
||||
Tools.switchDemo(Tools.isDemoProfile(v.getContext())); // avoid switching accounts being able to access
|
||||
if(Tools.isDemoProfile(v.getContext())){
|
||||
Toast.makeText(v.getContext(), R.string.toast_not_available_demo, Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
openPath(v.getContext(), getCurrentProfileDirectory(), false);
|
||||
});
|
||||
mOpenDirectoryButton.setOnClickListener((v)-> openPath(v.getContext(), getCurrentProfileDirectory(), false));
|
||||
|
||||
|
||||
mNewsButton.setOnLongClickListener((v)->{
|
||||
@@ -97,12 +89,6 @@ public class MainMenuFragment extends Fragment {
|
||||
}
|
||||
|
||||
private void runInstallerWithConfirmation(boolean isCustomArgs) {
|
||||
// avoid using custom installers to install a version
|
||||
if(Tools.isLocalProfile(requireContext()) || Tools.isDemoProfile(requireContext())){
|
||||
Toast.makeText(requireContext(), R.string.toast_not_available_demo, Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ProgressKeeper.getTaskCount() == 0)
|
||||
Tools.installMod(requireActivity(), isCustomArgs);
|
||||
else
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class OptiFineInstallFragment extends ModVersionListFragment<OptiFineUtil
|
||||
|
||||
@Override
|
||||
public Runnable createDownloadTask(Object selectedVersion, ModloaderListenerProxy listenerProxy) {
|
||||
return new OptiFineDownloadTask((OptiFineUtils.OptiFineVersion) selectedVersion, listenerProxy, requireActivity());
|
||||
return new OptiFineDownloadTask((OptiFineUtils.OptiFineVersion) selectedVersion, listenerProxy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-17
@@ -2,13 +2,11 @@ package net.kdt.pojavlaunch.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import net.kdt.pojavlaunch.PojavProfile;
|
||||
import net.kdt.pojavlaunch.R;
|
||||
import net.kdt.pojavlaunch.Tools;
|
||||
|
||||
@@ -27,25 +25,17 @@ public class ProfileTypeSelectFragment extends Fragment {
|
||||
// NOTE: Special care needed! If you wll decide to add these to the back stack, please read
|
||||
// the comment in FabricInstallFragment.onDownloadFinished() and amend the code
|
||||
// in FabricInstallFragment.onDownloadFinished() and ModVersionListFragment.onDownloadFinished()
|
||||
view.findViewById(R.id.optifine_profile).setOnClickListener(v ->
|
||||
tryInstall(OptiFineInstallFragment.class, OptiFineInstallFragment.TAG));
|
||||
view.findViewById(R.id.optifine_profile).setOnClickListener(v -> Tools.swapFragment(requireActivity(), OptiFineInstallFragment.class,
|
||||
OptiFineInstallFragment.TAG, null));
|
||||
view.findViewById(R.id.modded_profile_fabric).setOnClickListener((v)->
|
||||
tryInstall(FabricInstallFragment.class, FabricInstallFragment.TAG));
|
||||
Tools.swapFragment(requireActivity(), FabricInstallFragment.class, FabricInstallFragment.TAG, null));
|
||||
view.findViewById(R.id.modded_profile_forge).setOnClickListener((v)->
|
||||
tryInstall(ForgeInstallFragment.class, ForgeInstallFragment.TAG));
|
||||
Tools.swapFragment(requireActivity(), ForgeInstallFragment.class, ForgeInstallFragment.TAG, null));
|
||||
view.findViewById(R.id.modded_profile_modpack).setOnClickListener((v)->
|
||||
tryInstall(SearchModFragment.class, SearchModFragment.TAG));
|
||||
Tools.swapFragment(requireActivity(), SearchModFragment.class, SearchModFragment.TAG, null));
|
||||
view.findViewById(R.id.modded_profile_quilt).setOnClickListener((v)->
|
||||
tryInstall(QuiltInstallFragment.class, QuiltInstallFragment.TAG));
|
||||
Tools.swapFragment(requireActivity(), QuiltInstallFragment.class, QuiltInstallFragment.TAG, null));
|
||||
view.findViewById(R.id.modded_profile_bta).setOnClickListener((v)->
|
||||
tryInstall(BTAInstallFragment.class, BTAInstallFragment.TAG));
|
||||
}
|
||||
|
||||
private void tryInstall(Class<? extends Fragment> fragmentClass, String tag){
|
||||
if(Tools.isLocalProfile(requireContext()) || Tools.isDemoProfile(requireContext())){
|
||||
Toast.makeText(requireContext(), R.string.toast_not_available_demo, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Tools.swapFragment(requireActivity(), fragmentClass, tag, null);
|
||||
}
|
||||
Tools.swapFragment(requireActivity(), BTAInstallFragment.class, BTAInstallFragment.TAG, null));
|
||||
}
|
||||
}
|
||||
+2
-6
@@ -1,7 +1,5 @@
|
||||
package net.kdt.pojavlaunch.modloaders;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.kdt.mcgui.ProgressLayout;
|
||||
|
||||
import net.kdt.pojavlaunch.JMinecraftVersionList;
|
||||
@@ -24,13 +22,11 @@ public class OptiFineDownloadTask implements Runnable, Tools.DownloaderFeedback,
|
||||
private final ModloaderDownloadListener mListener;
|
||||
private final Object mMinecraftDownloadLock = new Object();
|
||||
private Throwable mDownloaderThrowable;
|
||||
private final Activity activity;
|
||||
|
||||
public OptiFineDownloadTask(OptiFineUtils.OptiFineVersion mOptiFineVersion, ModloaderDownloadListener mListener, Activity activity) {
|
||||
public OptiFineDownloadTask(OptiFineUtils.OptiFineVersion mOptiFineVersion, ModloaderDownloadListener mListener) {
|
||||
this.mOptiFineVersion = mOptiFineVersion;
|
||||
this.mDestinationFile = new File(Tools.DIR_CACHE, "optifine-installer.jar");
|
||||
this.mListener = mListener;
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +89,7 @@ public class OptiFineDownloadTask implements Runnable, Tools.DownloaderFeedback,
|
||||
if(minecraftJsonVersion == null) return false;
|
||||
try {
|
||||
synchronized (mMinecraftDownloadLock) {
|
||||
new MinecraftDownloader().start(activity, minecraftJsonVersion, minecraftVersion, this);
|
||||
new MinecraftDownloader().start(null, minecraftJsonVersion, minecraftVersion, this);
|
||||
mMinecraftDownloadLock.wait();
|
||||
}
|
||||
}catch (InterruptedException e) {
|
||||
|
||||
@@ -54,8 +54,6 @@ public class MinecraftDownloader {
|
||||
|
||||
private static final ThreadLocal<byte[]> sThreadLocalDownloadBuffer = new ThreadLocal<>();
|
||||
|
||||
private boolean isLocalProfile = false;
|
||||
|
||||
/**
|
||||
* Start the game version download process on the global executor service.
|
||||
* @param activity Activity, used for automatic installation of JRE 17 if needed
|
||||
@@ -66,14 +64,6 @@ public class MinecraftDownloader {
|
||||
public void start(@Nullable Activity activity, @Nullable JMinecraftVersionList.Version version,
|
||||
@NonNull String realVersion, // this was there for a reason
|
||||
@NonNull AsyncMinecraftDownloader.DoneListener listener) {
|
||||
if(activity != null){
|
||||
isLocalProfile = Tools.isLocalProfile(activity);
|
||||
Tools.switchDemo(Tools.isDemoProfile(activity));
|
||||
} else {
|
||||
isLocalProfile = true;
|
||||
Tools.switchDemo(true);
|
||||
}
|
||||
|
||||
sExecutorService.execute(() -> {
|
||||
try {
|
||||
downloadGame(activity, version, realVersion);
|
||||
@@ -516,10 +506,6 @@ public class MinecraftDownloader {
|
||||
}
|
||||
|
||||
private void downloadFile() throws Exception {
|
||||
if(isLocalProfile){
|
||||
throw new RuntimeException("Download failed. Please make sure you are logged in with a Microsoft Account.");
|
||||
}
|
||||
|
||||
try {
|
||||
DownloadUtils.ensureSha1(mTargetPath, mTargetSha1, () -> {
|
||||
DownloadMirror.downloadFileMirrored(mDownloadClass, mTargetUrl, mTargetPath,
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.apache.commons.io.*;
|
||||
@SuppressWarnings("IOStreamConstructor")
|
||||
public class DownloadUtils {
|
||||
public static final String USER_AGENT = Tools.APP_NAME;
|
||||
private static final int TIME_OUT = 10000;
|
||||
|
||||
public static void download(String url, OutputStream os) throws IOException {
|
||||
download(new URL(url), os);
|
||||
@@ -27,8 +26,7 @@ public class DownloadUtils {
|
||||
// System.out.println("Connecting: " + url.toString());
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestProperty("User-Agent", USER_AGENT);
|
||||
conn.setConnectTimeout(TIME_OUT);
|
||||
conn.setReadTimeout(TIME_OUT);
|
||||
conn.setConnectTimeout(10000);
|
||||
conn.setDoInput(true);
|
||||
conn.connect();
|
||||
if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
|
||||
@@ -69,8 +67,6 @@ public class DownloadUtils {
|
||||
FileUtils.ensureParentDirectory(outputFile);
|
||||
|
||||
HttpURLConnection conn = (HttpURLConnection) new URL(urlInput).openConnection();
|
||||
conn.setConnectTimeout(TIME_OUT);
|
||||
conn.setReadTimeout(TIME_OUT);
|
||||
InputStream readStr = conn.getInputStream();
|
||||
try (FileOutputStream fos = new FileOutputStream(outputFile)) {
|
||||
int current;
|
||||
@@ -85,9 +81,8 @@ public class DownloadUtils {
|
||||
monitor.updateProgress(overall, length);
|
||||
}
|
||||
conn.disconnect();
|
||||
} catch (IOException e) {
|
||||
throw new IOException("Unable to download from " + urlInput, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static <T> T downloadStringCached(String url, String cacheName, ParseCallback<T> parseCallback) throws IOException, ParseException{
|
||||
|
||||
@@ -223,6 +223,18 @@ public class JREUtils {
|
||||
envMap.put("AWTSTUB_WIDTH", Integer.toString(CallbackBridge.windowWidth > 0 ? CallbackBridge.windowWidth : CallbackBridge.physicalWidth));
|
||||
envMap.put("AWTSTUB_HEIGHT", Integer.toString(CallbackBridge.windowHeight > 0 ? CallbackBridge.windowHeight : CallbackBridge.physicalHeight));
|
||||
|
||||
File customEnvFile = new File(Tools.DIR_GAME_HOME, "custom_env.txt");
|
||||
if (customEnvFile.exists() && customEnvFile.isFile()) {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(customEnvFile));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// Not use split() as only split first one
|
||||
int index = line.indexOf("=");
|
||||
envMap.put(line.substring(0, index), line.substring(index + 1));
|
||||
}
|
||||
reader.close();
|
||||
}
|
||||
|
||||
GLInfoUtils.GLInfo info = GLInfoUtils.getGlInfo();
|
||||
if(!envMap.containsKey("LIBGL_ES") && LOCAL_RENDERER != null) {
|
||||
int glesMajor = info.glesMajorVersion;
|
||||
@@ -244,8 +256,6 @@ public class JREUtils {
|
||||
envMap.put("POJAV_LOAD_TURNIP", "1");
|
||||
}
|
||||
|
||||
readCustomEnv(envMap); // Must be last so it overrides anything the user sets for obvious reasons.
|
||||
|
||||
for (Map.Entry<String, String> env : envMap.entrySet()) {
|
||||
Logger.appendToLog("Added custom env: " + env.getKey() + "=" + env.getValue());
|
||||
try {
|
||||
@@ -264,19 +274,6 @@ public class JREUtils {
|
||||
// return ldLibraryPath;
|
||||
}
|
||||
|
||||
private static void readCustomEnv(Map<String, String> envMap) throws IOException {
|
||||
File customEnvFile = new File(Tools.DIR_GAME_HOME, "custom_env.txt");
|
||||
if (customEnvFile.exists() && customEnvFile.isFile()) {
|
||||
BufferedReader reader = new BufferedReader(new FileReader(customEnvFile));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// Not use split() as only split first one
|
||||
int index = line.indexOf("=");
|
||||
envMap.put(line.substring(0, index), line.substring(index + 1));
|
||||
}
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
public static void launchJavaVM(final AppCompatActivity activity, final Runtime runtime, File gameDirectory, final List<String> JVMArgs, final String userArgsString) throws Throwable {
|
||||
String runtimeHome = MultiRTUtils.getRuntimeHome(runtime.name).getAbsolutePath();
|
||||
|
||||
|
||||
@@ -45,11 +45,7 @@ public class MinecraftAccount {
|
||||
}
|
||||
|
||||
public boolean isLocal(){
|
||||
return accessToken.equals("0") && !username.startsWith("Demo.");
|
||||
}
|
||||
|
||||
public boolean isDemo(){
|
||||
return username.startsWith("Demo.");
|
||||
return accessToken.equals("0");
|
||||
}
|
||||
|
||||
public void updateSkinFace() {
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
|
||||
public class LauncherProfiles {
|
||||
public static MinecraftLauncherProfiles mainProfileJson;
|
||||
private static final File launcherProfilesFile = new File(Tools.GAME_PROFILES_FILE);
|
||||
private static final File launcherProfilesFile = new File(Tools.DIR_GAME_NEW, "launcher_profiles.json");
|
||||
|
||||
/** Reload the profile from the file, creating a default one if necessary */
|
||||
public static void load(){
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,7 +27,6 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="menu_ingame">
|
||||
<item>@string/control_forceclose</item>
|
||||
<item>@string/control_viewout</item>
|
||||
<item>@string/control_customkey</item>
|
||||
<item>@string/quick_setting_title</item>
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
<string name="main_add_account">Add account</string>
|
||||
<string name="tasks_ongoing">Tasks are in progress, please wait</string>
|
||||
<string name="no_saved_accounts">No saved accounts</string>
|
||||
<string name="mc_download_failed">Failed to download Minecraft! This could be due to bad network connection, incorrectly placed files, trying to download Minecraft from a Local account, etc..</string>
|
||||
<string name="mc_download_failed">Failed to download Minecraft! This could be due to bad network connection, incorrectly placed files, etc..</string>
|
||||
<string name="xerr_unknown">Unknown Xbox Live API error %d</string>
|
||||
<string name="xerr_no_account">You don\'t seem to have an Xbox Live account. Please log in once on https://minecraft.net/ and try again.</string>
|
||||
<string name="xerr_adult_verification">An adult needs to verify your account.</string>
|
||||
@@ -430,5 +430,4 @@
|
||||
<string name="bta_installer_untested_versions">Untested BTA versions</string>
|
||||
<string name="bta_installer_nightly_versions">Nightly BTA versions</string>
|
||||
<string name="newdl_extracting_native_libraries">Extracting native libraries (%d/%d)</string>
|
||||
<string name="toast_not_available_demo">This is not available in demo mode</string>
|
||||
</resources>
|
||||
@@ -6,15 +6,12 @@ java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes("Manifest-Version": "1.0",
|
||||
"PreMain-Class": "git.artdeell.arcdns.ArcDNSInjectorAgent")
|
||||
}
|
||||
if (gitUsed()){
|
||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/version")
|
||||
versionFile.write(getGitHash(project.name))
|
||||
}
|
||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/version")
|
||||
versionFile.write(String.valueOf(new Date().getTime()))
|
||||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/"))
|
||||
}
|
||||
@@ -1,33 +1 @@
|
||||
import java.io.IOException
|
||||
plugins{
|
||||
id 'com.android.application' version '8.7.2' apply false
|
||||
id 'com.android.library' version '8.7.2' apply false
|
||||
}
|
||||
|
||||
String getGitHash(String project) {
|
||||
def command = Runtime.getRuntime().exec("git rev-list -1 HEAD " + project)
|
||||
def returnCode = command.waitFor()
|
||||
if (returnCode != 0) {
|
||||
throw new IOException("Command 'getGitHash()' exited with " + returnCode)
|
||||
}
|
||||
String gitCommitHash = command.inputStream.text.trim()
|
||||
return gitCommitHash
|
||||
}
|
||||
|
||||
Boolean gitUsed() {
|
||||
def returnCode = Runtime.getRuntime().exec("git rev-parse --is-inside-work-tree").waitFor()
|
||||
switch(returnCode){
|
||||
case 127:
|
||||
println("git not found");
|
||||
return false;
|
||||
break;
|
||||
case 128:
|
||||
println("not inside a git repository");
|
||||
return false;
|
||||
break;
|
||||
case 0:
|
||||
return true;
|
||||
default:
|
||||
throw new IOException("Command 'gitUsed()' exited with " + returnCode)
|
||||
}
|
||||
}
|
||||
@@ -15,13 +15,11 @@ jar {
|
||||
from {
|
||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
if (gitUsed()){
|
||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/forge_installer/version")
|
||||
versionFile.write(getGitHash(project.name))
|
||||
}
|
||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/forge_installer/version")
|
||||
versionFile.write(String.valueOf(new Date().getTime()))
|
||||
manifest {
|
||||
attributes("Manifest-Version": "1.0",
|
||||
"PreMain-Class": "git.artdeell.installer_agent.Agent")
|
||||
}
|
||||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/forge_installer/"))
|
||||
}
|
||||
}
|
||||
Submodule
+1
Submodule gl4es added at b9c0c79dd9.
+1
-1
@@ -1,7 +1,7 @@
|
||||
#Fri Dec 06 21:56:04 CET 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -10,10 +10,9 @@ jar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
archiveBaseName = "lwjgl-glfw-classes"
|
||||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/lwjgl3/"))
|
||||
if (gitUsed()){
|
||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/lwjgl3/version")
|
||||
versionFile.write(getGitHash(project.name))
|
||||
}
|
||||
// Auto update the version with a timestamp so the project jar gets updated by Pojav
|
||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/lwjgl3/version")
|
||||
versionFile.write(String.valueOf(new Date().getTime()))
|
||||
from {
|
||||
configurations.default.collect {
|
||||
println(it.getName())
|
||||
|
||||
Reference in new issue
Block a user