Skip to content

Commit

Permalink
MCinaBox Release v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
longjunyu2 committed Apr 14, 2020
1 parent 51ecac6 commit 2adb504
Show file tree
Hide file tree
Showing 31 changed files with 747 additions and 247 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@

## Background

`Origin` I discovered the BoardwalkApp a few years ago, which can launch Minecraft Java Edition on Android devices. It's so exciting to see minecraft start on my phone. Thanks to Boardwalk, it left a deep impression on me, and since then I have also developed interest and love in programming. I learned Java programming for 8 days through 'Head First Java', and started to write my first Android program MCinaBox with the support of BoatApp Project.<br>
`Origin` I discovered the `BoardwalkApp` a few years ago, which can launch Minecraft Java Edition on Android devices. It's so exciting to see minecraft start on my phone.It's really a curious and interesting project<br>
`MBinaBox` is an open source project, and the back end is supported by the `BoatApp` project. And in the efforts of many people to make it run.
>zhuowei 's BoardwalkApp https://github.com/zhuowei/Boardwalk <br>
>CosineMath 's BoatApp https://github.com/CosineMath/BoatApp
## Change Log

### v0.1.3
- Fix create new user crash (By by-scott)
- Fix minecraft dependency priority is higher than Forge
- Add minecraft genuine validation (By by-scott)
- Add mouse mode to switch (manual)
- Add Spanish (By salted fish King)
### v0.1.2
- Fix reediting keys caused a crash while repairing virtual keyboard configurations
- Fix some control behavior exceptions in Boat-3 mode
Expand All @@ -42,6 +49,13 @@

Chinese Translation:

### v0.1.3
- 修复 创建新用户崩溃的问题 (By by-scott)
- 修复 Minecraft依赖项优先级高于Forge
- 添加 Minecraft正版验证 (By by-scott)
- 添加 鼠标模式切换(手动)
- 添加 西班牙语(By Salted fish King)

### v0.1.2
- 修复 虚拟键盘配置时重新编辑键导致的崩溃
- 修正 Boat-3模式中的一些控制行为异常
Expand Down Expand Up @@ -135,15 +149,18 @@ Chinese Translation:
This project exists thanks to all the people who contribute.

### List of contributors:
- Frank Ou provides Japanese translation
- MCredbear provides new English translation.(will be used)
- mmiguelmazetto found the code that caused forge error and proposed the correction
- `by-scott` perfect user management and genuine verification code
- `Frank Ou` provides Japanese translation
- `MCredbear` provides English translation.
- `miguelmazetto` found the code that caused forge error and proposed the correction
- `Salted fish King` provides Spanish translation
- `SnowFuryHQ` found the code that caused jni building error in Linux.
- All people who put forward issues.


If you want to submit a pull request, there're some requirements:
* IDE: Android Studio
* TargetSDK: 28
* TargetSDK: 21
* MimniumSDK: 21
* Do NOT modify `gradle` files.

Expand Down
36 changes: 17 additions & 19 deletions boat/src/main/java/cosine/boat/BoatClientActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class BoatClientActivity extends NativeActivity implements View.OnClickL
private HashMap<Object,int[]> layoutsPos;
private CrossButton[] crosskeychildren;
private int[] tempCrossKey;
private CheckBox checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext;
private CheckBox checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext,checkbox_modeswitch;
private CheckBox[] toolerBarChildren;
private HorizontalScrollView SwitcherBar_container;
private ImageButton SwitcherBar_switcher;
Expand All @@ -94,13 +94,7 @@ public class BoatClientActivity extends NativeActivity implements View.OnClickL
private Button crosskey_move;
private HashMap<GameButton,Boolean> autoKeep = new HashMap<GameButton,Boolean>();

private long TOUCH_DOWN_TIME;
private long TOUCH_UP_TIME;
private long MIN_CLICK_TIME = 0;
private long MAX_CLICK_TIME = 500; //ms
private long MAX_MOVE_LIMITION = 5; //px
private boolean TOUCH_IS_LONGCLICK = false;
private boolean TOUCH_IS_OUTLIMITION = false;
private final int PAUSE_TIME = 5; //ms
private boolean TOUCH_LONG_APPLY = false;
private boolean TOUCH_IS_MOVED = false;

