Compare commits
215
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e609dae5f7 | ||
|
|
3bcf2df9fa | ||
|
|
17ce185671 | ||
|
|
1fa0600d2c | ||
|
|
f6dc6db716 | ||
|
|
8bc725feb2 | ||
|
|
3cbed5bd7e | ||
|
|
bafbe384a1 | ||
|
|
378a2751ba | ||
|
|
383fdebad3 | ||
|
|
d7b9afb6bf | ||
|
|
b4389c86c3 | ||
|
|
729b228352 | ||
|
|
765936d422 | ||
|
|
29f9d19eea | ||
|
|
a47c3a0c7d | ||
|
|
98d3c1119d | ||
|
|
11382a795b | ||
|
|
ad5c86b95d | ||
|
|
2b0a96f4fe | ||
|
|
85eb3b340e | ||
|
|
e53c2e0cdb | ||
|
|
6df31a7be3 | ||
|
|
93055a2987 | ||
|
|
6b834de942 | ||
|
|
7aed98b7e3 | ||
|
|
03cde0b439 | ||
|
|
938000a041 | ||
|
|
10825d7b74 | ||
|
|
f7d95f2221 | ||
|
|
f9ef2f193b | ||
|
|
2d49ee8eb1 | ||
|
|
1d605bd634 | ||
|
|
7ea0ec1f20 | ||
|
|
d009fb359a | ||
|
|
1be7b74032 | ||
|
|
c45896b98a | ||
|
|
f85860fe98 | ||
|
|
91108a7d39 | ||
|
|
12d6096aed | ||
|
|
f55c0c80be | ||
|
|
50b5b6142b | ||
|
|
14f0d159b0 | ||
|
|
71decc46df | ||
|
|
861ed8352a | ||
|
|
0d36c0c19b | ||
|
|
a4b5301b90 | ||
|
|
c0cac50026 | ||
|
|
7ecb14534b | ||
|
|
226c8ae7e9 | ||
|
|
6132f81b25 | ||
|
|
fdc72af987 | ||
|
|
c491ec5edc | ||
|
|
fa7a340b2b | ||
|
|
759f692369 | ||
|
|
6ff539fb66 | ||
|
|
c5b79ab4ab | ||
|
|
21a6cb7074 | ||
|
|
8df8c90d34 | ||
|
|
0932fcad09 | ||
|
|
f02ae570c6 | ||
|
|
a5d020da94 | ||
|
|
3a450ae911 | ||
|
|
3bbec01507 | ||
|
|
7c68a3ac2a | ||
|
|
f8a73da290 | ||
|
|
8f7b17955a | ||
|
|
9a7981138f | ||
|
|
21c4b8d056 | ||
|
|
d5774ca006 | ||
|
|
0d2cd19b84 | ||
|
|
5b12c7bfb4 | ||
|
|
9d4b607003 | ||
|
|
234c1eaf9a | ||
|
|
457311354b | ||
|
|
a3a58aaa0a | ||
|
|
c0122c2a72 | ||
|
|
b82cb2fc45 | ||
|
|
827ab9f4dc | ||
|
|
45dc25e16c | ||
|
|
1aa5a9651b | ||
|
|
4d81e7e843 | ||
|
|
57fc260eac | ||
|
|
05aafcbd27 | ||
|
|
e5a04c7e78 | ||
|
|
cb143956e4 | ||
|
|
a916648e45 | ||
|
|
57249f2d0c | ||
|
|
1e9256c60b | ||
|
|
94b05fcd3a | ||
|
|
d451ee4dfe | ||
|
|
7a55074fb4 | ||
|
|
44afbe23f9 | ||
|
|
176cbe3ca1 | ||
|
|
ce0125658a | ||
|
|
3f11b01888 | ||
|
|
6631a588cb | ||
|
|
84d6ff85eb | ||
|
|
33dc73a98e | ||
|
|
0d6446de14 | ||
|
|
54ba0d759d | ||
|
|
faff301e32 | ||
|
|
ee4a84016f | ||
|
|
9632601aa3 | ||
|
|
4019487b68 | ||
|
|
9c6f2950b6 | ||
|
|
cfbc54017c | ||
|
|
f981615df9 | ||
|
|
a170dd0d7e | ||
|
|
e40c4955ab | ||
|
|
556b5cede4 | ||
|
|
3f1bec6368 | ||
|
|
ad584b81b8 | ||
|
|
beaa6883e3 | ||
|
|
02d4cf7d04 | ||
|
|
185d1cdb3c | ||
|
|
dfc0b3f719 | ||
|
|
60f804638a | ||
|
|
e6b8e8cf22 | ||
|
|
f4f6f6868a | ||
|
|
f4bdbba873 | ||
|
|
5741453299 | ||
|
|
b231706328 | ||
|
|
8376e7541f | ||
|
|
2ee7be113c | ||
|
|
50520593d7 | ||
|
|
2c8a0887a5 | ||
|
|
fcbfd51979 | ||
|
|
edcb8492c2 | ||
|
|
3b628d2883 | ||
|
|
47a7be595e | ||
|
|
4bda2a8672 | ||
|
|
32672372aa | ||
|
|
3d0264923d | ||
|
|
efffa26f2f | ||
|
|
d02e5cdff2 | ||
|
|
99dd12efce | ||
|
|
dda4e6f6c0 | ||
|
|
2434086335 | ||
|
|
ed6f15dd6f | ||
|
|
6345c352c2 | ||
|
|
7a92d86ad4 | ||
|
|
99e22c9a84 | ||
|
|
3dd6abb623 | ||
|
|
174f44c09a | ||
|
|
d545bf4bc8 | ||
|
|
487dcc8eee | ||
|
|
b4d7359366 | ||
|
|
3def5bd8a1 | ||
|
|
fc951edf61 | ||
|
|
a871fb1e48 | ||
|
|
21eb5c0aa5 | ||
|
|
6986c58853 | ||
|
|
bc06d0a94e | ||
|
|
c286c79722 | ||
|
|
9924302604 | ||
|
|
886bc74837 | ||
|
|
7868dff575 | ||
|
|
534243e8ba | ||
|
|
2d87c186eb | ||
|
|
5c2ce7534d | ||
|
|
a53d6ce0a4 | ||
|
|
7abd75ae98 | ||
|
|
755393cb10 | ||
|
|
b36cb0d45f | ||
|
|
8d5f5e3126 | ||
|
|
09da15ef13 | ||
|
|
99444d8b4a | ||
|
|
9cd20869c3 | ||
|
|
24bda98648 | ||
|
|
b72184a8d8 | ||
|
|
5c69b52161 | ||
|
|
c3280d31ae | ||
|
|
73958353a8 | ||
|
|
5494ed6b86 | ||
|
|
e8bbe7ae68 | ||
|
|
535725c149 | ||
|
|
0f9bf4608e | ||
|
|
d14ef38b8f | ||
|
|
0bda4a11fc | ||
|
|
a0e61210c7 | ||
|
|
fc19594127 | ||
|
|
bb343f26da | ||
|
|
058a280ca4 | ||
|
|
ee333d89c0 | ||
|
|
511a9110b5 | ||
|
|
ed6efd7f9f | ||
|
|
dfaff7ff33 | ||
|
|
9d347f2a66 | ||
|
|
03edbeb4cf | ||
|
|
f16b70d988 | ||
|
|
2ec155fcf2 | ||
|
|
3a3786bc7f | ||
|
|
8759a9f85d | ||
|
|
120a3d3206 | ||
|
|
39c3281f33 | ||
|
|
ede65a8c90 | ||
|
|
bd7a465a51 | ||
|
|
5af41ff0b8 | ||
|
|
6e0f5e819c | ||
|
|
b99ad2de4b | ||
|
|
f87771b5e0 | ||
|
|
5250faa924 | ||
|
|
65f1de276f | ||
|
|
dfeb505373 | ||
|
|
5f1e53e577 | ||
|
|
2035ba6e06 | ||
|
|
fb25891e3c | ||
|
|
980389a1af | ||
|
|
88370b1b7c | ||
|
|
9e68f13aec | ||
|
|
cd37263b35 | ||
|
|
4d008013ad | ||
|
|
0f76135da8 | ||
|
|
8ef9e2f4e6 |
No files matched your search
+59
@@ -0,0 +1,59 @@
|
||||
language: android
|
||||
sudo: required
|
||||
jdk: oraclejdk8
|
||||
|
||||
env:
|
||||
global:
|
||||
- ANDROID_API_LEVEL=26
|
||||
- ANDROID_BUILD_TOOLS_VERSION=26.0.0
|
||||
- ANDROID_ABI=armeabi-v7a
|
||||
- ANDROID_ABI=X86
|
||||
- ANDROID_ABI=ARMEABI_V7A
|
||||
|
||||
android:
|
||||
components:
|
||||
- tools
|
||||
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
|
||||
- android-$ANDROID_API_LEVEL
|
||||
- extra-android-m2repository
|
||||
licenses:
|
||||
- yes | sudo sdkmanager --licenses
|
||||
- 'android-sdk-preview-license-52d11cd2'
|
||||
- 'android-sdk-license-.+'
|
||||
- 'google-gdk-license-.+'
|
||||
|
||||
before_install:
|
||||
- yes | sdkmanager "platforms;android-26"
|
||||
- yes | sdkmanager "build-tools;26.0.0"
|
||||
- yes | sdkmanager "platforms;android-28"
|
||||
- yes | sdkmanager "build-tools;28.0.3"
|
||||
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
- $HOME/.android/build-cache
|
||||
|
||||
before_script:
|
||||
- chmod +x gradlew
|
||||
|
||||
script:
|
||||
- ./gradlew clean build
|
||||
- ./gradlew test
|
||||
|
||||
deploy:
|
||||
provider: release
|
||||
api-key: $GITHUB_API_KEY
|
||||
file: $TRAVIS_BUILD_DIR/app/build/outputs/apk/debug/app-debug.apk
|
||||
skip_cleanup: true
|
||||
name: PojavLauncher_DevBuild-$TRAVIS_COMMIT
|
||||
body: Automatic build of PojavLauncher from the latest source commit ($TRAVIS_COMMIT) built by Travis CI on $(date +'%F %T %Z').
|
||||
prerelease: true
|
||||
overwrite: true
|
||||
target_commitish: $TRAVIS_COMMIT
|
||||
on:
|
||||
branch: gl4es
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,9 +1,14 @@
|
||||
[](https://travis-ci.com/github/PojavLauncherTeam/PojavLauncher)
|
||||
[](https://crowdin.com/project/pojavlauncher)
|
||||
# PojavLauncher
|
||||
An open source Minecraft: Java Edition launcher for Android based from Boardwalk. Support up-to Minecraft 1.11
|
||||
(Codes has not been sorted yet, it contains ton of classes without packing to module).
|
||||
|
||||
Discord server: https://discord.gg/6RpEJda
|
||||
|
||||
## iOS version?
|
||||
- Impossible for directly run. RoboVM is AOT Compiler. You could also try UTM with Android-x86.
|
||||
- Impossible for directly run. There's RoboVM but is AOT Compiler. You could also try UTM with Android-x86.
|
||||
- OpenJDK 9 and GL4ES has iOS port so maybe run in a jailbreaked device. I don't have a Mac OS X device to build one.
|
||||
|
||||
## Installing OptiFine?
|
||||
Follow steps [here](https://github.com/khanhduytran0/PojavLauncher/wiki/Install-OptiFine).
|
||||
@@ -14,6 +19,7 @@ Not implemented yet.
|
||||
## Known issues
|
||||
- Some Huawei devices can't run Minecraft or OptiFine.
|
||||
- Can't run multiple versions at same time.
|
||||
- V2 will not work on Android 6 and return error `ClassNotFoundException`.
|
||||
|
||||
## FAQ
|
||||
### • Unable to drag item in inventory?
|
||||
@@ -29,7 +35,7 @@ Increase max DX references. Launcher Options -> Settings -> Increase max DX refe
|
||||
- Device name
|
||||
- Android version
|
||||
|
||||
## Minecraft versions worked in PojavLauncher 2.4.2
|
||||
## Minecraft versions worked in PojavLauncher [2.5.3](https://github.com/PojavLauncherTeam/PojavLauncher/releases/tag/untagged-4e80a0c1513abab0c480)
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
@@ -86,8 +92,8 @@ Increase max DX references. Launcher Options -> Settings -> Increase max DX refe
|
||||
<td align="center"><b>Yes</b></td>
|
||||
<td align="center"><b>Yes</b></td>
|
||||
<td align="center"><b>Yes</b></td>
|
||||
<td align="center">???</td>
|
||||
<td align="center">???</td>
|
||||
<td align="center"><b>Yes</b></td>
|
||||
<td align="center"><b>Yes</b></td>
|
||||
<td align="center"><a href="https://stackoverflow.com/a/57861173">Java8</a></td>
|
||||
<td align="center"><a href="https://stackoverflow.com/a/57861173">Java8</a></td>
|
||||
</tr>
|
||||
@@ -113,18 +119,38 @@ Increase max DX references. Launcher Options -> Settings -> Increase max DX refe
|
||||
<td align="center"><a href="https://stackoverflow.com/a/57861173">Java8</a></td>
|
||||
<td align="center"><a href="https://stackoverflow.com/a/57861173">Java8</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>11.0</td>
|
||||
<td align="center"><a href="https://github.com/khanhduytran0/PojavLauncher/issues/7#issue-586928527"><b>Yes</b></a></td>
|
||||
<td align="center"><a href="https://github.com/khanhduytran0/PojavLauncher/issues/7#issue-586928527"><b>Yes</b></a></td>
|
||||
<td align="center"><a href="https://github.com/khanhduytran0/PojavLauncher/issues/7#issue-586928527"><b>Yes</b></a></td>
|
||||
<td align="center"><a href="https://github.com/khanhduytran0/PojavLauncher/issues/7#issue-586928527"><b>Yes</b></a></td>
|
||||
<td align="center"><a href="https://github.com/khanhduytran0/PojavLauncher/issues/7#issue-586928527"><b>Yes</b></a></td>
|
||||
<td align="center"><a href="https://stackoverflow.com/a/57861173">Java8</a></td>
|
||||
<td align="center"><a href="https://stackoverflow.com/a/57861173">Java8</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
## OptiFine worked in PojavLauncher 2.4.2
|
||||
## OptiFine worked in PojavLauncher [2.5.3](https://github.com/PojavLauncherTeam/PojavLauncher/releases/tag/untagged-4e80a0c1513abab0c480)
|
||||
|Android version | 9.0 |???|???|Manually Android 10|9.0|
|
||||
|-----------------|------|---|---|-----|-----|
|
||||
|Minecraft version|1.7.10|1.8|1.9| 1.10| 1.11|
|
||||
|OptiFine |OptiFine_1.7.10_HD_U_E7|???|???|OptiFine_1.10_HD_U_H5|OptiFine_1.11_HD_U_F5|
|
||||
|Status |[Worked](https://youtu.be/In_EPebQG7Q)|???|???|[Worked (manually)](https://youtu.be/TJeJcPFgzcI)|[Worked (with 1 hack)](https://youtu.be/eIawM9UmQ88)
|
||||
|
||||
## Credits
|
||||
- [BoardwalkApp](https://github.com/BoardwalkApp) for original code.
|
||||
- pTitSeb and lunixbochs for [gl4es](https://github.com/pTitSeb/gl4es).
|
||||
- ...more (in-app).
|
||||
## A note about 1.12.x
|
||||
- Minecraft 1.12.x can be run on Android 8.0 and above by use d8 for desugar and dexing in the latest v2, but will crash in singleplayer.
|
||||
|
||||
## License
|
||||
- PojavLauncher is licensed under [GNU GPLv3](https://github.com/khanhduytran0/PojavLauncher/blob/master/LICENSE).
|
||||
|
||||
## Using libraries & Third party licenses
|
||||
- (v2) Boardwalk: [Apache License 2.0](https://github.com/zhuowei/Boardwalk/blob/master/LICENSE).
|
||||
- (v2) LegacyLauncher: (unknown license).<br>
|
||||
- (all) Android Support Libraries & DX Dexer: [Apache License 2.0](https://android.googlesource.com/platform/prebuilts/maven_repo/android/+/master/NOTICE.txt).
|
||||
- (all) gl4es: [MIT License](https://github.com/ptitSeb/gl4es/blob/master/LICENSE).<br>
|
||||
- (v3) OpenJDK: [GNU GPLv2 License](https://openjdk.java.net/legal/gplv2+ce.html).<br>
|
||||
- (v3) PRoot: [GNU GPLv2 License](https://github.com/termux/proot/blob/master/COPYING).<br>
|
||||
- (all) LWJGL 2: [Legacy LWJGL License](http://legacy.lwjgl.org/license.php.html).<br>
|
||||
+26
-7
@@ -2,22 +2,41 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.0'
|
||||
|
||||
dexOptions {
|
||||
javaMaxHeapSize "4g"
|
||||
}
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
signingConfigs {
|
||||
customDebug {
|
||||
storeFile file("debug.keystore")
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
}
|
||||
defaultConfig {
|
||||
applicationId "net.kdt.pojavlaunch"
|
||||
minSdkVersion 21
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 26
|
||||
versionCode 156235
|
||||
versionName "2.5.0_preview1_6397b_20200417"
|
||||
versionName "2.5.3_6400b_20200802"
|
||||
multiDexEnabled true //important
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// Don't set to true or java.awt will be a.a or something similar.
|
||||
debug {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
multiDexEnabled = true
|
||||
signingConfig signingConfigs.customDebug
|
||||
}
|
||||
release {
|
||||
// Don't set to true or java.awt will be a.a or something similar.
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
// defaultConfig already set
|
||||
// multiDexEnabled = true
|
||||
debuggable = true
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,19 +2,25 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="net.kdt.pojavlaunch">
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"
|
||||
android:required="true" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application
|
||||
android:largeHeap="true"
|
||||
android:largeHeap="true"
|
||||
android:allowBackup="true"
|
||||
android:name=".PojavApplication"
|
||||
android:theme="@style/AppTheme"
|
||||
android:name=".PojavApplication"
|
||||
android:theme="@style/AppTheme"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:roundIcon="@drawable/ic_launcher"
|
||||
android:resizeableActivity="true">
|
||||
android:roundIcon="@drawable/ic_launcher"
|
||||
android:resizeableActivity="true">
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="ratio_float"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
@@ -25,8 +31,14 @@
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:theme="@style/MenuDialog"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:name=".FatalErrorActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"/>
|
||||
|
||||
<activity
|
||||
android:screenOrientation="sensorLandscape"
|
||||
@@ -42,8 +54,7 @@
|
||||
android:launchMode="standard"
|
||||
android:multiprocess="true"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:theme="@style/RunTheme"
|
||||
android:name=".MainActivity"
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"/>
|
||||
|
||||
<activity
|
||||
|
||||
@@ -6,11 +6,8 @@ Using libraries:
|
||||
• LegacyLauncher: Open source Minecraft LaunchWrapper by Mojang.
|
||||
• LWJGL %s.
|
||||
• openal_soft: OpenAL port for Android devices by apportable.
|
||||
• PojavDX (dx 1.16): tool to convert java bytecode to dex.
|
||||
• Java AWT Implementation includes:
|
||||
- Boardwalk's makeshift.
|
||||
- OpenJDK 7 codes implementation.
|
||||
- Developer codes (copy text, open browser,...)
|
||||
• Android HandleView of EditText for easy resize for custom controls.
|
||||
• OpenJDK Mobile 9.
|
||||
* Notes:
|
||||
- This app is under development and will not be stable.
|
||||
- This app only use LWJGL2 and didn't have a JRE8 desugar so 1.13 or above versions will not supported.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
package com.android.internal.awt;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class AndroidGraphicsDevice extends GraphicsDevice
|
||||
{
|
||||
public GraphicsConfiguration[] mConfigurations = new GraphicsConfiguration[]{new AndroidGraphicsConfiguration()};
|
||||
|
||||
@Override
|
||||
public GraphicsConfiguration[] getConfigurations() {
|
||||
return mConfigurations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsConfiguration getDefaultConfiguration() {
|
||||
return mConfigurations[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIDstring() {
|
||||
return "Android";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return TYPE_IMAGE_BUFFER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* @author Alexey A. Petrenko, Oleg V. Khaschansky
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
package com.android.internal.awt;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.harmony.awt.gl.CommonGraphicsEnvironment;
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* AndroidGraphicsEnvironment implementation
|
||||
*
|
||||
*/
|
||||
public class AndroidGraphicsEnvironment extends CommonGraphicsEnvironment
|
||||
{
|
||||
public GraphicsDevice[] mGraphicsDevices = new GraphicsDevice[]{new AndroidGraphicsDevice()};
|
||||
|
||||
@Override
|
||||
public GraphicsDevice getDefaultScreenDevice() throws HeadlessException {
|
||||
return mGraphicsDevices[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsDevice[] getScreenDevices() throws HeadlessException {
|
||||
return mGraphicsDevices;
|
||||
}
|
||||
}
|
||||
@@ -34,12 +34,12 @@ import org.apache.harmony.awt.gl.CommonGraphics2DFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.content.Context;
|
||||
import org.apache.harmony.awt.gl.*;
|
||||
|
||||
public class AndroidGraphicsFactory extends CommonGraphics2DFactory {
|
||||
|
||||
public GraphicsEnvironment createGraphicsEnvironment(WindowFactory wf) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
return new AndroidGraphicsEnvironment();
|
||||
}
|
||||
|
||||
public Font embedFont(String fontFilePath) {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -28,7 +28,7 @@ public class GLTextureView
|
||||
View.OnLayoutChangeListener {
|
||||
|
||||
private final static String TAG = "GLTextureView";
|
||||
private final static boolean LOG_ALL = false;
|
||||
private final static boolean LOG_ALL = true;
|
||||
private final static boolean LOG_ATTACH_DETACH = LOG_ALL;
|
||||
private final static boolean LOG_THREADS = LOG_ALL;
|
||||
private final static boolean LOG_PAUSE_RESUME = LOG_ALL;
|
||||
|
||||
@@ -41,16 +41,20 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
}
|
||||
|
||||
private static int getInternalId(String type, String name) {
|
||||
for (Class perType : com.android.internal.R.class.getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
try {
|
||||
for (Class perType : Class.forName("com.android.internal.R").getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return (int) f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// If unable to find in com.android.internal.R, go find in android.R
|
||||
@@ -59,7 +63,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
return (int) f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
@@ -140,10 +144,10 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
adapter.addAll(AndroidLWJGLKeycode.generateKeyName());
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);
|
||||
spinnerKeycode.setAdapter(adapter);
|
||||
if (properties.lwjglKeycode < 0) {
|
||||
spinnerKeycode.setSelection(properties.lwjglKeycode + 2);
|
||||
if (properties.keycode < 0) {
|
||||
spinnerKeycode.setSelection(properties.keycode + 2);
|
||||
} else {
|
||||
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.lwjglKeycode + 2));
|
||||
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.keycode + 2));
|
||||
}
|
||||
spinnerKeycode.setOnItemSelectedListener(new Spinner.OnItemSelectedListener(){
|
||||
|
||||
@@ -169,7 +173,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
if (editName.getText().toString().isEmpty()) {
|
||||
editName.setError(view.getResources().getString(R.string.global_error_field_empty));
|
||||
} else {
|
||||
properties.lwjglKeycode = AndroidLWJGLKeycode.getKeyIndex(spinnerKeycode.getSelectedItemPosition()) - 2;
|
||||
properties.keycode = AndroidLWJGLKeycode.getKeyIndex(spinnerKeycode.getSelectedItemPosition()) - 2;
|
||||
properties.name = editName.getText().toString();
|
||||
properties.hidden = checkHidden.isChecked();
|
||||
|
||||
|
||||
@@ -74,16 +74,20 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
||||
}
|
||||
|
||||
private int getInternalId(String type, String name) {
|
||||
for (Class perType : com.android.internal.R.class.getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
try {
|
||||
for (Class perType : Class.forName("com.android.internal.R").getDeclaredClasses()) {
|
||||
if (perType.getSimpleName().equals(type)) {
|
||||
try {
|
||||
Field f = perType.getDeclaredField(name);
|
||||
f.setAccessible(true);
|
||||
return (int) f.get(null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.util.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import android.view.View.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
|
||||
public class MineButton extends Button
|
||||
{
|
||||
@@ -42,20 +43,16 @@ public class MineButton extends Button
|
||||
|
||||
private LayerDrawable layerdrawable, layerdrawablefocus;
|
||||
|
||||
public MineButton(Context ctx)
|
||||
{
|
||||
super(ctx);
|
||||
init();
|
||||
public MineButton(Context ctx) {
|
||||
this(ctx, null);
|
||||
}
|
||||
|
||||
public MineButton(Context ctx, AttributeSet attrs)
|
||||
{
|
||||
public MineButton(Context ctx, AttributeSet attrs) {
|
||||
super(ctx, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
public void init() {
|
||||
getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.*;
|
||||
import android.util.*;
|
||||
import android.widget.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import android.graphics.*;
|
||||
|
||||
public class MineEditText extends EditText
|
||||
{
|
||||
@@ -21,7 +22,8 @@ public class MineEditText extends EditText
|
||||
|
||||
public void init()
|
||||
{
|
||||
setBackgroundResource(R.drawable.border_edittext);
|
||||
// setBackgroundResource(R.drawable.border_edittext);
|
||||
setBackgroundColor(Color.parseColor("#131313"));
|
||||
setPadding(5, 5, 5, 5);
|
||||
}
|
||||
}
|
||||
@@ -6,39 +6,26 @@ import android.support.v7.app.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import java.util.*;
|
||||
import android.content.*;
|
||||
import com.kdt.mcgui.*;
|
||||
|
||||
public class MineActivity extends AppCompatActivity implements View.OnClickListener
|
||||
{
|
||||
private int topId = 150001;
|
||||
private boolean showBeforeView = true;
|
||||
|
||||
private FontChanger fontChanger;
|
||||
|
||||
private ImageButton menu;
|
||||
private LinearLayout content, undertop;
|
||||
|
||||
private LayoutInflater li;
|
||||
|
||||
public ViewGroup replaceFonts(ViewGroup viewTree)
|
||||
{
|
||||
if (fontChanger == null) fontChanger = new FontChanger(getAssets(), "font/NotoSans-Bold.ttf");
|
||||
return fontChanger.replaceFonts(viewTree);
|
||||
}
|
||||
|
||||
public View replaceFont(TextView view)
|
||||
{
|
||||
if (fontChanger == null) fontChanger = new FontChanger(getAssets(), "font/NotoSans-Bold.ttf");
|
||||
return fontChanger.replaceFont(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
this.onCreate(savedInstanceState, true);
|
||||
}
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState, boolean showBeforeView)
|
||||
{
|
||||
protected void onCreate(Bundle savedInstanceState, boolean showBeforeView) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
this.showBeforeView = showBeforeView;
|
||||
@@ -59,10 +46,12 @@ public class MineActivity extends AppCompatActivity implements View.OnClickListe
|
||||
li.inflate(R.layout.top_bar, top, true);
|
||||
li.inflate(R.layout.bottom_bar, btm, true);
|
||||
|
||||
replaceFonts(btm);
|
||||
|
||||
replaceFont((TextView) top.findViewById(R.id.topbar_language_text));
|
||||
FontChanger.changeFonts(btm);
|
||||
|
||||
// replaceFont((TextView) top.findViewById(R.id.topbar_navmenu_changelang));
|
||||
Spinner changeLangSpinner = ((Spinner) top.findViewById(R.id.topbar_navmenu_changelang));
|
||||
// Locale l = getResources().getConfiguration().locale;
|
||||
|
||||
RelativeLayout.LayoutParams conLay = new RelativeLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
conLay.addRule(root.BELOW, topId);
|
||||
conLay.bottomMargin = 66;
|
||||
@@ -99,7 +88,7 @@ public class MineActivity extends AppCompatActivity implements View.OnClickListe
|
||||
}
|
||||
|
||||
li.inflate(resource, content, true);
|
||||
replaceFonts(content);
|
||||
FontChanger.changeFonts(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +100,7 @@ public class MineActivity extends AppCompatActivity implements View.OnClickListe
|
||||
|
||||
content.addView(view);
|
||||
if (view instanceof ViewGroup) {
|
||||
replaceFonts((ViewGroup) view);
|
||||
FontChanger.changeFonts((ViewGroup) view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -717,6 +717,8 @@ public class Main {
|
||||
String fixedName = fixPath(name);
|
||||
|
||||
if (isClass) {
|
||||
|
||||
// if (fixedName.startsWith("META-INF/versions/9")) return false;
|
||||
|
||||
if (keepResources && args.keepClassesInJar) {
|
||||
synchronized (outputResources) {
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
|
||||
package java.awt;
|
||||
|
||||
import org.apache.harmony.awt.internal.nls.Messages;
|
||||
import org.apache.harmony.awt.internal.nls.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
/**
|
||||
* The GraphicsDevice class describes the graphics devices (such as screens or
|
||||
@@ -62,7 +63,7 @@ public abstract class GraphicsDevice {
|
||||
* Constructor is not to be used directly as this class is abstract.
|
||||
*/
|
||||
protected GraphicsDevice() {
|
||||
displayMode = new DisplayMode(0, 0, DisplayMode.BIT_DEPTH_MULTI,
|
||||
displayMode = new DisplayMode(AndroidDisplay.windowWidth, AndroidDisplay.windowHeight, DisplayMode.BIT_DEPTH_MULTI,
|
||||
DisplayMode.REFRESH_RATE_UNKNOWN);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,10 @@ public abstract class GraphicsEnvironment {
|
||||
* keyboard, or mouse, false otherwise.
|
||||
*/
|
||||
public static boolean isHeadless() {
|
||||
return "true".equals(System.getProperty("java.awt.headless"));
|
||||
return false;
|
||||
|
||||
// Disable headless...
|
||||
// "true".equals(System.getProperty("java.awt.headless"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -169,14 +169,17 @@ public final class HeadlessToolkit extends ToolkitImpl {
|
||||
try {
|
||||
ComponentInternals.setComponentInternals(new ComponentInternalsImpl());
|
||||
// ???AWT: new EventQueue(this); // create the system EventQueue
|
||||
// ???AWT: dispatcher = new Dispatcher(this);
|
||||
// ???AWT:
|
||||
dispatcher = new Dispatcher(this);
|
||||
desktopProperties = new HashMap<String, Object>();
|
||||
// ???AWT: desktopPropsSupport = new PropertyChangeSupport(this);
|
||||
// ???AWT: awtEventsManager = new AWTEventsManager();
|
||||
// ???AWT:
|
||||
awtEventsManager = new AWTEventsManager();
|
||||
// ???AWT: dispatchThread = new HeadlessEventDispatchThread(this,
|
||||
// dispatcher);
|
||||
// ???AWT: dtk = DTK.getDTK();
|
||||
dispatchThread.start();
|
||||
|
||||
// dispatchThread.start();
|
||||
} finally {
|
||||
unlockAWT();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
package java.awt.image;
|
||||
|
||||
import com.android.internal.awt.AndroidGraphics2D;
|
||||
import com.android.internal.awt.BufferedImageGraphics2D;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
@@ -710,10 +710,12 @@ public class BufferedImage extends Image implements WritableRenderedImage, Trans
|
||||
* @return the graphics2D object.
|
||||
*/
|
||||
public Graphics2D createGraphics() {
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
return BufferedImageGraphics2D.getInstance(this, null);
|
||||
|
||||
//GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
// return ge.createGraphics(this);
|
||||
// ???AWT hack, FIXME
|
||||
return AndroidGraphics2D.getInstance();
|
||||
//return AndroidGraphics2D.getInstance();
|
||||
// throw new RuntimeException("Not implemented!");
|
||||
// return null;
|
||||
}
|
||||
|
||||
@@ -13,27 +13,35 @@ import java.io.*;
|
||||
import java.util.*;
|
||||
import net.kdt.pojavlaunch.value.customcontrols.*;
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import android.support.v7.preference.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
|
||||
public class CustomControlsActivity extends AppCompatActivity
|
||||
{
|
||||
private DrawerLayout drawerLayout;
|
||||
private NavigationView navDrawer;
|
||||
|
||||
private ControlsLayout ctrlLayout;
|
||||
|
||||
private String selectedName = "";
|
||||
|
||||
private CustomControls mCtrl;
|
||||
|
||||
|
||||
private SharedPreferences mPref;
|
||||
|
||||
public boolean isModified = false;
|
||||
|
||||
private Gson gson;
|
||||
private String selectedName = "new_control";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.control_mapping);
|
||||
|
||||
|
||||
mPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
|
||||
|
||||
ctrlLayout = (ControlsLayout) findViewById(R.id.customctrl_controllayout);
|
||||
|
||||
// Menu
|
||||
drawerLayout = (DrawerLayout) findViewById(R.id.customctrl_drawerlayout);
|
||||
|
||||
@@ -49,6 +57,12 @@ public class CustomControlsActivity extends AppCompatActivity
|
||||
case R.id.menu_ctrl_add:
|
||||
ctrlLayout.addControlButton(new ControlButton("New", Keyboard.CHAR_NONE, 100, 100));
|
||||
break;
|
||||
case R.id.menu_ctrl_selectdefault:
|
||||
dialogSelectDefaultCtrl();
|
||||
break;
|
||||
case R.id.menu_ctrl_save:
|
||||
save(false);
|
||||
break;
|
||||
}
|
||||
//Toast.makeText(MainActivity.this, menuItem.getTitle() + ":" + menuItem.getItemId(), Toast.LENGTH_SHORT).show();
|
||||
|
||||
@@ -56,34 +70,85 @@ public class CustomControlsActivity extends AppCompatActivity
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mCtrl = new CustomControls();
|
||||
generateDefaultControlMap();
|
||||
|
||||
ctrlLayout = (ControlsLayout) findViewById(R.id.customctrl_controllayout);
|
||||
ctrlLayout.loadLayout(mCtrl);
|
||||
|
||||
ctrlLayout.setActivity(this);
|
||||
ctrlLayout.setModifiable(true);
|
||||
|
||||
loadControl(LauncherPreferences.PREF_DEFAULTCTRL_PATH);
|
||||
|
||||
ctrlLayout.loadLayout(mCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (!isModified) {
|
||||
super.onBackPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
save(true);
|
||||
}
|
||||
|
||||
private void setDefaultControlJson(String path) {
|
||||
try {
|
||||
// Load before save to make sure control is not error
|
||||
ctrlLayout.loadLayout(new Gson().fromJson(Tools.read(path), CustomControls.class));
|
||||
LauncherPreferences.DEFAULT_PREF.edit().putString("defaultCtrl", path).commit();
|
||||
LauncherPreferences.PREF_DEFAULTCTRL_PATH = path;
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(this, th);
|
||||
}
|
||||
}
|
||||
|
||||
private void dialogSelectDefaultCtrl() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.customctrl_selectdefault);
|
||||
builder.setPositiveButton(android.R.string.cancel, null);
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
FileListView flv = new FileListView(this);
|
||||
flv.listFileAt(Tools.CTRLMAP_PATH);
|
||||
flv.setFileSelectedListener(new FileSelectedListener(){
|
||||
|
||||
@Override
|
||||
public void onFileSelected(File file, String path, String name) {
|
||||
if (name.endsWith(".json")) {
|
||||
setDefaultControlJson(path);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
dialog.setView(flv);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
private String doSaveCtrl(String name) throws Exception {
|
||||
String jsonPath = Tools.CTRLMAP_PATH + "/" + name + ".json";
|
||||
ctrlLayout.saveLayout(jsonPath);
|
||||
|
||||
return jsonPath;
|
||||
}
|
||||
|
||||
private void save(final boolean exit) {
|
||||
final EditText edit = new EditText(this);
|
||||
edit.setSingleLine();
|
||||
edit.setText(selectedName);
|
||||
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.global_save);
|
||||
builder.setView(edit);
|
||||
builder.setPositiveButton(android.R.string.ok, null);
|
||||
builder.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.setNeutralButton("Exit without save", new AlertDialog.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
CustomControlsActivity.super.onBackPressed();
|
||||
}
|
||||
});
|
||||
if (exit) {
|
||||
builder.setNeutralButton("Exit without save", new AlertDialog.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2) {
|
||||
CustomControlsActivity.super.onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||
|
||||
@@ -99,11 +164,16 @@ public class CustomControlsActivity extends AppCompatActivity
|
||||
edit.setError(getResources().getString(R.string.global_error_field_empty));
|
||||
} else {
|
||||
try {
|
||||
Tools.write(Tools.CTRLMAP_PATH + "/" + edit.getText().toString() + ".json", gson.toJson(mCtrl));
|
||||
String jsonPath = doSaveCtrl(edit.getText().toString());
|
||||
|
||||
Toast.makeText(CustomControlsActivity.this, getString(R.string.global_save) + ": " + jsonPath, Toast.LENGTH_SHORT).show();
|
||||
|
||||
dialog.dismiss();
|
||||
CustomControlsActivity.super.onBackPressed();
|
||||
if (exit) {
|
||||
CustomControlsActivity.super.onBackPressed();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(CustomControlsActivity.this, th);
|
||||
Tools.showError(CustomControlsActivity.this, th, exit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,12 +181,12 @@ public class CustomControlsActivity extends AppCompatActivity
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void actionLoad() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("Select control json file");
|
||||
builder.setTitle(R.string.customctrl_title_selectctrl);
|
||||
builder.setPositiveButton(android.R.string.cancel, null);
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
@@ -127,32 +197,25 @@ public class CustomControlsActivity extends AppCompatActivity
|
||||
@Override
|
||||
public void onFileSelected(File file, String path, String name) {
|
||||
if (name.endsWith(".json")) {
|
||||
try {
|
||||
mCtrl = gson.fromJson(Tools.read(path), CustomControls.class);
|
||||
ctrlLayout.loadLayout(mCtrl);
|
||||
dialog.dismiss();
|
||||
} catch (Exception e) {
|
||||
Tools.showError(CustomControlsActivity.this, e);
|
||||
}
|
||||
loadControl(path);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
dialog.setView(flv);
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
private float dpToPx(float dp) {
|
||||
return Tools.dpToPx(this, dp);
|
||||
}
|
||||
|
||||
private void generateDefaultControlMap() {
|
||||
List<ControlButton> btn = mCtrl.button;
|
||||
btn.add(ControlButton.getSpecialButtons()[0]); // Keyboard
|
||||
btn.add(ControlButton.getSpecialButtons()[1]); // GUI
|
||||
// btn.add(ControlButton.getSpecialButtons()[2]); // Toggle mouse
|
||||
btn.add(new ControlButton(this, R.string.control_debug, Keyboard.KEY_F3, ControlButton.pixelOf2dp, ControlButton.pixelOf2dp, false));
|
||||
btn.add(new ControlButton(this, R.string.control_chat, Keyboard.KEY_T, ControlButton.pixelOf2dp * 2 + ControlButton.pixelOf80dp, ControlButton.pixelOf2dp, false));
|
||||
btn.add(new ControlButton(this, R.string.control_listplayers, Keyboard.KEY_TAB, ControlButton.pixelOf2dp * 3 + ControlButton.pixelOf80dp * 2, ControlButton.pixelOf2dp, false));
|
||||
btn.add(new ControlButton(this, R.string.control_thirdperson, Keyboard.KEY_F5, ControlButton.pixelOf2dp, ControlButton.pixelOf2dp, false));
|
||||
|
||||
private void loadControl(String path) {
|
||||
try {
|
||||
mCtrl = gson.fromJson(Tools.read(path), CustomControls.class);
|
||||
ctrlLayout.loadLayout(mCtrl);
|
||||
|
||||
selectedName = new File(path).getName();
|
||||
// Remove `.json`
|
||||
selectedName = selectedName.substring(0, selectedName.length() - 5);
|
||||
} catch (Exception e) {
|
||||
Tools.showError(CustomControlsActivity.this, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,16 @@ public class DroidToJavaKey {
|
||||
}
|
||||
*/
|
||||
|
||||
// Fix press 'e' key close inventory (while search item)
|
||||
// Should it be or other ways?
|
||||
/*
|
||||
if (!AndroidDisplay.grab && keyEvent.getDisplayLabel() != 'e') {
|
||||
mainActivity.sendKeyPress(keyEvent.getDisplayLabel(), status);
|
||||
} else {
|
||||
mainActivity.sendKeyPress(keyEvent.getDisplayLabel());
|
||||
}
|
||||
*/
|
||||
|
||||
mainActivity.sendKeyPress(keyEvent.getDisplayLabel(), status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.os.*;
|
||||
import android.support.v7.app.*;
|
||||
import android.util.*;
|
||||
import java.awt.*;
|
||||
import java.awt.datatransfer.*;
|
||||
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
public class FatalErrorActivity extends AppCompatActivity
|
||||
{
|
||||
public static void showError(Context ctx, String savePath, boolean storageAllow, /* boolean isFatalErr, */ Throwable th) {
|
||||
Intent ferrorIntent = new Intent(ctx, FatalErrorActivity.class);
|
||||
ferrorIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
ferrorIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
ferrorIntent.putExtra("throwable", th);
|
||||
ferrorIntent.putExtra("savePath", savePath);
|
||||
ferrorIntent.putExtra("storageAllow", storageAllow);
|
||||
// ferrorIntent.putExtra("isFatal", isFatalErr);
|
||||
ctx.startActivity(ferrorIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Bundle extras = getIntent().getExtras();
|
||||
boolean storageAllow = extras.getBoolean("storageAllow");
|
||||
final String strStackTrace = Log.getStackTraceString((Throwable) extras.getSerializable("throwable"));
|
||||
String strSavePath = extras.getString("savePath");
|
||||
String errHeader = storageAllow ?
|
||||
"Crash stack trace saved to " + strSavePath + "." :
|
||||
"Storage permission is required to save crash stack trace!";
|
||||
|
||||
// boolean isFatalError = extras.getBoolean("isFatal", false);
|
||||
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.error_fatal)
|
||||
.setMessage(errHeader + "\n\n" + strStackTrace)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2) {
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.global_restart, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2) {
|
||||
startActivity(new Intent(FatalErrorActivity.this, PojavLoginActivity.class));
|
||||
}
|
||||
})
|
||||
.setNeutralButton(android.R.string.copy, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2) {
|
||||
StringSelection errData = new StringSelection(strStackTrace);
|
||||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(errData, null);
|
||||
|
||||
finish();
|
||||
}
|
||||
})
|
||||
//.setNegativeButton("Report (not available)", null)
|
||||
.setCancelable(false)
|
||||
.show();
|
||||
|
||||
// Tools.showError(this, isFatalError ? R.string.error_fatal : R.string.global_error, th, true);
|
||||
}
|
||||
}
|
||||
@@ -4,37 +4,31 @@ import android.content.res.*;
|
||||
import android.graphics.*;
|
||||
import android.view.*;
|
||||
import android.widget.*;
|
||||
import android.content.*;
|
||||
import com.kdt.mcgui.*;
|
||||
|
||||
public class FontChanger
|
||||
{
|
||||
private Typeface typeface;
|
||||
|
||||
public FontChanger(Typeface typeface)
|
||||
{
|
||||
this.typeface = typeface;
|
||||
}
|
||||
|
||||
public FontChanger(AssetManager assets, String assetsFontFileName)
|
||||
{
|
||||
typeface = Typeface.createFromAsset(assets, assetsFontFileName);
|
||||
}
|
||||
|
||||
public ViewGroup replaceFonts(ViewGroup viewTree)
|
||||
{
|
||||
View child;
|
||||
private static Typeface fNotoSans, fMinecraftTen;
|
||||
|
||||
public static void initFonts(Context ctx) {
|
||||
fNotoSans = Typeface.createFromAsset(ctx.getAssets(), "font/NotoSans-Bold.ttf");
|
||||
fMinecraftTen = Typeface.createFromAsset(ctx.getAssets(), "font/minecraft-ten.ttf");
|
||||
}
|
||||
|
||||
public static void changeFonts(ViewGroup viewTree) {
|
||||
View child;
|
||||
for(int i = 0; i < viewTree.getChildCount(); ++i) {
|
||||
child = viewTree.getChildAt(i);
|
||||
if (child instanceof ViewGroup) {
|
||||
replaceFonts((ViewGroup)child);
|
||||
changeFonts((ViewGroup) child);
|
||||
} else if (child instanceof TextView) {
|
||||
replaceFont((TextView) child);
|
||||
changeFont((TextView) child);
|
||||
}
|
||||
}
|
||||
return viewTree;
|
||||
}
|
||||
}
|
||||
|
||||
public View replaceFont(TextView view) {
|
||||
view.setTypeface(typeface);
|
||||
return view;
|
||||
public static void changeFont(TextView view) {
|
||||
view.setTypeface(view instanceof MineButton ? fMinecraftTen : fNotoSans);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,9 @@ public class JMinecraftVersionList {
|
||||
public Version[] versions;
|
||||
|
||||
public static class Version {
|
||||
// Since 1.13, so it's one of ways to check
|
||||
public Arguments arguments;
|
||||
|
||||
public String assets;
|
||||
public Map<String, MinecraftClientInfo> downloads;
|
||||
public String id;
|
||||
@@ -27,5 +30,21 @@ public class JMinecraftVersionList {
|
||||
public String type;
|
||||
public String url;
|
||||
}
|
||||
|
||||
// Since 1.13
|
||||
public static class Arguments {
|
||||
public Object[] game;
|
||||
public Object[] jvm;
|
||||
|
||||
public static class ArgValue {
|
||||
public ArgRules[] rules;
|
||||
public String value;
|
||||
|
||||
public static class ArgRules {
|
||||
public String action;
|
||||
public String features;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,13 +67,29 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
gson = new Gson();
|
||||
|
||||
DisplayMetrics dm = Tools.getDisplayMetrics(this);
|
||||
AndroidDisplay.windowWidth = dm.widthPixels;
|
||||
AndroidDisplay.windowHeight = dm.heightPixels;
|
||||
viewInit();
|
||||
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
public void onSystemUiVisibilityChange(int visibility) {
|
||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
// DEBUG
|
||||
//new android.support.design.widget.NavigationView(this);
|
||||
@@ -116,7 +132,7 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
} catch(Exception e) {
|
||||
//Tools.throwError(this, e);
|
||||
e.printStackTrace();
|
||||
toast(getStr(R.string.toast_login_error) + " " + e.getMessage());
|
||||
toast(getStr(R.string.toast_login_error, e.getMessage()));
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -400,9 +416,11 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume()
|
||||
{
|
||||
protected void onResume(){
|
||||
super.onResume();
|
||||
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
private boolean canBack = false;
|
||||
@@ -428,6 +446,17 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
// Catching touch exception
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
try {
|
||||
return super.onTouchEvent(event);
|
||||
} catch (Throwable th) {
|
||||
Tools.showError(this, th);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private GameRunnerTask mTask;
|
||||
|
||||
@@ -522,7 +551,9 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
libItem.name.startsWith("com.mojang:realms") ||
|
||||
libItem.name.startsWith("net.java.jinput") ||
|
||||
libItem.name.startsWith("net.minecraft.launchwrapper") ||
|
||||
libItem.name.startsWith("org.lwjgl.lwjgl:lwjgl") ||
|
||||
libItem.name.startsWith("optifine:launchwrapper-of") ||
|
||||
// libItem.name.startsWith("org.lwjgl.lwjgl:lwjgl") ||
|
||||
libItem.name.startsWith("org.lwjgl") ||
|
||||
libItem.name.startsWith("tv.twitch")
|
||||
) { // Black list
|
||||
publishProgress("1", "Ignored " + libItem.name);
|
||||
@@ -598,7 +629,7 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
publishProgress("5", getStr(R.string.mcl_launch_download_client) + p1[0]);
|
||||
publishProgress("5", getStr(R.string.mcl_launch_download_client, p1[0]));
|
||||
outUnpatchedConvert = new File(unpatchedPath);
|
||||
boolean patchedExist = new File(patchedFile).exists();
|
||||
if (!patchedExist) {
|
||||
@@ -966,7 +997,8 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
super.onPreExecute();
|
||||
dialog = new ProgressDialog(MCLauncherActivity.this);
|
||||
dialog.setTitle("Installing OptiFine");
|
||||
dialog.setMessage("Prepaping");
|
||||
dialog.setMessage("Preparing");
|
||||
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
dialog.setMax(5);
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
@@ -992,12 +1024,12 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
Throwable throwable = null;
|
||||
File convertedFile = null;
|
||||
try {
|
||||
publishProgress("Prepaping", "5");
|
||||
publishProgress("Preparing", "5");
|
||||
|
||||
String origMd5 = OptiFinePatcher.calculateMD5(file[0]);
|
||||
convertedFile = new File(Tools.optifineDir, origMd5 + ".jar");
|
||||
if (!convertedFile.exists()) {
|
||||
publishProgress("Patching OptiFine Installer", null, "1", "ADD");
|
||||
publishProgress("Patching OptiFine Installer", null, "1", "true");
|
||||
|
||||
Tools.extractAssetFolder(MCLauncherActivity.this, "optifine_patch", Tools.optifineDir, true);
|
||||
|
||||
@@ -1006,7 +1038,7 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
String[] output = Tools.patchOptifineInstaller(MCLauncherActivity.this, file[0]);
|
||||
File patchedFile = new File(output[1]);
|
||||
|
||||
publishProgress("Converting OptiFine", null, null, Integer.toString(ProgressDialog.STYLE_SPINNER));
|
||||
publishProgress("Converting OptiFine", null, null, "false");
|
||||
|
||||
System.setOut(new PrintStream(logOut));
|
||||
System.setErr(new PrintStream(logErr));
|
||||
@@ -1028,7 +1060,7 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
patchedFile.delete();
|
||||
}
|
||||
|
||||
publishProgress("Launching OptiFine installer", null, null, Integer.toString(ProgressDialog.STYLE_SPINNER));
|
||||
publishProgress("Launching OptiFine installer", null, null, "true");
|
||||
|
||||
File optDir = getDir("dalvik-cache", 0);
|
||||
optDir.mkdir();
|
||||
@@ -1074,12 +1106,12 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
protected void onProgressUpdate(String[] text) {
|
||||
super.onProgressUpdate(text);
|
||||
dialog.setMessage(text[0]);
|
||||
if (text.length >= 2 && text[1] != null) {
|
||||
if (text.length > 1 && text[1] != null) {
|
||||
dialog.setMax(Integer.valueOf(text[1]));
|
||||
} if (text.length >= 3) {
|
||||
} if (text.length > 2) {
|
||||
dialog.setProgress(dialog.getProgress() + 1);
|
||||
} if (text.length >= 4) {
|
||||
dialog.setProgressStyle(Integer.parseInt(text[3]));
|
||||
} if (text.length > 3 && text[3] != null) {
|
||||
dialog.setIndeterminate(Boolean.getBoolean(text[3]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,49 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import java.util.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.security.*;
|
||||
|
||||
// This class simply get the modifiable original Collection from unmodifable one.
|
||||
public class Modifiable
|
||||
{
|
||||
public static <E> Collection<E> modifyCollection(Collection<? extends E> collection) {
|
||||
if (collection == null) {
|
||||
throw new NullPointerException("collection == null");
|
||||
} else if (collection.getClass().getSimpleName().startsWith("Unmodifiable")) {
|
||||
Field collectionField = null;
|
||||
try {
|
||||
collectionField = Class.forName("java.util.Collections$UnmodifiableCollection").getDeclaredField("c");
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
|
||||
if (collectionField != null) {
|
||||
collectionField.setAccessible(true);
|
||||
try {
|
||||
return (Collection<E>) collectionField.get(collection);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return (Collection<E>) collection;
|
||||
}
|
||||
|
||||
public static <E> List<E> modifyList(List<? extends E> list) {
|
||||
return (List<E>) modifyCollection(list);
|
||||
}
|
||||
|
||||
public static <E> Set<E> modifySet(Set<? extends E> set) {
|
||||
return (Set<E>) modifyCollection(set);
|
||||
}
|
||||
|
||||
// Get alias list from Provider.Service
|
||||
public static List<String> getServiceAliases(Provider.Service service) throws Throwable {
|
||||
Method getAliasesMethod = service.getClass().getDeclaredMethod("getAliases");
|
||||
getAliasesMethod.setAccessible(true);
|
||||
return (List<String>) getAliasesMethod.invoke(service);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,14 +6,52 @@ import android.content.pm.PackageManager.*;
|
||||
import android.content.pm.*;
|
||||
import net.kdt.pojavlaunch.prefs.*;
|
||||
import net.kdt.pojavlaunch.value.customcontrols.*;
|
||||
import android.support.v7.preference.*;
|
||||
import java.io.*;
|
||||
import android.content.*;
|
||||
import android.support.v4.app.*;
|
||||
import android.util.*;
|
||||
import net.kdt.pojavlaunch.exit.*;
|
||||
import java.time.*;
|
||||
import java.text.*;
|
||||
import java.util.*;
|
||||
|
||||
public class PojavApplication extends Application
|
||||
{
|
||||
public static String CRASH_REPORT_TAG = "PojavCrashReport";
|
||||
|
||||
@Override
|
||||
public void onCreate()
|
||||
{
|
||||
super.onCreate();
|
||||
public void onCreate() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
|
||||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable th) {
|
||||
boolean storagePermAllowed = Build.VERSION.SDK_INT < 23 || ActivityCompat.checkSelfPermission(PojavApplication.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
||||
File crashFile = new File(storagePermAllowed ? Tools.MAIN_PATH : Tools.datapath, "latestcrash.txt");
|
||||
try {
|
||||
// Write to file, since some devices may not able to show error
|
||||
crashFile.createNewFile();
|
||||
PrintStream crashStream = new PrintStream(crashFile);
|
||||
crashStream.append("PojavLauncher crash report\n");
|
||||
crashStream.append(" - Time: " + DateFormat.getDateTimeInstance().format(new Date()));
|
||||
crashStream.append(" - Device: " + Build.PRODUCT + " " + Build.MODEL);
|
||||
crashStream.append(" - Android version: " + Build.VERSION.RELEASE);
|
||||
crashStream.append(" - Crash stack trace:");
|
||||
crashStream.append(Log.getStackTraceString(th));
|
||||
crashStream.close();
|
||||
} catch (Throwable th2) {
|
||||
Log.e(CRASH_REPORT_TAG, " - Exception attempt saving crash stack trace:", th2);
|
||||
Log.e(CRASH_REPORT_TAG, " - The crash stack trace was:", th);
|
||||
}
|
||||
|
||||
FatalErrorActivity.showError(PojavApplication.this, crashFile.getAbsolutePath(), storagePermAllowed, th);
|
||||
// android.os.Process.killProcess(android.os.Process.myPid());
|
||||
|
||||
MainActivity.fullyExit();
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
super.onCreate();
|
||||
Tools.APP_NAME = getResources().getString(R.string.app_short_name);
|
||||
|
||||
PackageInfo thisApp = getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||
@@ -22,6 +60,7 @@ public class PojavApplication extends Application
|
||||
Tools.usingVerCode = thisApp.versionCode;
|
||||
Tools.datapath = getDir("files", MODE_PRIVATE).getParent();
|
||||
|
||||
LauncherPreferences.DEFAULT_PREF = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
LauncherPreferences.loadPreferences(this);
|
||||
|
||||
ControlButton.pixelOf2dp = (int) Tools.dpToPx(this, 2);
|
||||
@@ -31,8 +70,15 @@ public class PojavApplication extends Application
|
||||
ControlButton[] specialButtons = ControlButton.getSpecialButtons();
|
||||
specialButtons[0].name = getString(R.string.control_keyboard);
|
||||
specialButtons[1].name = getString(R.string.control_toggle);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
specialButtons[2].name = getString(R.string.control_primary);
|
||||
specialButtons[3].name = getString(R.string.control_secondary);
|
||||
specialButtons[4].name = getString(R.string.control_mouse);
|
||||
|
||||
FontChanger.initFonts(this);
|
||||
} catch (Throwable th) {
|
||||
Intent ferrorIntent = new Intent(this, FatalErrorActivity.class);
|
||||
ferrorIntent.putExtra("throwable", th);
|
||||
startActivity(ferrorIntent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,26 +22,46 @@ import android.system.*;
|
||||
import android.net.*;
|
||||
import static android.view.ViewGroup.LayoutParams.*;
|
||||
import net.kdt.pojavlaunch.update.*;
|
||||
import net.kdt.pojavlaunch.value.customcontrols.*;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
public class PojavLoginActivity extends MineActivity
|
||||
public class PojavLoginActivity extends AppCompatActivity
|
||||
// MineActivity
|
||||
{
|
||||
private EditText edit2, edit3;
|
||||
private int REQUEST_STORAGE_REQUEST_CODE = 1;
|
||||
private ProgressBar prb;
|
||||
private Switch sRemember, sOffline;
|
||||
private CheckBox sRemember, sOffline;
|
||||
private LinearLayout loginLayout;
|
||||
private ImageView imageLogo;
|
||||
|
||||
private boolean isPromptingGrant = false;
|
||||
// private boolean isPermGranted = false;
|
||||
|
||||
private SharedPreferences firstLaunchPrefs;
|
||||
// private String PREF_IS_DONOTSHOWAGAIN_WARN = "isWarnDoNotShowAgain";
|
||||
private String PREF_IS_INSTALLED_LIBRARIES = "isLibrariesExtracted";
|
||||
private String PREF_IS_INSTALLED_LIBRARIES = "isLibrariesExtracted2";
|
||||
|
||||
private boolean isInitCalled = false;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState, false);
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState); // false);
|
||||
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
public void onSystemUiVisibilityChange(int visibility) {
|
||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!isInitCalled) {
|
||||
init();
|
||||
isInitCalled = true;
|
||||
@@ -130,7 +150,7 @@ public class PojavLoginActivity extends MineActivity
|
||||
LinearLayout startScr = new LinearLayout(PojavLoginActivity.this);
|
||||
LayoutInflater.from(PojavLoginActivity.this).inflate(R.layout.start_screen, startScr);
|
||||
|
||||
replaceFonts(startScr);
|
||||
FontChanger.changeFonts(startScr);
|
||||
|
||||
progress = (ProgressBar) startScr.findViewById(R.id.startscreenProgress);
|
||||
//startScr.addView(progress);
|
||||
@@ -229,14 +249,23 @@ public class PojavLoginActivity extends MineActivity
|
||||
}
|
||||
|
||||
private void uiInit() {
|
||||
setContentView(R.layout.launcher_login);
|
||||
setContentView(R.layout.launcher_login_v2);
|
||||
|
||||
edit2 = (EditText) findViewById(R.id.launcherAccEmail);
|
||||
edit3 = (EditText) findViewById(R.id.launcherAccPassword);
|
||||
loginLayout = findViewById(R.id.login_layout_linear);
|
||||
imageLogo = findViewById(R.id.login_image_logo);
|
||||
loginLayout.postDelayed(new Runnable(){
|
||||
@Override
|
||||
public void run(){
|
||||
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
||||
}
|
||||
}, 100);
|
||||
|
||||
edit2 = (EditText) findViewById(R.id.login_edit_email);
|
||||
edit3 = (EditText) findViewById(R.id.login_edit_password);
|
||||
if(prb == null) prb = (ProgressBar) findViewById(R.id.launcherAccProgress);
|
||||
|
||||
sRemember = (Switch) findViewById(R.id.launcherAccRememberSwitch);
|
||||
sOffline = (Switch) findViewById(R.id.launcherAccOffSwitch);
|
||||
sRemember = findViewById(R.id.login_switch_remember);
|
||||
sOffline = findViewById(R.id.login_switch_offline);
|
||||
sOffline.setOnCheckedChangeListener(new OnCheckedChangeListener(){
|
||||
|
||||
@Override
|
||||
@@ -248,28 +277,16 @@ public class PojavLoginActivity extends MineActivity
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isAndroid7()
|
||||
{
|
||||
return Build.VERSION.SDK_INT >= 24;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
long lastTime = System.currentTimeMillis();
|
||||
long lastDel = 0;
|
||||
|
||||
|
||||
private void deAnr(String msg) {
|
||||
long currt = System.currentTimeMillis();
|
||||
lastDel = currt - lastTime;
|
||||
lastTime = currt;
|
||||
System.out.println("Time:" + lastDel + "ms||" + (lastDel / 1000) + "s: " + msg);
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
|
||||
if (loginLayout != null && imageLogo != null) {
|
||||
imageLogo.setTranslationY(loginLayout.getY() - (imageLogo.getHeight() / 2f));
|
||||
}
|
||||
|
||||
// Clear current profile
|
||||
PojavProfile.setCurrentProfile(this, null);
|
||||
@@ -292,21 +309,15 @@ public class PojavLoginActivity extends MineActivity
|
||||
mkdirs(Tools.worksDir);
|
||||
mkdirs(Tools.versnDir);
|
||||
mkdirs(Tools.libraries);
|
||||
mkdirs(Tools.mpProfiles);
|
||||
|
||||
mkdirs(Tools.MAIN_PATH);
|
||||
mkdirs(Tools.CTRLMAP_PATH);
|
||||
|
||||
File file0 = new File(Tools.mpProfiles);
|
||||
File file1 = new File(Tools.mpModEnable);
|
||||
File file2 = new File(Tools.mpModDisable);
|
||||
File file3 = new File(Tools.mpModAddNewMo);
|
||||
|
||||
file0.mkdir();
|
||||
file1.mkdirs();
|
||||
file2.mkdir();
|
||||
mkdirs(Tools.MAIN_PATH + "/mods");
|
||||
|
||||
try {
|
||||
file3.createNewFile();
|
||||
} catch (IOException e){}
|
||||
|
||||
try {
|
||||
mkdirs(Tools.MAIN_PATH);
|
||||
new CustomControls(this).save(Tools.CTRLDEF_FILE);
|
||||
|
||||
Tools.copyAssetFile(this, "options.txt", Tools.MAIN_PATH, false);
|
||||
|
||||
@@ -334,10 +345,10 @@ public class PojavLoginActivity extends MineActivity
|
||||
|
||||
private boolean mkdirs(String path)
|
||||
{
|
||||
File mFileeee = new File(path);
|
||||
if(mFileeee.getParentFile().exists())
|
||||
return mFileeee.mkdir();
|
||||
else return mFileeee.mkdirs();
|
||||
File file = new File(path);
|
||||
if(file.getParentFile().exists())
|
||||
return file.mkdir();
|
||||
else return file.mkdirs();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -362,7 +373,6 @@ public class PojavLoginActivity extends MineActivity
|
||||
public void loginSavedAcc(View view)
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.login_select_account);
|
||||
|
||||
if (Tools.enableDevFeatures) {
|
||||
/*
|
||||
@@ -380,7 +390,7 @@ public class PojavLoginActivity extends MineActivity
|
||||
}
|
||||
|
||||
builder.setPositiveButton(android.R.string.cancel, null);
|
||||
|
||||
builder.setTitle(this.getString(R.string.login_select_account));
|
||||
final AlertDialog dialog = builder.create();
|
||||
|
||||
/*
|
||||
@@ -391,6 +401,8 @@ public class PojavLoginActivity extends MineActivity
|
||||
lpHint.weight = 1;
|
||||
lpFlv.weight = 1;
|
||||
*/
|
||||
dialog.setTitle(this.getString(R.string.login_select_account));
|
||||
System.out.println("Setting title...");
|
||||
LinearLayout dialay = new LinearLayout(this);
|
||||
dialay.setOrientation(LinearLayout.VERTICAL);
|
||||
TextView fhint = new TextView(this);
|
||||
@@ -459,6 +471,7 @@ public class PojavLoginActivity extends MineActivity
|
||||
dialay.addView(flv);
|
||||
|
||||
dialog.setView(dialay);
|
||||
dialog.setTitle(this.getString(R.string.login_select_account));
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@@ -493,50 +506,8 @@ public class PojavLoginActivity extends MineActivity
|
||||
end skip*/
|
||||
|
||||
if (sOffline.isChecked()) {
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(this);
|
||||
alert.setTitle(R.string.warning_title);
|
||||
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
sRemember.setChecked(true);
|
||||
mProfile = loginOffline();
|
||||
playProfile();
|
||||
}
|
||||
});
|
||||
|
||||
alert.setNegativeButton(R.string.login_offline_alert_skip, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
mProfile = loginOffline();
|
||||
playProfile();
|
||||
}
|
||||
});
|
||||
|
||||
alert.setNeutralButton(android.R.string.cancel, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
mProfile = null;
|
||||
}
|
||||
});
|
||||
|
||||
if (!sRemember.isChecked()) {
|
||||
alert.setMessage(R.string.login_offline_warning_1);
|
||||
warning = alert.show();
|
||||
} else {
|
||||
mProfile = loginOffline();
|
||||
playProfile();
|
||||
}
|
||||
|
||||
/*
|
||||
while (warning != null && warning.isShowing()) {
|
||||
}
|
||||
*/
|
||||
mProfile = loginOffline();
|
||||
playProfile();
|
||||
} else {
|
||||
new LoginTask().setLoginListener(new LoginListener(){
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.util.*;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
/*
|
||||
* All methods there are from
|
||||
* https://android.googlesource.com/platform/frameworks/multidex/+/refs/heads/master/library/src/androidx/multidex/MultiDex.java
|
||||
*/
|
||||
public class SecondaryDexLoader
|
||||
{
|
||||
public static String TAG = "SecondaryDexLoader";
|
||||
|
||||
private static int ADDITIONAL_CLASSES = 0;
|
||||
|
||||
public static void install(ClassLoader loader, List<File> additionalClassPathEntries, File optimizedDirectory) throws Throwable {
|
||||
ADDITIONAL_CLASSES = additionalClassPathEntries.size();
|
||||
|
||||
/* The patched class loader is expected to be a descendant of
|
||||
* dalvik.system.BaseDexClassLoader. We modify its
|
||||
* dalvik.system.DexPathList pathList field to append additional DEX
|
||||
* file entries.
|
||||
*/
|
||||
|
||||
Object dexPathList = getDexPathList(loader);
|
||||
ArrayList<IOException> suppressedExceptions = new ArrayList<IOException>();
|
||||
expandFieldArray(dexPathList, "dexElements", makeDexElements(dexPathList,
|
||||
new ArrayList<File>(additionalClassPathEntries), optimizedDirectory,
|
||||
suppressedExceptions));
|
||||
if (suppressedExceptions.size() > 0) {
|
||||
for (IOException e : suppressedExceptions) {
|
||||
Log.w(TAG, "Exception in makeDexElement", e);
|
||||
}
|
||||
Field suppressedExceptionsField =
|
||||
findField(loader, "dexElementsSuppressedExceptions");
|
||||
IOException[] dexElementsSuppressedExceptions =
|
||||
(IOException[]) suppressedExceptionsField.get(loader);
|
||||
if (dexElementsSuppressedExceptions == null) {
|
||||
dexElementsSuppressedExceptions =
|
||||
suppressedExceptions.toArray(
|
||||
new IOException[suppressedExceptions.size()]);
|
||||
} else {
|
||||
IOException[] combined =
|
||||
new IOException[suppressedExceptions.size() +
|
||||
dexElementsSuppressedExceptions.length];
|
||||
suppressedExceptions.toArray(combined);
|
||||
System.arraycopy(dexElementsSuppressedExceptions, 0, combined,
|
||||
suppressedExceptions.size(), dexElementsSuppressedExceptions.length);
|
||||
dexElementsSuppressedExceptions = combined;
|
||||
}
|
||||
suppressedExceptionsField.set(loader, dexElementsSuppressedExceptions);
|
||||
}
|
||||
}
|
||||
|
||||
private static /* DexPathList */ Object getDexPathList(ClassLoader loader) throws Throwable {
|
||||
Field pathListField = findField(loader, "pathList");
|
||||
return pathListField.get(loader);
|
||||
}
|
||||
|
||||
/**
|
||||
* A wrapper around
|
||||
* {@code private static final dalvik.system.DexPathList#makeDexElements}.
|
||||
*/
|
||||
private static Object[] makeDexElements(Object dexPathList, ArrayList<File> files, File optimizedDirectory, ArrayList<IOException> suppressedExceptions) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
|
||||
Method makeDexElements = findMethod(dexPathList, "makeDexElements", ArrayList.class, File.class, ArrayList.class);
|
||||
return (Object[]) makeDexElements.invoke(dexPathList, files, optimizedDirectory, suppressedExceptions);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Locates a given field anywhere in the class inheritance hierarchy.
|
||||
*
|
||||
* @param instance an object to search the field into.
|
||||
* @param name field name
|
||||
* @return a field object
|
||||
* @throws NoSuchFieldException if the field cannot be located
|
||||
*/
|
||||
private static Field findField(Object instance, String name) throws NoSuchFieldException {
|
||||
for (Class<?> clazz = instance.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
Field field = clazz.getDeclaredField(name);
|
||||
if (!field.isAccessible()) {
|
||||
field.setAccessible(true);
|
||||
}
|
||||
return field;
|
||||
} catch (NoSuchFieldException e) {
|
||||
// ignore and search next
|
||||
}
|
||||
}
|
||||
throw new NoSuchFieldException("Field " + name + " not found in " + instance.getClass());
|
||||
}
|
||||
/**
|
||||
* Locates a given method anywhere in the class inheritance hierarchy.
|
||||
*
|
||||
* @param instance an object to search the method into.
|
||||
* @param name method name
|
||||
* @param parameterTypes method parameter types
|
||||
* @return a method object
|
||||
* @throws NoSuchMethodException if the method cannot be located
|
||||
*/
|
||||
private static Method findMethod(Object instance, String name, Class<?>... parameterTypes) throws NoSuchMethodException {
|
||||
for (Class<?> clazz = instance.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
Method method = clazz.getDeclaredMethod(name, parameterTypes);
|
||||
if (!method.isAccessible()) {
|
||||
method.setAccessible(true);
|
||||
}
|
||||
return method;
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore and search next
|
||||
}
|
||||
}
|
||||
throw new NoSuchMethodException("Method " + name + " with parameters " +
|
||||
Arrays.asList(parameterTypes) + " not found in " + instance.getClass());
|
||||
}
|
||||
/**
|
||||
* Replace the value of a field containing a non null array, by a new array containing the
|
||||
* elements of the original array plus the elements of extraElements.
|
||||
* @param instance the instance whose field is to be modified.
|
||||
* @param fieldName the field to modify.
|
||||
* @param extraElements elements to append at the end of the array.
|
||||
*/
|
||||
private static Object[] originalDex;
|
||||
private static void expandFieldArray(Object instance, String fieldName, Object[] extraElements) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
|
||||
Field jlrField = findField(instance, fieldName);
|
||||
originalDex = (Object[]) jlrField.get(instance);
|
||||
Object[] combined = (Object[]) Array.newInstance(
|
||||
originalDex.getClass().getComponentType(), originalDex.length + extraElements.length);
|
||||
System.arraycopy(originalDex, 0, combined, 0, originalDex.length);
|
||||
System.arraycopy(extraElements, 0, combined, originalDex.length, extraElements.length);
|
||||
jlrField.set(instance, combined);
|
||||
}
|
||||
|
||||
public static void resetFieldArray(ClassLoader loader) throws Throwable {
|
||||
if (originalDex == null) return;
|
||||
|
||||
Object instance = getDexPathList(loader);
|
||||
|
||||
Field jlrField = findField(instance, "dexElements");
|
||||
jlrField.set(instance, originalDex);
|
||||
|
||||
originalDex = null;
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,11 @@ public final class Tools
|
||||
public static String MAIN_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/minecraft";
|
||||
public static String ASSETS_PATH = MAIN_PATH + "/assets";
|
||||
public static String CTRLMAP_PATH = MAIN_PATH + "/controlmap";
|
||||
public static String CTRLDEF_FILE = MAIN_PATH + "/controlmap/default.json";
|
||||
|
||||
public static int usingVerCode = 1;
|
||||
public static String usingVerName = "2.4.2";
|
||||
public static String mhomeUrl = "https://khanhduytran0.github.io/PojavLauncher"; // "http://kdtjavacraft.eu5.net";
|
||||
public static String mhomeUrl = "https://pojavlauncherteam.github.io/PojavLauncher"; // "http://kdtjavacraft.eu5.net";
|
||||
public static String datapath = "/data/data/net.kdt.pojavlaunch";
|
||||
public static String worksDir = datapath + "/app_working_dir";
|
||||
|
||||
@@ -74,18 +75,24 @@ public final class Tools
|
||||
return versnDir + "/" + version + "/" + version + ".jar";
|
||||
}
|
||||
|
||||
// May useless
|
||||
public static boolean isOptifineInstalled(String version)
|
||||
{
|
||||
return new File(versnDir + "/" + version + "/optifine.jar").exists();
|
||||
}
|
||||
|
||||
private static boolean isClientFirst = false;
|
||||
public static String generate(String version) throws IOException
|
||||
public static String generateLaunchClassPath(String version) throws IOException
|
||||
{
|
||||
StringBuilder libStr = new StringBuilder(); //versnDir + "/" + version + "/" + version + ".jar:";
|
||||
String[] classpath = generateLibClasspath(getVersionInfo(version).libraries);
|
||||
|
||||
JMinecraftVersionList.Version info = getVersionInfo(version);
|
||||
String[] classpath = generateLibClasspath(info);
|
||||
|
||||
// Debug: LWJGL 3 override
|
||||
File lwjgl3Folder = new File(Tools.MAIN_PATH, "lwjgl3");
|
||||
if (info.arguments != null && lwjgl3Folder.exists()) {
|
||||
for (File file: lwjgl3Folder.listFiles()) {
|
||||
if (file.getName().endsWith(".jar")) {
|
||||
libStr.append(file.getAbsolutePath() + ":");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isClientFirst) {
|
||||
libStr.append(getPatchedFile(version));
|
||||
}
|
||||
@@ -155,13 +162,6 @@ public final class Tools
|
||||
showError(ctx, e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public static void extractLibraries(Activity ctx) throws Exception
|
||||
{
|
||||
extractAssetFolder(ctx, "libraries", worksDir);
|
||||
}
|
||||
*/
|
||||
|
||||
public static void showError(Context ctx, Throwable e)
|
||||
{
|
||||
@@ -170,10 +170,15 @@ public final class Tools
|
||||
|
||||
public static void showError(final Context ctx, final Throwable e, final boolean exitIfOk)
|
||||
{
|
||||
showError(ctx, e, exitIfOk, false);
|
||||
showError(ctx, R.string.global_error, e, exitIfOk, false);
|
||||
}
|
||||
|
||||
private static void showError(final Context ctx, final Throwable e, final boolean exitIfOk, final boolean showMore)
|
||||
public static void showError(final Context ctx, final int titleId, final Throwable e, final boolean exitIfOk)
|
||||
{
|
||||
showError(ctx, titleId, e, exitIfOk, false);
|
||||
}
|
||||
|
||||
private static void showError(final Context ctx, final int titleId, final Throwable e, final boolean exitIfOk, final boolean showMore)
|
||||
{
|
||||
Runnable runnable = new Runnable(){
|
||||
|
||||
@@ -182,7 +187,7 @@ public final class Tools
|
||||
{
|
||||
final String errMsg = showMore ? Log.getStackTraceString(e): e.getMessage();
|
||||
new AlertDialog.Builder((Context) ctx)
|
||||
.setTitle(R.string.global_error)
|
||||
.setTitle(titleId)
|
||||
.setMessage(errMsg)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@@ -203,7 +208,7 @@ public final class Tools
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2)
|
||||
{
|
||||
showError(ctx, e, exitIfOk, !showMore);
|
||||
showError(ctx, titleId, e, exitIfOk, !showMore);
|
||||
}
|
||||
})
|
||||
.setNeutralButton(android.R.string.copy, new DialogInterface.OnClickListener(){
|
||||
@@ -308,10 +313,10 @@ public final class Tools
|
||||
}
|
||||
}
|
||||
*/
|
||||
public static String[] generateLibClasspath(DependentLibrary[] libs)
|
||||
{
|
||||
public static String[] generateLibClasspath(JMinecraftVersionList.Version info) {
|
||||
List<String> libDir = new ArrayList<String>();
|
||||
for (DependentLibrary libItem: libs) {
|
||||
|
||||
for (DependentLibrary libItem: info.libraries) {
|
||||
String[] libInfos = libItem.name.split(":");
|
||||
libDir.add(Tools.libraries + "/" + Tools.artifactToPath(libInfos[0], libInfos[1], libInfos[2]));
|
||||
}
|
||||
@@ -384,6 +389,15 @@ public final class Tools
|
||||
inheritsVer.libraries = libList.toArray(new DependentLibrary[0]);
|
||||
}
|
||||
|
||||
// Inheriting Minecraft 1.13+ with append custom args
|
||||
if (inheritsVer.arguments != null && customVer.arguments != null) {
|
||||
List totalArgList = new ArrayList();
|
||||
totalArgList.addAll(Arrays.asList(inheritsVer.arguments.game));
|
||||
totalArgList.addAll(Arrays.asList(customVer.arguments.game));
|
||||
|
||||
customVer.arguments.game = totalArgList.toArray(new Object[0]);
|
||||
}
|
||||
|
||||
return inheritsVer;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -392,15 +406,15 @@ public final class Tools
|
||||
}
|
||||
|
||||
// Prevent NullPointerException
|
||||
private static void insertSafety(JMinecraftVersionList.Version inheritsVer, JMinecraftVersionList.Version theVer, String... keyArr) {
|
||||
private static void insertSafety(JMinecraftVersionList.Version targetVer, JMinecraftVersionList.Version fromVer, String... keyArr) {
|
||||
for (String key : keyArr) {
|
||||
Object value = null;
|
||||
try {
|
||||
Field fieldA = theVer.getClass().getDeclaredField(key);
|
||||
value = fieldA.get(theVer);
|
||||
Field fieldA = fromVer.getClass().getDeclaredField(key);
|
||||
value = fieldA.get(fromVer);
|
||||
if (value != null || ((value instanceof String) && !((String) value).isEmpty())) {
|
||||
Field fieldB = inheritsVer.getClass().getDeclaredField(key);
|
||||
fieldB.set(inheritsVer, value);
|
||||
Field fieldB = targetVer.getClass().getDeclaredField(key);
|
||||
fieldB.set(targetVer, value);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
System.err.println("Unable to insert " + key + "=" + value);
|
||||
@@ -438,11 +452,13 @@ public final class Tools
|
||||
|
||||
public static File lastFileModified(String dir) {
|
||||
File fl = new File(dir);
|
||||
|
||||
File[] files = fl.listFiles(new FileFilter() {
|
||||
public boolean accept(File file) {
|
||||
return file.isFile();
|
||||
}
|
||||
});
|
||||
|
||||
long lastMod = Long.MIN_VALUE;
|
||||
File choice = null;
|
||||
for (File file : files) {
|
||||
@@ -451,6 +467,7 @@ public final class Tools
|
||||
lastMod = file.lastModified();
|
||||
}
|
||||
}
|
||||
|
||||
return choice;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.kdt.pojavlaunch.exit;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
public class ExitManager {
|
||||
private static boolean stopLoop = false;
|
||||
private static boolean stopLoop = true;
|
||||
|
||||
private static ExitTrappedListener listener;
|
||||
private static Thread exitTrappedHook = new Thread(new Runnable(){
|
||||
@@ -12,25 +12,22 @@ public class ExitManager {
|
||||
public void run()
|
||||
{
|
||||
if (listener != null) listener.onExitTrapped();
|
||||
// Pre-check
|
||||
// if (stopLoop) stopLoop = false;
|
||||
|
||||
while (true) {
|
||||
if (stopLoop) {
|
||||
stopLoop = false;
|
||||
break;
|
||||
}
|
||||
|
||||
stopLoop = false;
|
||||
|
||||
while (!stopLoop) {
|
||||
// Make Thread hook never stop, then System.exit() never continue!
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {}
|
||||
}
|
||||
|
||||
stopLoop = false;
|
||||
}
|
||||
});
|
||||
|
||||
public static boolean isExiting() {
|
||||
return !stopLoop;
|
||||
}
|
||||
|
||||
public static void setExitTrappedListener(ExitTrappedListener l) {
|
||||
listener = l;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ConsoleFragment extends Fragment
|
||||
|
||||
consoleView = (TextView) view.findViewById(R.id.lmaintabconsoleLogTextView);
|
||||
consoleView.setTypeface(Typeface.MONOSPACE);
|
||||
consoleView.setHint("No log");
|
||||
consoleView.setHint(this.getText(R.string.main_nolog));
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CrashFragment extends Fragment
|
||||
|
||||
crashView = (TextView) getView().findViewById(R.id.lmaintabconsoleLogCrashTextView);
|
||||
crashView.setTypeface(Typeface.MONOSPACE);
|
||||
crashView.setHint("No crash detected.");
|
||||
crashView.setHint(this.getText(R.string.main_nocrash));
|
||||
|
||||
//new File(crashPath).mkdirs();
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package net.kdt.pojavlaunch.prefs;
|
||||
|
||||
import android.content.*;
|
||||
import com.pojavdx.dex.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
|
||||
public class LauncherPreferences
|
||||
{
|
||||
public static SharedPreferences DEFAULT_PREF;
|
||||
public static boolean PREF_VERTYPE_RELEASE = true;
|
||||
public static boolean PREF_VERTYPE_SNAPSHOT = false;
|
||||
public static boolean PREF_VERTYPE_OLDALPHA = false;
|
||||
@@ -13,20 +15,21 @@ public class LauncherPreferences
|
||||
public static boolean PREF_FORGETOF = false;
|
||||
public static float PREF_BUTTONSIZE = 1.0f;
|
||||
public static int PREF_LONGPRESS_TRIGGER = 500;
|
||||
public static String PREF_DEFAULTCTRL_PATH = Tools.CTRLDEF_FILE;
|
||||
|
||||
public static void loadPreferences(Context ctx) {
|
||||
SharedPreferences mainPreference = ctx.getSharedPreferences(ctx.getPackageName() + "_preferences", Context.MODE_PRIVATE);
|
||||
int maxDxPref = mainPreference.getInt("maxDxRefs", 0xFFF);
|
||||
int maxDxPref = DEFAULT_PREF.getInt("maxDxRefs", 0xFFF);
|
||||
DexFormat.MAX_MEMBER_IDX = maxDxPref;
|
||||
DexFormat.MAX_TYPE_IDX = maxDxPref;
|
||||
|
||||
PREF_BUTTONSIZE = mainPreference.getFloat("controlSize", 1f);
|
||||
PREF_FREEFORM = mainPreference.getBoolean("freeform", false);
|
||||
PREF_FORGETOF = mainPreference.getBoolean("forgetOptifinePath", false);
|
||||
PREF_VERTYPE_RELEASE = mainPreference.getBoolean("vertype_release", true);
|
||||
PREF_VERTYPE_SNAPSHOT = mainPreference.getBoolean("vertype_snapshot", false);
|
||||
PREF_VERTYPE_OLDALPHA = mainPreference.getBoolean("vertype_oldalpha", false);
|
||||
PREF_VERTYPE_OLDBETA = mainPreference.getBoolean("vertype_oldbeta", false);
|
||||
PREF_LONGPRESS_TRIGGER = mainPreference.getInt("timeLongPressTrigger", 500);
|
||||
PREF_BUTTONSIZE = DEFAULT_PREF.getFloat("controlSize", 1f);
|
||||
PREF_FREEFORM = DEFAULT_PREF.getBoolean("freeform", false);
|
||||
PREF_FORGETOF = DEFAULT_PREF.getBoolean("forgetOptifinePath", false);
|
||||
PREF_VERTYPE_RELEASE = DEFAULT_PREF.getBoolean("vertype_release", true);
|
||||
PREF_VERTYPE_SNAPSHOT = DEFAULT_PREF.getBoolean("vertype_snapshot", false);
|
||||
PREF_VERTYPE_OLDALPHA = DEFAULT_PREF.getBoolean("vertype_oldalpha", false);
|
||||
PREF_VERTYPE_OLDBETA = DEFAULT_PREF.getBoolean("vertype_oldbeta", false);
|
||||
PREF_LONGPRESS_TRIGGER = DEFAULT_PREF.getInt("timeLongPressTrigger", 500);
|
||||
PREF_DEFAULTCTRL_PATH = DEFAULT_PREF.getString("defaultCtrl", Tools.CTRLDEF_FILE);
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public class PojavPreferenceActivity extends MineActivity implements OnCheckedCh
|
||||
|
||||
try {
|
||||
Field field = R.id.class.getDeclaredField(getId(bar.getId()).replace("seekbar", "progressseek"));
|
||||
((TextView) findViewById(field.get(null))).setText(currProgress + "/" + bar.getMax());
|
||||
((TextView) findViewById((Integer) field.get(null))).setText(currProgress + "/" + bar.getMax());
|
||||
} catch (Throwable th) {
|
||||
throw new RuntimeException(th);
|
||||
}
|
||||
|
||||
@@ -1,35 +1,43 @@
|
||||
package net.kdt.pojavlaunch.value.customcontrols;
|
||||
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import android.view.*;
|
||||
import java.util.*;
|
||||
import android.content.*;
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.*;
|
||||
import android.view.View.*;
|
||||
|
||||
public class ControlButton
|
||||
public class ControlButton implements Cloneable
|
||||
{
|
||||
public static int pixelOf2dp;
|
||||
public static int pixelOf30dp;
|
||||
public static int pixelOf50dp;
|
||||
public static int pixelOf80dp;
|
||||
|
||||
public static final int SPECIALBTN_KEYBOARD = 0;
|
||||
public static final int SPECIALBTN_TOGGLECTRL = 1;
|
||||
|
||||
public static final int SPECIALBTN_KEYBOARD = -1;
|
||||
public static final int SPECIALBTN_TOGGLECTRL = -2;
|
||||
public static final int SPECIALBTN_MOUSEPRI = -3;
|
||||
public static final int SPECIALBTN_MOUSESEC = -4;
|
||||
public static final int SPECIALBTN_VIRTUALMOUSE = -5;
|
||||
|
||||
private static ControlButton[] SPECIAL_BUTTONS;
|
||||
private static String[] SPECIAL_BUTTON_NAME_ARRAY;
|
||||
|
||||
|
||||
public static ControlButton[] getSpecialButtons(){
|
||||
if (SPECIAL_BUTTONS == null) {
|
||||
SPECIAL_BUTTONS = new ControlButton[]{
|
||||
new ControlButton("Keyboard", -1, pixelOf2dp * 3 + pixelOf80dp * 2, pixelOf2dp, pixelOf80dp, pixelOf30dp),
|
||||
new ControlButton("GUI", -2, pixelOf2dp, AndroidDisplay.windowHeight - pixelOf2dp - pixelOf50dp)
|
||||
new ControlButton("Keyboard", SPECIALBTN_KEYBOARD, pixelOf2dp * 3 + pixelOf80dp * 2, pixelOf2dp, false),
|
||||
new ControlButton("GUI", SPECIALBTN_TOGGLECTRL, pixelOf2dp, AndroidDisplay.windowHeight - pixelOf50dp * 2 + pixelOf2dp * 4),
|
||||
new ControlButton("PRI", SPECIALBTN_MOUSEPRI, pixelOf2dp, AndroidDisplay.windowHeight - pixelOf50dp * 4 + pixelOf2dp * 2),
|
||||
new ControlButton("SEC", SPECIALBTN_MOUSESEC, pixelOf2dp * 3 + pixelOf50dp * 2, AndroidDisplay.windowHeight - pixelOf50dp * 4 + pixelOf2dp * 2),
|
||||
new ControlButton("Mouse", SPECIALBTN_VIRTUALMOUSE, AndroidDisplay.windowWidth - pixelOf80dp, pixelOf2dp, false)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return SPECIAL_BUTTONS;
|
||||
}
|
||||
|
||||
|
||||
public static String[] buildSpecialButtonArray() {
|
||||
if (SPECIAL_BUTTON_NAME_ARRAY == null) {
|
||||
List<String> nameList = new ArrayList<String>();
|
||||
@@ -38,53 +46,58 @@ public class ControlButton
|
||||
}
|
||||
SPECIAL_BUTTON_NAME_ARRAY = nameList.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
||||
return SPECIAL_BUTTON_NAME_ARRAY;
|
||||
}
|
||||
|
||||
|
||||
public String name;
|
||||
public float x;
|
||||
public float y;
|
||||
public int width = pixelOf50dp;
|
||||
public int height = pixelOf50dp;
|
||||
public int lwjglKeycode;
|
||||
public int keycode;
|
||||
public int keyindex;
|
||||
public boolean hidden;
|
||||
public boolean holdCtrl;
|
||||
public boolean holdAlt;
|
||||
public boolean holdShift;
|
||||
public View.OnClickListener specialButtonListener;
|
||||
public /* View.OnClickListener */ Object specialButtonListener;
|
||||
// public boolean hold
|
||||
|
||||
|
||||
public ControlButton() {
|
||||
this("", Keyboard.CHAR_NONE, 0, 0);
|
||||
}
|
||||
|
||||
public ControlButton(String name, int lwjglKeycode) {
|
||||
this(name, lwjglKeycode, 0, 0);
|
||||
}
|
||||
|
||||
public ControlButton(String name, int lwjglKeycode, float x, float y) {
|
||||
this(name, lwjglKeycode, x, y, pixelOf50dp, pixelOf50dp);
|
||||
public ControlButton(String name, int keycode) {
|
||||
this(name, keycode, 0, 0);
|
||||
}
|
||||
|
||||
public ControlButton(android.content.Context ctx, int resId, int lwjglKeycode, float x, float y, boolean isSquare) {
|
||||
this(ctx.getResources().getString(resId), lwjglKeycode, x, y, isSquare ? pixelOf50dp : pixelOf80dp, isSquare ? pixelOf50dp : pixelOf30dp);
|
||||
public ControlButton(String name, int keycode, float x, float y) {
|
||||
this(name, keycode, x, y, pixelOf50dp, pixelOf50dp);
|
||||
}
|
||||
|
||||
public ControlButton(String name, int lwjglKeycode, float x, float y, boolean isSquare) {
|
||||
this(name, lwjglKeycode, x, y, isSquare ? pixelOf50dp : pixelOf80dp, isSquare ? pixelOf50dp : pixelOf30dp);
|
||||
|
||||
public ControlButton(android.content.Context ctx, int resId, int keycode, float x, float y, boolean isSquare) {
|
||||
this(ctx.getResources().getString(resId), keycode, x, y, isSquare);
|
||||
}
|
||||
|
||||
public ControlButton(String name, int lwjglKeycode, float x, float y, int width, int height) {
|
||||
|
||||
public ControlButton(String name, int keycode, float x, float y, boolean isSquare) {
|
||||
this(name, keycode, x, y, isSquare ? pixelOf50dp : pixelOf80dp, isSquare ? pixelOf50dp : pixelOf30dp);
|
||||
}
|
||||
|
||||
public ControlButton(String name, int keycode, float x, float y, int width, int height) {
|
||||
this.name = name;
|
||||
this.lwjglKeycode = lwjglKeycode;
|
||||
this.keycode = keycode;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
|
||||
public void execute(MainActivity act, boolean isDown) {
|
||||
act.sendKeyPress(lwjglKeycode, isDown);
|
||||
act.sendKeyPress(keycode, isDown);
|
||||
}
|
||||
|
||||
public ControlButton clone() {
|
||||
return new ControlButton(name, keycode, x, y, width, height);
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,14 @@ public class ControlView extends Button implements OnLongClickListener, OnTouchL
|
||||
setTranslationY(moveY = properties.y);
|
||||
}
|
||||
|
||||
if (properties.specialButtonListener instanceof View.OnClickListener) {
|
||||
setOnClickListener((View.OnClickListener) properties.specialButtonListener);
|
||||
} else if (properties.specialButtonListener instanceof View.OnTouchListener) {
|
||||
setOnTouchListener((View.OnTouchListener) properties.specialButtonListener);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Field " + ControlButton.class.getName() + ".specialButtonListener must be View.OnClickListener or View.OnTouchListener, but is " + properties.specialButtonListener.getClass().getName());
|
||||
}
|
||||
|
||||
setLayoutParams(new FrameLayout.LayoutParams(properties.width, properties.height));
|
||||
}
|
||||
|
||||
@@ -105,6 +113,7 @@ public class ControlView extends Button implements OnLongClickListener, OnTouchL
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
if (!mCanModify) {
|
||||
mCanTriggerLongClick = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,14 +11,16 @@ public class ControlsLayout extends FrameLayout
|
||||
{
|
||||
private boolean mCanModify;
|
||||
private CustomControls mLayout;
|
||||
private CustomControlsActivity mActivity;
|
||||
private boolean mControlVisible = false;
|
||||
public ControlsLayout(Context ctx) {
|
||||
super(ctx);
|
||||
}
|
||||
|
||||
|
||||
public ControlsLayout(Context ctx, AttributeSet attrs) {
|
||||
super(ctx, attrs);
|
||||
}
|
||||
|
||||
|
||||
public void hideAllHandleViews() {
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View view = getChildAt(i);
|
||||
@@ -27,34 +29,65 @@ public class ControlsLayout extends FrameLayout
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void loadLayout(String jsonPath) {
|
||||
try {
|
||||
loadLayout(new Gson().fromJson(Tools.read(jsonPath), CustomControls.class));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void loadLayout(CustomControls controlLayout) {
|
||||
mLayout = controlLayout;
|
||||
removeAllViews();
|
||||
for (ControlButton button : controlLayout.button) {
|
||||
addControlView(button);
|
||||
}
|
||||
|
||||
setModified(false);
|
||||
}
|
||||
|
||||
|
||||
public void addControlButton(ControlButton controlButton) {
|
||||
mLayout.button.add(controlButton);
|
||||
addControlView(controlButton);
|
||||
}
|
||||
|
||||
|
||||
private void addControlView(ControlButton controlButton) {
|
||||
final ControlView view = new ControlView(getContext(), controlButton);
|
||||
view.setModifiable(mCanModify);
|
||||
addView(view);
|
||||
|
||||
setModified(true);
|
||||
}
|
||||
|
||||
|
||||
public void removeControlButton(ControlView controlButton) {
|
||||
mLayout.button.remove(controlButton.getProperties());
|
||||
controlButton.setVisibility(View.GONE);
|
||||
removeView(controlButton);
|
||||
|
||||
setModified(true);
|
||||
}
|
||||
|
||||
public void saveLayout(String path) throws Exception {
|
||||
mLayout.save(path);
|
||||
setModified(false);
|
||||
}
|
||||
|
||||
public void setActivity(CustomControlsActivity activity) {
|
||||
mActivity = activity;
|
||||
}
|
||||
|
||||
public void saveLayout(String path) throws Exception {
|
||||
Tools.write(path, new Gson().toJson(mLayout));
|
||||
public void toggleControlVisible() {
|
||||
if (mCanModify) return; // Not using on custom controls activity
|
||||
|
||||
mControlVisible = !mControlVisible;
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View view = getChildAt(i);
|
||||
if (view instanceof ControlView && ((ControlView) view).getProperties().keycode != ControlButton.SPECIALBTN_TOGGLECTRL) {
|
||||
((ControlView) view).setVisibility(mControlVisible ? (((ControlView) view).getProperties().hidden ? View.INVISIBLE : View.VISIBLE) : View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setModifiable(boolean z) {
|
||||
@@ -62,8 +95,14 @@ public class ControlsLayout extends FrameLayout
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View v = getChildAt(i);
|
||||
if (v instanceof ControlView) {
|
||||
((ControlView) v).setModifiable(z);
|
||||
ControlView cv = ((ControlView) v);
|
||||
cv.setModifiable(z);
|
||||
// cv.setVisibility(cv.getProperties().hidden ? View.INVISIBLE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setModified(boolean z) {
|
||||
if (mActivity != null) mActivity.isModified = z;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,48 @@
|
||||
package net.kdt.pojavlaunch.value.customcontrols;
|
||||
import java.util.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import com.google.gson.*;
|
||||
import android.content.*;
|
||||
import org.lwjgl.input.*;
|
||||
import org.lwjgl.opengl.AndroidDisplay;
|
||||
|
||||
public class CustomControls
|
||||
{
|
||||
public List<ControlButton> button = new ArrayList<ControlButton>();
|
||||
public List<ControlButton> button;
|
||||
public CustomControls() {
|
||||
this(new ArrayList<ControlButton>());
|
||||
}
|
||||
|
||||
public CustomControls(List<ControlButton> button) {
|
||||
this.button = button;
|
||||
}
|
||||
|
||||
// Generate default control
|
||||
public CustomControls(Context ctx) {
|
||||
this();
|
||||
this.button.add(ControlButton.getSpecialButtons()[0].clone()); // Keyboard
|
||||
this.button.add(ControlButton.getSpecialButtons()[1].clone()); // GUI
|
||||
this.button.add(ControlButton.getSpecialButtons()[2].clone()); // Primary Mouse button
|
||||
this.button.add(ControlButton.getSpecialButtons()[3].clone()); // Secondary Mouse button
|
||||
this.button.add(ControlButton.getSpecialButtons()[4].clone()); // Virtual mouse toggle
|
||||
|
||||
this.button.add(new ControlButton(ctx, R.string.control_debug, Keyboard.KEY_F3, ControlButton.pixelOf2dp, ControlButton.pixelOf2dp, false));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_chat, Keyboard.KEY_T, ControlButton.pixelOf2dp * 2 + ControlButton.pixelOf80dp, ControlButton.pixelOf2dp, false));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_listplayers, Keyboard.KEY_TAB, ControlButton.pixelOf2dp * 4 + ControlButton.pixelOf80dp * 3, ControlButton.pixelOf2dp, false));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_thirdperson, Keyboard.KEY_F5, ControlButton.pixelOf2dp, ControlButton.pixelOf30dp + ControlButton.pixelOf2dp, false));
|
||||
|
||||
this.button.add(new ControlButton(ctx, R.string.control_up, Keyboard.KEY_W, ControlButton.pixelOf2dp * 2 + ControlButton.pixelOf50dp, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp * 3 - ControlButton.pixelOf50dp * 3, true));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_left, Keyboard.KEY_A, ControlButton.pixelOf2dp, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp * 2 - ControlButton.pixelOf50dp * 2, true));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_down, Keyboard.KEY_S, ControlButton.pixelOf2dp * 2 + ControlButton.pixelOf50dp, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp - ControlButton.pixelOf50dp, true));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_right, Keyboard.KEY_D, ControlButton.pixelOf2dp * 3 + ControlButton.pixelOf50dp * 2, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp * 2 - ControlButton.pixelOf50dp * 2, true));
|
||||
|
||||
this.button.add(new ControlButton(ctx, R.string.control_inventory, Keyboard.KEY_E, ControlButton.pixelOf2dp * 3 + ControlButton.pixelOf50dp * 2, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp - ControlButton.pixelOf50dp, true));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_shift, Keyboard.KEY_LSHIFT, ControlButton.pixelOf2dp * 2 + ControlButton.pixelOf50dp, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp * 2 - ControlButton.pixelOf50dp * 2, true));
|
||||
this.button.add(new ControlButton(ctx, R.string.control_jump, Keyboard.KEY_SPACE, AndroidDisplay.windowWidth - ControlButton.pixelOf2dp * 3 - ControlButton.pixelOf50dp * 2, AndroidDisplay.windowHeight - ControlButton.pixelOf2dp * 2 - ControlButton.pixelOf50dp * 2, true));
|
||||
|
||||
}
|
||||
|
||||
public void save(String path) throws Exception {
|
||||
Tools.write(path, new Gson().toJson(this));
|
||||
}
|
||||
}
|
||||
@@ -160,6 +160,11 @@ public class Services {
|
||||
public static synchronized ArrayList<Provider.Service> getServices(String key) {
|
||||
return services.get(key);
|
||||
}
|
||||
|
||||
public static synchronized ArrayList<Provider.Service> getServices(String type, String algorithm) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default SecureRandom service description.
|
||||
*/
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2008 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl;
|
||||
|
||||
import java.nio.*;
|
||||
|
||||
/**
|
||||
* <p>A class to check buffer boundaries in general. If there is unsufficient space
|
||||
* in the buffer when the call is made then a buffer overflow would otherwise
|
||||
* occur and cause unexpected behaviour, a crash, or worse, a security risk.
|
||||
*
|
||||
* Internal class, don't use.
|
||||
* </p>
|
||||
* @author cix_foo <cix_foo@users.sourceforge.net>
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
* $Id$
|
||||
*/
|
||||
public class BufferChecks {
|
||||
/** Static methods only! */
|
||||
private BufferChecks() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a function pointer is not-null (0)
|
||||
*/
|
||||
public static void checkFunctionAddress(long pointer) {
|
||||
if (LWJGLUtil.CHECKS && pointer == 0) {
|
||||
// throw new IllegalStateException("Function is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a ByteBuffer is null-terminated
|
||||
*/
|
||||
public static void checkNullTerminated(ByteBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && buf.get(buf.limit() - 1) != 0) {
|
||||
throw new IllegalArgumentException("Missing null termination");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkNullTerminated(ByteBuffer buf, int count) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
int nullFound = 0;
|
||||
for ( int i = buf.position(); i < buf.limit(); i++ ) {
|
||||
if ( buf.get(i) == 0 )
|
||||
nullFound++;
|
||||
}
|
||||
|
||||
if ( nullFound < count )
|
||||
throw new IllegalArgumentException("Missing null termination");
|
||||
}
|
||||
}
|
||||
|
||||
/** Helper method to ensure an IntBuffer is null-terminated */
|
||||
public static void checkNullTerminated(IntBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && buf.get(buf.limit() - 1) != 0 ) {
|
||||
throw new IllegalArgumentException("Missing null termination");
|
||||
}
|
||||
}
|
||||
|
||||
/** Helper method to ensure a LongBuffer is null-terminated */
|
||||
public static void checkNullTerminated(LongBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && buf.get(buf.limit() - 1) != 0 ) {
|
||||
throw new IllegalArgumentException("Missing null termination");
|
||||
}
|
||||
}
|
||||
|
||||
/** Helper method to ensure a PointerBuffer is null-terminated */
|
||||
public static void checkNullTerminated(PointerBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && buf.get(buf.limit() - 1) != 0 ) {
|
||||
throw new IllegalArgumentException("Missing null termination");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkNotNull(Object o) {
|
||||
if ( LWJGLUtil.CHECKS && o == null)
|
||||
throw new IllegalArgumentException("Null argument");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper methods to ensure a buffer is direct (and, implicitly, non-null).
|
||||
*/
|
||||
public static void checkDirect(ByteBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && !buf.isDirect()) {
|
||||
throw new IllegalArgumentException("ByteBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirect(ShortBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && !buf.isDirect()) {
|
||||
throw new IllegalArgumentException("ShortBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirect(IntBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && !buf.isDirect()) {
|
||||
throw new IllegalArgumentException("IntBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirect(LongBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && !buf.isDirect()) {
|
||||
throw new IllegalArgumentException("LongBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirect(FloatBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && !buf.isDirect()) {
|
||||
throw new IllegalArgumentException("FloatBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirect(DoubleBuffer buf) {
|
||||
if ( LWJGLUtil.CHECKS && !buf.isDirect()) {
|
||||
throw new IllegalArgumentException("DoubleBuffer is not direct");
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkDirect(PointerBuffer buf) {
|
||||
// NO-OP, PointerBuffer is always direct.
|
||||
}
|
||||
|
||||
public static void checkArray(Object[] array) {
|
||||
if ( LWJGLUtil.CHECKS && (array == null || array.length == 0) )
|
||||
throw new IllegalArgumentException("Invalid array");
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a separate call to help inline checkBufferSize.
|
||||
*/
|
||||
private static void throwBufferSizeException(Buffer buf, int size) {
|
||||
throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size + ". Because at most " + size + " elements can be returned, a buffer with at least " + size + " elements is required, regardless of actual returned element count");
|
||||
}
|
||||
|
||||
private static void throwBufferSizeException(PointerBuffer buf, int size) {
|
||||
throw new IllegalArgumentException("Number of remaining pointer buffer elements is " + buf.remaining() + ", must be at least " + size);
|
||||
}
|
||||
|
||||
private static void throwArraySizeException(Object[] array, int size) {
|
||||
throw new IllegalArgumentException("Number of array elements is " + array.length + ", must be at least " + size);
|
||||
}
|
||||
|
||||
private static void throwArraySizeException(long[] array, int size) {
|
||||
throw new IllegalArgumentException("Number of array elements is " + array.length + ", must be at least " + size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to ensure a buffer is big enough to receive data from a
|
||||
* glGet* operation.
|
||||
*
|
||||
* @param buf
|
||||
* The buffer to check
|
||||
* @param size
|
||||
* The minimum buffer size
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public static void checkBufferSize(Buffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS && buf.remaining() < size) {
|
||||
throwBufferSizeException(buf, size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects the buffer type and performs the corresponding check
|
||||
* and also returns the buffer position in bytes.
|
||||
*
|
||||
* @param buffer the buffer to check
|
||||
* @param size the size to check
|
||||
*
|
||||
* @return the buffer position in bytes
|
||||
*/
|
||||
public static int checkBuffer(final Buffer buffer, final int size) {
|
||||
final int posShift;
|
||||
if ( buffer instanceof ByteBuffer ) {
|
||||
BufferChecks.checkBuffer((ByteBuffer)buffer, size);
|
||||
posShift = 0;
|
||||
} else if ( buffer instanceof ShortBuffer ) {
|
||||
BufferChecks.checkBuffer((ShortBuffer)buffer, size);
|
||||
posShift = 1;
|
||||
} else if ( buffer instanceof IntBuffer ) {
|
||||
BufferChecks.checkBuffer((IntBuffer)buffer, size);
|
||||
posShift = 2;
|
||||
} else if ( buffer instanceof LongBuffer ) {
|
||||
BufferChecks.checkBuffer((LongBuffer)buffer, size);
|
||||
posShift = 4;
|
||||
} else if ( buffer instanceof FloatBuffer ) {
|
||||
BufferChecks.checkBuffer((FloatBuffer)buffer, size);
|
||||
posShift = 2;
|
||||
} else if ( buffer instanceof DoubleBuffer ) {
|
||||
BufferChecks.checkBuffer((DoubleBuffer)buffer, size);
|
||||
posShift = 4;
|
||||
} else
|
||||
throw new IllegalArgumentException("Unsupported Buffer type specified: " + buffer.getClass());
|
||||
|
||||
return buffer.position() << posShift;
|
||||
}
|
||||
|
||||
public static void checkBuffer(ByteBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkBuffer(ShortBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkBuffer(IntBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkBuffer(LongBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkBuffer(FloatBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkBuffer(DoubleBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS ) {
|
||||
checkBufferSize(buf, size);
|
||||
checkDirect(buf);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkBuffer(PointerBuffer buf, int size) {
|
||||
if ( LWJGLUtil.CHECKS && buf.remaining() < size ) {
|
||||
throwBufferSizeException(buf, size);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkArray(Object[] array, int size) {
|
||||
if ( LWJGLUtil.CHECKS && array.length < size )
|
||||
throwArraySizeException(array, size);
|
||||
}
|
||||
|
||||
public static void checkArray(long[] array, int size) {
|
||||
if ( LWJGLUtil.CHECKS && array.length < size )
|
||||
throwArraySizeException(array, size);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2008 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
* $Id$
|
||||
*/
|
||||
abstract class DefaultSysImplementation implements SysImplementation {
|
||||
public /* native */ int getJNIVersion() {
|
||||
// Bypass JNI Version check.
|
||||
return getRequiredJNIVersion();
|
||||
}
|
||||
|
||||
public /* native */ int getPointerSize() {
|
||||
return 1;
|
||||
}
|
||||
public native void setDebug(boolean debug);
|
||||
|
||||
public long getTimerResolution() {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
public boolean has64Bit() {
|
||||
return System.getProperty("os.arch").contains("64");
|
||||
}
|
||||
|
||||
public abstract long getTime();
|
||||
public abstract void alert(String title, String message);
|
||||
public abstract String getClipboard();
|
||||
}
|
||||
@@ -1,621 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002-2008 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Internal library methods
|
||||
* </p>
|
||||
*
|
||||
* @author Brian Matzon <brian@matzon.dk>
|
||||
* @version $Revision$
|
||||
* $Id$
|
||||
*/
|
||||
public class LWJGLUtil {
|
||||
public static final int PLATFORM_LINUX = 1;
|
||||
public static final int PLATFORM_MACOSX = 2;
|
||||
public static final int PLATFORM_WINDOWS = 3;
|
||||
public static final int PLATFORM_ANDROID = 1337;
|
||||
public static final String PLATFORM_LINUX_NAME = "linux";
|
||||
public static final String PLATFORM_MACOSX_NAME = "macosx";
|
||||
public static final String PLATFORM_WINDOWS_NAME = "windows";
|
||||
public static final String PLATFORM_ANDROID_NAME = "android";
|
||||
|
||||
private static final String LWJGL_ICON_DATA_16x16 =
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\376\377\377\377\302\327\350\377" +
|
||||
"\164\244\313\377\120\213\275\377\124\216\277\377\206\257\322\377" +
|
||||
"\347\357\366\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\365\365\365\377\215\217\221\377\166\202\215\377" +
|
||||
"\175\215\233\377\204\231\252\377\224\267\325\377\072\175\265\377" +
|
||||
"\110\206\272\377\332\347\361\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\364\370\373\377\234\236\240\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\344\344\344\377\204\255\320\377" +
|
||||
"\072\175\265\377\133\222\301\377\374\375\376\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\221\266\325\377\137\137\137\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\042\042\042\377\377\377\377\377\350\360\366\377" +
|
||||
"\071\174\265\377\072\175\265\377\304\330\351\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\306\331\351\377" +
|
||||
"\201\253\316\377\035\035\035\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\146\146\146\377\377\377\377\377\320\340\355\377" +
|
||||
"\072\175\265\377\072\175\265\377\215\264\324\377\377\377\377\377" +
|
||||
"\362\362\362\377\245\245\245\377\337\337\337\377\242\301\334\377" +
|
||||
"\260\305\326\377\012\012\012\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\250\250\250\377\377\377\377\377\227\272\330\377" +
|
||||
"\072\175\265\377\072\175\265\377\161\241\312\377\377\377\377\377" +
|
||||
"\241\241\241\377\000\000\000\377\001\001\001\377\043\043\043\377" +
|
||||
"\314\314\314\377\320\320\320\377\245\245\245\377\204\204\204\377" +
|
||||
"\134\134\134\377\357\357\357\377\377\377\377\377\140\226\303\377" +
|
||||
"\072\175\265\377\072\175\265\377\155\236\310\377\377\377\377\377" +
|
||||
"\136\136\136\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\317\317\317\377\037\037\037\377\003\003\003\377\053\053\053\377" +
|
||||
"\154\154\154\377\306\306\306\377\372\374\375\377\236\277\332\377" +
|
||||
"\167\245\314\377\114\211\274\377\174\250\316\377\377\377\377\377" +
|
||||
"\033\033\033\377\000\000\000\377\000\000\000\377\027\027\027\377" +
|
||||
"\326\326\326\377\001\001\001\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\122\122\122\377\345\345\345\377\075\075\075\377" +
|
||||
"\150\150\150\377\246\246\247\377\332\336\341\377\377\377\377\377" +
|
||||
"\164\164\164\377\016\016\016\377\000\000\000\377\131\131\131\377" +
|
||||
"\225\225\225\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\221\221\221\377\233\233\233\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\002\002\002\377\103\103\103\377" +
|
||||
"\377\377\377\377\356\356\356\377\214\214\214\377\277\277\277\377" +
|
||||
"\126\126\126\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\323\323\323\377\130\130\130\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\063\063\063\377" +
|
||||
"\377\377\377\377\377\377\377\377\374\375\376\377\377\377\377\377" +
|
||||
"\300\300\300\377\100\100\100\377\002\002\002\377\000\000\000\377" +
|
||||
"\033\033\033\377\373\373\373\377\027\027\027\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\170\170\170\377" +
|
||||
"\377\377\377\377\377\377\377\377\322\341\356\377\176\251\316\377" +
|
||||
"\340\352\363\377\377\377\377\377\324\324\324\377\155\155\155\377" +
|
||||
"\204\204\204\377\323\323\323\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\275\275\275\377" +
|
||||
"\377\377\377\377\377\377\377\377\376\376\376\377\146\232\305\377" +
|
||||
"\075\177\266\377\202\254\320\377\344\355\365\377\377\377\377\377" +
|
||||
"\377\377\377\377\345\345\345\377\055\055\055\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\014\014\014\377\366\366\366\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\342\354\364\377" +
|
||||
"\115\211\274\377\072\175\265\377\076\200\266\377\207\260\322\377" +
|
||||
"\347\357\366\377\377\377\377\377\376\376\376\377\274\274\274\377" +
|
||||
"\117\117\117\377\003\003\003\377\112\112\112\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\353\362\370\377\214\263\324\377\126\220\300\377\120\214\275\377" +
|
||||
"\167\245\314\377\355\363\370\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\337\337\337\377\346\346\346\377\377\377\377\377";
|
||||
|
||||
private static final String LWJGL_ICON_DATA_32x32 =
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\374\375\377" +
|
||||
"\313\335\354\377\223\267\326\377\157\240\311\377\134\223\302\377\140\226\303\377\172\247\315\377\254\310\340\377\355\363\370\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\375\376\377\265\316\343\377\132\222\301\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\105\205\271\377" +
|
||||
"\241\301\334\377\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\374\374\377\342\352\361\377\270\317\343\377\256\311\340\377" +
|
||||
"\243\302\334\377\230\272\330\377\214\263\323\377\201\254\317\377\156\237\310\377\075\177\266\377\072\175\265\377\072\175\265\377" +
|
||||
"\072\175\265\377\162\242\312\377\365\370\373\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\330\330\330\377\061\061\061\377\044\044\044\377\061\061\061\377\100\100\100\377" +
|
||||
"\122\122\122\377\145\145\145\377\164\164\164\377\217\217\217\377\367\370\370\377\254\310\337\377\073\175\265\377\072\175\265\377" +
|
||||
"\072\175\265\377\072\175\265\377\171\247\315\377\374\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\376\376\376\377\150\150\150\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\266\266\266\377\376\376\376\377\206\256\321\377\072\175\265\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\256\312\341\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\323\342\356\377\341\352\362\377\050\050\050\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\002\002\002\377\336\336\336\377\377\377\377\377\365\370\373\377\133\222\301\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\110\206\272\377\364\370\373\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\354\363\370\377\144\231\305\377\327\331\333\377\005\005\005\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\044\044\044\377\376\376\376\377\377\377\377\377\377\377\377\377\300\325\347\377" +
|
||||
"\071\174\265\377\072\175\265\377\072\175\265\377\072\175\265\377\253\310\340\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\377\377" +
|
||||
"\170\246\314\377\173\247\315\377\236\236\236\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\145\145\145\377\377\377\377\377\377\377\377\377\377\377\377\377\342\354\364\377" +
|
||||
"\067\173\264\377\072\175\265\377\072\175\265\377\072\175\265\377\146\232\305\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\327\350\377" +
|
||||
"\071\175\265\377\262\314\341\377\130\130\130\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\251\251\251\377\377\377\377\377\377\377\377\377\377\377\377\377\274\322\345\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\100\201\267\377\356\364\371\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\374\375\377\132\222\301\377" +
|
||||
"\075\177\266\377\335\345\355\377\034\034\034\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\007\007\007\377\347\347\347\377\377\377\377\377\377\377\377\377\377\377\377\377\205\256\321\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\071\175\265\377\314\336\354\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\377\272\322\345\377\072\175\265\377" +
|
||||
"\127\220\277\377\320\321\321\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\063\063\063\377\375\375\375\377\377\377\377\377\377\377\377\377\373\374\375\377\120\213\275\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\071\175\265\377\261\314\342\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\312\312\312\377\067\067\067\377\141\141\141\377\242\242\242\377\335\335\335\377\344\354\363\377\261\313\341\377" +
|
||||
"\264\315\342\377\346\346\346\377\043\043\043\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\162\162\162\377\377\377\377\377\377\377\377\377\377\377\377\377\330\345\360\377\072\175\265\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\240\300\333\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\146\146\146\377\000\000\000\377\000\000\000\377\000\000\000\377\006\006\006\377\047\047\047\377\146\146\146\377" +
|
||||
"\324\324\324\377\377\377\377\377\366\366\366\377\320\320\320\377\227\227\227\377\136\136\136\377\047\047\047\377\004\004\004\377" +
|
||||
"\000\000\000\377\003\003\003\377\300\300\300\377\377\377\377\377\377\377\377\377\377\377\377\377\242\301\333\377\072\175\265\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\236\277\332\377\377\377\377\377\377\377\377\377" +
|
||||
"\373\373\373\377\045\045\045\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\134\134\134\377\377\377\377\377\352\352\352\377\217\217\217\377\265\265\265\377\351\351\351\377\375\375\375\377\347\347\347\377" +
|
||||
"\262\262\262\377\275\275\275\377\376\376\376\377\377\377\377\377\377\377\377\377\377\377\377\377\153\235\307\377\072\175\265\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\241\301\334\377\377\377\377\377\377\377\377\377" +
|
||||
"\333\333\333\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\203\203\203\377\377\377\377\377\137\137\137\377\000\000\000\377\000\000\000\377\013\013\013\377\067\067\067\377\166\166\166\377" +
|
||||
"\267\267\267\377\360\360\360\377\377\377\377\377\377\377\377\377\377\377\377\377\360\365\371\377\113\210\273\377\075\177\266\377" +
|
||||
"\071\174\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\262\314\342\377\377\377\377\377\377\377\377\377" +
|
||||
"\232\232\232\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\305\305\305\377\367\367\367\377\035\035\035\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\007\007\007\377\074\074\074\377\337\337\337\377\377\377\377\377\373\374\375\377\374\375\376\377\363\367\372\377" +
|
||||
"\314\335\353\377\236\276\332\377\162\241\311\377\114\211\273\377\072\175\265\377\311\334\353\377\377\377\377\377\377\377\377\377" +
|
||||
"\126\126\126\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\017\017\017\377" +
|
||||
"\371\371\371\377\321\321\321\377\003\003\003\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\216\216\216\377\377\377\377\377\371\371\371\377\204\204\204\377\160\160\160\377" +
|
||||
"\260\260\260\377\352\352\352\377\377\377\377\377\371\373\374\377\334\350\362\377\366\371\374\377\377\377\377\377\377\377\377\377" +
|
||||
"\025\025\025\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\116\116\116\377" +
|
||||
"\377\377\377\377\221\221\221\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\273\273\273\377\377\377\377\377\236\236\236\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\004\004\004\377\057\057\057\377\160\160\160\377\260\260\260\377\346\346\346\377\376\376\376\377\377\377\377\377" +
|
||||
"\071\071\071\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\220\220\220\377" +
|
||||
"\377\377\377\377\115\115\115\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\020\020\020\377\360\360\360\377\377\377\377\377\132\132\132\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\011\011\011\377\062\062\062\377\261\261\261\377" +
|
||||
"\366\366\366\377\241\241\241\377\065\065\065\377\002\002\002\377\000\000\000\377\000\000\000\377\002\002\002\377\321\321\321\377" +
|
||||
"\365\365\365\377\023\023\023\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\105\105\105\377\376\376\376\377\370\370\370\377\035\035\035\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\053\053\053\377" +
|
||||
"\377\377\377\377\377\377\377\377\374\374\374\377\276\276\276\377\120\120\120\377\005\005\005\377\045\045\045\377\371\371\371\377" +
|
||||
"\302\302\302\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\206\206\206\377\377\377\377\377\322\322\322\377\001\001\001\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\103\103\103\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377\334\334\334\377\340\340\340\377\377\377\377\377" +
|
||||
"\225\225\225\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\001\001\001\377\310\310\310\377\377\377\377\377\216\216\216\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\210\210\210\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\337\337\337\377\051\051\051\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\030\030\030\377\365\365\365\377\377\377\377\377\112\112\112\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\317\317\317\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\361\366\372\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\371\371\371\377\265\265\265\377\113\113\113\377\006\006\006\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\122\122\122\377\377\377\377\377\370\370\370\377\020\020\020\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\034\034\034\377\370\370\370\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\206\257\321\377\220\265\325\377\352\361\367\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\333\333\333\377\170\170\170\377\033\033\033\377\000\000\000\377" +
|
||||
"\000\000\000\377\226\226\226\377\377\377\377\377\306\306\306\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\132\132\132\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\303\330\351\377\072\175\265\377\103\203\270\377" +
|
||||
"\224\270\326\377\355\363\370\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\364\364\364\377\247\247\247\377" +
|
||||
"\205\205\205\377\364\364\364\377\377\377\377\377\206\206\206\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\235\235\235\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\373\375\377\135\224\302\377\072\175\265\377" +
|
||||
"\072\175\265\377\106\205\271\377\230\273\330\377\357\364\371\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\233\233\233\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\005\005\005\377\335\335\335\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\305\331\351\377\073\176\266\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\110\206\272\377\236\276\332\377\362\366\372\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\373\373\373\377\216\216\216\377\045\045\045\377\001\001\001\377\000\000\000\377" +
|
||||
"\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\054\054\054\377\374\374\374\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\217\265\325\377" +
|
||||
"\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\112\207\273\377\243\302\334\377\363\367\372\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\372\372\372\377\260\260\260\377\105\105\105\377" +
|
||||
"\004\004\004\377\000\000\000\377\000\000\000\377\000\000\000\377\000\000\000\377\156\156\156\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\374\375\376\377" +
|
||||
"\205\257\321\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\115\211\274\377" +
|
||||
"\250\305\336\377\366\371\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377" +
|
||||
"\322\322\322\377\150\150\150\377\016\016\016\377\000\000\000\377\001\001\001\377\270\270\270\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\376\376\377\377\261\313\342\377\114\211\274\377\071\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377\072\175\265\377" +
|
||||
"\072\175\265\377\115\211\274\377\277\324\347\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\354\354\354\377\223\223\223\377\233\233\233\377\375\375\375\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\363\367\372\377\265\316\343\377\201\254\320\377\145\231\305\377\141\227\304\377\154\236\310\377" +
|
||||
"\217\265\325\377\305\331\351\377\367\372\374\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" +
|
||||
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377";
|
||||
|
||||
/** LWJGL Logo - 16 by 16 pixels */
|
||||
public static final ByteBuffer LWJGLIcon16x16 = loadIcon(LWJGL_ICON_DATA_16x16);
|
||||
|
||||
/** LWJGL Logo - 32 by 32 pixels */
|
||||
public static final ByteBuffer LWJGLIcon32x32 = loadIcon(LWJGL_ICON_DATA_32x32);
|
||||
|
||||
/** Debug flag. */
|
||||
public static final boolean DEBUG = true;/*getPrivilegedBoolean("org.lwjgl.util.Debug");*/
|
||||
|
||||
public static final boolean CHECKS = !getPrivilegedBoolean("org.lwjgl.util.NoChecks");
|
||||
|
||||
private static final int PLATFORM;
|
||||
|
||||
static {
|
||||
/*final String osName = getPrivilegedProperty("os.name");
|
||||
if ( osName.startsWith("Windows") )
|
||||
PLATFORM = PLATFORM_WINDOWS;
|
||||
else if ( osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS") || osName.startsWith("Unix") )
|
||||
PLATFORM = PLATFORM_LINUX;
|
||||
else if ( osName.startsWith("Mac OS X") || osName.startsWith("Darwin") )
|
||||
PLATFORM = PLATFORM_MACOSX;
|
||||
else
|
||||
throw new LinkageError("Unknown platform: " + osName);*/
|
||||
PLATFORM = PLATFORM_ANDROID;
|
||||
}
|
||||
|
||||
private static ByteBuffer loadIcon(String data) {
|
||||
int len = data.length();
|
||||
ByteBuffer bb = BufferUtils.createByteBuffer(len);
|
||||
for(int i=0 ; i<len ; i++) {
|
||||
bb.put(i, (byte)data.charAt(i));
|
||||
}
|
||||
return bb.asReadOnlyBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #PLATFORM_WINDOWS
|
||||
* @see #PLATFORM_LINUX
|
||||
* @see #PLATFORM_MACOSX
|
||||
* @return the current platform type
|
||||
*/
|
||||
public static int getPlatform() {
|
||||
return PLATFORM;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see #PLATFORM_WINDOWS_NAME
|
||||
* @see #PLATFORM_LINUX_NAME
|
||||
* @see #PLATFORM_MACOSX_NAME
|
||||
* @return current platform name
|
||||
*/
|
||||
public static String getPlatformName() {
|
||||
switch (LWJGLUtil.getPlatform()) {
|
||||
case LWJGLUtil.PLATFORM_LINUX:
|
||||
return PLATFORM_LINUX_NAME;
|
||||
case LWJGLUtil.PLATFORM_MACOSX:
|
||||
return PLATFORM_MACOSX_NAME;
|
||||
case LWJGLUtil.PLATFORM_WINDOWS:
|
||||
return PLATFORM_WINDOWS_NAME;
|
||||
/*
|
||||
case LWJGLUtil.PLATFORM_ANDROID:
|
||||
return PLATFORM_ANDROID_NAME;
|
||||
*/
|
||||
default:
|
||||
return PLATFORM_ANDROID_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates the paths required by a library.
|
||||
*
|
||||
* @param libname Local Library Name to search the classloader with ("openal").
|
||||
* @param platform_lib_name The native library name ("libopenal.so")
|
||||
* @param classloader The classloader to ask for library paths
|
||||
* @return Paths to located libraries, if any
|
||||
*/
|
||||
public static String[] getLibraryPaths(String libname, String platform_lib_name, ClassLoader classloader) {
|
||||
return getLibraryPaths(libname, new String[]{platform_lib_name}, classloader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates the paths required by a library.
|
||||
*
|
||||
* @param libname Local Library Name to search the classloader with ("openal").
|
||||
* @param platform_lib_names The list of possible library names ("libopenal.so")
|
||||
* @param classloader The classloader to ask for library paths
|
||||
* @return Paths to located libraries, if any
|
||||
*/
|
||||
public static String[] getLibraryPaths(String libname, String[] platform_lib_names, ClassLoader classloader) {
|
||||
// need to pass path of possible locations of library to native side
|
||||
List<String> possible_paths = new ArrayList<String>();
|
||||
|
||||
String classloader_path = getPathFromClassLoader(libname, classloader);
|
||||
if (classloader_path != null) {
|
||||
log("getPathFromClassLoader: Path found: " + classloader_path);
|
||||
possible_paths.add(classloader_path);
|
||||
}
|
||||
|
||||
for ( String platform_lib_name : platform_lib_names ) {
|
||||
String lwjgl_classloader_path = getPathFromClassLoader("lwjgl", classloader);
|
||||
if ( lwjgl_classloader_path != null ) {
|
||||
log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path);
|
||||
possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator))
|
||||
+ File.separator + platform_lib_name);
|
||||
}
|
||||
|
||||
// add Installer path
|
||||
String alternative_path = getPrivilegedProperty("org.lwjgl.librarypath");
|
||||
if ( alternative_path != null ) {
|
||||
possible_paths.add(alternative_path + File.separator + platform_lib_name);
|
||||
}
|
||||
|
||||
// Add all possible paths from java.library.path
|
||||
String java_library_path = getPrivilegedProperty("java.library.path");
|
||||
|
||||
StringTokenizer st = new StringTokenizer(java_library_path, File.pathSeparator);
|
||||
while ( st.hasMoreTokens() ) {
|
||||
String path = st.nextToken();
|
||||
possible_paths.add(path + File.separator + platform_lib_name);
|
||||
}
|
||||
|
||||
//add current path
|
||||
String current_dir = getPrivilegedProperty("user.dir");
|
||||
possible_paths.add(current_dir + File.separator + platform_lib_name);
|
||||
|
||||
//add pure library (no path, let OS search)
|
||||
possible_paths.add(platform_lib_name);
|
||||
}
|
||||
|
||||
//create needed string array
|
||||
return possible_paths.toArray(new String[possible_paths.size()]);
|
||||
}
|
||||
|
||||
static void execPrivileged(final String[] cmd_array) throws Exception {
|
||||
try {
|
||||
Process process = AccessController.doPrivileged(new PrivilegedExceptionAction<Process>() {
|
||||
public Process run() throws Exception {
|
||||
return Runtime.getRuntime().exec(cmd_array);
|
||||
}
|
||||
});
|
||||
// Close unused streams to make sure the child process won't hang
|
||||
process.getInputStream().close();
|
||||
process.getOutputStream().close();
|
||||
process.getErrorStream().close();
|
||||
} catch (PrivilegedActionException e) {
|
||||
throw (Exception)e.getCause();
|
||||
}
|
||||
}
|
||||
|
||||
private static String getPrivilegedProperty(final String property_name) {
|
||||
return AccessController.doPrivileged(new PrivilegedAction<String>() {
|
||||
public String run() {
|
||||
return System.getProperty(property_name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to locate named library from the current ClassLoader
|
||||
* This method exists because native libraries are loaded from native code, and as such
|
||||
* is exempt from ClassLoader library loading rutines. It therefore always fails.
|
||||
* We therefore invoke the protected method of the ClassLoader to see if it can
|
||||
* locate it.
|
||||
*
|
||||
* @param libname Name of library to search for
|
||||
* @param classloader Classloader to use
|
||||
* @return Absolute path to library if found, otherwise null
|
||||
*/
|
||||
private static String getPathFromClassLoader(final String libname, final ClassLoader classloader) {
|
||||
Class<?> c = null;
|
||||
|
||||
try {
|
||||
log("getPathFromClassLoader: searching for: " + libname);
|
||||
c = classloader.getClass();
|
||||
while (c != null) {
|
||||
final Class<?> clazz = c;
|
||||
try {
|
||||
return AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
|
||||
public String run() throws Exception {
|
||||
Method findLibrary = clazz.getDeclaredMethod("findLibrary", String.class);
|
||||
findLibrary.setAccessible(true);
|
||||
String path = (String)findLibrary.invoke(classloader, libname);
|
||||
return path;
|
||||
}
|
||||
});
|
||||
} catch (PrivilegedActionException e) {
|
||||
log("Failed to locate findLibrary method: " + e.getCause());
|
||||
c = c.getSuperclass();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log("Failure locating " + e + " using classloader:" + c);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a boolean property as a privileged action.
|
||||
*/
|
||||
public static boolean getPrivilegedBoolean(final String property_name) {
|
||||
return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
|
||||
public Boolean run() {
|
||||
return Boolean.getBoolean(property_name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an integer property as a privileged action.
|
||||
*
|
||||
* @param property_name the integer property name
|
||||
*
|
||||
* @return the property value
|
||||
*/
|
||||
public static Integer getPrivilegedInteger(final String property_name) {
|
||||
return AccessController.doPrivileged(new PrivilegedAction<Integer>() {
|
||||
public Integer run() {
|
||||
return Integer.getInteger(property_name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an integer property as a privileged action.
|
||||
*
|
||||
* @param property_name the integer property name
|
||||
* @param default_val the default value to use if the property is not defined
|
||||
*
|
||||
* @return the property value
|
||||
*/
|
||||
public static Integer getPrivilegedInteger(final String property_name, final int default_val) {
|
||||
return AccessController.doPrivileged(new PrivilegedAction<Integer>() {
|
||||
public Integer run() {
|
||||
return Integer.getInteger(property_name, default_val);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the given message to System.err if DEBUG is true.
|
||||
*
|
||||
* @param msg Message to print
|
||||
*/
|
||||
public static void log(CharSequence msg) {
|
||||
if (DEBUG) {
|
||||
System.err.println("[LWJGL] " + msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to determine if the current system is running a version of
|
||||
* Mac OS X better than the given version. This is only useful for Mac OS X
|
||||
* specific code and will not work for any other platform.
|
||||
*/
|
||||
public static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) {
|
||||
String os_version = getPrivilegedProperty("os.version");
|
||||
StringTokenizer version_tokenizer = new StringTokenizer(os_version, ".");
|
||||
int major;
|
||||
int minor;
|
||||
try {
|
||||
String major_str = version_tokenizer.nextToken();
|
||||
String minor_str = version_tokenizer.nextToken();
|
||||
major = Integer.parseInt(major_str);
|
||||
minor = Integer.parseInt(minor_str);
|
||||
} catch (Exception e) {
|
||||
LWJGLUtil.log("Exception occurred while trying to determine OS version: " + e);
|
||||
// Best guess, no
|
||||
return false;
|
||||
}
|
||||
return major > major_required || (major == major_required && minor >= minor_required);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map of public static final integer fields in the specified classes, to their String representations.
|
||||
* An optional filter can be specified to only include specific fields. The target map may be null, in which
|
||||
* case a new map is allocated and returned.
|
||||
* <p>
|
||||
* This method is useful when debugging to quickly identify values returned from the AL/GL/CL APIs.
|
||||
*
|
||||
* @param filter the filter to use (optional)
|
||||
* @param target the target map (optional)
|
||||
* @param tokenClasses an array of classes to get tokens from
|
||||
*
|
||||
* @return the token map
|
||||
*/
|
||||
|
||||
public static Map<Integer, String> getClassTokens(final TokenFilter filter, final Map<Integer, String> target, final Class ... tokenClasses) {
|
||||
return getClassTokens(filter, target, Arrays.asList(tokenClasses));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a map of public static final integer fields in the specified classes, to their String representations.
|
||||
* An optional filter can be specified to only include specific fields. The target map may be null, in which
|
||||
* case a new map is allocated and returned.
|
||||
* <p>
|
||||
* This method is useful when debugging to quickly identify values returned from the AL/GL/CL APIs.
|
||||
*
|
||||
* @param filter the filter to use (optional)
|
||||
* @param target the target map (optional)
|
||||
* @param tokenClasses the classes to get tokens from
|
||||
*
|
||||
* @return the token map
|
||||
*/
|
||||
public static Map<Integer, String> getClassTokens(final TokenFilter filter, Map<Integer, String> target, final Iterable<Class> tokenClasses) {
|
||||
if ( target == null )
|
||||
target = new HashMap<Integer, String>();
|
||||
|
||||
final int TOKEN_MODIFIERS = Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL;
|
||||
|
||||
for ( final Class tokenClass : tokenClasses ) {
|
||||
for ( final Field field : tokenClass.getDeclaredFields() ) {
|
||||
// Get only <public static final int> fields.
|
||||
if ( (field.getModifiers() & TOKEN_MODIFIERS) == TOKEN_MODIFIERS && field.getType() == int.class ) {
|
||||
try {
|
||||
final int value = field.getInt(null);
|
||||
if ( filter != null && !filter.accept(field, value) )
|
||||
continue;
|
||||
|
||||
if ( target.containsKey(value) ) // Print colliding tokens in their hex representation.
|
||||
target.put(value, toHexString(value));
|
||||
else
|
||||
target.put(value, field.getName());
|
||||
} catch (IllegalAccessException e) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the integer argument as an
|
||||
* unsigned integer in base 16. The string will be uppercase
|
||||
* and will have a leading '0x'.
|
||||
*
|
||||
* @param value the integer value
|
||||
*
|
||||
* @return the hex string representation
|
||||
*/
|
||||
public static String toHexString(final int value) {
|
||||
return "0x" + Integer.toHexString(value).toUpperCase();
|
||||
}
|
||||
|
||||
/** Simple interface for Field filtering. */
|
||||
public interface TokenFilter {
|
||||
|
||||
/**
|
||||
* Should return true if the specified Field passes the filter.
|
||||
*
|
||||
* @param field the Field to test
|
||||
* @param value the integer value of the field
|
||||
*
|
||||
* @result true if the Field is accepted
|
||||
*/
|
||||
boolean accept(Field field, int value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -226,14 +226,14 @@ public final class GLContext {
|
||||
// Detect OpenGL version first
|
||||
|
||||
/* final */ String version = glGetString(GL_VERSION);
|
||||
|
||||
|
||||
if (version == null) {
|
||||
// throw new IllegalStateException("glGetString(GL_VERSION) returned null - possibly caused by missing current context.");
|
||||
|
||||
|
||||
System.err.println("Unable to get real OpenGL version, inserting OpenGL 2.0.");
|
||||
version = "2.0";
|
||||
}
|
||||
|
||||
|
||||
final StringTokenizer version_tokenizer = new StringTokenizer(version, ". ");
|
||||
final String major_string = version_tokenizer.nextToken();
|
||||
final String minor_string = version_tokenizer.nextToken();
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright LWJGL. All rights reserved.
|
||||
* License terms: https://www.lwjgl.org/license
|
||||
*/
|
||||
package org.lwjgl.system;
|
||||
|
||||
/**
|
||||
* Simple index checks.
|
||||
*
|
||||
* <p>On Java 9 these checks are replaced with the corresponding {@link java.util.Objects} methods, which perform better.</p>
|
||||
*/
|
||||
public final class CheckIntrinsics {
|
||||
|
||||
private CheckIntrinsics() {
|
||||
}
|
||||
|
||||
public static int checkIndex(int index, int length) {
|
||||
if (index < 0 || length <= index) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
public static int checkFromToIndex(int fromIndex, int toIndex, int length) {
|
||||
if (fromIndex < 0 || toIndex < fromIndex || length < toIndex) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
return fromIndex;
|
||||
}
|
||||
|
||||
public static int checkFromIndexSize(int fromIndex, int size, int length) {
|
||||
if ((length | fromIndex | size) < 0 || length - fromIndex < size) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
return fromIndex;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
#ifdef DOUBLE_FP
|
||||
#ifdef AMD_FP
|
||||
#pragma OPENCL EXTENSION cl_amd_fp64 : enable
|
||||
#else
|
||||
#ifndef CL_VERSION_1_2
|
||||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||
#endif
|
||||
#endif
|
||||
#define varfloat double
|
||||
#define _255 255.0
|
||||
#else
|
||||
#define varfloat float
|
||||
#define _255 255.0f
|
||||
#endif
|
||||
|
||||
#ifdef USE_TEXTURE
|
||||
#define OUTPUT_TYPE __write_only image2d_t
|
||||
#else
|
||||
#define OUTPUT_TYPE global uint *
|
||||
#endif
|
||||
|
||||
/**
|
||||
* For a description of this algorithm please refer to
|
||||
* http://en.wikipedia.org/wiki/Mandelbrot_set
|
||||
* @author Michael Bien
|
||||
*/
|
||||
kernel void mandelbrot(
|
||||
const int width, const int height,
|
||||
const varfloat x0, const varfloat y0,
|
||||
const varfloat rangeX, const varfloat rangeY,
|
||||
OUTPUT_TYPE output, global uint *colorMap,
|
||||
const int colorMapSize, const int maxIterations
|
||||
) {
|
||||
unsigned int ix = get_global_id(0);
|
||||
unsigned int iy = get_global_id(1);
|
||||
|
||||
varfloat r = x0 + ix * rangeX / width;
|
||||
varfloat i = y0 + iy * rangeY / height;
|
||||
|
||||
varfloat x = 0;
|
||||
varfloat y = 0;
|
||||
|
||||
varfloat magnitudeSquared = 0;
|
||||
int iteration = 0;
|
||||
|
||||
while ( magnitudeSquared < 4 && iteration < maxIterations ) {
|
||||
varfloat x2 = x*x;
|
||||
varfloat y2 = y*y;
|
||||
y = 2 * x * y + i;
|
||||
x = x2 - y2 + r;
|
||||
magnitudeSquared = x2+y2;
|
||||
iteration++;
|
||||
}
|
||||
|
||||
if ( iteration == maxIterations ) {
|
||||
#ifdef USE_TEXTURE
|
||||
write_imagef(output, (int2)(ix, iy), (float4)0);
|
||||
#else
|
||||
output[iy * width + ix] = 0;
|
||||
#endif
|
||||
} else {
|
||||
float alpha = (float)iteration / maxIterations;
|
||||
int colorIndex = (int)(alpha * colorMapSize);
|
||||
#ifdef USE_TEXTURE
|
||||
// We could have changed colorMap to a texture + sampler, but the
|
||||
// unpacking below has minimal overhead and it's kinda interesting.
|
||||
// We could also use an R32UI texture and do the unpacking in GLSL,
|
||||
// but then we'd require OpenGL 3.0 (GLSL 1.30).
|
||||
uint c = colorMap[colorIndex];
|
||||
float4 oc = (float4)(
|
||||
(c & 0xFF) >> 0,
|
||||
(c & 0xFF00) >> 8,
|
||||
(c & 0xFF0000) >> 16,
|
||||
255.0f
|
||||
);
|
||||
write_imagef(output, (int2)(ix, iy), oc / 255.0f);
|
||||
#else
|
||||
output[iy * width + ix] = colorMap[colorIndex];
|
||||
#endif
|
||||
// monochrom
|
||||
//output[iy * width + ix] = 255*iteration/maxIterations;
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
!!ARBfp1.0
|
||||
OPTION ARB_precision_hint_fastest;
|
||||
|
||||
ATTRIB winPos = fragment.position;
|
||||
ATTRIB iDots = fragment.texcoord[0];
|
||||
|
||||
PARAM ambience = state.lightmodel.ambient;
|
||||
|
||||
PARAM specularColor = state.light[0].specular;
|
||||
|
||||
PARAM UNIFORMS = program.local[0];
|
||||
|
||||
TEMP temp;
|
||||
|
||||
OUTPUT oColor = result.color;
|
||||
|
||||
# Offset window-space fragment position.
|
||||
ADD temp.xyz, winPos, UNIFORMS.zwxx;
|
||||
# Normalize position.
|
||||
DP3 temp.w, temp, temp;
|
||||
RSQ temp.w, temp.w;
|
||||
MUL temp.xy, temp, temp.w;
|
||||
|
||||
# Multiply with current sin.
|
||||
MUL temp.xy, temp, UNIFORMS.x;
|
||||
# {-1..1} => {0..1}
|
||||
MAD temp.xy, temp, 0.5, 0.5;
|
||||
# Intensify colors.
|
||||
MUL temp.xy, temp, 2.0;
|
||||
MOV temp.z, 1.0;
|
||||
|
||||
# Accumulate color contributions.
|
||||
MAD temp.xyz, iDots.x, temp, ambience;
|
||||
# Calculate <specular dot product>^<specular exponent>
|
||||
POW temp.w, iDots.y, UNIFORMS.y;
|
||||
MAD oColor.xyz, temp.w, specularColor, temp;
|
||||
|
||||
MOV oColor.w, 1.0;
|
||||
|
||||
END
|
||||
@@ -1,37 +0,0 @@
|
||||
!!ARBvp1.0
|
||||
|
||||
ATTRIB iPos = vertex.position;
|
||||
ATTRIB iNormal = vertex.normal;
|
||||
|
||||
PARAM mvp[4] = { state.matrix.mvp };
|
||||
PARAM mvIT[4] = { state.matrix.modelview.invtrans };
|
||||
|
||||
PARAM lightDir = state.light[0].position;
|
||||
PARAM halfDir = state.light[0].half;
|
||||
|
||||
PARAM UNIFORMS = program.local[0];
|
||||
|
||||
TEMP normal, dots;
|
||||
|
||||
OUTPUT oPos = result.position;
|
||||
OUTPUT oDots = result.texcoord[0];
|
||||
|
||||
# Transform the vertex to clip coordinates.
|
||||
DP4 oPos.x, mvp[0], iPos;
|
||||
DP4 oPos.y, mvp[1], iPos;
|
||||
DP4 oPos.z, mvp[2], iPos;
|
||||
DP4 oPos.w, mvp[3], iPos;
|
||||
|
||||
# Transform the normal to eye coordinates.
|
||||
DP3 normal.x, mvIT[0], iNormal;
|
||||
DP3 normal.y, mvIT[1], iNormal;
|
||||
DP3 normal.z, mvIT[2], iNormal;
|
||||
|
||||
# Compute diffuse and specular dot products and clamp them.
|
||||
DP3 dots.x, normal, lightDir;
|
||||
MAX oDots.x, dots.x, 0.0;
|
||||
|
||||
DP3 dots.y, normal, halfDir;
|
||||
MAX oDots.y, dots.y, 0.0;
|
||||
|
||||
END
|
||||
@@ -1,21 +0,0 @@
|
||||
uniform vec4 UNIFORMS;
|
||||
|
||||
varying vec2 dots;
|
||||
|
||||
void main(void) {
|
||||
// Offset window-space fragment position.
|
||||
vec3 color2D = vec3(gl_FragCoord + UNIFORMS.zwxx);
|
||||
|
||||
// Normalize position.
|
||||
// Multiply with current sin.
|
||||
color2D.xy = normalize(color2D).xy * UNIFORMS.x;
|
||||
// {-1..1} => {0..1} & Intensify colors.
|
||||
color2D.xy = (vec2(color2D) * 0.5 + 0.5) * 2.0;
|
||||
color2D.z = 1.0;
|
||||
|
||||
// Accumulate color contributions.
|
||||
// Hardcoded ambience and specular color, due to buggy drivers.
|
||||
color2D = dots.x * color2D + vec3(0.2, 0.2, 0.2);
|
||||
gl_FragColor.rgb = pow(dots.y, UNIFORMS.y) * vec3(1.0, 1.0, 0.5) + color2D;
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
uniform vec4 UNIFORMS;
|
||||
|
||||
varying vec2 dots;
|
||||
|
||||
void main(void) {
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
vec3 normal = gl_NormalMatrix * gl_Normal;
|
||||
|
||||
// Pass the dot products to the fragment shader.
|
||||
dots.x = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
|
||||
dots.y = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#version 140
|
||||
#extension GL_ARB_uniform_buffer_object : enable
|
||||
|
||||
layout(std140) uniform test {
|
||||
vec2 uniformA;
|
||||
vec3 uniformB;
|
||||
};
|
||||
|
||||
void main(void) {
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
vec3 normal = gl_NormalMatrix * gl_Normal;
|
||||
|
||||
float diffuseDot = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
|
||||
float specularDot = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
|
||||
specularDot = pow(specularDot, uniformA.y);
|
||||
|
||||
// Normalize position, to get a {-1..1} value for each vertex.
|
||||
// Multiply with current sin.
|
||||
vec3 color3D = normalize(vec3(gl_Vertex)) * uniformA.x;
|
||||
// {-1..1} => {0..1} & Intensify colors.
|
||||
color3D = (color3D * 0.5 + 0.5) * 2.0;
|
||||
|
||||
// Accumulate color contributions.
|
||||
color3D = diffuseDot * (uniformB + color3D) + vec3(gl_LightModel.ambient);
|
||||
gl_FrontColor.rgb = specularDot * vec3(gl_LightSource[0].specular) + color3D;
|
||||
gl_FrontColor.a = 1.0;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
!!ARBvp1.0
|
||||
|
||||
ATTRIB iPos = vertex.position;
|
||||
ATTRIB iNormal = vertex.normal;
|
||||
|
||||
PARAM mvp[4] = { state.matrix.mvp };
|
||||
PARAM mvIT[4] = { state.matrix.modelview.invtrans };
|
||||
|
||||
PARAM ambience = state.lightmodel.ambient;
|
||||
|
||||
PARAM lightDir = state.light[0].position;
|
||||
PARAM halfDir = state.light[0].half;
|
||||
PARAM diffuseColor = state.light[0].diffuse;
|
||||
PARAM specularColor = state.light[0].specular;
|
||||
|
||||
PARAM UNIFORMS = program.local[0];
|
||||
|
||||
TEMP temp, temp2, normal, dots;
|
||||
|
||||
OUTPUT oPos = result.position;
|
||||
OUTPUT oColor = result.color;
|
||||
|
||||
# Transform the vertex to clip coordinates.
|
||||
DP4 oPos.x, mvp[0], iPos;
|
||||
DP4 oPos.y, mvp[1], iPos;
|
||||
DP4 oPos.z, mvp[2], iPos;
|
||||
DP4 oPos.w, mvp[3], iPos;
|
||||
|
||||
# Transform the normal to eye coordinates.
|
||||
DP3 normal.x, mvIT[0], iNormal;
|
||||
DP3 normal.y, mvIT[1], iNormal;
|
||||
DP3 normal.z, mvIT[2], iNormal;
|
||||
|
||||
# Compute diffuse and specular dot products and use LIT to compute
|
||||
# lighting coefficients.
|
||||
DP3 dots.x, normal, lightDir;
|
||||
DP3 dots.y, normal, halfDir;
|
||||
MOV dots.w, UNIFORMS.y;
|
||||
LIT dots, dots;
|
||||
|
||||
# Normalize position, to get a {-1..1} value for each vertex.
|
||||
DP3 temp.w, iPos, iPos;
|
||||
RSQ temp.w, temp.w;
|
||||
MUL temp.xyz, iPos, temp.w;
|
||||
|
||||
# Multiply with current sin.
|
||||
MUL temp.xyz, temp, UNIFORMS.x;
|
||||
# {-1..1} => {0..1}
|
||||
MAD temp.xyz, temp, 0.5, 0.5;
|
||||
# Intensify colors.
|
||||
MUL temp.xyz, temp, 2.0;
|
||||
|
||||
# Accumulate color contributions.
|
||||
MAD temp.xyz, dots.y, temp, ambience;
|
||||
MAD oColor.xyz, dots.z, specularColor, temp;
|
||||
MOV oColor.w, 1.0;
|
||||
|
||||
|
||||
END
|
||||
@@ -1,22 +0,0 @@
|
||||
uniform vec2 UNIFORMS;
|
||||
|
||||
void main(void) {
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
vec3 normal = gl_NormalMatrix * gl_Normal;
|
||||
|
||||
float diffuseDot = max(dot(normal, vec3(gl_LightSource[0].position)), 0.0);
|
||||
float specularDot = max(dot(normal, vec3(gl_LightSource[0].halfVector)), 0.0);
|
||||
specularDot = pow(specularDot, UNIFORMS.y);
|
||||
|
||||
// Normalize position, to get a {-1..1} value for each vertex.
|
||||
// Multiply with current sin.
|
||||
vec3 color3D = normalize(vec3(gl_Vertex)) * UNIFORMS.x;
|
||||
// {-1..1} => {0..1} & Intensify colors.
|
||||
color3D = (color3D * 0.5 + 0.5) * 2.0;
|
||||
|
||||
// Accumulate color contributions.
|
||||
color3D = diffuseDot * color3D + vec3(gl_LightModel.ambient);
|
||||
gl_FrontColor.rgb = specularDot * vec3(gl_LightSource[0].specular) + color3D;
|
||||
gl_FrontColor.a = 1.0;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package sun.security.jca;
|
||||
|
||||
import java.security.*;
|
||||
import java.util.*;
|
||||
|
||||
// Stub class to access to Android 7.0 hidden API
|
||||
public final class ProviderList
|
||||
{
|
||||
// Since Android 10
|
||||
public Provider.Service getService(String type, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Provider> providers() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package sun.security.jca;
|
||||
|
||||
public class Providers
|
||||
{
|
||||
public static ProviderList getProviderList() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,4 +2,5 @@
|
||||
<bitmap
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/bg_wool_dark"
|
||||
android:gravity="top" />
|
||||
android:gravity="top"
|
||||
android:tileMode="repeat"/>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke android:width="5px" android:color="#000000" />
|
||||
<stroke android:width="5px" android:color="#131313" />
|
||||
</shape>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 877 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item><layer-list>
|
||||
<item><shape>
|
||||
<solid android:color="@android:color/black" />
|
||||
<corners android:radius="4dp" />
|
||||
<padding android:left="8dp"/>
|
||||
</shape></item>
|
||||
<item><bitmap android:gravity="left"
|
||||
android:src="@drawable/ic_earth"/>
|
||||
</item>
|
||||
</layer-list></item>
|
||||
</selector>
|
||||
@@ -33,6 +33,6 @@
|
||||
android:fitsSystemWindows="true"
|
||||
app:menu="@menu/menu_customctrl"
|
||||
android:id="@+id/customctrl_navigation_view"/>
|
||||
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/sign_in_background"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="25dp"
|
||||
android:background="#272727"
|
||||
android:layout_gravity="center"
|
||||
android:id="@+id/login_layout_linear">
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/login_online_username_hint"
|
||||
android:layout_gravity="left"/>
|
||||
|
||||
<com.kdt.mcgui.MineEditText
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:id="@+id/login_edit_email"
|
||||
android:inputType="textEmailAddress"
|
||||
android:layout_marginBottom="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/login_online_password_hint"/>
|
||||
|
||||
<com.kdt.mcgui.MineEditText
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:id="@+id/login_edit_password"
|
||||
android:inputType="textPassword"
|
||||
android:layout_marginBottom="5dp"/>
|
||||
|
||||
<CheckBox
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/login_online_check_keeplogin"
|
||||
android:id="@+id/login_switch_remember"/>
|
||||
|
||||
<CheckBox
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/login_offline_label"
|
||||
android:id="@+id/login_switch_offline"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="bottom|center_vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_height="42dp"
|
||||
android:layout_width="210dp"
|
||||
android:layout_marginRight="10dp">
|
||||
|
||||
<com.kdt.mcgui.MineButton
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/login_online_login_label"
|
||||
android:onClick="loginMC"
|
||||
android:gravity="center"/>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#88000000"
|
||||
android:id="@+id/launcherAccProgress"
|
||||
android:visibility="gone"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.kdt.mcgui.MineButton
|
||||
android:layout_width="210dip"
|
||||
android:layout_height="42dp"
|
||||
android:text="@string/login_select_account"
|
||||
android:onClick="loginSavedAcc"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="300dp"
|
||||
android:src="@drawable/logo"
|
||||
android:id="@+id/login_image_logo"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#EEEEEE"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ProgressBar
|
||||
@@ -78,13 +77,13 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_height="match_parent"
|
||||
android:text="Version:"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:id="@+id/lMTVVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textSize="12sp"
|
||||
android:layout_width="wrap_content"/>
|
||||
android:text="@string/main_version_"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Spinner
|
||||
android:layout_width="match_parent"
|
||||
@@ -94,24 +93,24 @@
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:text="Options"
|
||||
android:onClick="launcherMenu"
|
||||
style="?android:attr/buttonBarButtonStyle"/>
|
||||
android:text="@string/main_options" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.kdt.mcgui.MineButton
|
||||
android:layout_toRightOf="@id/lMTVVer"
|
||||
android:layout_toLeftOf="@id/launcherMainLeftLayout"
|
||||
android:id="@+id/launcherMainPlayButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="80dp"
|
||||
android:text="Play"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_toLeftOf="@id/launcherMainLeftLayout"
|
||||
android:layout_toRightOf="@id/lMTVVer"
|
||||
android:onClick="launchGame"
|
||||
android:id="@+id/launcherMainPlayButton"
|
||||
android:layout_margin="5dp"/>
|
||||
android:text="@string/main_play" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/launcherMainRightLayout"
|
||||
@@ -130,10 +129,10 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:text="Welcome,"
|
||||
android:layout_marginRight="4dp"
|
||||
android:textSize="12sp"
|
||||
android:gravity="center"/>
|
||||
android:gravity="center"
|
||||
android:text="@string/main_welcome"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -161,20 +160,20 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="40dp"
|
||||
android:text="Info (DEV)"
|
||||
android:textSize="10sp"
|
||||
android:onClick="mcaccSwitchUser"
|
||||
style="?android:attr/buttonBarButtonStyle"/>
|
||||
android:text="@string/main_infodev"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<Button
|
||||
style="?android:attr/buttonBarButtonStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:text="Switch user"
|
||||
android:textSize="10sp"
|
||||
android:onClick="mcaccLogout"
|
||||
style="?android:attr/buttonBarButtonStyle"/>
|
||||
android:text="@string/main_switchuser"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -244,7 +244,6 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:animateLayoutChanges="true"
|
||||
android:id="@+id/content_log_layout"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
@@ -310,7 +309,7 @@
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:fitsSystemWindows="true"
|
||||
android:fitsSystemWindows="false"
|
||||
app:menu="@menu/menu_runopt"
|
||||
android:id="@+id/main_navigation_view"/>
|
||||
|
||||
|
||||
@@ -11,27 +11,11 @@
|
||||
android:orientation="horizontal"
|
||||
android:background="#000000">
|
||||
|
||||
<RelativeLayout
|
||||
<Spinner
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="42px"
|
||||
android:background="#FFFFFF"
|
||||
android:id="@+id/topbar_earth_icon"/>
|
||||
|
||||
<TextView
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/language_name"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="15px"
|
||||
android:layout_toRightOf="@id/topbar_earth_icon"
|
||||
android:textColor="#FFFFFF"
|
||||
android:id="@+id/topbar_language_text"/>
|
||||
|
||||
</RelativeLayout>
|
||||
android:layout_width="wrap_content"
|
||||
style="@style/SpinnerChangeLanguage"
|
||||
android:id="@+id/topbar_navmenu_changelang"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menu_ctrl_add"
|
||||
android:title="@string/customctrl_addbutton"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_ctrl_load"
|
||||
android:title="@string/global_load"/>
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_ctrl_add"
|
||||
android:title="@string/global_add"/>
|
||||
android:id="@+id/menu_ctrl_save"
|
||||
android:title="@string/global_save"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_ctrl_selectdefault"
|
||||
android:title="@string/customctrl_selectdefault"/>
|
||||
</menu>
|
||||
@@ -12,4 +12,7 @@
|
||||
<item
|
||||
android:id="@+id/nav_customkey"
|
||||
android:title="@string/control_customkey" />
|
||||
<item
|
||||
android:id="@+id/nav_shiftmodechg"
|
||||
android:title="@string/control_shiftmodechg" />
|
||||
</menu>
|
||||
@@ -0,0 +1,203 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- App name part -->
|
||||
<string name="app_name">PojavLauncher (Minecraft: Java Edition for Android)</string>
|
||||
<string name="app_short_name">PojavLauncher</string>
|
||||
<string name="app_motd">Launch Minecraft: Java Edition in your device!</string>
|
||||
|
||||
<!-- Action bar part -->
|
||||
<string name="actionbar_help">BANTUAN</string>
|
||||
|
||||
<!-- Languages list part -->
|
||||
<string name="language_name">BAHASA - ID</string>
|
||||
|
||||
<!-- Logging output -->
|
||||
<string name="log_title">Catatan log</string>
|
||||
|
||||
<!-- Login strings -->
|
||||
<string name="login_online_username_hint">Email atau username</string>
|
||||
<string name="login_online_username_question">(Saya pilih yang mana?)</string>
|
||||
<string name="login_online_password_hint">Password</string>
|
||||
<string name="login_online_password_question">Lupa password?</string>
|
||||
<string name="login_online_remember">Ingat saya?</string>
|
||||
<string name="login_online_check_keeplogin">Tetapkan login saya?</string>
|
||||
<string name="login_online_login_label">Login</string>
|
||||
<string name="login_online_create_account">(Buat akun baru?)</string>
|
||||
|
||||
<string name="login_offline_switch">Akun offline?</string>
|
||||
<string name="login_offline_label">Login sebagai akun offline</string>
|
||||
<string name="login_offline_alert_skip">Lewati</string>
|
||||
|
||||
<string name="login_error_short_username">Username harus ada 3 karakter</string>
|
||||
<string name="login_error_exist_username">Username ini sudah ada</string>
|
||||
|
||||
<string name="login_select_account">Pilih akun</string>
|
||||
|
||||
<!-- Hint -->
|
||||
<string name="hint_select_account">Untuk memilih akun, di-klik. Untuk menghapus akun, dipencet dengan ditahan.</string>
|
||||
<string name="hint_control_mapping">"Fitur ini belum di-dukung, jadi kontrol kustom belum busa dipakai!\nGeser dari kanan ke kiri untuk membuka menu ◀\nTahan sebuah tombol untuk menyesuaikan: edit, mengubah ukuran atau menghapus."</string>
|
||||
|
||||
<!-- Warning -->
|
||||
<string name="warning_title">Peringatan</string>
|
||||
<string name="warning_msg">Aplikasi ini mungkin tidak biaa dipakai di perangkat anda (lebih atau sama dari Android 7.0). Anda bisa menggunakan VMOS kemudian memasang aplikasi ini di VMOS. Tapi VMOS dihapus dari Play Store, anda harus memasangnya secara manual.</string>
|
||||
<string name="warning_noshowagain">Jangan tunjukkan lagi</string>
|
||||
<string name="warning_action_install">Pasang VMOS</string>
|
||||
<string name="warning_action_tryanyway">Coba saja</string>
|
||||
<string name="warning_action_exit">Keluar</string>
|
||||
<string name="warning_remove_account">Akun ini akan dihapus!</string>
|
||||
|
||||
<!-- AlertDialog title -->
|
||||
<string name="alerttitle_selectkeymap">Pilih sebuah keymap json</string>
|
||||
<string name="alerttitle_installmod">Pilih sebuah mod untuk di tambah</string>
|
||||
<string name="alerttitle_installoptifine">Pilih jar-nya OptiFine</string>
|
||||
|
||||
<!-- Error messages -->
|
||||
<string name="error_fatal">PojavLauncher tiba-tiba crash!</string>
|
||||
<string name="error_checklog">Error! Mohon cek catatan log: %s</string>
|
||||
<string name="error_no_version">Tidak ada versi!</string>
|
||||
<string name="error_load_version">Tidak bisa mengload versi! %s</string>
|
||||
<string name="error_convert_lib">Tidak bisa melakukan konversi pada library %s</string>
|
||||
<string name="error_convert_client">Tidak bisa melakukan konversi pada Minecraft %s</string>
|
||||
<string name="error_show_more">Tunjukkan lebih</string>
|
||||
<string name="error_show_less">Tunjukkan sedikit</string>
|
||||
|
||||
<!-- Toast messages -->
|
||||
<string name="toast_permission_denied">Permisi untuk membaca/menulis ke penyimpanan perangkat dibutuhkan!</string>
|
||||
<string name="toast_login_error">Sesuatu buruk terjadi setelah login. Mohon feedback kepada developer. \nError: %s</string>
|
||||
<string name="toast_optifine_success">Pemasangan berhasil</string>
|
||||
<!--
|
||||
<string name="toast_3">Keluar</string>
|
||||
-->
|
||||
|
||||
<!-- MCLauncherActivity: Tabs -->
|
||||
<string name="mcl_tab_news">Berita launcher</string>
|
||||
<string name="mcl_tab_console">Konsol debug</string>
|
||||
<string name="mcl_tab_crash">Catatan crash</string>
|
||||
|
||||
<!-- MCLauncherActivity: Strings -->
|
||||
<string name="mcl_version_msg">Siap untuk main Minecraft %s</string>
|
||||
<string name="mcl_launch_cleancache">Membersihkan file-file cache</string>
|
||||
<string name="mcl_launch_downloading">Mengunduh %s</string>
|
||||
<string name="mcl_launch_download_lib">Mengunduh library %s</string>
|
||||
<string name="mcl_launch_download_client">Mengunduh Minecraft %s</string>
|
||||
<string name="mcl_launch_convert_lib">Melakukan konversi pada library %s</string>
|
||||
<string name="mcl_launch_convert_client">Melakukan konversi pada Minecraft %s</string>
|
||||
<string name="mcl_launch_patch_client">Melakukan patch pada Minecraft %s</string>
|
||||
<string name="mcl_launch_download_assets">Bersiap-siap untuk mengunduh sumber</string>
|
||||
|
||||
<string name="mcl_options">Pilihan</string>
|
||||
<string name="mcl_option_modmgr">Mod manager (tidak berfungsi)</string>
|
||||
<string name="mcl_option_optifineinstall">Pasang OptiFine</string>
|
||||
<string name="mcl_option_checkupdate">Periksa ada update</string>
|
||||
<string name="mcl_option_customcontrol">Kontrol kustom</string>
|
||||
<string name="mcl_option_settings">Pengaturan</string>
|
||||
<string name="mcl_option_about">Tentang</string>
|
||||
|
||||
<string name="mcl_setting_title_setmaxdxref">Set maksimal referensi DX</string>
|
||||
<string name="mcl_setting_subtitle_setmaxdxref">Tambahkan jika ada error waktu melakukan konversi: Terlalu banyak ... referensi. Anda bisa mencoba untuk menggunakan pilihan multi dex. Rekomendasi: 4096 atau 8192.</string>
|
||||
<string name="mcl_setting_title_freeform">Luncurkan Minecraft dalam mode freeform window.</string>
|
||||
<string name="mcl_setting_subtitle_freeform">Luncurkan minecraft dalam mode freeform window. Membutuhkan Android 7.0+</string>
|
||||
<string name="mcl_setting_title_longpresstrigger">Berapa lama untuk melakukan trigger setelah dipencet dengan ditahan</string>
|
||||
<string name="mcl_setting_subtitle_longpresstrigger">Ganti waktu trigger setelah melakukan oencetan dengan ditahan untuk menghancurkan dan menjatuhkan item.</string>
|
||||
<string name="mcl_setting_title_controlsize">Set ukuran tombol untuk kontrol.</string>
|
||||
<string name="mcl_setting_title_forgetoptifpath">Buat OptiFine tidak bisa mencari diri sendiri</string>
|
||||
<string name="mcl_setting_subtitle_forgetoptifpath">Bisa dipakai untuk meluncurkan OptiFine di beberapa device</string>
|
||||
<string name="mcl_setting_category_general">Pengaturan umum</string>
|
||||
<string name="mcl_setting_category_veroption">Tipe versi yang ada di daftar versi</string>
|
||||
<string name="mcl_setting_veroption_release">Release</string>
|
||||
<string name="mcl_setting_veroption_snapshot">Snapshot</string>
|
||||
<string name="mcl_setting_veroption_oldalpha">Old-alpha</string>
|
||||
<string name="mcl_setting_veroption_oldbeta">Old-beta</string>
|
||||
|
||||
<string name="mcl_version_clone">Klon</string>
|
||||
|
||||
<!-- Global strings -->
|
||||
<string name="global_add">Tambah</string>
|
||||
<string name="global_edit">Edit</string>
|
||||
<string name="global_error">Error</string>
|
||||
<string name="global_load">Load</string>
|
||||
<string name="global_name">Nama</string>
|
||||
<string name="global_remove">Hapus</string>
|
||||
<string name="global_restart">Restart</string>
|
||||
<string name="global_save">Simpan</string>
|
||||
<string name="global_error_field_empty">Tempat ini tidak boleh kosong.</string>
|
||||
|
||||
<!--
|
||||
<string name="mcl_about">
|
||||
%1$s BETA (Minecraft Java launcher for Android), version " + PathTools.usingVerName + "\n" +
|
||||
" - by Khanh Duy Tran (based from \"Boardwalk\" app)\n" +
|
||||
//"© 2019 Khanh Duy Tran\n" +
|
||||
"Using libraries:\n" +
|
||||
" • LWJGL " + org.lwjgl.Sys.getVersion() + "\n" +
|
||||
//" • Boardwalk memory manager (not used now).\n" +
|
||||
" • gl4es: OpenGL for OpenGL ES devices by lunixbochs and ptitSeb.\n" +
|
||||
" • dx: tool to convert.\n" +
|
||||
" • Java AWT Implementation includes:\n" +
|
||||
" - Boardwalk's makeshift.\n" +
|
||||
" - Apache Harmony AWT Framework.\n" +
|
||||
" - OpenJDK 7 codes implementation.\n" +
|
||||
" - Developer code implement (copy text, open browser,...)\n" +
|
||||
"\n" +
|
||||
"* Notes:\n" +
|
||||
" - This app is currently BETA, it will not be stable.\n" +
|
||||
//"* This app will unstable on Android 7.0 or higher devices.\n" +
|
||||
" - This app only use LWJGL2 and don't have a JRE8 desugar, so doesn't support 1.13 or higher versions.\n" +
|
||||
" - This app is not affiliated with Minecraft, Mojang or Microsoft.\n")
|
||||
</string>
|
||||
-->
|
||||
<!-- MainActivity: strings -->
|
||||
<string name="mcn_exit_title">Dikeluarkan dari game</string>
|
||||
<string name="mcn_exit_call">Keluar</string>
|
||||
<string name="mcn_exit_crash">Game crash terdeteksi! Pencet OK untuk keluar.</string>
|
||||
<string name="mcn_exit_errcrash">Tidak bisa mencari sumber crash, anda bisa mengabaikan ini.</string>
|
||||
<string name="mcn_exit_confirm">Apa anda yakin mau tutup secara paksa?</string>
|
||||
|
||||
<!-- MainActivity: Control buttons -->
|
||||
<string name="controls">Kontrol</string>
|
||||
<string name="control_toggle">GUI</string>
|
||||
<string name="control_keyboard">Keyboard</string>
|
||||
<string name="control_chat">Obrolan</string>
|
||||
<string name="control_debug">Debug</string>
|
||||
<string name="control_zoom">Perbesar (C)</string>
|
||||
<string name="control_primary">Pertama</string>
|
||||
<string name="control_secondary">Kedua</string>
|
||||
<string name="control_shift">◇</string>
|
||||
<string name="control_inventory">Inv</string>
|
||||
<string name="control_up">▲</string>
|
||||
<string name="control_left">◀</string>
|
||||
<string name="control_right">▶</string>
|
||||
<string name="control_down">▼</string>
|
||||
<string name="control_jump">⬛</string>
|
||||
<string name="control_thirdperson">3rd</string>
|
||||
<string name="control_listplayers">Tab</string>
|
||||
<string name="control_mouse">Mouse</string>
|
||||
<string name="control_mouseoff">Mouse: off</string>
|
||||
<string name="control_mouseon">Mouse: on </string>
|
||||
|
||||
<!-- MainActivity: Menu advanced controls -->
|
||||
<string name="control_forceclose">Tutp secara paksa</string>
|
||||
<string name="control_viewout">Catatan log</string>
|
||||
<string name="control_adebug">PointerCapture Debug</string>
|
||||
<string name="control_customkey">Kirim keycode kustom</string>
|
||||
|
||||
<string name="control_more3"></string>
|
||||
<string name="control_more4"></string>
|
||||
|
||||
<string name="customctrl_keyname">Keycode</string>
|
||||
<string name="customctrl_specialkey">Key spesial</string>
|
||||
<string name="customctrl_hidden">Tersembunyi</string>
|
||||
<string name="customctrl_addbutton">Tambah tombol</string>
|
||||
<string name="customctrl_title_selectctrl">Pilih json kontrol default</string>
|
||||
<string name="customctrl_selectdefault">Pilih json kontrol default</string>
|
||||
|
||||
<!-- Update part (unused now) -->
|
||||
<string name="update_console">Perbarui konsol</string>
|
||||
<string name="main_options">Pilihan</string>
|
||||
<string name="main_play">Main</string>
|
||||
<string name="main_welcome">Selamat datang,</string>
|
||||
<string name="main_infodev">Info (DEV)</string>
|
||||
<string name="main_switchuser">Beralih/ganti user</string>
|
||||
<string name="main_version_">Versi:</string>
|
||||
<string name="main_nocrash">Tidak ada crash terdeteksi</string>
|
||||
<string name="main_nolog">Tidak ada catatan log.</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- App name part -->
|
||||
<string name="app_name">PojavLauncher (Minecraft: Java Edition dla Androida)</string>
|
||||
<string name="app_short_name">PojavLauncher</string>
|
||||
<string name="app_motd">Uruchom Minecraft: Java Edition na swoim urządzeniu!</string>
|
||||
|
||||
<!-- Action bar part -->
|
||||
<string name="actionbar_help">WSPARCIE</string>
|
||||
|
||||
<!-- Languages list part -->
|
||||
<string name="language_name">Polski - PL</string>
|
||||
|
||||
<!-- Logging output -->
|
||||
<string name="log_title">Wyjście dziennika</string>
|
||||
|
||||
<!-- Login strings -->
|
||||
<string name="login_online_username_hint">Email lub nazwa użytkownika</string>
|
||||
<string name="login_online_username_question">(Którego mam użyć?)</string>
|
||||
<string name="login_online_password_hint">Hasło</string>
|
||||
<string name="login_online_password_question">Zapomniałeś hasła?</string>
|
||||
<string name="login_online_remember">Zapamiętaj mnie?</string>
|
||||
<string name="login_online_login_label">Zaloguj sie</string>
|
||||
<string name="login_online_create_account">(Stwórz nowe konto?)</string>
|
||||
|
||||
<string name="login_offline_switch">Konto offline?</string>
|
||||
<string name="login_offline_alert_skip">Pominąć</string>
|
||||
|
||||
<string name="login_error_short_username">Nazwa użytkownika musi mieć co najmniej 3 znaki</string>
|
||||
<string name="login_error_exist_username">Ta nazwa użytkownika już istnieje</string>
|
||||
|
||||
<string name="login_select_account">Wybierz konto</string>
|
||||
|
||||
<!-- Hint -->
|
||||
<string name="hint_select_account">Aby wybrać, kliknij go. Aby usunąć konto, przytrzymaj je.</string>
|
||||
<string name="hint_control_mapping">„Ta funkcja nie została jeszcze ukończona, więc nie można w tej chwili zastosować niestandardowego sterowania! \ NPrzesuń palcem od prawej do lewej, aby otworzyć menu ◀ \ nPrzytrzymaj przycisk, aby dostosować: edytować, zmienić rozmiar lub usunąć.”</string>
|
||||
|
||||
<!-- Warning -->
|
||||
<string name="warning_title">Ostrzeżenie</string>
|
||||
<string name="warning_msg">Ta aplikacja może nie być zgodna z Twoją wersją Androida (powyżej lub równa Androidowi 7.0). Możesz użyć VMOS, a następnie zainstalować tę aplikację w VMOS. Ale VMOS jest usuwany przez Sklep Play, musisz go zainstalować ręcznie.</string>
|
||||
<string name="warning_noshowagain">Nie pokazuj ponownie</string>
|
||||
<string name="warning_action_install">Zainstaluj VMOS</string>
|
||||
<string name="warning_action_tryanyway">Spróbuj mimo wszystko</string>
|
||||
<string name="warning_action_exit">Wyjście</string>
|
||||
<string name="warning_remove_account">To konto zostanie usunięte!</string>
|
||||
|
||||
<!-- AlertDialog title -->
|
||||
<string name="alerttitle_selectkeymap">Wybierz plik json mapy klawiszy</string>
|
||||
<string name="alerttitle_installmod">Wybierz mod do dodania</string>
|
||||
<string name="alerttitle_installoptifine">Wybierz plik jar OptiFine</string>
|
||||
|
||||
<!-- Error messages -->
|
||||
<string name="error_checklog">Błąd! Sprawdź dziennik poniżej: %s</string>
|
||||
<string name="error_no_version">Brak wersji!</string>
|
||||
<string name="error_load_version">Nie można załadować wersji %s</string>
|
||||
<string name="error_convert_lib">Nie można przekonwertować biblioteki %s</string>
|
||||
<string name="error_convert_client">Nie można przekonwertować %s Minecrafta</string>
|
||||
<string name="error_show_more">Pokaż więcej</string>
|
||||
<string name="error_show_less">Pokaż mniej</string>
|
||||
|
||||
<!-- Toast messages -->
|
||||
<string name="toast_permission_denied">Wymagane jest uprawnienie do odczytu / zapisu w pamięci!</string>
|
||||
<string name="toast_login_error">Coś poszło nie tak po zalogowaniu. Prześlij opinię do programisty. \ NBłąd:% s</string>
|
||||
<string name="toast_optifine_success">Instalacja powiodła się</string>
|
||||
<!--
|
||||
<string name="toast_3">Wyjście</string>
|
||||
-->
|
||||
|
||||
<!-- MCLauncherActivity: Tabs -->
|
||||
<string name="mcl_tab_news">Wiadomości dotyczące programu uruchamiającego</string>
|
||||
<string name="mcl_tab_console">Konsola programistyczna</string>
|
||||
<string name="mcl_tab_crash">Dziennik awarii</string>
|
||||
|
||||
<!-- MCLauncherActivity: Strings -->
|
||||
<string name="mcl_version_msg">Gotowy do gry w Minecrafta %s</string>
|
||||
<string name="mcl_launch_cleancache">Czyszczenie plików pamięci podręcznej</string>
|
||||
<string name="mcl_launch_downloading">Pobieranie %s</string>
|
||||
<string name="mcl_launch_download_lib">Pobieranie biblioteki %s</string>
|
||||
<string name="mcl_launch_download_client">Pobieranie gry Minecraft %s</string>
|
||||
<string name="mcl_launch_convert_lib">Konwertowanie biblioteki %s</string>
|
||||
<string name="mcl_launch_convert_client">Konwertowanie Minecrafta %s</string>
|
||||
<string name="mcl_launch_patch_client">Aktualizowanie Minecrafta %s</string>
|
||||
<string name="mcl_launch_download_assets">Przygotowanie do pobrania zasobów</string>
|
||||
|
||||
<string name="mcl_options">Opcje</string>
|
||||
<string name="mcl_option_modmgr">Menedżer modów (brak funkcji)</string>
|
||||
<string name="mcl_option_optifineinstall">Zainstaluj OptiFine</string>
|
||||
<string name="mcl_option_checkupdate">Sprawdź aktualizacje</string>
|
||||
<string name="mcl_option_customcontrol">Niestandardowe kontrole</string>
|
||||
<string name="mcl_option_settings">Ustawienia</string>
|
||||
<string name="mcl_option_about">O aplikacji</string>
|
||||
|
||||
<string name="mcl_setting_title_setmaxdxref">Ustaw maksymalną liczbę referencji DX</string>
|
||||
<string name="mcl_setting_subtitle_setmaxdxref">Zwiększ Jeśli podczas konwersji wystąpił błąd: Za dużo ... odniesień. Możesz spróbować opcji multi-dex. Zalecane: 4096 lub 8192.</string>
|
||||
<string name="mcl_setting_title_freeform">Uruchom Minecraft w trybie swobodnym</string>
|
||||
<string name="mcl_setting_subtitle_freeform">Uruchom Minecrafta w pływającym oknie. Wymaga Androida 7.0+</string>
|
||||
<string name="mcl_setting_title_longpresstrigger">Jak długo będzie się uruchamiać po długim naciśnięciu</string>
|
||||
<string name="mcl_setting_subtitle_longpresstrigger">Zmień czas wyzwalania na długie naciśnięcie w zniszczeniu bloku i upuszczeniu przedmiotu.</string>
|
||||
<string name="mcl_setting_title_controlsize">Ustaw rozmiar przycisków sterujących</string>
|
||||
<string name="mcl_setting_title_forgetoptifpath">Uniemożliwić OptiFine zlokalizowanie się</string>
|
||||
<string name="mcl_setting_subtitle_forgetoptifpath">Przydatne do uruchamiania OptiFine na niektórych urządzeniach.</string>
|
||||
<string name="mcl_setting_category_general">Ustawienia główne</string>
|
||||
<string name="mcl_setting_category_veroption">Typ wersji będzie na liście wersji</string>
|
||||
<string name="mcl_setting_veroption_release">Wydanie</string>
|
||||
<string name="mcl_setting_veroption_snapshot">Migawka</string>
|
||||
<string name="mcl_setting_veroption_oldalpha">Stara alfa</string>
|
||||
<string name="mcl_setting_veroption_oldbeta">Stara wersja beta</string>
|
||||
|
||||
<string name="mcl_version_clone">Klonuj</string>
|
||||
|
||||
<!-- Global strings -->
|
||||
<string name="global_add">Dodaj</string>
|
||||
<string name="global_edit">Edytować</string>
|
||||
<string name="global_error">Błąd</string>
|
||||
<string name="global_load">Załaduj</string>
|
||||
<string name="global_name">Nazwa</string>
|
||||
<string name="global_remove">Usunąć</string>
|
||||
<string name="global_save">Zapisać</string>
|
||||
<string name="global_error_field_empty">To pole nie może być puste</string>
|
||||
|
||||
<!--
|
||||
<string name="mcl_about">
|
||||
%1$s BETA (Minecraft Java Launcher dla Androida), wersja " + PathTools.usingVerName + "\n" +
|
||||
" - autor: Khanh Duy Tran (na podstawie aplikacji "Boardwalk"\n" +
|
||||
//"© 2019 Khanh Duy Tran\n" +
|
||||
"Korzystanie z bibliotek:\n" +
|
||||
" • LWJGL "+ org.lwjgl.Sys.getVersion () +"\n" +
|
||||
//" • Menedżer pamięci Boardwalk (obecnie nieużywany).\n" +
|
||||
" • gl4es: OpenGL dla urządzeń OpenGL ES autorstwa lunixbochs i ptitSeb.\n" +
|
||||
" • dx: narzędzie do konwersji.\n" +
|
||||
" • Implementacja Java AWT obejmuje:\n" +
|
||||
" - Boardwalk jest prowizoryczny.\n" +
|
||||
" - Apache Harmony AWT Framework.\n" +
|
||||
" - Implementacja kodów OpenJDK 7.\n" +
|
||||
" - Implementacja kodu programisty (kopiowanie tekstu, otwieranie przeglądarki, ...)\n" +
|
||||
"\n" +
|
||||
"* Uwagi:\n" +
|
||||
" - Ta aplikacja jest obecnie w wersji BETA, nie będzie stabilna.\n" +
|
||||
//"* Ta aplikacja będzie działać niestabilnie na urządzeniach z Androidem 7.0 lub nowszym.\n" +
|
||||
" - Ta aplikacja używa tylko LWJGL2 i nie ma desugera JRE8, więc nie obsługuje wersji 1.13 lub wyższych.\n" +
|
||||
" - Ta aplikacja nie jest powiązana z Minecraft, Mojang ani Microsoft.\n")
|
||||
</string>
|
||||
-->
|
||||
<!-- MainActivity: strings -->
|
||||
<string name="mcn_exit_title">Gra została zakończona</string>
|
||||
<string name="mcn_exit_call">Wyjście</string>
|
||||
<string name="mcn_exit_crash">Wykryto awarię gry! Kliknij OK, aby wyjść.</string>
|
||||
<string name="mcn_exit_errcrash">Nie można zlokalizować awarii!</string>
|
||||
<string name="mcn_exit_confirm">Czy na pewno chcesz wymusić zamknięcie?</string>
|
||||
|
||||
<!-- MainActivity: Control buttons -->
|
||||
<string name="controls">Sterownica</string>
|
||||
<string name="control_toggle">GUI</string>
|
||||
<string name="control_keyboard">Klawiatura</string>
|
||||
<string name="control_chat">Czat</string>
|
||||
<string name="control_debug">Debug</string>
|
||||
<string name="control_zoom">Powiększenie (C)</string>
|
||||
<string name="control_primary">Pri</string>
|
||||
<string name="control_secondary">Sec</string>
|
||||
<string name="control_shift">◇</string>
|
||||
<string name="control_inventory">Inv</string>
|
||||
<string name="control_thirdperson">3rd</string>
|
||||
<string name="control_listplayers">Tab</string>
|
||||
<string name="control_mouse">Mysz</string>
|
||||
<string name="control_mouseoff">Mysz: wyłączona</string>
|
||||
<string name="control_mouseon">Mysz: włączona </string>
|
||||
|
||||
<!-- MainActivity: Menu advanced controls -->
|
||||
<string name="control_forceclose">Wymuś zamknięcie</string>
|
||||
<string name="control_viewout">Wyjście dziennika</string>
|
||||
<string name="control_adebug">Debugowanie PointerCapture</string>
|
||||
<string name="control_customkey">Wyślij własny kod klucza</string>
|
||||
|
||||
<string name="control_more3"></string>
|
||||
<string name="control_more4"></string>
|
||||
|
||||
<string name="customctrl_keyname">Kod Klucza</string>
|
||||
<string name="customctrl_specialkey">Klucz specjalny</string>
|
||||
<string name="customctrl_hidden">Ukryty</string>
|
||||
<string name="customctrl_addbutton">Dodaj przycisk</string>
|
||||
<string name="customctrl_title_selectctrl">Wybierz domyślny json Control</string>
|
||||
<string name="customctrl_selectdefault">Wybierz domyślny json Control</string>
|
||||
|
||||
<!-- Update part (unused now) -->
|
||||
<string name="update_console">Zaktualizuj konsolę</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- App name part -->
|
||||
<string name="app_name">PojavLauncher (Minecraft: Java Edition для Android)</string>
|
||||
<string name="app_short_name">PojavLauncher</string>
|
||||
<string name="app_motd">Запустите Minecraft: Java Edition на вашем устройстве!</string>
|
||||
|
||||
<!-- Action bar part -->
|
||||
<string name="actionbar_help">ПОМОЩЬ</string>
|
||||
|
||||
<!-- Languages list part -->
|
||||
<string name="language_name">РУССКИЙ - RU</string>
|
||||
|
||||
<!-- Logging output -->
|
||||
<string name="log_title">Журнал</string>
|
||||
|
||||
<!-- Login strings -->
|
||||
<string name="login_online_username_hint">Email или имя пользователя</string>
|
||||
<string name="login_online_username_question">(Что мне использовать?)</string>
|
||||
<string name="login_online_password_hint">Пароль</string>
|
||||
<string name="login_online_password_question">Забыли пароль?</string>
|
||||
<string name="login_online_remember">Запомнить меня?</string>
|
||||
<string name="login_online_check_keeplogin">Сохранить меня авторизованным</string>
|
||||
<string name="login_online_login_label">Вход</string>
|
||||
<string name="login_online_create_account">(Создать новую учётную запись?)</string>
|
||||
|
||||
<string name="login_offline_switch">Автономная учётная запись?</string>
|
||||
<string name="login_offline_label">Войти как автономная учётная запись</string>
|
||||
<string name="login_offline_alert_skip">Пропустить</string>
|
||||
|
||||
<string name="login_error_short_username">Имя пользователя должно быть не менее 3-х символов</string>
|
||||
<string name="login_error_exist_username">Это имя пользователя уже существует</string>
|
||||
|
||||
<string name="login_select_account">Учётные записи</string>
|
||||
|
||||
<!-- Hint -->
|
||||
<string name="hint_select_account">Чтобы выбрать учётную запись, нажмите на неё. Чтобы удалить, нажмите и удерживайте её.</string>
|
||||
<string name="hint_control_mapping">"Эта функция еще не завершена, поэтому в данный момент вы не можете применить пользовательское управление!\nПроведите пальцем справа налево, чтобы открыть меню ◀\nУдерживайте кнопку для настройки: редактирования, изменения размера или удаления."</string>
|
||||
|
||||
<!-- Warning -->
|
||||
<string name="warning_title">Предупреждение</string>
|
||||
<string name="warning_msg">Это приложение может быть несовместимо с вашей версией Android (Android 7.0 и выше). Вместо этого вы можете использовать VMOS и установить это приложение на VMOS. Но VMOS удалён из Play Маркета, вы должны установить его вручную.</string>
|
||||
<string name="warning_noshowagain">Больше не показывать</string>
|
||||
<string name="warning_action_install">Установить VMOS</string>
|
||||
<string name="warning_action_tryanyway">Все равно попробовать</string>
|
||||
<string name="warning_action_exit">Выйти</string>
|
||||
<string name="warning_remove_account">Эта учётная запись будет удалена!</string>
|
||||
|
||||
<!-- AlertDialog title -->
|
||||
<string name="alerttitle_selectkeymap">Выбрать раскладку формата json</string>
|
||||
<string name="alerttitle_installmod">Выбрать мод для добавления</string>
|
||||
<string name="alerttitle_installoptifine">Выбрать файл OptiFine формата jar</string>
|
||||
|
||||
<!-- Error messages -->
|
||||
<string name="error_fatal">PojavLauncher был остановлен в результате сбоя</string>
|
||||
<string name="error_checklog">Ошибка! Пожалуйста, проверьте журнал ниже: %s</string>
|
||||
<string name="error_no_version">Нет версий!</string>
|
||||
<string name="error_load_version">Не удалось загрузить версию %s</string>
|
||||
<string name="error_convert_lib">Не удалось конвертировать библиотеку %s</string>
|
||||
<string name="error_convert_client">Не удалось конвертировать Minecraft %s</string>
|
||||
<string name="error_show_more">Развернуть</string>
|
||||
<string name="error_show_less">Свернуть</string>
|
||||
|
||||
<!-- Toast messages -->
|
||||
<string name="toast_permission_denied">Требуется разрешение на чтение/запись в хранилище!</string>
|
||||
<string name="toast_login_error">После входа что-то пошло не так. Пожалуйста, сообщите об этом разработчику.\nОшибка: %s</string>
|
||||
<string name="toast_optifine_success">Установка прошла успешно</string>
|
||||
<string name="toast_shiftmode">Режим кнопки Shift (крадся) изменен на %s</string>
|
||||
<string name="toast_shiftmode_hold">режим удержания</string>
|
||||
<string name="toast_shiftmode_toggle">режим переключения</string>
|
||||
<!--
|
||||
<string name="toast_3">Exit</string>
|
||||
-->
|
||||
|
||||
<!-- MCLauncherActivity: Tabs -->
|
||||
<string name="mcl_tab_news">Новости лаунчера</string>
|
||||
<string name="mcl_tab_console">Консоль разработки</string>
|
||||
<string name="mcl_tab_crash">Журнал сбоев</string>
|
||||
|
||||
<!-- MCLauncherActivity: Strings -->
|
||||
<string name="mcl_version_msg">Minecraft %s готов к запуску</string>
|
||||
<string name="mcl_launch_cleancache">Очистка файлов кэша</string>
|
||||
<string name="mcl_launch_downloading">Загрузка %s</string>
|
||||
<string name="mcl_launch_download_lib">Загрузка библиатеки %s</string>
|
||||
<string name="mcl_launch_download_client">Загрузка Minecraft %s</string>
|
||||
<string name="mcl_launch_convert_lib">Конвертация библиотеки %s</string>
|
||||
<string name="mcl_launch_convert_client">Конвертация Minecraft %s</string>
|
||||
<string name="mcl_launch_patch_client">Сборка Minecraft %s</string>
|
||||
<string name="mcl_launch_download_assets">Подготовка к загрузке ресурсов</string>
|
||||
|
||||
<string name="mcl_options">Опции</string>
|
||||
<string name="mcl_option_modmgr">Диспетчер модов (не работает)</string>
|
||||
<string name="mcl_option_optifineinstall">Установить OptiFine</string>
|
||||
<string name="mcl_option_checkupdate">Проверить наличие обновлений</string>
|
||||
<string name="mcl_option_customcontrol">Пользовательское управление</string>
|
||||
<string name="mcl_option_settings">Настройки</string>
|
||||
<string name="mcl_option_about">О лаунчере</string>
|
||||
|
||||
<string name="mcl_setting_title_setmaxdxref">Установка макс. кол-во запросов DX</string>
|
||||
<string name="mcl_setting_subtitle_setmaxdxref">Увеличьте если при конвертации произошла ошибка: Too many ... references. Вы можете попробовать опцию multi-dex. Рекомендуем: 4096 или 8192.</string>
|
||||
<string name="mcl_setting_title_freeform">Запуск Minecraft в плавающем окне</string>
|
||||
<string name="mcl_setting_subtitle_freeform">Запустите Minecraft в плавающем окне. Требуется Android 7.0 или выше</string>
|
||||
<string name="mcl_setting_title_longpresstrigger">Длительность долгого нажатия</string>
|
||||
<string name="mcl_setting_subtitle_longpresstrigger">Изменить длительность долгого нажатие для ломания блоков и выкидования предметов.</string>
|
||||
<string name="mcl_setting_title_controlsize">Установка размера кнопок управления</string>
|
||||
<string name="mcl_setting_title_forgetoptifpath">Сделать OptiFine неспособным обнаружить себя</string>
|
||||
<string name="mcl_setting_subtitle_forgetoptifpath">Позволяет сделать OptiFine способным запуститься на некоторых устройствах.</string>
|
||||
<string name="mcl_setting_category_general">Общие настройки</string>
|
||||
<string name="mcl_setting_category_veroption">Типы версий, которые будут отображаться в списке версий</string>
|
||||
<string name="mcl_setting_veroption_release">Релизы</string>
|
||||
<string name="mcl_setting_veroption_snapshot">Снапшоты</string>
|
||||
<string name="mcl_setting_veroption_oldalpha">Старые альфа</string>
|
||||
<string name="mcl_setting_veroption_oldbeta">Старые бета</string>
|
||||
|
||||
<string name="mcl_version_clone">Клонировать</string>
|
||||
|
||||
<!-- Global strings -->
|
||||
<string name="global_add">Добавить</string>
|
||||
<string name="global_edit">Редактировать</string>
|
||||
<string name="global_error">Ошибка</string>
|
||||
<string name="global_load">Загрузка</string>
|
||||
<string name="global_name">Имя</string>
|
||||
<string name="global_remove">Удалить</string>
|
||||
<string name="global_restart">Перезапуск</string>
|
||||
<string name="global_save">Сохранить</string>
|
||||
<string name="global_error_field_empty">Это поле не может быть пустым</string>
|
||||
|
||||
<!--
|
||||
<string name="mcl_about">
|
||||
%1$s БЕТА (Minecraft Java launcher для Android), версия: " + PathTools.usingVerName + "\n" +
|
||||
" - от Khanh Duy Tran (на основе приложения \"Boardwalk\")\n" +
|
||||
//"© 2019 Khanh Duy Tran\n" +
|
||||
"Используемые библиотеки:\n" +
|
||||
" • LWJGL " + org.lwjgl.Sys.getVersion() + "\n" +
|
||||
//" • Boardwalk memory manager (not used now).\n" +
|
||||
" • gl4es: OpenGL для устройств OpenGL ES от lunixbochs и ptitSeb.\n" +
|
||||
" • dx: инструмент для конвертации.\n" +
|
||||
" • Реализация Java AWT включает в себя:\n" +
|
||||
" - Makeshift от Boardwalk.\n" +
|
||||
" - Фреймворк Apache Harmony AWT.\n" +
|
||||
" - Реализация кодов OpenJDK 7 .\n" +
|
||||
" - Реализация кода разработчика (копирование текста, открытие браузера,...)\n" +
|
||||
"\n" +
|
||||
"* Примечание:\n" +
|
||||
" - В настоящее время это приложение в БЕТЕ, она может работать нестабильно.\n" +
|
||||
//"* Это приложение будет нестабильным на устройствах Android 7.0 или выше.\n" +
|
||||
" - Это приложение использует только LWJGL2 и не имеет jre8 desugar, поэтому не поддерживает версии 1.13 или выше.\n" +
|
||||
" - Это приложение не связано с Minecraft, Mojang или Microsoft.\n")
|
||||
</string>
|
||||
-->
|
||||
<!-- MainActivity: strings -->
|
||||
<string name="mcn_exit_title">Игра закрылась</string>
|
||||
<string name="mcn_exit_call">Выйти</string>
|
||||
<string name="mcn_exit_crash">Обнаружен сбой игры! Нажмите кнопку ОК, чтобы выйти.</string>
|
||||
<string name="mcn_exit_errcrash">Не удалось найти сбой! Можете не обращать на это внимания.</string>
|
||||
<string name="mcn_exit_confirm">Вы уверены, что хотите принудительно закрыть его?</string>
|
||||
|
||||
<!-- MainActivity: Control buttons -->
|
||||
<string name="controls">Управление</string>
|
||||
<string name="control_toggle">GUI</string>
|
||||
<string name="control_keyboard">Клавиатура</string>
|
||||
<string name="control_chat">Чат</string>
|
||||
<string name="control_debug">Отладка</string>
|
||||
<string name="control_zoom">Зум (C)</string>
|
||||
<string name="control_primary">ЛКМ</string>
|
||||
<string name="control_secondary">ПКМ</string>
|
||||
<string name="control_shift">◇</string>
|
||||
<string name="control_inventory">Инв</string>
|
||||
<string name="control_up">▲</string>
|
||||
<string name="control_left">◀</string>
|
||||
<string name="control_right">▶</string>
|
||||
<string name="control_down">▼</string>
|
||||
<string name="control_jump">⬛</string>
|
||||
<string name="control_thirdperson">3-е лицо</string>
|
||||
<string name="control_listplayers">Tab</string>
|
||||
<string name="control_mouse">Мышь</string>
|
||||
<string name="control_mouseoff">Мышь: Выкл</string>
|
||||
<string name="control_mouseon">Мышь: Вкл </string>
|
||||
|
||||
<!-- MainActivity: Menu advanced controls -->
|
||||
<string name="control_forceclose">Принудительное закрытие</string>
|
||||
<string name="control_viewout">Показать вывод журнала</string>
|
||||
<string name="control_adebug">Откладка PointerCapture</string>
|
||||
<string name="control_customkey">Отправить потловательскую раскладку</string>
|
||||
|
||||
<string name="control_shiftmodechg">Изменить режим кнопки Shift (крадся)</string>
|
||||
|
||||
<string name="control_more4"></string>
|
||||
|
||||
<string name="customctrl_keyname">Код клавиши</string>
|
||||
<string name="customctrl_specialkey">Специальная клавиша</string>
|
||||
<string name="customctrl_hidden">Скрыто</string>
|
||||
<string name="customctrl_addbutton">Добавить кнопку</string>
|
||||
<string name="customctrl_title_selectctrl">Выберать управление по умолчанию</string>
|
||||
<string name="customctrl_selectdefault">Выберать управление по умолчанию</string>
|
||||
|
||||
<!-- Update part (unused now) -->
|
||||
<string name="update_console">Обновить консоль</string>
|
||||
<string name="main_options">Опции</string>
|
||||
<string name="main_play">Играть</string>
|
||||
<string name="main_welcome">Добро пожаловать,</string>
|
||||
<string name="main_infodev">Инфо (Разраб.)</string>
|
||||
<string name="main_switchuser">Выбрать пользователя</string>
|
||||
<string name="main_version_">Версия:</string>
|
||||
<string name="main_nocrash">Сбоев не обнаружено</string>
|
||||
<string name="main_nolog">Нет записей</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- App name part -->
|
||||
<string name="app_name">PojavLauncher(适用于 Android 的 Java 版 Minecraft)</string>
|
||||
<string name="app_short_name">PojavLauncher</string>
|
||||
<string name="app_motd">在您的设备上启动 Java 版 Minecraft!</string>
|
||||
|
||||
<!-- Action bar part -->
|
||||
<string name="actionbar_help">帮助</string>
|
||||
|
||||
<!-- Languages list part -->
|
||||
<string name="language_name">SIMPLIFIED CHINESE - CN</string>
|
||||
|
||||
<!-- Logging output -->
|
||||
<string name="log_title">日志输出</string>
|
||||
|
||||
<!-- Login strings -->
|
||||
<string name="login_online_username_hint">电子邮件或用户名</string>
|
||||
<string name="login_online_username_question">(使用哪个?)</string>
|
||||
<string name="login_online_password_hint">密码</string>
|
||||
<string name="login_online_password_question">忘记密码?</string>
|
||||
<string name="login_online_remember">记住我</string>
|
||||
<string name="login_online_check_keeplogin">保持登录状态</string>
|
||||
<string name="login_online_login_label">登录</string>
|
||||
<string name="login_online_create_account">(创建新账号?)</string>
|
||||
|
||||
<string name="login_offline_switch">离线登录?</string>
|
||||
<string name="login_offline_label">以离线账号登录</string>
|
||||
<string name="login_offline_alert_skip">跳过</string>
|
||||
|
||||
<string name="login_error_short_username">用户名至少为3字符长</string>
|
||||
<string name="login_error_exist_username">用户名已存在</string>
|
||||
|
||||
<string name="login_select_account">选择账号</string>
|
||||
|
||||
<!-- Hint -->
|
||||
<string name="hint_select_account">点击选择账号,长按删除。</string>
|
||||
<string name="hint_control_mapping">"此项功能尚未完善,暂时无法应用自定义控制键位!\n左滑打开菜单 ◀\n长按按键以自定义:编辑,缩放或删除。"</string>
|
||||
|
||||
<!-- Warning -->
|
||||
<string name="warning_title">警告</string>
|
||||
<string name="warning_msg">本应用可能与您的 Android 版本(大于等于 Android 7.0)不兼容。作为替代,您可以安装虚拟大师并在其中安装本应用。但由于虚拟大师已从 Play 商店移除,您必须手动安装。</string>
|
||||
<string name="warning_noshowagain">不再提示</string>
|
||||
<string name="warning_action_install">安装虚拟大师</string>
|
||||
<string name="warning_action_tryanyway">仍然尝试</string>
|
||||
<string name="warning_action_exit">退出</string>
|
||||
<string name="warning_remove_account">此账号将被移除!</string>
|
||||
|
||||
<!-- AlertDialog title -->
|
||||
<string name="alerttitle_selectkeymap">选择 .json 键位文件</string>
|
||||
<string name="alerttitle_installmod">选择要添加的 Mod</string>
|
||||
<string name="alerttitle_installoptifine">选择 OptiFine .jar 文件</string>
|
||||
|
||||
<!-- Error messages -->
|
||||
<string name="error_fatal">PojavLauncher 意外崩溃</string>
|
||||
<string name="error_checklog">错误!检查下方日志: %s</string>
|
||||
<string name="error_no_version">无版本!</string>
|
||||
<string name="error_load_version">无法加载版本 %s</string>
|
||||
<string name="error_convert_lib">无法转换运行库 %s</string>
|
||||
<string name="error_convert_client">无法转换 Minecraft %s</string>
|
||||
<string name="error_show_more">显示细节</string>
|
||||
<string name="error_show_less">隐藏细节</string>
|
||||
|
||||
<!-- Toast messages -->
|
||||
<string name="toast_permission_denied">需要存储读写权限!</string>
|
||||
<string name="toast_login_error">登录后出现问题。请向开发者反馈。\n错误: %s</string>
|
||||
<string name="toast_optifine_success">安装成功</string>
|
||||
<string name="toast_shiftmode">Shift(潜行)键已修改为 %s 模式</string>
|
||||
<string name="toast_shiftmode_hold">保持模式</string>
|
||||
<string name="toast_shiftmode_toggle">点按切换模式</string>
|
||||
<!--
|
||||
<string name="toast_3">Exit</string>
|
||||
-->
|
||||
|
||||
<!-- MCLauncherActivity: Tabs -->
|
||||
<string name="mcl_tab_news">启动器新闻</string>
|
||||
<string name="mcl_tab_console">开发控制台</string>
|
||||
<string name="mcl_tab_crash">崩溃日志</string>
|
||||
|
||||
<!-- MCLauncherActivity: Strings -->
|
||||
<string name="mcl_version_msg">Minecraft %s 就绪</string>
|
||||
<string name="mcl_launch_cleancache">正在清理缓存</string>
|
||||
<string name="mcl_launch_downloading">正在下载 %s</string>
|
||||
<string name="mcl_launch_download_lib">正在下载运行库 %s</string>
|
||||
<string name="mcl_launch_download_client">正在下载 Minecraft %s</string>
|
||||
<string name="mcl_launch_convert_lib">正在转换运行库 %s</string>
|
||||
<string name="mcl_launch_convert_client">正在转换 Minecraft %s</string>
|
||||
<string name="mcl_launch_patch_client">正在为 Minecraft %s 打补丁</string>
|
||||
<string name="mcl_launch_download_assets">正在准备下载资源</string>
|
||||
|
||||
<string name="mcl_options">选项</string>
|
||||
<string name="mcl_option_modmgr">Mod 管理器(无功能)</string>
|
||||
<string name="mcl_option_optifineinstall">安装 OptiFine</string>
|
||||
<string name="mcl_option_checkupdate">检查更新</string>
|
||||
<string name="mcl_option_customcontrol">自定义控制键</string>
|
||||
<string name="mcl_option_settings">设置</string>
|
||||
<string name="mcl_option_about">关于</string>
|
||||
|
||||
<string name="mcl_setting_title_setmaxdxref">设定最大 DX 引用值</string>
|
||||
<string name="mcl_setting_subtitle_setmaxdxref">若转换时出现错误:“Too many ... references. You may try multi-dex option.”则调高此值。建议的值:4096或8192。</string>
|
||||
<string name="mcl_setting_title_freeform">以自由式模式启动 Minecraft</string>
|
||||
<string name="mcl_setting_subtitle_freeform">在浮动窗口中启动 Minecraft。需要 Android 7.0+</string>
|
||||
<string name="mcl_setting_title_longpresstrigger">长按触发时长</string>
|
||||
<string name="mcl_setting_subtitle_longpresstrigger">修改长按摧毁方块、丢弃物品的触发时长</string>
|
||||
<string name="mcl_setting_title_controlsize">设定控制键大小</string>
|
||||
<string name="mcl_setting_title_forgetoptifpath">阻止 OptiFine 定位自身</string>
|
||||
<string name="mcl_setting_subtitle_forgetoptifpath">可能使 OptiFine 在某些设备上可以启动。</string>
|
||||
<string name="mcl_setting_category_general">通用设置</string>
|
||||
<string name="mcl_setting_category_veroption">版本类型将在版本列表中显示</string>
|
||||
<string name="mcl_setting_veroption_release">Release</string>
|
||||
<string name="mcl_setting_veroption_snapshot">Snapshot</string>
|
||||
<string name="mcl_setting_veroption_oldalpha">Old-alpha</string>
|
||||
<string name="mcl_setting_veroption_oldbeta">Old-beta</string>
|
||||
|
||||
<string name="mcl_version_clone">复制</string>
|
||||
|
||||
<!-- Global strings -->
|
||||
<string name="global_add">添加</string>
|
||||
<string name="global_edit">修改</string>
|
||||
<string name="global_error">错误</string>
|
||||
<string name="global_load">加载</string>
|
||||
<string name="global_name">名称</string>
|
||||
<string name="global_remove">移除</string>
|
||||
<string name="global_restart">重启</string>
|
||||
<string name="global_save">保存</string>
|
||||
<string name="global_error_field_empty">此处表单不能为空</string>
|
||||
|
||||
<!--
|
||||
<string name="mcl_about">
|
||||
%1$s BETA (Minecraft Java launcher for Android), version " + PathTools.usingVerName + "\n" +
|
||||
" - by Khanh Duy Tran (based from \"Boardwalk\" app)\n" +
|
||||
"Using libraries:\n" +
|
||||
" • LWJGL " + org.lwjgl.Sys.getVersion() + "\n" +
|
||||
//" • Boardwalk memory manager (not used now).\n" +
|
||||
" • gl4es: OpenGL for OpenGL ES devices by lunixbochs and ptitSeb.\n" +
|
||||
" • dx: tool to convert.\n" +
|
||||
" • Java AWT Implementation includes:\n" +
|
||||
" - Boardwalk's makeshift.\n" +
|
||||
" - Apache Harmony AWT Framework.\n" +
|
||||
" - OpenJDK 7 codes implementation.\n" +
|
||||
" - Developer code implement (copy text, open browser,...)\n" +
|
||||
"\n" +
|
||||
"* Notes:\n" +
|
||||
" - This app is currently BETA, it will not be stable.\n" +
|
||||
//"* This app will unstable on Android 7.0 or higher devices.\n" +
|
||||
" - This app only use LWJGL2 and don't have a JRE8 desugar, so doesn't support 1.13 or higher versions.\n" +
|
||||
" - This app is not affiliated with Minecraft, Mojang or Microsoft.\n")
|
||||
</string>
|
||||
-->
|
||||
<!-- MainActivity: strings -->
|
||||
<string name="mcn_exit_title">游戏退出</string>
|
||||
<string name="mcn_exit_call">退出</string>
|
||||
<string name="mcn_exit_crash">检测到游戏崩溃!按确定键退出。</string>
|
||||
<string name="mcn_exit_errcrash">无法定位崩溃!您可以忽略这条消息。</string>
|
||||
<string name="mcn_exit_confirm">确定强制关闭?</string>
|
||||
|
||||
<!-- MainActivity: Control buttons -->
|
||||
<string name="controls">控制</string>
|
||||
<string name="control_toggle">GUI</string>
|
||||
<string name="control_keyboard">键盘</string>
|
||||
<string name="control_chat">聊天</string>
|
||||
<string name="control_debug">调试</string>
|
||||
<string name="control_zoom">缩放 (C)</string>
|
||||
<string name="control_primary">主</string>
|
||||
<string name="control_secondary">副</string>
|
||||
<string name="control_shift">◇</string>
|
||||
<string name="control_inventory">背包</string>
|
||||
<string name="control_up">▲</string>
|
||||
<string name="control_left">◀</string>
|
||||
<string name="control_right">▶</string>
|
||||
<string name="control_down">▼</string>
|
||||
<string name="control_jump">⬛</string>
|
||||
<string name="control_thirdperson">3rd</string>
|
||||
<string name="control_listplayers">Tab</string>
|
||||
<string name="control_mouse">鼠标</string>
|
||||
<string name="control_mouseoff">鼠标:关</string>
|
||||
<string name="control_mouseon">鼠标:开</string>
|
||||
|
||||
<!-- MainActivity: Menu advanced controls -->
|
||||
<string name="control_forceclose">强制关闭</string>
|
||||
<string name="control_viewout">日志输出</string>
|
||||
<string name="control_adebug">指针捕捉调试</string>
|
||||
<string name="control_customkey">发送自定义键码</string>
|
||||
<string name="control_shiftmodechg">修改 Shift(潜行)模式</string>
|
||||
|
||||
<string name="control_more4"></string>
|
||||
|
||||
<string name="customctrl_keyname">键码</string>
|
||||
<string name="customctrl_specialkey">特殊键</string>
|
||||
<string name="customctrl_hidden">隐藏</string>
|
||||
<string name="customctrl_addbutton">添加按键</string>
|
||||
<string name="customctrl_title_selectctrl">选择默认 .json 控制键位</string>
|
||||
<string name="customctrl_selectdefault">选择默认 .json 控制键位</string>
|
||||
|
||||
<!-- Update part (unused now) -->
|
||||
<string name="update_console">更新控制台</string>
|
||||
<string name="main_options">选项</string>
|
||||
<string name="main_play">启动游戏</string>
|
||||
<string name="main_welcome">欢迎,</string>
|
||||
<string name="main_infodev">信息(开发)</string>
|
||||
<string name="main_switchuser">切换账号</string>
|
||||
<string name="main_version_">版本:</string>
|
||||
<string name="main_nocrash">未检测到崩溃</string>
|
||||
<string name="main_nolog">无日志。</string>
|
||||
</resources>
|
||||
@@ -2,6 +2,7 @@
|
||||
<resources>
|
||||
<string-array name="mcl_options">
|
||||
<item>@string/mcl_option_modmgr</item>
|
||||
<!-- <item>@string/mcl_option_forgeinstall</item> -->
|
||||
<item>@string/mcl_option_optifineinstall</item>
|
||||
<item>@string/mcl_option_customcontrol</item>
|
||||
<item>@string/mcl_option_settings</item>
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
<string name="login_online_password_hint">Password</string>
|
||||
<string name="login_online_password_question">Forgot password?</string>
|
||||
<string name="login_online_remember">Remember me?</string>
|
||||
<string name="login_online_check_keeplogin">Keep me logged in</string>
|
||||
<string name="login_online_login_label">Login</string>
|
||||
<string name="login_online_create_account">(Create new account?)</string>
|
||||
|
||||
<string name="login_offline_switch">Offline account?</string>
|
||||
<string name="login_offline_warning_1">You are logging in by an offline account, but if you don\'t save it, your data may be reset in your worlds/multiplayers/servers. We recommend you to save it.</string>
|
||||
<string name="login_offline_label">Login as offline account</string>
|
||||
<string name="login_offline_alert_skip">Skip</string>
|
||||
|
||||
<string name="login_error_short_username">Username must be at least 3 characters</string>
|
||||
@@ -34,7 +35,7 @@
|
||||
|
||||
<!-- Hint -->
|
||||
<string name="hint_select_account">To select, click it. To delete an account, hold it.</string>
|
||||
<string name="hint_control_mapping">Swipe from right to left to open menu\n◀</string>
|
||||
<string name="hint_control_mapping">"This feature is not yet finished so can\'t apply custom control at the moment!\nSwipe from right to left to open menu ◀\nHold a button to customize: edit, resize or delete."</string>
|
||||
|
||||
<!-- Warning -->
|
||||
<string name="warning_title">Warning</string>
|
||||
@@ -51,6 +52,7 @@
|
||||
<string name="alerttitle_installoptifine">Select OptiFine jar file</string>
|
||||
|
||||
<!-- Error messages -->
|
||||
<string name="error_fatal">PojavLauncher has unexpectedly crashed</string>
|
||||
<string name="error_checklog">Error! Please check the log below: %s</string>
|
||||
<string name="error_no_version">No version!</string>
|
||||
<string name="error_load_version">Unable to load version %s</string>
|
||||
@@ -63,6 +65,9 @@
|
||||
<string name="toast_permission_denied">The read/write to storage permission is required!</string>
|
||||
<string name="toast_login_error">Something went wrong after login. Please feedback to the developer.\nError: %s</string>
|
||||
<string name="toast_optifine_success">Install successful</string>
|
||||
<string name="toast_shiftmode">Shift (sneak) button mode changed to %s</string>
|
||||
<string name="toast_shiftmode_hold">Hold mode</string>
|
||||
<string name="toast_shiftmode_toggle">Click toggle mode</string>
|
||||
<!--
|
||||
<string name="toast_3">Exit</string>
|
||||
-->
|
||||
@@ -81,7 +86,7 @@
|
||||
<string name="mcl_launch_convert_lib">Converting library %s</string>
|
||||
<string name="mcl_launch_convert_client">Converting Minecraft %s</string>
|
||||
<string name="mcl_launch_patch_client">Patching Minecraft %s</string>
|
||||
<string name="mcl_launch_download_assets">Prepaping to download resources</string>
|
||||
<string name="mcl_launch_download_assets">Preparing to download resources</string>
|
||||
|
||||
<string name="mcl_options">Options</string>
|
||||
<string name="mcl_option_modmgr">Mod manager (no function)</string>
|
||||
@@ -116,6 +121,7 @@
|
||||
<string name="global_load">Load</string>
|
||||
<string name="global_name">Name</string>
|
||||
<string name="global_remove">Remove</string>
|
||||
<string name="global_restart">Restart</string>
|
||||
<string name="global_save">Save</string>
|
||||
<string name="global_error_field_empty">This field can\'t be empty</string>
|
||||
|
||||
@@ -123,7 +129,6 @@
|
||||
<string name="mcl_about">
|
||||
%1$s BETA (Minecraft Java launcher for Android), version " + PathTools.usingVerName + "\n" +
|
||||
" - by Khanh Duy Tran (based from \"Boardwalk\" app)\n" +
|
||||
//"© 2019 Khanh Duy Tran\n" +
|
||||
"Using libraries:\n" +
|
||||
" • LWJGL " + org.lwjgl.Sys.getVersion() + "\n" +
|
||||
//" • Boardwalk memory manager (not used now).\n" +
|
||||
@@ -146,7 +151,7 @@
|
||||
<string name="mcn_exit_title">Game exited</string>
|
||||
<string name="mcn_exit_call">Exit</string>
|
||||
<string name="mcn_exit_crash">Game Crash detected! Click OK to exit.</string>
|
||||
<string name="mcn_exit_errcrash">Unable to locate crash!</string>
|
||||
<string name="mcn_exit_errcrash">Unable to locate crash! You may ignore this.</string>
|
||||
<string name="mcn_exit_confirm">Are you sure want to force close?</string>
|
||||
|
||||
<!-- MainActivity: Control buttons -->
|
||||
@@ -167,6 +172,7 @@
|
||||
<string name="control_jump">⬛</string>
|
||||
<string name="control_thirdperson">3rd</string>
|
||||
<string name="control_listplayers">Tab</string>
|
||||
<string name="control_mouse">Mouse</string>
|
||||
<string name="control_mouseoff">Mouse: off</string>
|
||||
<string name="control_mouseon">Mouse: on </string>
|
||||
|
||||
@@ -175,15 +181,25 @@
|
||||
<string name="control_viewout">Log output</string>
|
||||
<string name="control_adebug">PointerCapture Debug</string>
|
||||
<string name="control_customkey">Send custom keycode</string>
|
||||
|
||||
<string name="control_more3"></string>
|
||||
<string name="control_more4"></string>
|
||||
<string name="control_shiftmodechg">Change Shift (Sneak) mode</string>
|
||||
|
||||
<string name="customctrl_keyname">LWJGL Keycode</string>
|
||||
<string name="control_more4"></string>
|
||||
|
||||
<string name="customctrl_keyname">Keycode</string>
|
||||
<string name="customctrl_specialkey">Special Key</string>
|
||||
<string name="customctrl_hidden">Hidden</string>
|
||||
<string name="customctrl_addbutton">Add button</string>
|
||||
<string name="customctrl_title_selectctrl">Select default Control json</string>
|
||||
<string name="customctrl_selectdefault">Select default Control json</string>
|
||||
|
||||
<!-- Update part (unused now) -->
|
||||
<string name="update_console">Update console</string>
|
||||
|
||||
<string name="main_options">Options</string>
|
||||
<string name="main_play">Play</string>
|
||||
<string name="main_welcome">Welcome,</string>
|
||||
<string name="main_infodev">Info (DEV)</string>
|
||||
<string name="main_switchuser">Switch user</string>
|
||||
<string name="main_version_">Version:</string>
|
||||
<string name="main_nocrash">No crash detected</string>
|
||||
<string name="main_nolog">No log.</string>
|
||||
</resources>
|
||||
@@ -1,24 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Light or not? -->
|
||||
<style name="AppTheme" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
</style>
|
||||
|
||||
<style name="RunTheme" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<style name="AlertTheme" parent="@style/AppTheme">
|
||||
</style>
|
||||
|
||||
<style name="AlertTheme" parent="@android:style/Theme.Material">
|
||||
</style>
|
||||
|
||||
<style name="MenuDialog" parent="@android:style/Theme.Material">
|
||||
<style name="MenuDialog" parent="@style/AppTheme">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
@@ -27,10 +22,17 @@
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowAnimationStyle">@style/MenuDialogAnimation</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
</style>
|
||||
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MenuDialogAnimation">
|
||||
<item name="android:windowEnterAnimation">@anim/translate_left_side</item>
|
||||
<item name="android:windowExitAnimation">@anim/translate_right_side</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
<style name="SpinnerChangeLanguage">
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:background">@drawable/spinner_change_language</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
files:
|
||||
- source: /app/src/main/res/values/strings.xml
|
||||
translation: /app/src/main/res/values-%osx_locale%/%original_file_name%
|
||||
Vendored
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
||||
#Mon Sep 12 09:22:55 CEST 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
@@ -0,0 +1,164 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
Reference in new issue
Block a user