Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a25089fdd9 | ||
|
|
638a5871ca | ||
|
|
24984f360f | ||
|
|
92bda73750 | ||
|
|
967d488457 | ||
|
|
ea8e83903d | ||
|
|
394a08ee5a |
No files matched your search
+1
-1
@@ -56,4 +56,4 @@ deploy:
|
||||
overwrite: true
|
||||
target_commitish: $TRAVIS_COMMIT
|
||||
on:
|
||||
branch: gl4es
|
||||
branch: gl4es_lwjgl3
|
||||
@@ -1,3 +1,6 @@
|
||||
## Warning
|
||||
Do not merge this branch as it only have LWJGL3 so Minecraft 1.12.2 and below will not run...
|
||||
|
||||

|
||||
# PojavLauncher
|
||||
An open source Minecraft: Java Edition launcher for Android based from Boardwalk. Support up-to Minecraft 1.11
|
||||
|
||||
File renamed without changes.
@@ -8,31 +8,28 @@ import android.widget.Toast;
|
||||
|
||||
import net.kdt.pojavlaunch.Tools;
|
||||
import java.awt.mod.*;
|
||||
import android.os.*;
|
||||
|
||||
public class Clipboard extends Object
|
||||
{
|
||||
private final Activity mActivity;
|
||||
public static Context mSystemCtx;
|
||||
public static ClipboardManager mClipboardAndroidMgr;
|
||||
public Clipboard() {
|
||||
mActivity = ModdingKit.getCurrentActivity();
|
||||
// mActivity = ModdingKit.getCurrentActivity();
|
||||
mSystemCtx = ModdingKit.getSystemContext();
|
||||
mClipboardAndroidMgr = (ClipboardManager) mSystemCtx.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
}
|
||||
|
||||
public synchronized void setContents(final Transferable contents, ClipboardOwner owner) {
|
||||
try {
|
||||
mActivity.runOnUiThread(new Runnable(){
|
||||
|
||||
new Handler().post(new Runnable(){
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
ClipboardManager clipboard = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("Minecraft", ((StringSelection) contents).getString());
|
||||
clipboard.setPrimaryClip(clip);
|
||||
public void run() {
|
||||
ClipData clip = ClipData.newPlainText("Clipboard", ((StringSelection) contents).getString());
|
||||
mClipboardAndroidMgr.setPrimaryClip(clip);
|
||||
|
||||
Toast.makeText(mActivity, "Copied to clipboard!", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(mSystemCtx, "Copied to clipboard!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Transferable clipboardText;
|
||||
@@ -41,15 +38,12 @@ public class Clipboard extends Object
|
||||
try {
|
||||
clipboardPasted = false;
|
||||
|
||||
mActivity.runOnUiThread(new Runnable(){
|
||||
|
||||
new Handler().post(new Runnable(){
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
ClipboardManager clipboard = (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
clipboardText = new StringSelection(clipboard.getText().toString());
|
||||
public void run() {
|
||||
clipboardText = new StringSelection(mClipboardAndroidMgr.getText().toString());
|
||||
clipboardPasted = true;
|
||||
Toast.makeText(mActivity, "Paste from clipboard", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(mSystemCtx, "Paste from clipboard", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
package java.awt.mod;
|
||||
|
||||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.graphics.*;
|
||||
import java.awt.image.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
|
||||
public class ModdingKit
|
||||
{
|
||||
public static Activity getCurrentActivity()
|
||||
{
|
||||
public static Context getSystemContext() {
|
||||
try {
|
||||
// ActivityThread.currentActivityThread().getSystemContext();
|
||||
Class activityThreadClass = Class.forName("android.app.ActivityThread");
|
||||
Object activityThread = activityThreadClass.getMethod("currentActivityThread").invoke(null);
|
||||
return (Context) activityThreadClass.getDeclaredMethod("getSystemContext").invoke(activityThread);
|
||||
} catch (Throwable th) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Activity getCurrentActivity() {
|
||||
try {
|
||||
Class activityThreadClass = Class.forName("android.app.ActivityThread");
|
||||
Object activityThread = activityThreadClass.getMethod("currentActivityThread").invoke(null);
|
||||
|
||||
@@ -203,7 +203,11 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
setTitle("Minecraft " + mProfile.getVersion());
|
||||
|
||||
initEnvs();
|
||||
//System.loadLibrary("gl4es");
|
||||
|
||||
if (mVersionInfo.arguments != null) {
|
||||
System.loadLibrary("gl04es");
|
||||
}
|
||||
|
||||
/*
|
||||
if (mVersionInfo.arguments != null) {
|
||||
System.loadLibrary("lwjgl32");
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.kdt.pojavlaunch.patcher.*;
|
||||
import java.lang.reflect.*;
|
||||
import dalvik.system.*;
|
||||
import optifine.*;
|
||||
import android.text.*;
|
||||
import java.awt.*;
|
||||
import javax.xml.transform.*;
|
||||
import java.awt.datatransfer.*;
|
||||
@@ -220,7 +219,11 @@ public final class Tools
|
||||
{
|
||||
StringSelection errData = new StringSelection(errMsg);
|
||||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(errData, null);
|
||||
|
||||
|
||||
ClipboardManager cmgr = (ClipboardManager) ctx.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("Error", Log.getStackTraceString(e));
|
||||
cmgr.setPrimaryClip(clip);
|
||||
|
||||
if(exitIfOk) {
|
||||
if (ctx instanceof MainActivity) {
|
||||
MainActivity.fullyExit();
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user