Expand Down Expand Up @@ -399,7 +393,8 @@ public void InitWindowsAndScreenKeyboard(){
checkbox_otg = SwitcherBar.findViewById(R.id.checkbox_Otg);
checkbox_lock = SwitcherBar.findViewById(R.id.checkbox_Lock);
checkbox_edittext = SwitcherBar.findViewById(R.id.checkbox_Edittext);
toolerBarChildren = new CheckBox[]{checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext};
checkbox_modeswitch = SwitcherBar.findViewById(R.id.checkbox_ModeSwitch);
toolerBarChildren = new CheckBox[]{checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext,checkbox_modeswitch};
SwitcherBar_container = SwitcherBar.findViewById(R.id.switchbar_container);
SwitcherBar_switcher = SwitcherBar.findViewById(R.id.switchbar_switcher);
SwitcherBar_switcher.setOnTouchListener(this);
Expand Down Expand Up @@ -705,7 +700,7 @@ private void OnTouchCrossKey(View p1,MotionEvent p2){

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -935,7 +930,7 @@ private void SendDownOrUpToInput(int[] recordKeys,int[] downKeys,int mode){

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -951,7 +946,7 @@ private void SendDownOrUpToInput(int[] recordKeys,int[] downKeys,int mode){

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -1028,6 +1023,14 @@ public void onCheckedChanged(CompoundButton v,boolean ischecked){
}else{
inputScanner.setVisibility(View.INVISIBLE);
}
}else if(v == checkbox_modeswitch){
if(mode){
mode = false;
BoatClientActivity.this.mouseCursor.setVisibility(View.VISIBLE);
}else{
mode = true;
BoatClientActivity.this.mouseCursor.setVisibility(View.INVISIBLE);
}
}
}
};
Expand Down Expand Up @@ -1060,7 +1063,7 @@ public void onFinish() {

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -1124,13 +1127,10 @@ private void OnClickTouchPad(MotionEvent p1){

break;
case MotionEvent.ACTION_UP:
//TOUCH_UP_TIME = p1.getEventTime();
//long DV = TOUCH_UP_TIME - TOUCH_DOWN_TIME;
//if( !TOUCH_IS_MOVED && DV >= MIN_CLICK_TIME && DV <= MAX_CLICK_TIME){
if(!TOUCH_LONG_APPLY && !TOUCH_IS_MOVED){
mInputEventSender.setMouseButton((byte)2,true);
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -1140,8 +1140,6 @@ private void OnClickTouchPad(MotionEvent p1){
Log.e("Screen","释放长按操作!");
mInputEventSender.setMouseButton((byte)1,false);
}
//TOUCH_IS_LONGCLICK = false;
//TOUCH_IS_OUTLIMITION = false;
TOUCH_IS_MOVED = false;
TOUCH_LONG_APPLY = false;

Expand Down
33 changes: 18 additions & 15 deletions boat/src/main/java/cosine/boat/version3/BoatClientActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class BoatClientActivity extends NativeActivity implements View.OnClickL
private HashMap<Object,int[]> layoutsPos;
private CrossButton[] crosskeychildren;
private int[] tempCrossKey;
private CheckBox checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext;
private CheckBox checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext,checkbox_modeswitch;
private CheckBox[] toolerBarChildren;
private HorizontalScrollView SwitcherBar_container;
private ImageButton SwitcherBar_switcher;
Expand All @@ -94,13 +94,7 @@ public class BoatClientActivity extends NativeActivity implements View.OnClickL
private Button crosskey_move;
private HashMap<GameButton,Boolean> autoKeep = new HashMap<GameButton,Boolean>();

private long TOUCH_DOWN_TIME;
private long TOUCH_UP_TIME;
private long MIN_CLICK_TIME = 0;
private long MAX_CLICK_TIME = 500; //ms
private long MAX_MOVE_LIMITION = 5; //px
private boolean TOUCH_IS_LONGCLICK = false;
private boolean TOUCH_IS_OUTLIMITION = false;
private final int PAUSE_TIME = 5; //ms
private boolean TOUCH_LONG_APPLY = false;
private boolean TOUCH_IS_MOVED = false;

Expand Down Expand Up @@ -377,7 +371,8 @@ public void InitWindowsAndScreenKeyboard(){
checkbox_otg = SwitcherBar.findViewById(R.id.checkbox_Otg);
checkbox_lock = SwitcherBar.findViewById(R.id.checkbox_Lock);
checkbox_edittext = SwitcherBar.findViewById(R.id.checkbox_Edittext);
toolerBarChildren = new CheckBox[]{checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext};
checkbox_modeswitch = SwitcherBar.findViewById(R.id.checkbox_ModeSwitch);
toolerBarChildren = new CheckBox[]{checkbox_qwertkeyboard,checkbox_crosskey,checkbox_mousekey,checkbox_virtualkeyboard,checkbox_otg,checkbox_joystick,checkbox_lock,checkbox_edittext,checkbox_modeswitch};
SwitcherBar_container = SwitcherBar.findViewById(R.id.switchbar_container);
SwitcherBar_switcher = SwitcherBar.findViewById(R.id.switchbar_switcher);
SwitcherBar_switcher.setOnTouchListener(this);
Expand Down Expand Up @@ -665,7 +660,7 @@ private void OnTouchCrossKey(View p1,MotionEvent p2){

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -895,7 +890,7 @@ private void SendDownOrUpToInput(int[] recordKeys,int[] downKeys,int mode){

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -911,7 +906,7 @@ private void SendDownOrUpToInput(int[] recordKeys,int[] downKeys,int mode){

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -988,7 +983,15 @@ public void onCheckedChanged(CompoundButton v,boolean ischecked){
}else{
inputScanner.setVisibility(View.INVISIBLE);
}
}
}else if(v == checkbox_modeswitch){
if(mode){
BoatClientActivity.this.mouseCursor.setVisibility(View.VISIBLE);
mode = false;
}else{
BoatClientActivity.this.mouseCursor.setVisibility(View.INVISIBLE);
mode = true;
}
}
}
};

Expand Down Expand Up @@ -1020,7 +1023,7 @@ public void onFinish() {

//时序
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -1089,7 +1092,7 @@ private void OnClickTouchPad(MotionEvent p1){
if(!TOUCH_LONG_APPLY && !TOUCH_IS_MOVED){
BoatInputEventSender.setMouseButton((byte)3,true);
try {
Thread.sleep(0);
Thread.sleep(PAUSE_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
4 changes: 2 additions & 2 deletions mcinabox/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.aof.mcinabox"
minSdkVersion 21
targetSdkVersion 21
versionCode 3
versionName '0.1.2'
versionCode 4
versionName '0.1.3'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file removed mcinabox/release/mcinabox-release.apk
Binary file not shown.

0 comments on commit 2adb504

Please sign in to comment.