Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GenericLauncher

A base for Minecraft PE hacked clients. Starts you off with a basic launcher base that you can use to build off of. Currently just starts up and plays MCPE like normal, make it do what you want.

Take the code, and do what you want with it. It's a base for anyone to use. Change the package name, don't give me cradit, I don't care.
Take the code, and do what you want with it. It's a base for anyone to use. Change the package name, don't give me credit, I don't care.


A few thanks to @zhuowei. This app is a barebones base of his app, BlockLauncher.
A few thanks to @zhuowei. This app is a barebones base of his app, BlockLauncher.
3 changes: 2 additions & 1 deletion jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ APP_PLATFORM := android-14
APP_CFLAGS := -O2 -std=gnu99 -Wall
APP_CPPFLAGS += -frtti -std=c++11

APP_STL := gnustl_shared
APP_STL := gnustl_shared
NDK_TOOLCHAIN_VERSION=4.9
19 changes: 19 additions & 0 deletions src/com/microsoft/xbox/idp/interop/Interop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.microsoft.xbox.idp.interop;

import android.content.Context;
import android.util.Log;

public class Interop {

public Interop() {}

public static String ReadConfigFile(Context context) {
Log.i("GenericLauncher","Interop: ReadConfigFile");
return "";
}

public static String getSystemProxy() {
Log.i("GenericLauncher","Interop: getSystemproxy");
return "";
}
}
60 changes: 48 additions & 12 deletions src/com/mojang/minecraftpe/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@
import java.util.Locale;
import java.util.UUID;

import android.media.AudioManager;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Environment;
import android.os.Vibrator;
import android.app.NativeActivity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.ColorDrawable;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Environment;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.text.Editable;
import android.text.InputType;
Expand Down Expand Up @@ -136,6 +137,16 @@ public void run() {

}

public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getCharacters() != null) {
nativeTypeCharacter(event.getCharacters());
}
if (nativeKeyHandler(event.getKeyCode(), event.getAction())) {
return true;
}
return super.dispatchKeyEvent(event);
}

public String getExternalStoragePath() {
return Environment.getExternalStorageDirectory().getAbsolutePath();
}
Expand Down Expand Up @@ -254,6 +265,8 @@ public PackageManager getPackageManager() {

public native void nativeBackSpacePressed();

public native boolean nativeKeyHandler(int keycode, int action);

public native void nativeReturnKeyPressed();

public void buyGame() {
Expand All @@ -276,7 +289,7 @@ public String getDateString(int time) {
}

public byte[] getFileDataBytes(String name) {
System.out.println("Get file data: " + name);
//System.out.println("Get file data: " + name);
try {
if (name.isEmpty())
return null;
Expand Down Expand Up @@ -360,11 +373,8 @@ protected InputStream getLocalInputStreamForAsset(String name) {
}
}

public int[] getImageData(String name, boolean wtf) {
if (!wtf) {
Log.w("GenericLauncher","I must return null?");
}
System.out.println("Get image data: " + name);
public int[] getImageData(String name) {
//System.out.println("Get image data: " + name);
try {
InputStream is = getInputStreamForAsset(name);
if (is == null) {
Expand Down Expand Up @@ -727,6 +737,32 @@ public void clearLoginInformation() {
public String[] getBroadcastAddresses() {
return new String[]{};
}

public String[] getIPAddresses() {
Log.i("GenericLauncher", "getIPAdresses");
return new String[]{};
}

void setFileDialogCallback(long callback) {
Log.i("GenericLauncher", "setFileDialogCallback");
}

public Intent createAndroidLaunchIntent() {
Context context = getApplicationContext();
return context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
}

public void updateLocalization(final String language, final String country) {
runOnUiThread(new Runnable() {
public void run() {
Locale locale = new Locale(language,country);
Locale.setDefault(locale);
Configuration conf = new Configuration();
conf.locale = locale;
MainActivity.this.getResources().updateConfiguration(conf,MainActivity.this.getResources().getDisplayMetrics());
}
});
}

public long getTotalMemory() {
ActivityManager localActivityManager = (ActivityManager)getSystemService("activity");
Expand Down
8 changes: 6 additions & 2 deletions src/com/mojang/minecraftpe/store/Purchase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
public class Purchase
{
public String mProductId;
public boolean mPurchaseActive;
public String mReceipt;

public Purchase(String paramString)
public Purchase(String productId, String receipt, boolean active)
{
this.mProductId = paramString;
this.mProductId = productId;
this.mReceipt = receipt;
this.mPurchaseActive = active;
}
}

11 changes: 8 additions & 3 deletions src/com/mojang/minecraftpe/store/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ public Store(StoreListener paramStoreListener)
{
this.listener = paramStoreListener;
}


public void acknowledgePurchase(String str1, String str2)
{
Log.i("GenericLauncher","Store: Acknowledge " + " " + str1 + " " + str2);
}

public void destructor()
{
Log.i("GenericLauncher","Store: Destructor");
Expand All @@ -22,9 +27,9 @@ public String getStoreId()
return "Placeholder store ID";
}

public void purchase(String paramString)
public void purchase(String str1, boolean bool, String str2)
{
Log.i("GenericLauncher","Store: Purchase " + paramString);
Log.i("GenericLauncher","Store: Purchase " + str1 + " " + bool + " "+str2);
}

public void queryProducts(String[] paramArrayOfString)
Expand Down