diff --git a/app/build.gradle b/app/build.gradle index 823d85f..1737b99 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "net.fengberd.minecraftpe_server" minSdkVersion 14 targetSdkVersion 21 - versionCode 1091 - versionName "1.0.9.1" + versionCode 1092 + versionName "1.0.9.2" vectorDrawables.useSupportLibrary = true } diff --git a/app/src/main/assets/urls.json b/app/src/main/assets/urls.json index a5edd59..3877d46 100644 --- a/app/src/main/assets/urls.json +++ b/app/src/main/assets/urls.json @@ -1,4 +1,5 @@ { + "version": 1, "jenkins": { "nukkit": [ "MengCraft|http://ci.mengcraft.com:8080/job/nukkit/", @@ -16,5 +17,7 @@ "[Abandoned]ClearSky-PHP7 (ZXDA)|https://jenkins.zxda.net/job/ClearSky-PHP7/", "[Abandoned]ClearSky-PHP5 (ZXDA)|https://jenkins.zxda.net/job/ClearSky-PHP5/" ] - } + }, + "source_code": "https://github.com/fengberd/PocketServer", + "binaries_download": "https://www.dropbox.com/sh/bk5l4pn1pzc406b/AABzdxQENP6vw_q3p0nrfyTaa?dl=0" } diff --git a/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java b/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java index 69a1430..1e502b5 100644 --- a/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java +++ b/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java @@ -24,12 +24,13 @@ public class MainActivity extends Activity implements Handler.Callback { - public static Handler actionHandler=null; public final static int ACTION_STOP_SERVICE=1, ACTION_START_FAILED_WARNING=2; public final static int CHOOSE_PHP_CODE=1, CHOOSE_JAVA_CODE=2; public static Intent serverIntent=null; + public static Handler actionHandler=null; + public static JSONObject urls_json=null; public static boolean nukkitMode=false, ansiMode=false; @@ -69,6 +70,12 @@ public void onCreate(Bundle savedInstanceState) setContentView(R.layout.activity_main); ConfigProvider.init(getSharedPreferences("config",0)); + + if(ConfigProvider.getBoolean("FirstRun",true)) + { + showReadmeDialog(); + } + ansiMode=ConfigProvider.getBoolean("ANSIMode",nukkitMode); nukkitMode=ConfigProvider.getBoolean("NukkitMode",nukkitMode); @@ -91,6 +98,8 @@ public void onCreate(Bundle savedInstanceState) toast(e.getMessage()); } + reloadUrls(); + actionHandler=new Handler(this); serverIntent=new Intent(this,ServerService.class); @@ -200,6 +209,9 @@ public boolean onOptionsItemSelected(MenuItem item) stopService(serverIntent); fragment_main.refreshElements(); break; + case R.id.menu_readme: + showReadmeDialog(); + break; default: return super.onOptionsItemSelected(item); } @@ -273,6 +285,84 @@ public void run() }); } + public void reloadUrls() + { + try + { + File file=new File(ServerUtils.getAppFilesDirectory(),"urls.json"); + if(!file.exists()) + { + copyAsset("urls.json",file); + } + if(file.length()<2) + { + file.delete(); + reloadUrls(); + return; + } + + int current_version=0; + InputStream is=getAssets().open("urls.json"); + byte[] data=new byte[is.available()]; + is.read(data); + is.close(); + current_version=new JSONObject(new String(data,"UTF-8")).getInt("version"); + + is=new FileInputStream(file); + data=new byte[(int)file.length()]; + is.read(data); + is.close(); + JSONObject json=new JSONObject(new String(data,"UTF-8")); + + if(!json.has("version") || json.getInt("version") diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml index 22215c1..f6017c9 100644 --- a/app/src/main/res/menu/main.xml +++ b/app/src/main/res/menu/main.xml @@ -14,4 +14,7 @@ + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index ed45e6d..5d40ded 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -26,13 +26,16 @@ Thanks to everyone above! PocketMine 通用 - Firebase統計 - Firebase統計能幫助我改進這個APP或者知道哪些地方出了問題,如果你沒有Google服務框架或者非常不想使用這個統計系統你可以關掉它. + 自動掛載Java運行庫 + 在你開啟伺服器的時候自動掛載Java運行庫. 使用 ku.sud 請求root許可權 使用 "ku.sud" 命令而不是 "su" 請求root許可權,只對KingRoot有效. + Firebase統計 + Firebase統計能幫助我改進這個APP或者知道哪些地方出了問題,如果你沒有Google服務框架或者非常不想使用這個統計系統你可以關掉它. 安裝PHP 手動安裝PHP7 安裝Java + 下載可執行文件(Java/PHP等) 從伺服器更新源 控制台 啟用ANSI支持 @@ -61,6 +64,11 @@ Thanks to everyone above! 伺服器啟動失敗 你的伺服器沒有正常啟動,它在3秒鐘內被關閉了.\n這可能是以下原因造成的:\n\n· 伺服器核心崩潰\n· 設備內存太小\n· 設備ABI不受支持或者你使用了一個錯誤的Binary文件\n· 你自己關掉了伺服器\n\n以上的所有錯誤我都不能解決,請聯繫你正在使用的核心的開發者尋求幫助.\n在Google Play留一星評論沒有任何效果 + 使用前必讀 + /sdcard/PocketMine 或者 /sdcard/Nukkit\n· \"為什麼這玩意卡到飛起甚至把系統卡死了?\"–>你的設備性能太差了,畢竟它只是個手機/平板而不是搭載E5–2699的伺服器...\n· 控制台里出現\"Login Timeout\" 或者 \"XXX 錯誤\"->伺服器核心的問題,我無能為力\n· 一些類似 \"No such file or directory\" 的控制台輸出->你的設備不受支持,無法解決.\n· ABI不受支持的對話框->我只提供x86和armeabi支持.\n· \"伺服器IP/埠是多少?\",\"伺服器進不去!!!\"->卸載就行了,我不會在Google Play上回復你.\n· PocketMine伺服器突然關閉,沒有錯誤信息->核心問題或者PHP問題\n\n這是一個讓你在移動設備上運行\"伺服器核心\"的APP,\"伺服器核心\"不是我寫的,出問題請找它們的開發者.\n作為一個高中生不可能經常更新這個APP,出問題請耐心等待.\n\n如果你碰到問題然後不想幫助我修復,卸載這個APP然後忘了它就行了]]> + 退出 + 同意並繼續 + 伺服器管理 伺服器類型 把 PocketMine-MP.phar 或 src 資料夾放至 /sdcard/PocketMine diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index a3d2e80..e46d177 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -25,13 +25,16 @@ Thanks to everyone above! PocketMine 通用 - Firebase统计 - Firebase统计能帮助我改进这个APP或者知道哪些地方出了问题,如果你没有Google服务框架或者非常不想使用这个统计系统你可以关掉它. + 自动挂载Java运行库 + 在你开启服务器的时候自动挂载Java运行库. 使用 ku.sud 请求root权限 使用 "ku.sud" 命令而不是 "su" 请求root权限,只对KingRoot有效. + Firebase统计 + Firebase统计能帮助我改进这个APP或者知道哪些地方出了问题,如果你没有Google服务框架或者非常不想使用这个统计系统你可以关掉它. 安装PHP 手动安装PHP7 安装Java + 下载可执行文件(Java/PHP等) 从服务器更新源 控制台 启用ANSI支持 @@ -60,6 +63,11 @@ Thanks to everyone above! 服务器启动失败 你的服务器没有正常启动,它在3秒钟内被关闭了.\n这可能是以下原因造成的:\n\n· 服务器核心崩溃\n· 设备内存太小\n· 设备ABI不受支持或者你使用了一个错误的Binary文件\n· 你自己关掉了服务器\n\n以上的所有错误我都不能解决,请联系你正在使用的核心的开发者寻求帮助.\n在Google Play留一星评论没有任何效果 + 使用前必读 + /sdcard/PocketMine 或者 /sdcard/Nukkit\n· \"为什么这玩意卡到飞起甚至把系统卡死了?\"–>你的设备性能太差了,毕竟它只是个手机/平板而不是搭载E5–2699的服务器...\n· 控制台里出现\"Login Timeout\" 或者 \"XXX 错误\"->服务器核心的问题,我无能为力\n· 一些类似 \"No such file or directory\" 的控制台输出->你的设备不受支持,无法解决.\n· ABI不受支持的对话框->我只提供x86和armeabi支持.\n· \"服务器IP/端口是多少?\",\"服务器进不去!!!\"->卸载就行了,我不会在Google Play上回复你.\n· PocketMine服务器突然关闭,没有错误信息->核心问题或者PHP问题\n\n这是一个让你在移动设备上运行\"服务器核心\"的APP,\"服务器核心\"不是我写的,出问题请找它们的开发者.\n作为一个高中生不可能经常更新这个APP,出问题请耐心等待.\n\n如果你碰到问题然后不想帮助我修复,卸载这个APP然后忘了它就行了]]> + 退出 + 同意并继续 + 服务器管理 服务器类型 把 PocketMine-MP.phar 或 src 文件夹放到 /sdcard/PocketMine diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4cb7e12..2d2d3b7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,13 +25,16 @@ Thanks to everyone above! PocketMine General - Firebase Analytics - Firebase Analytics can help me to improve this app and let me know if there\'s anything wrong,if you really mind this you can turn it off. + Auto mount java library + Mount java library automatically when you start the server. Use ku.sud to request root Request root by "ku.sud" command instead of "su",only works with KingRoot. + Firebase Analytics + Firebase Analytics can help me to improve this app and let me know if there\'s anything wrong,if you really mind this you can turn it off. Install PHP Install PHP manually Install Java + Download Binaries(Java/PHP etc.) Update Repositories From Server Console Enable ANSI support @@ -58,7 +61,13 @@ Thanks to everyone above! Ignore Failed To Start Server - Your server isn\'t started correctly because it\'s stopped in 3 seconds.\nThis might caused by following reasons:\n\n· Server software crashed\n· Device memory too low\n· Device ABI not supported or you are using a wrong binary\n· You shut down the server manually\n\nAll reasons above CANNOT BE SOLVED BY THE DEVELOPER OF POCKET SERVER,please contact THE DEVELOPER OF SERVER SOFTWARE THAT YOU ARE USING for help.\nLEAVE A 1 STAR COMMENT IN GOOGLE PLAY TAKES NO EFFECT! + Your server isn\'t started correctly because it\'s stopped in 3 seconds.\nThis might caused by following reasons:\n\n· Server software crashed\n· Device memory too low\n· Device ABI not supported or you are using a wrong binary\n· You shut down the server manually\n\nAll reasons above CANNOT BE SOLVED BY THE DEVELOPER OF POCKET SERVER,please contact THE DEVELOPER OF SERVER SOFTWARE THAT YOU ARE USING for help.\nLEAVING 1 STAR REVIEW TAKES NO EFFECT + + + READ BEFORE USE + /sdcard/PocketMine or /sdcard/Nukkit\n· \"Why it\'s so lagggg even freezing my system?\"–>Casued by your device,it\'s just a phone or tablet instead of a server with E5–2699...\n· \"Login Timeout\" or \"XXX Error\" in console->Casued by server softwares\n· Some strange output like \"No such file or directory\" in console->This is something like ABI not supported,it\'s caused by your device.\n· ABI Not Supported dialog->Only supported x86 and armeabi devices.\n· \"How do I get the IP address and port for my server?\",\"I can\'t join the server!!!S**t app!!!\"->Just uninstall it,I\'ll not reply you in Google Play.\n· PocketMine server stopped suddenly with no extra messages->Caused by server softwares or PHP binaries\n\nThis app is a platform to let you run \"Server Software\" on your devices,\"Server Software\" isn\'t developed by me,you should contact the developer of them to fix these problems.\nAs a student I CANNOT update this app frequently,please be patient.\n\nIF THIS APP DOES NOT WORK AND YOU ARE NOT INTERESTED IN HELP ME TO FIX IT,JUST CLICK THE UNINSTALL BUTTON]]> + Exit + Agree & Continue Server Management Server Type diff --git a/app/src/main/res/xml/config.xml b/app/src/main/res/xml/config.xml index 23789cd..a7d972a 100644 --- a/app/src/main/res/xml/config.xml +++ b/app/src/main/res/xml/config.xml @@ -4,6 +4,12 @@ + + + +