├── .gitignore ├── gif └── 20221026_150902.gif ├── gcandroid ├── src │ ├── README.md │ ├── color.py │ ├── check.py │ ├── download.py │ └── extract.py ├── editConfigJson.sh ├── Edit_Config_Json │ ├── Server │ │ ├── logcommands.sh │ │ ├── game │ │ │ ├── logPackets.sh │ │ │ ├── enableConsole.sh │ │ │ ├── isShowLoopPackets.sh │ │ │ ├── isShowPacketPayload.sh │ │ │ ├── enableScriptInBigWorld.sh │ │ │ ├── gameOptions │ │ │ │ ├── energyUsage.sh │ │ │ │ ├── staminaUsage.sh │ │ │ │ ├── enableShopItems.sh │ │ │ │ ├── fishhookTeleport.sh │ │ │ │ ├── watchGachaConfig.sh │ │ │ │ ├── resinOptions │ │ │ │ │ ├── resinUsage.sh │ │ │ │ │ ├── cap.sh │ │ │ │ │ ├── rechargeTime.sh │ │ │ │ │ └── resinOptions.sh │ │ │ │ ├── rates │ │ │ │ │ ├── leyLines.sh │ │ │ │ │ ├── mora.sh │ │ │ │ │ ├── adventureExp.sh │ │ │ │ │ └── rates.sh │ │ │ │ ├── sceneEntityLimit.sh │ │ │ │ ├── inventoryLimits │ │ │ │ │ ├── all.sh │ │ │ │ │ ├── materials.sh │ │ │ │ │ ├── relics.sh │ │ │ │ │ ├── weapons.sh │ │ │ │ │ ├── furniture.sh │ │ │ │ │ └── inventoryLimits.sh │ │ │ │ ├── avatarLimits │ │ │ │ │ ├── singlePlayerTeam.sh │ │ │ │ │ ├── multiplayerTeam.sh │ │ │ │ │ └── avatarLimits.sh │ │ │ │ └── gameOptions.sh │ │ │ ├── accessPort.sh │ │ │ ├── bindPort.sh │ │ │ ├── kcpInterval.sh │ │ │ ├── loadEntitiesForPlayerRange.sh │ │ │ ├── accessAddress.sh │ │ │ ├── bindAddress.sh │ │ │ └── game.sh │ │ ├── http │ │ │ ├── encryption │ │ │ │ ├── useInRouting.sh │ │ │ │ ├── useEncryption.sh │ │ │ │ ├── keystore.sh │ │ │ │ ├── keystorePassword.sh │ │ │ │ └── encryption.sh │ │ │ ├── accessPort.sh │ │ │ ├── policies │ │ │ │ ├── cors │ │ │ │ │ ├── enabled.sh │ │ │ │ │ └── cors.sh │ │ │ │ └── policies.sh │ │ │ ├── files │ │ │ │ ├── errorFile.sh │ │ │ │ ├── indexFile.sh │ │ │ │ └── files.sh │ │ │ ├── accessAddress.sh │ │ │ ├── bindAddress.sh │ │ │ └── Http.sh │ │ ├── runMode.sh │ │ └── Server.sh │ ├── language │ │ ├── document.sh │ │ ├── fallback.sh │ │ ├── language_1.sh │ │ └── language.sh │ ├── databaseInfo │ │ ├── server │ │ │ ├── collection.sh │ │ │ ├── connectionUri.sh │ │ │ └── server.sh │ │ ├── game │ │ │ ├── connectionUri.sh │ │ │ ├── collection.sh │ │ │ └── game.sh │ │ └── databaseInfo.sh │ ├── folderStructure │ │ ├── data.sh │ │ ├── packets.sh │ │ ├── plugins.sh │ │ ├── scripts.sh │ │ ├── resources.sh │ │ └── folderStructure.sh │ └── configjsonMain.sh ├── update.sh ├── removePlugin.sh ├── resetConfigjson.sh ├── compileGrasscutter.sh ├── changePort.sh ├── runGrasscutter.sh ├── GM_Handbook │ └── avatars.txt ├── generateHandbook.sh ├── cli │ └── installGrasscutter.sh ├── spin.sh ├── settingsRepo.sh ├── generateKeystore.sh ├── EditBanners.sh ├── gcandroidTools.sh ├── installPlugin.sh ├── installGrasscutter.sh └── getConfigjson.sh ├── dos2unix.sh ├── import.bat ├── README.md ├── .vscode └── settings.json ├── Code └── gcandroid.sh └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | test.sh 2 | import.sh 3 | -------------------------------------------------------------------------------- /gif/20221026_150902.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ElaXan/GCAndroid/HEAD/gif/20221026_150902.gif -------------------------------------------------------------------------------- /gcandroid/src/README.md: -------------------------------------------------------------------------------- 1 | # GCAndroid 2 | 3 | This code is only stored here first, because it is not yet stable or needs to be fixed a lot, before using it on the project 4 | -------------------------------------------------------------------------------- /dos2unix.sh: -------------------------------------------------------------------------------- 1 | 2 | # This code for converting dos to unix format from Windows to Linux (Termux) 3 | 4 | dir='GCAndroid' 5 | 6 | cd "$HOME/.ElaXan" || exit 1 7 | 8 | for file in $(find "$dir" -type f); do 9 | dos2unix "$file" 10 | done -------------------------------------------------------------------------------- /gcandroid/editConfigJson.sh: -------------------------------------------------------------------------------- 1 | editJsonJq() { 2 | cd $grasscutter_path || exit 1 3 | fileConfig="config.json" 4 | jq .$1 $fileConfig > ZEdit.json 5 | rm $fileConfig 6 | mv ZEdit.json $fileConfig 7 | $editConfigJson_Back 8 | } -------------------------------------------------------------------------------- /gcandroid/src/color.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class color: 4 | def __init__(self) -> None: 5 | self.green = "\033[1;32m" 6 | self.red = "\033[1;31m" 7 | self.white = "\033[0;37m" 8 | self.magenta = "\033[1;35m" 9 | -------------------------------------------------------------------------------- /import.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd .. 3 | scp -r GCAndroid Termux:~/.ElaXan 4 | ssh Termux -- ln -sv $HOME/.ElaXan/GCAndroid/Code/gcandroid.sh $PREFIX/bin/gcandroid 5 | ssh Termux -- chmod +x $PREFIX/bin/gcandroid 6 | ssh Termux -- bash $HOME/.ElaXan/GCAndroid/dos2unix.sh 7 | pause 8 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/logcommands.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_logcommands() { 2 | editConfigJson_Back="edit_configjson_Server_main" 3 | if [ $logCommands = "true" ]; then 4 | editJsonJq "server.logCommands=false" 5 | elif [ $logCommands = "false" ]; then 6 | editJsonJq "server.logCommands=true" 7 | fi 8 | } 9 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/logPackets.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_logPackets() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | if [[ $server_game_logPackets == "ALL" ]]; then 4 | editJsonJq "server.game.logPackets=\"NONE\"" 5 | elif [[ $server_game_logPackets == "NONE" ]]; then 6 | editJsonJq "server.game.logPackets=\"ALL\"" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/enableConsole.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_enableConsole() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | if [[ $server_game_enableConsole == "true" ]]; then 4 | editJsonJq "server.game.enableConsole=false" 5 | elif [[ $server_game_enableConsole == "false" ]]; then 6 | editJsonJq "server.game.enableConsole=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/isShowLoopPackets.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_isShowLoopPackets() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | if [[ $server_game_isShowLoopPackets == "true" ]]; then 4 | editJsonJq "server.game.isShowLoopPackets=false" 5 | elif [[ $server_game_isShowLoopPackets == "false" ]]; then 6 | editJsonJq "server.game.isShowLoopPackets=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/isShowPacketPayload.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_isShowPacketPayload() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | if [[ $server_game_isShowPacketPayload == "true" ]]; then 4 | editJsonJq "server.game.isShowPacketPayload=false" 5 | elif [[ $server_game_isShowPacketPayload == "false" ]]; then 6 | editJsonJq "server.game.isShowPacketPayload=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/enableScriptInBigWorld.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_enableScriptInBigWorld() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | if [[ $server_game_enableScriptInBigWorld == "true" ]]; then 4 | editJsonJq "server.game.enableScriptInBigWorld=false" 5 | elif [[ $server_game_enableScriptInBigWorld == "false" ]]; then 6 | editJsonJq "server.game.enableScriptInBigWorld=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/encryption/useInRouting.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_encryption_useInRouting() { 2 | editConfigJson_Back="edit_configjson_Server_http_encryption" 3 | if [ $server_http_encryption_useInRouting = "true" ]; then 4 | editJsonJq "server.http.encryption.useInRouting=false" 5 | elif [ $server_http_encryption_useInRouting = "false" ]; then 6 | editJsonJq "server.http.encryption.useInRouting=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/language/document.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_language_document() { 2 | editConfigJson_Back="edit_configjson_language" 3 | echo 4 | echo -n "${CCB}Enter custom document${WC} : ${YC}" 5 | read -r language_document_input 6 | echo -n "${WC}" 7 | if [ -z "$language_document_input" ]; then 8 | edit_configjson_language 9 | else 10 | editJsonJq "language.document=\"$language_document_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/language/fallback.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_language_fallback() { 2 | editConfigJson_Back="edit_configjson_language" 3 | echo 4 | echo -n "${CCB}Enter custom fallback${WC} : ${YC}" 5 | read -r language_fallback_input 6 | echo -n "${WC}" 7 | if [ -z "$language_fallback_input" ]; then 8 | edit_configjson_language 9 | else 10 | editJsonJq "language.fallback=\"$language_fallback_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/energyUsage.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_energyUsage() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions" 3 | if [[ $server_game_gameOptions_energyUsage == "false" ]]; then 4 | editJsonJq "server.game.gameOptions.energyUsage=true" 5 | elif [[ $server_game_gameOptions_energyUsage == "true" ]]; then 6 | editJsonJq "server.game.gameOptions.energyUsage=false" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/encryption/useEncryption.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_encryption_useEncryption() { 2 | editConfigJson_Back="edit_configjson_Server_http_encryption" 3 | if [ $server_http_encryption_useEncryption = "true" ]; then 4 | editJsonJq "server.http.encryption.useEncryption=false" 5 | elif [ $server_http_encryption_useEncryption = "false" ]; then 6 | editJsonJq "server.http.encryption.useEncryption=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/runMode.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_runMode() { 2 | editConfigJson_Back="edit_configjson_Server_main" 3 | if [ $runMode = "\"HYBRID\"" ]; then 4 | editJsonJq "server.runMode=\"DISPATCH_ONLY\"" 5 | elif [ $runMode = "\"DISPATCH_ONLY\"" ]; then 6 | editJsonJq "server.runMode=\"GAME_ONLY\"" 7 | elif [ $runMode = "\"GAME_ONLY\"" ]; then 8 | editJsonJq "server.runMode=\"HYBRID\"" 9 | fi 10 | } 11 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/language/language_1.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_language_language() { 2 | editConfigJson_Back="edit_configjson_language" 3 | echo 4 | echo -n "${CCB}Enter custom language${WC} : ${YC}" 5 | read -r language_language_input 6 | echo -n "${WC}" 7 | if [ -z "$language_language_input" ]; then 8 | edit_configjson_language 9 | else 10 | editJsonJq "language.language=\"$language_language_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/server/collection.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database_server_collection() { 2 | editConfigJson_Back="edit_configjson_database_server" 3 | echo 4 | echo -n "${CCB}Enter custom collection : ${YC}" 5 | read -r collection 6 | echo -n "${WC}" 7 | if [[ -z $collection ]]; then 8 | edit_configjson_database_server 9 | else 10 | editJsonJq "databaseInfo.server.collection=\"$collection\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/staminaUsage.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_staminaUsage() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions" 3 | if [[ $server_game_gameOptions_staminaUsage == "true" ]]; then 4 | editJsonJq "server.game.gameOptions.staminaUsage=false" 5 | elif [[ $server_game_gameOptions_staminaUsage == "false" ]]; then 6 | editJsonJq "server.game.gameOptions.staminaUsage=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/game/connectionUri.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database_game_connectionUri() { 2 | editConfigJson_Back="edit_configjson_database_game" 3 | echo 4 | echo -n "${CCB}Enter custom connectionUri : ${YC}" 5 | read -r connectionUri 6 | echo -n "${WC}" 7 | if [[ -z $connectionUri ]]; then 8 | edit_configjson_database_game 9 | else 10 | editJsonJq "databaseInfo.game.connectionUri=\"$connectionUri\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/enableShopItems.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_enableShopItems() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions" 3 | if [[ $server_game_gameOptions_enableShopItems == "true" ]]; then 4 | editJsonJq "server.game.gameOptions.enableShopItems=false" 5 | elif [[ $server_game_gameOptions_enableShopItems == "false" ]]; then 6 | editJsonJq "server.game.gameOptions.enableShopItems=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/server/connectionUri.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database_server_connectionUri() { 2 | editConfigJson_Back="edit_configjson_database_server" 3 | echo 4 | echo -n "${CCB}Enter custom connectionUri : ${YC}" 5 | read -r connectionUri 6 | echo -n "${WC}" 7 | if [[ -z $connectionUri ]]; then 8 | edit_configjson_database_server 9 | else 10 | editJsonJq "databaseInfo.server.connectionUri=\"$connectionUri\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/fishhookTeleport.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_fishhookTeleport() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions" 3 | if [[ $server_game_gameOptions_fishhookTeleport == "true" ]]; then 4 | editJsonJq "server.game.gameOptions.fishhookTeleport=false" 5 | elif [[ $server_game_gameOptions_fishhookTeleport == "false" ]]; then 6 | editJsonJq "server.game.gameOptions.fishhookTeleport=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/watchGachaConfig.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_watchGachaConfig() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions" 3 | if [[ $server_game_gameOptions_watchGachaConfig == "true" ]]; then 4 | editJsonJq "server.game.gameOptions.watchGachaConfig=false" 5 | elif [[ $server_game_gameOptions_watchGachaConfig == "false" ]]; then 6 | editJsonJq "server.game.gameOptions.watchGachaConfig=true" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/accessPort.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_accessPort() { 2 | editConfigJson_Back="edit_configjson_Server_http" 3 | echo 4 | echo -n "${CCB}Enter new accessPort : ${YC}" 5 | read -r edit_configjson_Server_http_accessPort_input 6 | if [[ $edit_configjson_Server_http_accessPort_input = "" ]]; then 7 | edit_configjson_Server_http 8 | else 9 | editJsonJq "server.http.accessPort=$edit_configjson_Server_http_accessPort_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/accessPort.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_accessPort() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | echo 4 | echo -n "${CCB}Enter custom accessPort : ${YC}" 5 | read -r edit_configjson_Server_game_accessPort_input 6 | if [[ $edit_configjson_Server_game_accessPort_input == "" ]]; then 7 | edit_configjson_Server_game 8 | else 9 | editJsonJq "server.game.accessPort=$edit_configjson_Server_game_accessPort_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/bindPort.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_bindPort() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | echo 4 | echo -n "${CCB}Enter custom bindPort : ${YC}" 5 | read -r edit_configjson_Server_game_bindPort_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_bindPort_input = "" ]]; then 8 | edit_configjson_Server_game 9 | else 10 | editJsonJq "server.game.bindPort=$edit_configjson_Server_game_bindPort_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/policies/cors/enabled.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_policies_cors_enabled() { 2 | editConfigJson_Back="edit_configjson_Server_http_policies_cors" 3 | if [[ $server_http_policies_cors_enabled == "true" ]]; then 4 | editJsonJq "server.http.policies.cors.enabled=false" 5 | elif [[ $server_http_policies_cors_enabled == "false" ]]; then 6 | editJsonJq "server.http.policies.cors.enabled=true" 7 | else 8 | edit_configjson_Server_http_policies_cors 9 | fi 10 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/folderStructure/data.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_folderStructure_data() { 2 | editConfigJson_Back="edit_configjson_folderStructure" 3 | echo 4 | echo -n "${CCB}Enter custom data : ${YC}" 5 | read -r edit_configjson_folderStructure_data_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_folderStructure_data_input == "" ]]; then 8 | edit_configjson_folderStructure 9 | else 10 | editJsonJq "folderStructure.data=\"$edit_configjson_folderStructure_data_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/resinOptions/resinUsage.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_resinOptions_resinUsage() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_resinOptions" 3 | if [[ $server_game_gameOptions_resinOptions_resinUsage == "false" ]]; then 4 | editJsonJq "server.game.gameOptions.resinOptions.resinUsage=true" 5 | elif [[ $server_game_gameOptions_resinOptions_resinUsage == "true" ]]; then 6 | editJsonJq "server.game.gameOptions.resinOptions.resinUsage=false" 7 | fi 8 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/kcpInterval.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_kcpInterval() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | echo 4 | echo -n "${CCB}Enter custom kcpInterval : ${YC}" 5 | read -r edit_configjson_Server_game_kcpInterval_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_kcpInterval_input == "" ]]; then 8 | edit_configjson_Server_game 9 | else 10 | editJsonJq "server.game.kcpInterval=$edit_configjson_Server_game_kcpInterval_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/folderStructure/packets.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_folderStructure_packets() { 2 | editConfigJson_Back="edit_configjson_folderStructure" 3 | echo 4 | echo -n "${CCB}Enter custom packets : ${YC}" 5 | read -r edit_configjson_folderStructure_packets_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_folderStructure_packets_input == "" ]]; then 8 | edit_configjson_folderStructure 9 | else 10 | editJsonJq "folderStructure.packets=\"$edit_configjson_folderStructure_packets_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/folderStructure/plugins.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_folderStructure_plugins() { 2 | editConfigJson_Back="edit_configjson_folderStructure" 3 | echo 4 | echo -n "${CCB}Enter custom plugins : ${YC}" 5 | read -r edit_configjson_folderStructure_plugins_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_folderStructure_plugins_input == "" ]]; then 8 | edit_configjson_folderStructure 9 | else 10 | editJsonJq "folderStructure.plugins=\"$edit_configjson_folderStructure_plugins_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/folderStructure/scripts.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_folderStructure_scripts() { 2 | editConfigJson_Back="edit_configjson_folderStructure" 3 | echo 4 | echo -n "${GC}Enter custom scripts : ${YC}" 5 | read -r edit_configjson_folderStructure_scripts_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_folderStructure_scripts_input == "" ]]; then 8 | edit_configjson_folderStructure 9 | else 10 | editJsonJq "folderStructure.scripts=\"$edit_configjson_folderStructure_scripts_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/game/collection.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database_game_collection() { 2 | editConfigJson_Back="edit_configjson_database_game" 3 | echo 4 | echo -n "${CCB}Enter custom collection : ${YC}" 5 | read -r edit_configjson_database_game_collection_input 6 | echo -n "${WC}" 7 | if [[ -z $edit_configjson_database_game_collection_input ]]; then 8 | edit_configjson_database_game 9 | else 10 | editJsonJq "databaseInfo.game.collection=\"$edit_configjson_database_game_collection_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/folderStructure/resources.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_folderStructure_resources() { 2 | editConfigJson_Back="edit_configjson_folderStructure" 3 | echo 4 | echo -n "${CCB}Enter custom resources : ${YC}" 5 | read -r edit_configjson_folderStructure_resources_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_folderStructure_resources_input == "" ]]; then 8 | edit_configjson_folderStructure 9 | else 10 | editJsonJq "folderStructure.resources=\"$edit_configjson_folderStructure_resources_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/files/errorFile.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_files_errorFile() { 2 | editConfigJson_Back="edit_configjson_Server_http_files" 3 | echo 4 | echo -n "${CCB}Emter custom errorFile : ${YC}" 5 | read -r edit_configjson_Server_http_files_errorFile_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_http_files_errorFile_input == "" ]]; then 8 | edit_configjson_Server_http_files 9 | else 10 | editJsonJq "server.http.files.errorFile=\"$edit_configjson_Server_http_files_errorFile_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/files/indexFile.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_files_indexFile() { 2 | editConfigJson_Back="edit_configjson_Server_http_files" 3 | echo 4 | echo -n "${CCB}Emter custom indexFile : ${YC}" 5 | read -r edit_configjson_Server_http_files_indexFile_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_http_files_indexFile_input == "" ]]; then 8 | edit_configjson_Server_http_files 9 | else 10 | editJsonJq "server.http.files.indexFile=\"$edit_configjson_Server_http_files_indexFile_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/encryption/keystore.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_encryption_keystore() { 2 | editConfigJson_Back="edit_configjson_Server_http_encryption" 3 | echo 4 | echo -n "${CCB}Enter custom keystore : ${YC}" 5 | read -r edit_configjson_Server_http_encryption_keystore_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_http_encryption_keystore_input = "" ]]; then 8 | edit_configjson_Server_http_encryption 9 | else 10 | editJsonJq "server.http.encryption.keystore=\"$edit_configjson_Server_http_encryption_keystore_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/rates/leyLines.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_rates_leyLines() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_rates" 3 | echo 4 | echo -n "${CCB}Enter custom leyLines : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_rates_leyLines_input 6 | if [[ $edit_configjson_Server_game_gameOptions_rates_leyLines_input == "" ]]; then 7 | edit_configjson_Server_game_gameOptions_rates 8 | else 9 | editJsonJq "server.game.gameOptions.rates.leyLines=$edit_configjson_Server_game_gameOptions_rates_leyLines_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/rates/mora.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_rates_mora() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_rates" 3 | echo 4 | echo -n "${CCB}Enter custom mora : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_rates_mora_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_rates_mora_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_rates 9 | else 10 | editJsonJq "server.game.gameOptions.rates.mora=$edit_configjson_Server_game_gameOptions_rates_mora_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/loadEntitiesForPlayerRange.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_loadEntitiesForPlayerRange() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | echo 4 | echo -n "${CCB}Enter custom loadEntitiesForPlayerRange : ${YC}" 5 | read -r edit_configjson_Server_game_loadEntitiesForPlayerRange_input 6 | echo "${WC}" 7 | if [[ $edit_configjson_Server_game_loadEntitiesForPlayerRange_input == "" ]]; then 8 | edit_configjson_Server_game 9 | else 10 | editJsonJq "server.game.loadEntitiesForPlayerRange=$edit_configjson_Server_game_loadEntitiesForPlayerRange_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/sceneEntityLimit.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_sceneEntityLimit() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions" 3 | echo 4 | echo -n "${CCB}Enter custom sceneEntityLimit : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_sceneEntityLimit_input 6 | if [[ $edit_configjson_Server_game_gameOptions_sceneEntityLimit_input == "" ]]; then 7 | edit_configjson_Server_game_gameOptions 8 | else 9 | editJsonJq "server.game.gameOptions.sceneEntityLimit=$edit_configjson_Server_game_gameOptions_sceneEntityLimit_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/resinOptions/cap.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_resinOptions_cap() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_resinOptions" 3 | echo 4 | echo -n "${CCB}Enter custom cap : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_resinOptions_cap_input 6 | if [[ $edit_configjson_Server_game_gameOptions_resinOptions_cap_input == "" ]]; then 7 | edit_configjson_Server_game_gameOptions_resinOptions 8 | else 9 | editJsonJq "server.game.gameOptions.resinOptions.cap=$edit_configjson_Server_game_gameOptions_resinOptions_cap_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/policies/policies.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_policies() { 2 | credit_hah 3 | Center_Text "Edit config.json [policies]" 4 | echo "1. ${CCB}cors${WC}" 5 | echo "0. ${RC}Back${WC}" 6 | echo 7 | echo -n "Enter input : " 8 | read -r edit_configjson_Server_http_policies_input 9 | case $edit_configjson_Server_http_policies_input in 10 | "1") edit_configjson_Server_http_policies_cors ;; 11 | "0") edit_configjson_Server_http ;; 12 | *) 13 | echo "${RC}Wrong Input!${WC}" 14 | sleep 0.5s 15 | edit_configjson_Server_http_policies 16 | ;; 17 | esac 18 | } 19 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/encryption/keystorePassword.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_encryption_keystorePassword() { 2 | editConfigJson_Back="edit_configjson_Server_http_encryption" 3 | echo 4 | echo -n "${CCB}Enter custom keystorePassword : ${YC}" 5 | read -r edit_configjson_Server_http_encryption_keystorePassword_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_http_encryption_keystorePassword_input = "" ]]; then 8 | edit_configjson_Server_http_encryption 9 | else 10 | editJsonJq "server.http.encryption.keystorePassword=\"$edit_configjson_Server_http_encryption_keystorePassword_input\"" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/src/check.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | def check_folder(path): 4 | """Checking if folder exists or not 5 | 6 | Args: 7 | path (_type_): _description_ 8 | 9 | Returns: 10 | _type_: _description_ 11 | """ 12 | if not os.path.exists(path): 13 | return False 14 | else: 15 | return True 16 | 17 | # Check if files exist 18 | def check_file(path): 19 | """Checking if file exists or not 20 | 21 | Args: 22 | path (_type_): _description_ 23 | 24 | Returns: 25 | _type_: _description_ 26 | """ 27 | if not os.path.isfile(path): 28 | return False 29 | else: 30 | return True -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/rates/adventureExp.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_rates_adventureExp() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_rates" 3 | echo 4 | echo -n "${CCB}Enter custom adventureExp : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_rates_adventureExp_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_rates_adventureExp_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_rates 9 | else 10 | editJsonJq "server.game.gameOptions.rates.adventureExp=$edit_configjson_Server_game_gameOptions_rates_adventureExp_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/inventoryLimits/all.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_inventoryLimits_all() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_inventoryLimits" 3 | echo 4 | echo -n "${CCB}Enter custom all : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_inventoryLimits_all_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_inventoryLimits_all_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_inventoryLimits 9 | else 10 | editJsonJq "server.game.gameOptions.inventoryLimits.all=$edit_configjson_Server_game_gameOptions_inventoryLimits_all_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/inventoryLimits/materials.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_inventoryLimits_materials() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_inventoryLimits" 3 | echo 4 | echo -n "${CCB}Enter custom materials : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_inventoryLimits_materials_input 6 | if [[ $edit_configjson_Server_game_gameOptions_inventoryLimits_materials_input == "" ]]; then 7 | edit_configjson_Server_game_gameOptions_inventoryLimits 8 | else 9 | editJsonJq "server.game.gameOptions.inventoryLimits.materials=$edit_configjson_Server_game_gameOptions_inventoryLimits_materials_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/inventoryLimits/relics.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_inventoryLimits_relics() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_inventoryLimits" 3 | echo 4 | echo -n "${CCB}Enter custom relics : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_inventoryLimits_relics_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_inventoryLimits_relics_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_inventoryLimits 9 | else 10 | editJsonJq "server.game.gameOptions.inventoryLimits.relics=$edit_configjson_Server_game_gameOptions_inventoryLimits_relics_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/inventoryLimits/weapons.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_inventoryLimits_weapons() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_inventoryLimits" 3 | echo 4 | echo -n "${CCB}Enter custom weapons : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_inventoryLimits_weapons_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_inventoryLimits_weapons_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_inventoryLimits 9 | else 10 | editJsonJq "server.game.gameOptions.inventoryLimits.weapons=$edit_configjson_Server_game_gameOptions_inventoryLimits_weapons_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/resinOptions/rechargeTime.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_resinOptions_rechargeTime() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_resinOptions" 3 | echo 4 | echo -n "${CCB}Enter custom rechargeTime : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_resinOptions_rechargeTime_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_resinOptions_rechargeTime_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_resinOptions 9 | else 10 | editJsonJq "server.game.gameOptions.resinOptions.rechargeTime=$edit_configjson_Server_game_gameOptions_resinOptions_rechargeTime_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/accessAddress.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_accessAddress() { 2 | editConfigJson_Back="edit_configjson_Server_http" 3 | echo 4 | echo -n "${CCB}Enter new accessAddress : ${YC}" 5 | read -r edit_configjson_Server_http_accessAddress_input 6 | if [[ $edit_configjson_Server_http_accessAddress_input = "" ]]; then 7 | edit_configjson_Server_http 8 | elif ! (echo $edit_configjson_Server_http_accessAddress_input | grep ".*\..*\..*\..*" &> /dev/null); then 9 | echo "${RC}Error${WC}" 10 | sleep 0.3s 11 | edit_configjson_Server_http 12 | else 13 | editJsonJq "server.http.accessAddress=\"$edit_configjson_Server_http_accessAddress_input\"" 14 | fi 15 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/accessAddress.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_accessAddress() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | echo 4 | echo -n "${CCB}Enter custom accessAddress : ${YC}" 5 | read -r edit_configjson_Server_game_accessAddress_input 6 | if [[ $edit_configjson_Server_game_accessAddress_input = "" ]]; then 7 | edit_configjson_Server_game 8 | elif ! (echo "$edit_configjson_Server_game_accessAddress_input" | grep ".*\..*\..*\..*" &> /dev/null); then 9 | echo "${RC}Error${WC}" 10 | sleep 0.3s 11 | edit_configjson_Server_game 12 | else 13 | editJsonJq "server.game.accessAddress=\"$edit_configjson_Server_game_accessAddress_input\"" 14 | fi 15 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/avatarLimits/singlePlayerTeam.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_avatarLimits_singlePlayerTeam() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_avatarLimits" 3 | echo 4 | echo -n "${CCB}Enter custom singlePlayerTeam : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_avatarLimits_singlePlayerTeam_input 6 | if [[ $edit_configjson_Server_game_gameOptions_avatarLimits_singlePlayerTeam_input == "" ]]; then 7 | edit_configjson_Server_game_gameOptions_avatarLimits 8 | else 9 | editJsonJq "server.game.gameOptions.avatarLimits.singlePlayerTeam=$edit_configjson_Server_game_gameOptions_avatarLimits_singlePlayerTeam_input" 10 | fi 11 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/inventoryLimits/furniture.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_inventoryLimits_furniture() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_inventoryLimits" 3 | echo 4 | echo -n "${CCB}Enter custom furniture : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_inventoryLimits_furniture_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_inventoryLimits_furniture_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_inventoryLimits 9 | else 10 | editJsonJq "server.game.gameOptions.inventoryLimits.furniture=$edit_configjson_Server_game_gameOptions_inventoryLimits_furniture_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/bindAddress.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_bindAddress() { 2 | editConfigJson_Back="edit_configjson_Server_game" 3 | echo 4 | echo -n "${CCB}Enter custom bindAddress : ${YC}" 5 | read -r edit_configjson_Server_game_bindAddress_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_bindAddress_input = "" ]]; then 8 | edit_configjson_Server_game 9 | elif ! (echo "$edit_configjson_Server_game_bindAddress_input" | grep ".*\..*\..*\..*" &> /dev/null); then 10 | echo "${RC}Error${WC}" 11 | sleep 0.3s 12 | edit_configjson_Server_game 13 | else 14 | editJsonJq "server.game.bindAddress=\"$edit_configjson_Server_game_bindAddress_input\"" 15 | fi 16 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/bindAddress.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_bindAddress() { 2 | echo 3 | echo -n "${CCB}Enter new bindAddress : ${YC}" 4 | read -r edit_configjson_Server_http_bindAddress_input 5 | echo -n "${RC}" 6 | if [[ $edit_configjson_Server_http_bindAddress_input = "" ]]; then 7 | edit_configjson_Server_http 8 | elif ! (echo $edit_configjson_Server_http_bindAddress_input | grep ".*\..*\..*\..*" &> /dev/null); then 9 | echo "${RC}Error${WC}" 10 | sleep 0.3s 11 | edit_configjson_Server_http 12 | else 13 | editConfigJson_Back="edit_configjson_Server_http" 14 | editJsonJq "server.http.bindAddress=\"$edit_configjson_Server_http_bindAddress_input\"" 15 | fi 16 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/avatarLimits/multiplayerTeam.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_avatarLimits_multiplayerTeam() { 2 | editConfigJson_Back="edit_configjson_Server_game_gameOptions_avatarLimits" 3 | echo 4 | echo -n "${CCB}Enter custom multiplayerTeam : ${YC}" 5 | read -r edit_configjson_Server_game_gameOptions_avatarLimits_multiplayerTeam_input 6 | echo -n "${WC}" 7 | if [[ $edit_configjson_Server_game_gameOptions_avatarLimits_multiplayerTeam_input == "" ]]; then 8 | edit_configjson_Server_game_gameOptions_avatarLimits 9 | else 10 | editJsonJq "server.game.gameOptions.avatarLimits.multiplayerTeam=$edit_configjson_Server_game_gameOptions_avatarLimits_multiplayerTeam_input" 11 | fi 12 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/policies/cors/cors.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_policies_cors() { 2 | credit_hah 3 | Center_Text "Edit config.json [cors]" 4 | getConfigJson "Server.http.policies.cors" 5 | echo "1. [$server_http_policies_cors_enabledOut] enabled" 6 | echo "0. ${RC}Back${WC}" 7 | echo 8 | echo -n "Enter input : " 9 | read -r edit_configjson_Server_http_policies_cors_input 10 | case $edit_configjson_Server_http_policies_cors_input in 11 | "1") edit_configjson_Server_http_policies_cors_enabled ;; 12 | "0") edit_configjson_Server_http_policies ;; 13 | *) 14 | echo "${RC}Wrong Input!${WC}" 15 | sleep 0.5 16 | edit_configjson_Server_http_policies_cors 17 | ;; 18 | esac 19 | } 20 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/databaseInfo.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database() { 2 | credit_hah 3 | Center_Text "Edit config.json [Database]" 4 | echo "1. ${CCB}Game${WC}" 5 | echo "2. ${CCB}Server${WC}" 6 | echo "0. ${RC}Back${WC}" 7 | echo 8 | echo -n "Enter input : " 9 | read -r edit_configjson_database_input 10 | case $edit_configjson_database_input in 11 | 1) 12 | edit_configjson_database_game 13 | ;; 14 | 2) 15 | edit_configjson_database_server 16 | ;; 17 | 0) 18 | edit_configjson 19 | ;; 20 | *) 21 | echo -e "${RC}Invalid input!${WC}" 22 | sleep 0.5s 23 | edit_configjson_database 24 | ;; 25 | esac 26 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/configjsonMain.sh: -------------------------------------------------------------------------------- 1 | edit_configjson() { 2 | cd $grasscutter_path || exit 1 3 | credit_hah 4 | Center_Text "Edit config.json [MAIN]" 5 | echo "1. ${CCB}folderStructure${WC}" 6 | echo "2. ${CCB}Database${WC}" 7 | echo "3. ${CCB}language${WC}" 8 | echo "4. ${CCB}Server${WC}" 9 | echo "0. ${RC}Back${WC}" 10 | echo 11 | echo -n "Enter input : " 12 | read -r edit_configjson_input 13 | case $edit_configjson_input in 14 | "1") edit_configjson_folderStructure ;; 15 | "2") edit_configjson_database ;; 16 | "3") edit_configjson_language ;; 17 | "4") edit_configjson_Server_main ;; 18 | "0") menu_config ;; 19 | *) 20 | echo "${RC}Wrong input!${WC}" 21 | sleep 0.5s 22 | edit_configjson 23 | ;; 24 | esac 25 | } 26 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/files/files.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_files() { 2 | credit_hah 3 | Center_Text "Edit config.json [files]" 4 | getConfigJson "server.http.files" 5 | echo "1. [${GC}$server_http_files_indexFile${WC}] indexFile" 6 | echo "2. [${GC}$server_http_files_errorFIle${WC}] errorFile" 7 | echo "0. ${RC}Back${WC}" 8 | echo 9 | echo -n "Enter input : " 10 | read -r edit_configjson_Server_http_files_input 11 | case $edit_configjson_Server_http_files_input in 12 | "1") edit_configjson_Server_http_files_indexFile ;; 13 | "2") edit_configjson_Server_http_files_errorFile ;; 14 | "0") edit_configjson_Server_http ;; 15 | *) 16 | echo "${RC}Wrong input!${WC}" 17 | sleep 0.5s 18 | edit_configjson_Server_http_files 19 | ;; 20 | esac 21 | } 22 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/language/language.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_language() { 2 | credit_hah 3 | Center_Text "Edit config.json [language]" 4 | getConfigJson "language" 5 | echo "1. [${GC}$language_language${WC}] language" 6 | echo "2. [${GC}$language_fallback${WC}] fallback" 7 | echo "3. [${GC}$language_document${WC}] document" 8 | echo "0. ${RC}Back${WC}" 9 | echo 10 | echo -n "Enter input : " 11 | read -r edit_configjson_language_input 12 | case $edit_configjson_language_input in 13 | "1") edit_configjson_language_language ;; 14 | "2") edit_configjson_language_fallback ;; 15 | "3") edit_configjson_language_document ;; 16 | "0") edit_configjson ;; 17 | *) 18 | echo "${RC}Wrong input!${WC}" 19 | sleep 0.5s 20 | edit_configjson_language 21 | ;; 22 | esac 23 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/server/server.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database_server() { 2 | credit_hah 3 | Center_Text "Edit config.json [Server]" 4 | getConfigJson "databaseInfo.server" 5 | echo "1. [${GC}$databaseInfo_server_connectionUri${WC}] connectionUri" 6 | echo "2. [${GC}$databaseInfo_server_collection${WC}] collection" 7 | echo "0. ${RC}Back${WC}" 8 | echo 9 | echo -n "Enter input : " 10 | read -r edit_configjson_database_server_input 11 | case $edit_configjson_database_server_input in 12 | "1") edit_configjson_database_server_connectionUri ;; 13 | "2") edit_configjson_database_server_collection ;; 14 | "0") edit_configjson_database ;; 15 | *) 16 | echo "${RC}Wrong input!${WC}" 17 | sleep 0.5s 18 | edit_configjson_database_server 19 | ;; 20 | esac 21 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/Server.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_main() { 2 | credit_hah 3 | cd $grasscutter_path || exit 1 4 | getConfigJson "Server" 5 | echo "${YC} Still Development${WC}" 6 | Center_Text "Edit config.json [SERVER]" 7 | echo "1. [$logCommandsOut] logCommand" 8 | echo "2. [$runModeOut] runMode" 9 | echo "3. ${CCB}http${WC}" 10 | echo "4. ${CCB}game${WC}" 11 | echo "0. ${RC}Back${WC}" 12 | echo 13 | echo -n "Enter input : " 14 | read -r edit_configjson_main_input 15 | case $edit_configjson_main_input in 16 | "1") edit_configjson_Server_logcommands ;; 17 | "2") edit_configjson_Server_runMode ;; 18 | "3") edit_configjson_Server_http ;; 19 | "4") edit_configjson_Server_game ;; 20 | "0") edit_configjson ;; 21 | *) 22 | echo "${RC}Wrong input!${WC}" 23 | sleep 1s 24 | edit_configjson_Server_main 25 | ;; 26 | esac 27 | } 28 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/databaseInfo/game/game.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_database_game() { 2 | credit_hah 3 | Center_Text "Edit config.json [Game]" 4 | getConfigJson "databaseInfo.game" 5 | echo "1. [${GC}$databaseInfo_game_connectionUri${WC}] connectionUri" 6 | echo "2. [${GC}$databaseInfo_game_collection${WC}] collection" 7 | echo "0. ${RC}Back${WC}" 8 | echo 9 | echo -n "Enter input : " 10 | read -r edit_configjson_database_game_input 11 | case $edit_configjson_database_game_input in 12 | 1) 13 | edit_configjson_database_game_connectionUri 14 | ;; 15 | 2) 16 | edit_configjson_database_game_collection 17 | ;; 18 | 0) 19 | edit_configjson_database 20 | ;; 21 | *) 22 | echo -e "${RC}Invalid input!${WC}" 23 | sleep 0.5s 24 | edit_configjson_database_game 25 | ;; 26 | esac 27 | } -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/avatarLimits/avatarLimits.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_avatarLimits() { 2 | credit_hah 3 | Center_Text "Edit config.json [avatarLimits]" 4 | getConfigJson "server.game.gameOptions.avatarLimits" 5 | echo "1. [${GC}$server_game_gameOptions_avatarLimits_singlePlayerTeam${WC}] singlePlayerTeam" 6 | echo "2. [${GC}$server_game_gameOptions_avatarLimits_multiplayerTeam${WC}] multiplayerTeam" 7 | echo "0. ${RC}Back${WC}" 8 | echo 9 | echo -n "Enter input : " 10 | read -r edit_configjson_Server_game_gameOptions_avatarLimits_input 11 | case $edit_configjson_Server_game_gameOptions_avatarLimits_input in 12 | "1") edit_configjson_Server_game_gameOptions_avatarLimits_singlePlayerTeam ;; 13 | "2") edit_configjson_Server_game_gameOptions_avatarLimits_multiplayerTeam ;; 14 | "0") edit_configjson_Server_game_gameOptions ;; 15 | *) 16 | echo "${RC}Wrong Input!${WC}" 17 | sleep 0.5s 18 | edit_configjson_Server_game_gameOptions_avatarLimits 19 | ;; 20 | esac 21 | } 22 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/rates/rates.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_rates() { 2 | credit_hah 3 | Center_Text "Edit config.json [rates]" 4 | getConfigJson "server.game.gameOptions.rates" 5 | echo "1. [${GC}$server_game_gameOptions_rates_adventureExp${WC}] adventureExp" 6 | echo "2. [${GC}$server_game_gameOptions_rates_mora${WC}] mora" 7 | echo "3. [${GC}$server_game_gameOptions_rates_leyLines${WC}] leyLines" 8 | echo "0. ${RC}Back${WC}" 9 | echo 10 | echo -n "Enter input : " 11 | read -r edit_configjson_Server_game_gameOptions_rates_input 12 | case $edit_configjson_Server_game_gameOptions_rates_input in 13 | "1") edit_configjson_Server_game_gameOptions_rates_adventureExp ;; 14 | "2") edit_configjson_Server_game_gameOptions_rates_mora ;; 15 | "3") edit_configjson_Server_game_gameOptions_rates_leyLines ;; 16 | "0") edit_configjson_Server_game_gameOptions ;; 17 | *) 18 | echo "${RC}Wrong Input!${WC}" 19 | sleep 0.5s 20 | edit_configjson_Server_game_gameOptions_rates 21 | ;; 22 | esac 23 | } 24 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/Http.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http() { 2 | credit_hah 3 | Center_Text "Edit config.json [HTTP]" 4 | getConfigJson "Server.HTTP" 5 | echo "1. [${GC}$server_http_bindAddress${WC}] bindAddress" 6 | echo "2. [${GC}$server_http_accessAddress${WC}] accessAddress" 7 | echo "3. [${GC}$server_http_accessPort${WC}] accessPort" 8 | echo "4. ${CCB}encryption${WC}" 9 | echo "5. ${CCB}policies${WC}" 10 | echo "6. ${CCB}files${WC}" 11 | echo "0. ${RC}Back${WC}" 12 | echo 13 | echo -n "Enter input : " 14 | read -r edit_configjson_Server_http_input 15 | case $edit_configjson_Server_http_input in 16 | "1") edit_configjson_Server_http_bindAddress ;; 17 | "2") edit_configjson_Server_http_accessAddress ;; 18 | "3") edit_configjson_Server_http_accessPort ;; 19 | "4") edit_configjson_Server_http_encryption ;; 20 | "5") edit_configjson_Server_http_policies ;; 21 | "6") edit_configjson_Server_http_files ;; 22 | "0") edit_configjson_Server_main ;; 23 | *) 24 | echo "${RC}Wrong Input!${RC}" 25 | sleep 0.5s 26 | edit_configjson_Server_http 27 | ;; 28 | esac 29 | } 30 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/http/encryption/encryption.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_http_encryption() { 2 | credit_hah 3 | getConfigJson "Server.HTTP.Encryption" 4 | Center_Text "Edit config.json [Encryption]" 5 | echo "1. [$server_http_encryption_useEncryptionOut] useEncryption" 6 | echo "2. [$server_http_encryption_useInRoutingOut] useInRouting" 7 | echo "3. [${GC}$server_http_encryption_keystore${WC}] keystore" 8 | echo "4. [${GC}$server_http_encryption_keystorePassword${WC}] keystorePassword" 9 | echo "0. ${RC}Back${WC}" 10 | echo 11 | echo -n "Enter input : " 12 | read -r edit_configjson_Server_http_encryption_input 13 | case $edit_configjson_Server_http_encryption_input in 14 | "1") edit_configjson_Server_http_encryption_useEncryption ;; 15 | "2") edit_configjson_Server_http_encryption_useInRouting ;; 16 | "3") edit_configjson_Server_http_encryption_keystore ;; 17 | "4") edit_configjson_Server_http_encryption_keystorePassword ;; 18 | "0") edit_configjson_Server_http ;; 19 | *) 20 | echo "${RC}Wrong input!${WC}" 21 | sleep 0.3s 22 | edit_configjson_Server_http_encryption 23 | ;; 24 | esac 25 | } 26 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/resinOptions/resinOptions.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_resinOptions() { 2 | credit_hah 3 | Center_Text "Edit config.json [resinOptions]" 4 | getConfigJson "server.game.gameOptions.resinOptions" 5 | echo "1. [$server_game_gameOptions_resinOptions_resinUsageOut] resinUsage" 6 | echo "2. [${GC}$server_game_gameOptions_resinOptions_cap${WC}] cap" 7 | echo "3. [${GC}$server_game_gameOptions_resinOptions_rechargeTime${WC}] rechargeTime" 8 | echo "0. ${RC}Back${WC}" 9 | echo 10 | echo -n "Enter input : " 11 | read -r edit_configjson_Server_game_gameOptions_resinOptions_input 12 | case $edit_configjson_Server_game_gameOptions_resinOptions_input in 13 | "1") edit_configjson_Server_game_gameOptions_resinOptions_resinUsage ;; 14 | "2") edit_configjson_Server_game_gameOptions_resinOptions_cap ;; 15 | "3") edit_configjson_Server_game_gameOptions_resinOptions_rechargeTime ;; 16 | "0") edit_configjson_Server_game_gameOptions ;; 17 | *) 18 | echo "${RC}Wrong Input!${WC}" 19 | sleep 0.5s 20 | edit_configjson_Server_game_gameOptions_resinOptions 21 | ;; 22 | esac 23 | } 24 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/folderStructure/folderStructure.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_folderStructure() { 2 | cd $grasscutter_path || exit 1 3 | credit_hah 4 | Center_Text "Edit config.json [folderStructure]" 5 | getConfigJson "folderStructure" 6 | echo "1. [${GC}$folderStructure_resources${WC}] resources" 7 | echo "2. [${GC}$folderStructure_data${WC}] data" 8 | echo "3. [${GC}$folderStructure_packets${WC}] packets" 9 | echo "4. [${GC}$folderStructure_scripts${WC}] scripts" 10 | echo "5. [${GC}$folderStructure_plugins${WC}] plugins" 11 | echo "0. ${RC}Back${WC}" 12 | echo 13 | echo -n "Enter input : " 14 | read -r edit_configjson_folderStructure_input 15 | case $edit_configjson_folderStructure_input in 16 | "1") edit_configjson_folderStructure_resources ;; 17 | "2") edit_configjson_folderStructure_data ;; 18 | "3") edit_configjson_folderStructure_packets ;; 19 | "4") edit_configjson_folderStructure_scripts ;; 20 | "5") edit_configjson_folderStructure_plugins ;; 21 | "0") edit_configjson ;; 22 | *) 23 | echo "${RC}Wrong Input!${WC}" 24 | sleep 0.5s 25 | edit_configjson_folderStructure 26 | ;; 27 | esac 28 | } 29 | -------------------------------------------------------------------------------- /gcandroid/src/download.py: -------------------------------------------------------------------------------- 1 | from tqdm import tqdm 2 | from check import check_file 3 | from color import color 4 | import requests 5 | import sys 6 | 7 | color = color() 8 | 9 | def download_file(url, path): 10 | try: 11 | if not (check_file(path)): 12 | r = requests.get(url, stream=True) 13 | size = int(r.headers.get('Content-Length', 0)) 14 | block_size = 1024 15 | progress_bar = tqdm(total=size, unit='iB', unit_scale=True) 16 | with open(path, 'wb') as f: 17 | for data in r.iter_content(block_size): 18 | progress_bar.update(len(data)) 19 | f.write(data) 20 | exit(0) 21 | else: 22 | print(f"File already downloaded") 23 | exit(0) 24 | except Exception as e: 25 | print(f"\033[F\033[2K[{color.red}X{color.white}] Failed to download file from {url}\n{e}") 26 | exit(1) 27 | 28 | if __name__ == "__main__": 29 | if len(sys.argv) == 1: 30 | print("Usage: python3 download.py ") 31 | exit(1) 32 | elif len(sys.argv) == 2: 33 | print("Usage: python3 download.py ") 34 | exit(1) 35 | elif len(sys.argv) == 3: 36 | download_file(sys.argv[1], sys.argv[2]) -------------------------------------------------------------------------------- /gcandroid/update.sh: -------------------------------------------------------------------------------- 1 | Update_Grasscutter() { 2 | credit_hah 3 | echo "${GC}Updating Grasscutter${WC}" 4 | if [[ ! -d $grasscutter_path/.git ]]; then 5 | echo "${RC}.git folder not found, can't update Grasscutter${WC}" 6 | echo 7 | echo -n "Press enter for back to Menu" 8 | read 9 | main_menu 10 | fi 11 | # Check if git is installed 12 | if ! command -v git &>/dev/null; then 13 | Run "apt install git -y" "Installing git command" "0" "main_menu" "Main Menu" 14 | fi 15 | # Run git pull and get the output 16 | # if already up to date then return 17 | git_pull_output=$(git -C $grasscutter_path pull 2>&1) 18 | if [[ $git_pull_output == *"Already up to date"* ]]; then 19 | echo "${GC}Grasscutter is already up to date${WC}" 20 | echo 21 | echo -n "Press enter for back to Menu" 22 | read 23 | main_menu 24 | else 25 | echo "${GC}Grasscutter is updated${WC}" 26 | echo "Output : $git_pull_output" 27 | echo 28 | echo -n "Press enter for back to Menu" 29 | read 30 | main_menu 31 | fi 32 | # if failed to update then return 33 | if [[ $git_pull_output == *"error"* ]]; then 34 | echo "${RC}Failed to update Grasscutter${WC}" 35 | echo 36 | echo -n "Press enter for back to Menu" 37 | read 38 | main_menu 39 | fi 40 | } -------------------------------------------------------------------------------- /gcandroid/removePlugin.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | # Source code from my friend, aka @CharonCB21 on Telegram 5 | # And the code already modified by me, aka @ElaXan on GitHub 6 | removePlugin() { 7 | credit_hah 8 | pathPlugin="$grasscutter_path/plugins" 9 | if [ ! -d "$pathPlugin" ]; then 10 | echo "${RC}Folder $pathPlugin not found!${WC}" 11 | sleep 1s 12 | Grasscutter_Tools 13 | fi 14 | extension="jar" 15 | cd $pathPlugin 16 | dirlist=($(ls *.$extension 2>/dev/null)) 17 | diramount=${#dirlist[@]} 18 | staticnum=0 19 | if [[ $diramount = 0 ]]; then 20 | echo "${YC}No plugins installed!${WC}" 21 | sleep 1s 22 | Grasscutter_Tools 23 | fi 24 | for fname in "${dirlist[@]}"; do 25 | staticnum=$(($staticnum + 1)) 26 | echo "$staticnum. ${GC}$fname${WC}" 27 | done 28 | echo "0. ${RC}Back${WC}" 29 | echo 30 | printf "Your Option : " 31 | read userchoicef 32 | if [ $userchoicef -eq 0 ]; then 33 | Grasscutter_Tools 34 | elif [ $userchoicef -le $diramount ]; then 35 | curfile=${dirlist[$userchoicef - 1]} 36 | rm -rf $curfile 37 | echo "${GC}Successfully Removed plugin${WC} : ${CCB}$curfile!${WC}" 38 | sleep 1s 39 | removePlugin 40 | else 41 | echo "${RC}Invalid option!${WC}" 42 | sleep 1s 43 | removePlugin 44 | fi 45 | } 46 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/inventoryLimits/inventoryLimits.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions_inventoryLimits() { 2 | credit_hah 3 | Center_Text "Edit config.json [inventoryLimits]" 4 | getConfigJson "server.game.gameOptions.inventoryLimits" 5 | echo "1. [${GC}$server_game_gameOptions_inventoryLimits_weapons${WC}] weapons" 6 | echo "2. [${GC}$server_game_gameOptions_inventoryLimits_relics${WC}] relics" 7 | echo "3. [${GC}$server_game_gameOptions_inventoryLimits_materials${WC}] materials" 8 | echo "4. [${GC}$server_game_gameOptions_inventoryLimits_furniture${WC}] furniture" 9 | echo "5. [${GC}$server_game_gameOptions_inventoryLimits_all${WC}] all" 10 | echo "0. ${RC}Back${WC}" 11 | echo 12 | echo -n "Enter input : " 13 | read -r edit_configjson_Server_game_gameOptions_inventoryLimits_input 14 | case $edit_configjson_Server_game_gameOptions_inventoryLimits_input in 15 | "1") edit_configjson_Server_game_gameOptions_inventoryLimits_weapons ;; 16 | "2") edit_configjson_Server_game_gameOptions_inventoryLimits_relics ;; 17 | "3") edit_configjson_Server_game_gameOptions_inventoryLimits_materials ;; 18 | "4") edit_configjson_Server_game_gameOptions_inventoryLimits_furniture ;; 19 | "5") edit_configjson_Server_game_gameOptions_inventoryLimits_all ;; 20 | "0") edit_configjson_Server_game_gameOptions ;; 21 | *) 22 | echo "${RC}Wrong Input${WC}" 23 | sleep 0.5s 24 | edit_configjson_Server_game_gameOptions_inventoryLimits 25 | ;; 26 | esac 27 | } 28 | -------------------------------------------------------------------------------- /gcandroid/resetConfigjson.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | reset_configjson() { 5 | if [ ! -d "$grasscutter_path" ]; then 6 | echo "${RC}Error${WC} : $grasscutter_path not found" 7 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutter-directory-not-found${WC}" 8 | echo 9 | read -p "Press enter for back to Menu!" 10 | main_menu 11 | return 12 | fi 13 | if [ ! -f "$wherethegrassss" ]; then 14 | echo "${RC}Error${WC} : $wherethegrassss not found" 15 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutterjar-not-found${WC}" 16 | echo 17 | read -p "Press enter for back to Menu!" 18 | main_menu 19 | return 20 | fi 21 | cd $grasscutter_path || exit 1 22 | clear 23 | credit_hah 24 | echo "${YC}Are you sure want to reset config.json?" 25 | echo 26 | read -p "${WC}Enter input (y/N) : ${CCB}" reset_configjson_input 27 | echo -n "${WC}" 28 | case $reset_configjson_input in 29 | "y" | "Y") echo -n ;; 30 | "n" | "N") menu_config ;; 31 | *) 32 | echo "${RC}Wrong input!${WC}" 33 | sleep 1s 34 | reset_configjson 35 | ;; 36 | esac 37 | clear 38 | credit_hah 39 | if [ -f "$configpath" ]; then 40 | rm $configpath 41 | fi 42 | Run "timeout --foreground 5s java -jar grasscutter.jar" "Reset config.json" "124" "Menu" "main_menu" 43 | echo 44 | read -p "Press enter for back to edit config.json" 45 | menu_config 46 | return 47 | } 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | gif animated 3 |

4 | 5 | # GCAndroid 6 | 7 | Project is free to use. If you bought it from someone, please refund\ 8 | Join our [Discord](https://discord.gg/2TTSUZZ) 9 | 10 | # Note 11 | 12 | Unfortunately, my phone has died again, and as a result, I have to stop working on this project. I do not plan to update it in the future, even though I have created new code using Python and optimized the existing code. It's worth remembering that GCAndroid is only a tool designed to install Grasscutter on your Android device. 13 | 14 | For those who are curious, I used a Poco X3 Pro for this project, which is an excellent phone. However, I recently had an issue with it, and I took it to the service center, but unfortunately, they were not able to fix it effectively. I had to pay over $50, but the problem still persists. 15 | 16 | ## About 17 | 18 | What can I do with a Localhost Server? 19 | 20 | * The lowest Ping possible. 21 | * The abillity to change the (Banners, Events, Abyss, and etc) 22 | * Much more 23 | 24 | ## Changelog 25 | 26 | For changelog, please check [here](https://github.com/Score-Inc/GCAndroid/blob/Server/CHANGELOG.md) 27 | 28 | ## Prerequisites 29 | 30 | The Requirements are as follows: [Termux](https://termux.dev/en/) and a ton of `Skillssss`. This may burden your phone, so it's not recommended for low spec devices. 31 | 32 | ## Download links 33 | 34 | Download [Termux F-Droid](https://f-droid.org/repo/com.termux_118.apk) 35 | 36 | ## Install 37 | 38 | You can check our [Website](https://docs.elaxan.com/project/GCAndroid/install) 39 | -------------------------------------------------------------------------------- /gcandroid/compileGrasscutter.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | Compile_Grasscutter() { 5 | if [ ! -d "$grasscutter_path" ]; then 6 | echo "${RC}Error${WC} : $grasscutter_path not found" 7 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutter-directory-not-found${WC}" 8 | echo 9 | read -p "Press enter for back to Menu Grasscutter" 10 | Grasscutter_Menu 11 | return 12 | fi 13 | if [ ! -f "$grasscutter_path/gradlew" ]; then 14 | echo "${RC}Error${WC} : gradlew not found!" 15 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutter-gradlew-file-not-found${WC}" 16 | echo 17 | read -p "Press enter for back to Menu Grasscutter" 18 | Grasscutter_Menu 19 | return 20 | fi 21 | clear 22 | credit_hah 23 | Center_Text "Compile .jar [PLEASE WAIT]" 24 | cd $grasscutter_path || exit 1 25 | if [ -f "grasscutter.jar" ]; then 26 | rm grasscutter.jar 27 | fi 28 | Run "./gradlew jar" "Compiling grasscutter.jar" "0" "Menu" "main_menu" 29 | GrasscutterJar=$(ls grasscutter*.jar) 30 | if [ ! $GrasscutterJar ]; then 31 | echo "${RC}Error${WC} : Failed compile jar${WC}" 32 | echo 33 | read -p "Press enter for back to Menu Grasscutter!" 34 | Grasscutter_Menu 35 | else 36 | mv grasscutter*.jar grasscutter.jar 37 | echo "${GC}Success compile jar and output to $grasscutter_path folder" 38 | echo "With name grasscutter.jar${WC}" 39 | echo 40 | read -p "Press enter for back to Menu Grasscutter!" 41 | Grasscutter_Menu 42 | fi 43 | } 44 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true, 3 | "workbench.activityBar.visible": true, 4 | "editor.cursorStyle": "block-outline", 5 | "python.analysis.logLevel": "Information", 6 | "editor.cursorSmoothCaretAnimation": "on", 7 | "editor.fontSize": 14, 8 | "shellformat.effectLanguages": [ 9 | "shellscript", 10 | "dockerfile", 11 | "dotenv", 12 | "hosts", 13 | "jvmoptions", 14 | "ignore", 15 | "gitignore", 16 | "properties", 17 | "spring-boot-properties", 18 | "azcli", 19 | "bats" 20 | ], 21 | "git.mergeEditor": false, 22 | "cSpell.words": [ 23 | "abillity", 24 | "Acreateserial", 25 | "certfile", 26 | "civis", 27 | "cnorm", 28 | "configjson", 29 | "configpath", 30 | "curfile", 31 | "diramount", 32 | "dirlist", 33 | "dockergs", 34 | "dockergspull", 35 | "extfile", 36 | "finalise", 37 | "fname", 38 | "fselect", 39 | "Gacha", 40 | "gcandroid", 41 | "genpkey", 42 | "gradlew", 43 | "grasscutter", 44 | "Grasscutters", 45 | "inet", 46 | "inkey", 47 | "inpscript", 48 | "inputmain", 49 | "Jembud", 50 | "keyid", 51 | "keyout", 52 | "logcommands", 53 | "logpath", 54 | "newkey", 55 | "passout", 56 | "Pemotong", 57 | "pgrep", 58 | "pkcs", 59 | "pkill", 60 | "Repojson", 61 | "sdcard", 62 | "siakbary", 63 | "staticnum", 64 | "Termux", 65 | "textss", 66 | "userchoicef", 67 | "wherethegrassss", 68 | "zerr" 69 | ] 70 | } -------------------------------------------------------------------------------- /gcandroid/src/extract.py: -------------------------------------------------------------------------------- 1 | from check import check_folder 2 | from colorama import Fore as color 3 | import sys 4 | import os 5 | import zipfile 6 | 7 | def extract_zip(path, new_path): 8 | try: 9 | if (check_folder(new_path)): 10 | print(f"[{color.YELLOW}X{color.RESET}] Skip extracting zip because folder already exists") 11 | exit(2) 12 | with zipfile.ZipFile(path, 'r') as zip_ref: 13 | for file in zip_ref.namelist(): 14 | # get percent and ignore after dot 15 | percent = str(round(zip_ref.namelist().index( 16 | file) / len(zip_ref.namelist()) * 100, 2)).split(".")[0] 17 | # Hide a cursor 18 | print("\033[?25l", end="") 19 | zip_ref.extract(file, new_path) 20 | get_terminal_size = os.get_terminal_size() 21 | # Clear 2 lines 22 | print(f"\r\033[F\033[2K{color.GREEN}[{percent}%]{color.RESET} Extracting : {file}"[ 23 | :get_terminal_size.columns + 15]) 24 | print( 25 | f"\r\033[F\033[2K[{color.GREEN}✓{color.RESET}] Extracting zip from {path} to {new_path}") 26 | exit(0) 27 | except Exception as e: 28 | print(f"[{color.RED}X{color.RESET}] Failed to extract zip from {path} to {new_path}\n{e}") 29 | exit(1) 30 | finally: 31 | print("\033[?25h", end="") 32 | 33 | if __name__ == "__main__": 34 | if len(sys.argv) == 1: 35 | print("Usage: python3 extract.py ") 36 | exit(1) 37 | elif len(sys.argv) == 2: 38 | print("Usage: python3 extract.py ") 39 | exit(1) 40 | elif len(sys.argv) == 3: 41 | extract_zip(sys.argv[1], sys.argv[2]) -------------------------------------------------------------------------------- /gcandroid/changePort.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | changePort() { 5 | credit_hah 6 | Center_Text "Change Port" 7 | if [ ! -f $configpath ]; then 8 | echo "${RC}Error${WC} : $configpath not found!" 9 | echo "See : ${CCU}${linksDocs}/Error#error-configjson-not-found${WC}" 10 | echo 11 | echo -n "Press enter for back to Menu!" 12 | read 13 | menu_config 14 | return 15 | fi 16 | checkPort=$(cat $configpath | grep "\"bindPort\":" | head -n 1 | sed -e "s/.*\": //g" -e "s/,//g") 17 | echo "${CCB}Current Port : ${checkPort}${WC}" 18 | echo "=====================================" 19 | echo "${YC}Enter b/B for back or cancel${WC}" 20 | echo 21 | echo -n "Enter port : " 22 | read -r PortChange 23 | if [[ $PortChange = "b" ]] || [[ $PortChange = "B" ]]; then 24 | menu_config 25 | return 26 | fi 27 | if [[ $PortChange = "" ]]; then 28 | echo "${RC}Please enter Port!${WC}" 29 | echo 30 | echo -n "Press enter for try again!" 31 | read 32 | changePort 33 | return 34 | fi 35 | if [[ $PortChange == $checkPort ]]; then 36 | echo "${RC}Error:${WC} Port $PortChange already used!" 37 | echo 38 | echo -n "Press enter for try again!" 39 | read 40 | changePort 41 | return 42 | fi 43 | if nc localhost $PortChange; then 44 | echo "${RC}Error:${WC} Port $PortChange already used!" 45 | echo 46 | echo -n "Press enter for try again!" 47 | read 48 | changePort 49 | return 50 | fi 51 | sed -i "s/\"bindPort\": $checkPort,/\"bindPort\": $PortChange,/g" $configpath 52 | changePort 53 | } 54 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/gameOptions/gameOptions.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game_gameOptions() { 2 | credit_hah 3 | Center_Text "Edit config.json [gameOptions]" 4 | getConfigJson "server.game.gameOptions" 5 | echo "1. [${GC}$server_game_gameOptions_sceneEntityLimit${WC}] sceneEntityLimit" 6 | echo "2. [$server_game_gameOptions_watchGachaConfigOut] watchGachaConfig" 7 | echo "3. [$server_game_gameOptions_enableShopItemsOut] enableShopItems" 8 | echo "4. [$server_game_gameOptions_staminaUsageOut] staminaUsage" 9 | echo "5. [$server_game_gameOptions_energyUsageOut] energyUsage" 10 | echo "6. [$server_game_gameOptions_fishhookTeleportOut] fishhookTeleport" 11 | echo "7. ${CCB}inventoryLimits${WC}" 12 | echo "8. ${CCB}avatarLimits${WC}" 13 | echo "9. ${CCB}resinOptions${WC}" 14 | echo "10. ${CCB}rates${WC}" 15 | echo "0. ${RC}Back${WC}" 16 | echo 17 | echo -n "Enter input : " 18 | read -r edit_configjson_Server_game_gameOptions_input 19 | case $edit_configjson_Server_game_gameOptions_input in 20 | "1") edit_configjson_Server_game_gameOptions_sceneEntityLimit ;; 21 | "2") edit_configjson_Server_game_gameOptions_watchGachaConfig ;; 22 | "3") edit_configjson_Server_game_gameOptions_enableShopItems ;; 23 | "4") edit_configjson_Server_game_gameOptions_staminaUsage ;; 24 | "5") edit_configjson_Server_game_gameOptions_energyUsage ;; 25 | "6") edit_configjson_Server_game_gameOptions_fishhookTeleport ;; 26 | "7") edit_configjson_Server_game_gameOptions_inventoryLimits ;; 27 | "8") edit_configjson_Server_game_gameOptions_avatarLimits ;; 28 | "9") edit_configjson_Server_game_gameOptions_resinOptions ;; 29 | "10") edit_configjson_Server_game_gameOptions_rates ;; 30 | "0") edit_configjson_Server_game ;; 31 | *) 32 | echo "${RC}Wrong Input!${WC}" 33 | sleep 0.5 34 | edit_configjson_Server_game_gameOptions 35 | ;; 36 | esac 37 | } 38 | -------------------------------------------------------------------------------- /gcandroid/runGrasscutter.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | GoTouchGrass() { 5 | credit_hah 6 | Center_Text "Go Touch Grass" 7 | if ! command -v mongo &>/dev/null; then 8 | echo "${RC}Please install mongodb First!${WC}" 9 | echo 10 | echo -n "Press enter for back to Menu!" 11 | read 12 | main_menu 13 | return 14 | fi 15 | if [[ ! -f $grasscutter_path/grasscutter.jar ]]; then 16 | echo "${RC}Error${WC} : $grasscutter_path/grasscutter.jar not found!" 17 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutterjar-not-found${WC}" 18 | echo 19 | echo -n "Press enter for back to Menu!" 20 | read -r 21 | main_menu 22 | return 23 | else 24 | config_file="$grasscutter_path/config.json" 25 | if [[ -f $config_file ]]; then 26 | access_address=$(jq -r .server.http.accessAddress $config_file) 27 | bind_port=$(jq .server.http.bindPort $config_file) 28 | 29 | echo "${GC}Checking port used${WC}" 30 | timeout --foreground 2s php -S $access_address:$bind_port &>/dev/null 31 | exitCode=$? 32 | if [[ $exitCode == 1 ]]; then 33 | echo "${RC}Error${WC} : Port $bind_port is used/permission denied!" 34 | 35 | echo "${YC}Server: $access_address:$bind_port${WC}" 36 | echo 37 | echo -n "Press enter for back to Menu!" 38 | read -r 39 | main_menu 40 | return 41 | fi 42 | echo "${GC}Port $bind_port is not used!${WC}" 43 | fi 44 | if pgrep mongod > /dev/null; then 45 | pkill mongod 46 | fi 47 | mongod &>/dev/null & 48 | cd $grasscutter_path 49 | java -jar $wherethegrassss 50 | echo -n "Press enter for back to Main Menu!" 51 | read -r 52 | main_menu 53 | fi 54 | } 55 | -------------------------------------------------------------------------------- /gcandroid/Edit_Config_Json/Server/game/game.sh: -------------------------------------------------------------------------------- 1 | edit_configjson_Server_game() { 2 | credit_hah 3 | Center_Text "Edit config.json [GAME]" 4 | getConfigJson "server.http.game" 5 | echo "1. [${GC}$server_game_bindAddress${WC}] bindAddress" 6 | echo "2. [${GC}$server_game_bindPort${WC}] bindPort" 7 | echo "3. [${GC}$server_game_accessAddress${WC}] accessAddress" 8 | echo "4. [${GC}$server_game_accessPort${WC}] accessPort" 9 | echo "5. [${GC}$server_game_loadEntitiesForPlayerRange${WC}] loadEntitiesForPlayerRange" 10 | echo "6. [${GC}$server_game_enableScriptInBigWorldOut${WC}] enableScriptInBigWorld" 11 | echo "7. [${GC}$server_game_enableConsoleOut${WC}] enableConsole" 12 | echo "8. [${GC}$server_game_kcpInterval${WC}] kcpInterval" 13 | echo "9. [${GC}$server_game_logPackets${WC}] logPackets" 14 | echo "10. [${GC}$server_game_isShowPacketPayloadOut${WC}] isShowPacketPayload" 15 | echo "11. [$server_game_isShowLoopPacketsOut] isShowLoopPackets" 16 | echo "12. ${CCB}gameOptions${WC}" 17 | echo "0. ${RC}Back${WC}" 18 | echo 19 | echo -n "Enter input : " 20 | read -r edit_configjson_game_input 21 | case $edit_configjson_game_input in 22 | "1") edit_configjson_Server_game_bindAddress ;; 23 | "2") edit_configjson_Server_game_bindPort ;; 24 | "3") edit_configjson_Server_game_accessAddress ;; 25 | "4") edit_configjson_Server_game_accessPort ;; 26 | "5") edit_configjson_Server_game_loadEntitiesForPlayerRange ;; 27 | "6") edit_configjson_Server_game_enableScriptInBigWorld ;; 28 | "7") edit_configjson_Server_game_enableConsole ;; 29 | "8") edit_configjson_Server_game_kcpInterval ;; 30 | "9") edit_configjson_Server_game_logPackets ;; 31 | "10") edit_configjson_Server_game_isShowPacketPayload ;; 32 | "11") edit_configjson_Server_game_isShowLoopPackets ;; 33 | "12") edit_configjson_Server_game_gameOptions ;; 34 | "0") edit_configjson_Server_main ;; 35 | *) 36 | echo "${RC}Wrong Input!${WC}" 37 | sleep 0.4s 38 | edit_configjson_Server_game 39 | ;; 40 | esac 41 | } 42 | -------------------------------------------------------------------------------- /gcandroid/GM_Handbook/avatars.txt: -------------------------------------------------------------------------------- 1 | // Avatars 2 | 10000001 : Kate 3 | 10000002 : Kamisato Ayaka 4 | 10000003 : Jean 5 | 10000005 : Traveler 6 | 10000006 : Lisa 7 | 10000007 : Traveler 8 | 10000014 : Barbara 9 | 10000015 : Kaeya 10 | 10000016 : Diluc 11 | 10000020 : Razor 12 | 10000021 : Amber 13 | 10000022 : Venti 14 | 10000023 : Xiangling 15 | 10000024 : Beidou 16 | 10000025 : Xingqiu 17 | 10000026 : Xiao 18 | 10000027 : Ningguang 19 | 10000029 : Klee 20 | 10000030 : Zhongli 21 | 10000031 : Fischl 22 | 10000032 : Bennett 23 | 10000033 : Tartaglia 24 | 10000034 : Noelle 25 | 10000035 : Qiqi 26 | 10000036 : Chongyun 27 | 10000037 : Ganyu 28 | 10000038 : Albedo 29 | 10000039 : Diona 30 | 10000041 : Mona 31 | 10000042 : Keqing 32 | 10000043 : Sucrose 33 | 10000044 : Xinyan 34 | 10000045 : Rosaria 35 | 10000046 : Hu Tao 36 | 10000047 : Kaedehara Kazuha 37 | 10000048 : Yanfei 38 | 10000049 : Yoimiya 39 | 10000050 : Thoma 40 | 10000051 : Eula 41 | 10000052 : Raiden Shogun 42 | 10000053 : Sayu 43 | 10000054 : Sangonomiya Kokomi 44 | 10000055 : Gorou 45 | 10000056 : Kujou Sara 46 | 10000057 : Arataki Itto 47 | 10000058 : Yae Miko 48 | 10000059 : Shikanoin Heizou 49 | 10000060 : Yelan 50 | 10000062 : Aloy 51 | 10000063 : Shenhe 52 | 10000064 : Yun Jin 53 | 10000065 : Kuki Shinobu 54 | 10000066 : Kamisato Ayato 55 | 10000067 : Collei 56 | 10000068 : Dori 57 | 10000069 : Tighnari 58 | 10000070 : Nilou 59 | 10000071 : Cyno 60 | 10000072 : Candace 61 | 10000073 : Nahida 62 | 10000074 : Layla 63 | 10000075 : Wanderer 64 | 10000076 : Faruzan 65 | 10000077 : Yaoyao 66 | 10000078 : Alhaitham 67 | 11000008 : Party Test #4 68 | 11000009 : Background Test 69 | 11000010 : Naked Model #1 70 | 11000011 : Naked Man 71 | 11000013 : Co-Op Test 72 | 11000017 : Adult Male Body Test 73 | 11000018 : Adult Female Body Test 74 | 11000019 : Girl Body Test 75 | 11000025 : Akuliya 76 | 11000026 : Yaoyao (Trial) 77 | 11000027 : Girl Body Test - #2 Machine 78 | 11000028 : Shiro Maiden 79 | 11000030 : Greatsword Maiden 80 | 11000031 : Late Weapon Test A 81 | 11000032 : Late Weapon Test B 82 | 11000033 : Late Weapon Test C 83 | 11000034 : Late Weapon Test D 84 | 11000035 : Lance Warrioress 85 | 11000036 : Swordswoman Test 86 | 11000037 : Rx White-Box 87 | 11000038 : Boy Body Test 88 | 11000039 : Adult Male Body Test 89 | 11000040 : Female Lead New Normal Attack 90 | 11000041 : Male Lead New Normal Attack 91 | 11000042 : Chongyun (Test) 92 | 11000043 : Test Character 93 | 11000044 : Qiqi (Test) 94 | 11000045 : Diona (Test) -------------------------------------------------------------------------------- /gcandroid/generateHandbook.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | generateHandbook() { 5 | credit_hah 6 | Center_Text "GM Handbook" 7 | if ! command -v java &>/dev/null; then 8 | echo "${RC}Java not found!${WC}" 9 | echo 10 | echo -n "Press enter for back to Grasscutter tools" 11 | read -r 12 | Grasscutter_Tools 13 | fi 14 | if ! command -v mongo &>/dev/null; then 15 | echo "${RC}Mongodb not installed, install it in Main Menu!${RC}" 16 | echo 17 | echo -n "Press enter for back to Main Menu!" 18 | read -r 19 | main_menu 20 | fi 21 | if [ ! -d "$grasscutter_path" ]; then 22 | echo "${RC}Folder $nameFolder not found!${RC}" 23 | echo 24 | echo -n "Press enter for back to Grasscutter Tools" 25 | read -r 26 | Grasscutter_Tools 27 | fi 28 | if [ ! -f "$grasscutter_path/grasscutter.jar" ]; then 29 | echo "${RC}File grasscutter.jar not found!${RC}" 30 | echo 31 | echo -n "Press enter for back to Grasscutter Tools" 32 | read -r 33 | Grasscutter_Tools 34 | fi 35 | if ! (ls /sdcard > /dev/null 2>&1); then 36 | echo "${RC}Error${WC} : /sdcard can't access/permission denied" 37 | echo 38 | echo -n "Press enter for back to Grasscutter Tools" 39 | read -r 40 | Grasscutter_Tools 41 | fi 42 | cd $grasscutter_path || exit 1 43 | mongod &>/dev/null & 44 | Run "timeout 10s java -jar grasscutter.jar -handbook" "Getting GM_Handbook" "124" "Menu" "main_menu" 45 | if [ -z "$(ls -A $grasscutter_path/GM\ Handbook/)" ]; then 46 | echo "${RC}Error${WC} : GM Handbook not found!" 47 | echo 48 | echo -n "Press enter for back to Grasscutter Tools" 49 | read -r 50 | Grasscutter_Tools 51 | fi 52 | if [ ! -d "/sdcard/GM_Handbook" ]; then 53 | mkdir "/sdcard/GM_Handbook" 54 | fi 55 | Run "mv -f GM*Handbook/* /sdcard/GM_Handbook/" "Move GM_Handbook to /sdcard" "0" "Menu" "main_menu" 56 | pkill mongod 57 | if (ls "/sdcard/GM_Handbook"/* > /dev/null 2>&1); then 58 | echo "${GC}Success get GM Handbook to /sdcard in Folder GM_Handbook${WC}" 59 | echo 60 | echo -n "Press enter for back to Main Menu!" 61 | read -r 62 | main_menu 63 | else 64 | echo "${RC}Failed to get GM Handbook!${WC}" 65 | echo 66 | echo -n "Press enter for back to Main Menu!" 67 | read -r 68 | main_menu 69 | fi 70 | } -------------------------------------------------------------------------------- /gcandroid/cli/installGrasscutter.sh: -------------------------------------------------------------------------------- 1 | installGrasscutter_cli() { 2 | # WORKING IN PROGRESS (WIP) 3 | # this is so fucking messy and i don't know how to make it better 4 | # may be i can't make this function better 5 | # ahhhhhh who cares 6 | if [ "$1" = "--force" ] || [ "$1" = "-f" ]; then 7 | if [ -d "$grasscutter_path" ]; then 8 | rm -rf "$grasscutter_path" 9 | fi 10 | else 11 | if [ -d "$grasscutter_path" ]; then 12 | echo "Grasscutter already installed!" 13 | echo "Use --force or -f to force remove existing grasscutter folder" 14 | exit 1 15 | fi 16 | fi 17 | 18 | # clone grasscutter 19 | cd $HOME 20 | git clone $(jq -r .Grasscutter $Path_Repojson) || exit 1 21 | # check if --force is used then download resources 22 | if [ "$1" = "--force" ] || [ "$1" = "-f" ]; then 23 | mkdir $HOME/.ElaXan/Download 24 | cd $HOME/.ElaXan/Download || exit 1 25 | wget $(jq -r .GrasscutterResources $Path_Repojson) -O GrasscutterResources.zip || exit 1 26 | unzip GrasscutterResources.zip || exit 1 27 | rm -rf GrasscutterResources.zip 28 | if [ -d "$grasscutter_path/resources" ]; then 29 | rm -rf "$grasscutter_path/resources" 30 | fi 31 | mv -f GrasscutterResources/*/* $grasscutter_path/resources 32 | rm -rf $HOME/.ElaXan/Download 33 | else 34 | read -p "Do you want to download Resources? [y/n] " -n 1 -r 35 | echo 36 | if [[ $REPLY =~ ^[Yy]$ ]]; then 37 | mkdir $HOME/.ElaXan/Download 38 | cd $HOME/.ElaXan/Download || exit 1 39 | wget $(jq -r .GrasscutterResources $Path_Repojson) -O GrasscutterResources.zip || exit 1 40 | read -p "Do you want to extract Resources? [y/n] " -n 1 -r 41 | echo 42 | if [[ $REPLY =~ ^[Yy]$ ]]; then 43 | unzip GrasscutterResources.zip || exit 1 44 | rm -rf GrasscutterResources.zip 45 | if [ -d "$grasscutter_path/resources" ]; then 46 | rm -rf "$grasscutter_path/resources" 47 | fi 48 | mv -f GrasscutterResources/*/* $grasscutter_path/resources 49 | rm -rf $HOME/.ElaXan/Download 50 | else 51 | rm -rf GrasscutterResources.zip 52 | if [ -d "$grasscutter_path/resources" ]; then 53 | rm -rf "$grasscutter_path/resources" 54 | fi 55 | mv -f GrasscutterResources $grasscutter_path/resources 56 | rm -rf $HOME/.ElaXan/Download 57 | fi 58 | fi 59 | fi 60 | } -------------------------------------------------------------------------------- /gcandroid/spin.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | Loading() { 5 | pid=$! 6 | name=$1 7 | spin[0]="-" 8 | spin[1]="\\" 9 | spin[2]="|" 10 | spin[3]="/" 11 | index=0 12 | # :) 13 | echo 14 | 15 | while kill -0 $pid 2> /dev/null; do 16 | if [ -f "$HOME/zerr.log" ]; then 17 | Loading_Text=$(tail -n 1 $HOME/zerr.log) 18 | fi 19 | tput civis 20 | for i in "${spin[@]}"; do 21 | tput cuu1 22 | tput el 23 | if [ -z "$Loading_Text" ]; then 24 | echo -ne "\r[${GC}$i${WC}] ${GC}$name${WC}\n\r" 25 | else 26 | echo -ne "\r[${GC}$i${WC}] ${GC}$name${WC}\n\033[2K\r > ${YC}$(echo $Loading_Text | cut -c 1-$(( $(tput cols) - 3 )))${WC}" 27 | fi 28 | sleep 0.1 29 | done 30 | if ! (ps $pid > /dev/null); then 31 | tput cnorm 32 | errCode=$(cat $HOME/z.log 2>/dev/null | grep "$catLogs_code") 33 | errOutput=$(cat $HOME/zerr.log 2>/dev/null) 34 | if [[ $errCode == $2 ]]; then 35 | tput cuu1 36 | tput el 37 | echo -ne "\r\033[2K[${GC}✓${WC}] ${GC}$name Done${WC}\n\r\033[2K\r" 38 | else 39 | tput cuu1 40 | tput el 41 | echo -ne "\r[${RC}X${WC}] ${GC}$name${WC} ${RC}Failed${WC}\n\r\033[2K" 42 | if [ ${#errOutput} -gt 400 ]; then 43 | echo -e "\n${RC}Error Output${WC} : \n\n$(echo $errOutput | tail -c 400)${WC}..." 44 | else 45 | echo -e "\n${RC}Error Output${WC} : \n\n$errOutput${WC}" 46 | fi 47 | echo 48 | echo "${GC}Exit Code${WC} : ${RC}$errCode${WC}" 49 | echo "${GC}Exit Target${WC} : ${RC}$2${WC}" 50 | if [ $(cat $HOME/z.log) != $2 ]; then 51 | echo -e "\n${YC}If this bug, please report it to Issues page${WC}" 52 | fi 53 | if [ -f $HOME/z.log ]; then 54 | rm -rf $HOME/z.log 2>/dev/null || echo "z.log not found/script stopped by user" 55 | fi 56 | if [ -f $HOME/zerr.log ]; then 57 | rm -rf $HOME/zerr.log 2>/dev/null || echo "zerr.log not found/script stopped by user" 58 | fi 59 | echo 60 | echo -n "Press enter for back to $3!" 61 | read 62 | $4 63 | fi 64 | tput cnorm 65 | rm -rf $HOME/z.log 2>/dev/null || echo "z.log not found/script stopped by user" 66 | rm -rf $HOME/zerr.log 2>/dev/null || echo "zerr.log not found/script stopped by user" 67 | fi 68 | done 69 | } 70 | 71 | # Run "Code_Program" "Progress_Name" "Exit_Code" "Back_To" "function_name" 72 | 73 | log() { 74 | echo -n "$1" >$HOME/z.log 2> /dev/null 75 | catLogs_code=$(cat "$HOME"/z.log 2>/dev/null | grep "$1") 76 | } 77 | 78 | Run() { 79 | command=$1 80 | name=$2 81 | run_Program() { 82 | $command > $HOME/zerr.log 2>&1 83 | errCode=$? 84 | log $errCode 85 | } 86 | run_Program & 87 | Loading "$name" "$3" "$4" "$5" 88 | } -------------------------------------------------------------------------------- /gcandroid/settingsRepo.sh: -------------------------------------------------------------------------------- 1 | GrasscutterRepo() { 2 | credit_hah 3 | get_current_gc_repo=$(jq -r '.Grasscutter' "$Path_Repojson") 4 | echo "${CCB}Current Grasscutter repository: ${GC}$get_current_gc_repo${WC}" 5 | echo 6 | echo "${YC}Enter b/B to go back to the main menu${WC}" 7 | echo 8 | echo -n "Enter new Grasscutter repository: " 9 | read -r new_gc_repo 10 | echo 11 | if [[ "$new_gc_repo" == "b" ]] || [[ "$new_gc_repo" == "B" ]]; then 12 | settingsMenu 13 | fi 14 | if [[ "$new_gc_repo" == "" ]]; then 15 | echo "${RC}You must enter a repository${WC}" 16 | echo 17 | echo -n "Press enter to try again" 18 | read -r 19 | GrasscutterRepo 20 | fi 21 | jq .Grasscutter=\"$new_gc_repo\" "$Path_Repojson" > "$GCAndroid/ZEdit.json" 22 | rm "$Path_Repojson" 23 | mv "$HOME/.ElaXan/GCAndroid/ZEdit.json" "$Path_Repojson" 24 | echo "${GC}Grasscutter repository changed to: $new_gc_repo${WC}" 25 | echo 26 | echo "${CCB}Restarting GCAndroid${WC}" 27 | sleep 2s 28 | gcandroid 29 | } 30 | 31 | ResourcesRepo() { 32 | credit_hah 33 | get_current_resources_repo=$(jq -r '.Resources' "$Path_Repojson") 34 | echo "${CCB}Current Resources repository: ${GC}$get_current_resources_repo${WC}" 35 | echo 36 | echo "${YC}Enter b/B to go back to the main menu${WC}" 37 | echo 38 | echo -n "Enter new Resources repository: " 39 | read -r new_resources_repo 40 | echo 41 | if [[ "$new_resources_repo" == "b" ]] || [[ "$new_resources_repo" == "B" ]]; then 42 | settingsMenu 43 | fi 44 | if [[ "$new_resources_repo" == "" ]]; then 45 | echo "${RC}You must enter a repository${WC}" 46 | echo 47 | echo -n "Press enter to try again" 48 | read -r 49 | ResourcesRepo 50 | fi 51 | jq .Resources=\"$new_resources_repo\" "$Path_Repojson" > "$HOME/.ElaXan/GCAndroid/ZEdit.json" 52 | rm "$Path_Repojson" 53 | mv "$GCAndroid/ZEdit.json" "$Path_Repojson" 54 | echo "${GC}Resources repository changed to: $new_resources_repo${WC}" 55 | echo 56 | echo "${CCB}Restarting GCAndroid${WC}" 57 | sleep 2s 58 | gcandroid 59 | } 60 | 61 | ResetSettingsJSON() { 62 | credit_hah 63 | echo "${RC}This will reset the repo.json file to the default settings${WC}" 64 | echo 65 | echo -n "Are you sure you want to continue? (y/n): " 66 | read -r reset_settings_json 67 | echo 68 | if [[ "$reset_settings_json" == "y" ]] || [[ "$reset_settings_json" == "Y" ]]; then 69 | rm $Path_Repojson 70 | echo "{ 71 | \"Grasscutter\": \"https://github.com/Grasscutters/Grasscutter.git\", 72 | \"Resources\": \"https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.4/GC-Resources-3.4.zip\" 73 | }" > "$Path_Repojson" 74 | echo "${GC}repo.json file reset to default settings${WC}" 75 | echo 76 | echo "${CCB}Restarting GCAndroid${WC}" 77 | sleep 2s 78 | gcandroid 79 | fi 80 | if [[ "$reset_settings_json" == "n" ]] || [[ "$reset_settings_json" == "N" ]]; then 81 | settingsMenu 82 | fi 83 | if [[ "$reset_settings_json" != "y" ]] || [[ "$reset_settings_json" != "Y" ]] || [[ "$reset_settings_json" != "n" ]] || [[ "$reset_settings_json" != "N" ]]; then 84 | echo "${RC}You must enter y/Y or n/N${WC}" 85 | echo 86 | echo -n "Press enter to try again" 87 | read -r 88 | ResetSettingsJSON 89 | fi 90 | } -------------------------------------------------------------------------------- /gcandroid/generateKeystore.sh: -------------------------------------------------------------------------------- 1 | 2 | # Score-Inc/GCAndroid is licensed under the 3 | # GNU General Public License v3.0 4 | 5 | Generate_Keystore() { 6 | credit_hah 7 | Center_Text "Generate Keystore File" 8 | if [ ! -d $grasscutter_path ]; then 9 | echo "${RC}Error${WC} : The directory ${CCB}$grasscutter_path${WC} does not exist." 10 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutter-directory-not-found${WC}" 11 | echo 12 | echo -n "Press any key to back to the main menu..." 13 | read -n 1 14 | Grasscutter_Tools 15 | fi 16 | getIp=$(ifconfig 2>/dev/null | grep "inet " | sed -n 's/.*inet \([0-9.]*\) .*/\1/p') 17 | getType=$(ifconfig 2>/dev/null | sed -n 's/^\([a-z0-9_]*\):.*/\1/p') 18 | echo "${GC}Please choose the ip address to create the keystore file:${WC}" 19 | numberIp=0 20 | for ip in $getIp 21 | do 22 | numberIp=$(($numberIp+1)) 23 | echo "$numberIp. ${CCB}$ip${WC} (${YC}$(echo "$getType" | sed -n "${numberIp}p")${WC})" 24 | done 25 | echo "0. ${RC}Back${WC}" 26 | echo 27 | read -p "Please input of the number: " num 28 | if [ "$num" = "0" ]; then 29 | Grasscutter_Tools 30 | fi 31 | if ! [[ "$num" =~ ^[0-9]+$ ]]; then 32 | echo "${RC}Error${WC} : Please input the number!" 33 | echo 34 | echo -n "Press any key to try again..." 35 | read -n 1 36 | Generate_Keystore 37 | fi 38 | if [ "$num" -gt "$numberIp" ] || [ "$num" -lt 1 ]; then 39 | echo "${RC}Error${WC} : Please input the number between 1 and $numberIp!" 40 | echo 41 | echo -n "Press any key to try again..." 42 | read -n 1 43 | Generate_Keystore 44 | fi 45 | ip=$(echo "$getIp" | sed -n "${num}p") 46 | echo "Are you sure to create the keystore file with the ip address ${CCB}$ip${WC} ?" 47 | read -p "Please input ${CCB}yes${WC} or ${CCB}no${WC}: " answer 48 | if [ "$answer" = "yes" ]; then 49 | echo "Using source code from ${CCB}https://github.com/Grasscutters/Grasscutter/blob/development/install.sh${WC}" 50 | echo 51 | mkdir $HOME/.ElaXan/certs 52 | cd $HOME/.ElaXan/certs 53 | echo "Generating CA key and certificate pair..." 54 | openssl req -x509 -nodes -days 25202 -newkey rsa:2048 -subj "/C=GB/ST=Essex/L=London/O=Grasscutters/OU=Grasscutters/CN=$ip" -keyout CAkey.key -out CAcert.crt 55 | echo "Generating SSL key and certificate pair..." 56 | openssl genpkey -out ssl.key -algorithm rsa 57 | echo "Creates a conf file in order to generate a csr" 58 | cat > csr.conf < cert.conf < /dev/null); then 74 | echo "${GC}Installing micro text editor${WC}" 75 | apt install micro -y &> /dev/null 76 | credit_hah 77 | Center_Text "Edit Banners" 78 | fi 79 | if ! (command -v micro &> /dev/null); then 80 | echo "${RC}Failed to install micro text editor${WC}" 81 | echo 82 | echo -n "Press enter for back to Menu" 83 | read 84 | main_menu 85 | fi 86 | if [[ ! -d "$grasscutter_path" ]]; then 87 | echo "${RC}Error${WC} : $nameFolder directory not found${WC}" 88 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutter-directory-not-found${WC}" 89 | echo 90 | echo -n "Press enter for back to Menu" 91 | read 92 | main_menu 93 | fi 94 | if [[ ! -f "$grasscutter_path/gradlew" ]]; then 95 | echo "${RC}Error${WC} : $nameFolder gradlew file not found${WC}" 96 | echo "See : ${CCU}${linksDocs}/Error#error--grasscutter-gradlew-file-not-found${WC}" 97 | echo 98 | echo -n "Press enter for back to Menu" 99 | read 100 | main_menu 101 | fi 102 | if [[ ! -f "$grasscutter_path/src/main/resources/defaults/data/Banners.tsj" ]]; then 103 | echo "${RC}Error${WC} : Banners.tsj file not found${WC}" 104 | echo 105 | echo -n "Press enter for back to Menu" 106 | read 107 | main_menu 108 | fi 109 | echo "1. ${CCB}Edit Banners.tsj${WC}" 110 | echo "2. ${CCB}Import Banners.tsj${WC}" 111 | echo "3. ${CCB}Reset Banners.tsj${WC}" 112 | echo "0. ${RC}Back${WC}" 113 | echo 114 | echo -n "Enter your choice : " 115 | read Edit_Banners_Choice 116 | case $Edit_Banners_Choice in 117 | 1) 118 | Edit_Banner 119 | ;; 120 | 2) 121 | Import_Banners 122 | ;; 123 | 3) 124 | Reset_Banners 125 | ;; 126 | 0) 127 | Grasscutter_Tools 128 | ;; 129 | *) 130 | echo "${RC}Error${WC} : Invalid Choice${WC}" 131 | sleep 1s 132 | Edit_Banners 133 | ;; 134 | esac 135 | } 136 | -------------------------------------------------------------------------------- /gcandroid/gcandroidTools.sh: -------------------------------------------------------------------------------- 1 | delete_avatars() { 2 | mongod &> /dev/null & 3 | credit_hah 4 | Center_Text "Delete Avatars" 5 | list_get=$(mongo --quiet grasscutter --eval "db.avatars.find()") 6 | echo "${YC}Enter b/B for back/cancel${CCB}" 7 | echo 8 | read -p "${CCB}Enter your UID : ${WC}" delete_mongodb_uid 9 | if [[ $delete_mongodb_uid == "b" ]] || [[ $delete_mongodb_uid == "B" ]]; then 10 | gcandroidTools 11 | fi 12 | read -p "${CCB}Enter Avatars ID : ${WC}" delete_mongodb_avatar_id 13 | if [[ $delete_mongodb_avatar_id =~ [0-9] ]]; then 14 | Characters_Name=$(grep "$delete_mongodb_avatar_id" $Path_Shell/GM_Handbook/avatars.txt) 15 | delete_mongodb_avatar_id_results=$(echo -n "$Character_Name" | grep -i "$delete_mongodb_avatar_id" | awk -F ":" '{print $1}') 16 | if [ ${#delete_mongodb_avatar_id} -lt 8 ]; then 17 | echo "${RC}Please enter 8 character not ${#delete_mongodb_avatar_id}!${WC}" 18 | sleep 1s 19 | delete_avatars 20 | elif [ ${#delete_mongodb_avatar_id} -gt 8 ]; then 21 | echo "${RC}Please enter 8 character not ${#delete_mongodb_avatar_id}!${WC}" 22 | sleep 1s 23 | delete_avatars 24 | fi 25 | elif [[ $delete_mongodb_avatar_id == "b" ]] || [[ $delete_mongodb_avatar_id == "B" ]]; then 26 | gcandroidTools 27 | fi 28 | echo 29 | checking_the_avatars_id=$(mongo --quiet grasscutter --eval "db.avatars.find()" | grep "$delete_mongodb_avatar_id" | grep "$delete_mongodb_uid") 30 | if [[ $? != 0 ]]; then 31 | echo "${RC}Avatars ID not found!${WC}" 32 | echo 33 | echo -n "Press enter for back to GCAndroid Tools!" 34 | read 35 | gcandroidTools 36 | else 37 | delete_mongodb_avatar_id_results_name=$(echo "$Characters_Name" | grep -i "$delete_mongodb_avatar_id_results" | awk -F ":" '{print $2}') 38 | delete_mongodb_avatar_id_results_name=$(echo "$delete_mongodb_avatar_id_results_name" | sed 's/^ *//') 39 | echo "${CCB}Avatars ID found!${WC}" 40 | echo "${GC}Avatars Name${WC} : ${CCB}$delete_mongodb_avatar_id_results_name${WC}" 41 | echo 42 | echo -n "Are you sure? (y/N) : " 43 | read -r delete_mongodb_input 44 | case $delete_mongodb_input in 45 | "y" | "Y") 46 | mongo --quiet grasscutter --eval "db.avatars.remove($checking_the_avatars_id)" >/dev/null 2>&1 47 | if [[ $? != 0 ]]; then 48 | echo "${RC}Failed to delete!${WC}" 49 | echo 50 | echo -n "Press enter for back to GCAndroid Tools!" 51 | read 52 | gcandroidTools 53 | else 54 | echo "${GC}Success deleted!${WC}" 55 | echo 56 | echo -n "Press enter for back to GCAndroid Tools!" 57 | read 58 | gcandroidTools 59 | fi 60 | ;; 61 | "n" | "N") main_menu ;; 62 | *) 63 | echo "${RC}Wrong Input!${WC}" 64 | sleep 1s 65 | delete_avatars 66 | ;; 67 | esac 68 | fi 69 | } 70 | 71 | check_avatars() { 72 | mongod &> /dev/null & 73 | credit_hah 74 | Center_Text "Check Avatars" 75 | echo "${YC}Enter b/B for back/cancel${CCB}" 76 | echo 77 | read -p "Enter your UID : " check_mongodb_uid 78 | check_uid_database=$(mongo --quiet grasscutter --eval "db.avatars.find()" | grep "\"ownerId\" : $check_mongodb_uid") 79 | if [[ $check_mongodb_uid == "b" ]] || [[ $check_mongodb_uid == "B" ]]; then 80 | gcandroidTools 81 | elif [[ -z $check_uid_database ]]; then 82 | echo "${RC}UID not found!${WC}" 83 | echo 84 | echo -n "Press enter for back to GCAndroid Tools!" 85 | read 86 | gcandroidTools 87 | 88 | else 89 | echo "${GC}UID found!${WC}" 90 | check_character_database=$(mongo --quiet grasscutter --eval "db.avatars.find()" | grep "\"ownerId\" : $check_mongodb_uid" | grep "\"avatarId\" :" | sed "s/.*\"avatarId\" : //g" | sed "s/,.*//g") 91 | if [[ -z $check_character_database ]]; then 92 | echo "${RC}Character not found!${WC}" 93 | echo 94 | echo -n "Press enter for back to GCAndroid Tools!" 95 | read 96 | gcandroidTools 97 | else 98 | check_character_avatars=$(grep "$check_character_database" $Path_Shell/GM_Handbook/avatars.txt) 99 | if [[ -z $check_character_avatars ]]; then 100 | echo "${RC}Character not found!${WC}" 101 | echo 102 | echo -n "Press enter for back to GCAndroid Tools!" 103 | read 104 | gcandroidTools 105 | else 106 | echo "${CCB}List Avatars${WC}" 107 | echo $line | sed 's/=/~/g' 108 | get_character_avatars=$(grep "$check_character_database" $Path_Shell/GM_Handbook/avatars.txt | awk -F ":" '{print $1}') 109 | count_character_avatars=0 110 | for i in $get_character_avatars; do 111 | count_character_avatars=$((count_character_avatars + 1)) 112 | get_character_avatars_name=$(grep "$i" $Path_Shell/GM_Handbook/avatars.txt | awk -F ":" '{print $2}') 113 | get_character_avatars_id=$(grep "$i" $Path_Shell/GM_Handbook/avatars.txt | awk -F ":" '{print $1}') 114 | echo -e "$count_character_avatars. Name :${YC}$get_character_avatars_name${WC}\n > ID : ${GC}$get_character_avatars_id${WC}\n$(echo $line | sed 's/=/~/g')" 115 | done 116 | echo 117 | echo -n "Press enter for back to GCAndroid Tools!" 118 | read 119 | gcandroidTools 120 | fi 121 | fi 122 | fi 123 | } 124 | 125 | gcandroidTools() { 126 | credit_hah 127 | Center_Text "GCAndroid Tools" 128 | echo "1. ${CCB}Delete Avatars${WC}" 129 | echo "2. ${CCB}Check Avatars${WC}" 130 | echo "0. ${RC}Back${WC}" 131 | echo 132 | read -p "Enter your choice : " gcandroid_tools_input 133 | case $gcandroid_tools_input in 134 | 1) delete_avatars ;; 135 | 2) check_avatars ;; 136 | 0) main_menu ;; 137 | *) 138 | echo "${RC}Wrong Input!${WC}" 139 | sleep 1s 140 | gcandroidTools 141 | ;; 142 | esac 143 | } 144 | -------------------------------------------------------------------------------- /gcandroid/installPlugin.sh: -------------------------------------------------------------------------------- 1 | # Score-Inc/GCAndroid is licensed under the 2 | # GNU General Public License v3.0 3 | 4 | installPlugin_Download() { 5 | credit_hah 6 | Center_Text "Install Plugin Download" 7 | echo "${YC}Enter b/B for back${WC}" 8 | echo 9 | echo -n "${GC}Enter link Download .jar : ${WC}" 10 | read -r installPlugin_Download_Link 11 | if [[ $installPlugin_Download_Link == "" ]]; then 12 | echo "${RC}Please enter link!${WC}" 13 | sleep 1s 14 | installPlugin_Download 15 | elif [[ $installPlugin_Download_Link == "b" ]] || [[ $installPlugin_Download_Link == "B" ]]; then 16 | installPlugin 17 | fi 18 | folderNamePlugin=$HOME/PluginsGC 19 | if [ -d "$folderNamePlugin" ]; then 20 | rm -rf $folderNamePlugin 21 | mkdir $folderNamePlugin 22 | fi 23 | if [ ! -d "$folderNamePlugin" ]; then 24 | mkdir $folderNamePlugin 25 | fi 26 | cd $folderNamePlugin 27 | Run "wget $installPlugin_Download_Link" "Download .jar plugin" "0" "Plugins Menu" "installPlugin" 28 | getNamePlugin=$(ls $folderNamePlugin | sed "s/.*\///g") 29 | if [ ! -d "$grasscutter_path/plugins" ]; then 30 | mkdir "$grasscutter_path/plugins" 31 | fi 32 | if [[ $(echo "$getNamePlugin" | sed "s/.*\.//g") != "jar" ]]; then 33 | echo "${RC}Cannot continue because $getNamePlugin not .jar file!${WC}" 34 | echo 35 | rm -rf $folderNamePlugin 36 | read -p "Press enter for back to Menu!" 37 | main_menu 38 | return 39 | fi 40 | if [ -f "$grasscutter_path/plugins/$getNamePlugin" ]; then 41 | echo "${YC}Failed to install because $getNamePlugin already installed${WC}" 42 | echo 43 | echo -n "Press enter for back to Plugin Menu!" 44 | rm -rf $folderNamePlugin 45 | read 46 | installPlugin 47 | return 48 | fi 49 | Run "cp $folderNamePlugin/$getNamePlugin $grasscutter_path/plugins/" "Installing .jar plugin" "0" "Plugins Menu" "installPlugin" 50 | if [ -f "$grasscutter_path/plugins/${getNamePlugin}" ]; then 51 | echo "${GC}Install plugin ${getNamePlugin} success!${WC}" 52 | echo 53 | rm -rf $folderNamePlugin 54 | echo -n "Press enter for back to Menu!" 55 | read 56 | main_menu 57 | return 58 | else 59 | echo "${RC}Install plugin ${getNamePlugin} failed!${WC}" 60 | echo 61 | rm -rf $folderNamePlugin 62 | echo -n "Press enter for back to Menu!" 63 | read 64 | main_menu 65 | return 66 | fi 67 | } 68 | 69 | installPlugin_from_directory() { 70 | credit_hah 71 | Center_Text "Install Plugin Directory" 72 | echo "1. ${CCB}Using dialog command${WC}" 73 | echo "2. ${CCB}Manual Typing${WC}" 74 | echo "3. ${CCB}Help for Dialog command${WC}" 75 | echo "0. ${RC}Back${WC}" 76 | echo 77 | echo -n "Enter input : " 78 | read -r installPlugin_from_directory_input 79 | case $installPlugin_from_directory_input in 80 | "1") 81 | installPlugin_from_directory_Input="1" 82 | installPlugin_from_directory_process 83 | ;; 84 | "2") 85 | installPlugin_from_directory_Input="2" 86 | installPlugin_from_directory_process 87 | ;; 88 | "3") 89 | credit_hah 90 | echo "${YC}1. ${CCB}Space on your keyboard for select file!${WC}" 91 | echo "${YC}2. ${CCB}Use ↑, ↓, ←, → for interaction!${WC}" 92 | echo "${YC}3. ${CCB}Enter on your keyboard to continue if the choice is correct${WC}" 93 | echo 94 | echo -n "Press enter for back!" 95 | read 96 | installPlugin_from_directory 97 | ;; 98 | "0") installPlugin ;; 99 | *) 100 | echo "${RC}Wrong input!${WC}" 101 | sleep 1s 102 | installPlugin_from_directory 103 | ;; 104 | esac 105 | } 106 | 107 | installPlugin_from_directory_process() { 108 | if [[ $installPlugin_from_directory_Input == "1" ]]; then 109 | FILE=$(dialog --stdout --title "Please choose a .jar plugin" --fselect /sdcard/ 14 48) 110 | clear 111 | installPlugin_from_directory_Input_File=$FILE 112 | fileSearchDialog=true 113 | # echo "$installPlugin_from_directory_Input_File" 114 | # exit 115 | credit_hah 116 | Center_Text "Install Plugin Directory" 117 | elif [[ $installPlugin_from_directory_Input == "2" ]]; then 118 | credit_hah 119 | Center_Text "Install Plugin Directory" 120 | echo "${YC}Enter b/B for back${WC}" 121 | echo 122 | echo "${CCB}Please enter where .jar plugin${WC}" 123 | echo 124 | echo -n "${GC}Path : ${WC}" 125 | read -r installPlugin_from_directory_Input_File 126 | else 127 | echo "${RC}Wrong input!${WC}" 128 | sleep 1s 129 | installPlugin_from_directory 130 | return 131 | fi 132 | if [[ $installPlugin_from_directory_Input_File == "" ]]; then 133 | if [[ $fileSearchDialog = true ]]; then 134 | echo "${RC}Cancel by user${WC}" 135 | sleep 1s 136 | installPlugin_from_directory 137 | else 138 | echo "${RC}Please enter path!${WC}" 139 | sleep 1s 140 | installPlugin_from_directory_process 141 | return 142 | fi 143 | elif [[ $installPlugin_from_directory_Input_File == "b" ]] || [[ $installPlugin_from_directory_Input == "B" ]]; then 144 | installPlugin_from_directory 145 | return 146 | fi 147 | if ! [ -f "$installPlugin_from_directory_Input_File" ]; then 148 | echo "${RC}.jar not found! in ${installPlugin_from_directory_Input_File}${WC}" 149 | sleep 1.5s 150 | installPlugin_from_directory 151 | return 152 | else 153 | if ! [ "$(ls $installPlugin_from_directory_Input_File | sed "s/.*\.//g")" == "jar" ]; then 154 | echo "${RC}Cannot continue because $(echo "$installPlugin_from_directory_Input_File" | sed "s/.*\///g") not .jar file!${WC}" 155 | echo 156 | read -p "Press enter for back to Menu!" 157 | main_menu 158 | return 159 | else 160 | cp "$installPlugin_from_directory_Input_File" $grasscutter_path/plugins &>/dev/null 161 | fi 162 | getNamePlugin=$(ls $installPlugin_from_directory_Input_File | sed "s/.*\///g") 163 | if [[ ! -f "$grasscutter_path/plugins/$(echo $installPlugin_from_directory_Input_File | sed "s/.*\///g")" ]]; then 164 | echo "${RC}Failed install ${getNamePlugin} plugin to Grasscutter Folder!${WC}" 165 | echo 166 | read -p "Press enter for back to Menu!" 167 | main_menu 168 | return 169 | else 170 | echo "${GC}Plugin ${getNamePlugin} success installed!${WC}" 171 | echo 172 | read -p "Press enter for back to Menu!" 173 | main_menu 174 | return 175 | fi 176 | fi 177 | } 178 | 179 | installPlugin() { 180 | credit_hah 181 | Center_Text "Install Plugin" 182 | if ! [ -d "$grasscutter_path" ]; then 183 | echo "${RC}Folder Grasscutter in $grasscutter_path is not found!${WC}" 184 | echo 185 | read -p "Press enter for back to Menu Grasscutter Tools" 186 | Grasscutter_Tools 187 | fi 188 | echo "1. ${CCB}Download plugin and Install${WC}" 189 | echo "2. ${CCB}Install Plugin from local directory${WC}" 190 | echo "0. ${RC}Back${WC}" 191 | echo 192 | echo -n "Enter input : " 193 | read -r installPlugin_Input 194 | case $installPlugin_Input in 195 | "1") installPlugin_Download ;; 196 | "2") installPlugin_from_directory ;; 197 | "0") Grasscutter_Tools ;; 198 | *) 199 | echo "${RC}Wrong input!${WC}" 200 | sleep 1s 201 | installPlugin 202 | ;; 203 | esac 204 | } 205 | -------------------------------------------------------------------------------- /gcandroid/installGrasscutter.sh: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | # Score-Inc/GCAndroid is licensed under the 4 | # GNU General Public License v3.0 5 | 6 | Install_Grasscutter_process() { 7 | if ! command -v unzip &>/dev/null; then 8 | echo "${GC}Installing unzip command...${WC}" 9 | apt install unzip -y &>/dev/null 10 | fi 11 | if ! command -v git &>/dev/null; then 12 | echo "${GC}Installing git command...${WC}" 13 | apt install git -y &>/dev/null 14 | fi 15 | if [[ "${Grasscutter_Already_Installed}" == "1" ]]; then 16 | credit_hah 17 | echo "${GC}Do you want to keep resources folder?${WC}" 18 | echo 19 | echo -n "Enter your choice [y/N] : " 20 | read Keep_Resources 21 | if [[ $Keep_Resources == "y" || $Keep_Resources == "Y" ]]; then 22 | Backup_Resources="1" 23 | elif [[ $Keep_Resources == "n" || $Keep_Resources == "N" ]]; then 24 | Backup_Resources="0" 25 | else 26 | echo "${RC}Invalid choice${WC}" 27 | echo 28 | echo -n "Press enter for back to Menu" 29 | read 30 | main_menu 31 | fi 32 | fi 33 | Install_Grasscutter_process_grasscutter="compile" 34 | Install_Grasscutter_Resources_Version="3.3" 35 | credit_hah 36 | if [[ $Backup_Resources == "1" ]]; then 37 | echo "${CCB}Backup Resources : ${GC}Yes${WC}" 38 | if [ -f $grasscutter_path/resources* ]; then 39 | mv -r $grasscutter_path/resources* $HOME/resourcesBackupGCAndroid.zip 40 | elif [ -d $grasscutter_path/resources* ]; then 41 | mv -r $grasscutter_path/resources* $HOME/resourcesBackupGCAndroid 42 | elif [[ -z $(ls -A $grasscutter_path/resources* 2>/dev/null) ]]; then 43 | echo "${CCB}Resources : ${RC}Resources is exist but empty${WC}" 44 | echo 45 | echo -n "Press enter for back to Menu" 46 | read 47 | main_menu 48 | elif ! (${checkResources} > /dev/null 2>&1); then 49 | echo "${CCB}Resources : ${RC}Resources is not exist${WC}" 50 | echo 51 | echo -n "Press enter for back to Menu" 52 | read 53 | main_menu 54 | else 55 | echo "${RC}Errors while backup resources${WC}" 56 | echo 57 | echo -n "Press enter for back to Menu" 58 | read 59 | main_menu 60 | fi 61 | echo $line 62 | elif [[ $Backup_Resources == "0" ]]; then 63 | echo "${CCB}Backup Resources : ${GC}No${WC}" 64 | else 65 | echo "${CCB}Backup Resources : ${RC}Not Selected${WC}" 66 | fi 67 | sleep 1s 68 | if [[ $Backup_Resources == "0" ]]; then 69 | clear 70 | credit_hah 71 | fi 72 | Run "apt install openjdk-17 -y" "Install Java JDK 17" "0" "Menu" "main_menu" 73 | if [ -d "$grasscutter_path" ]; then 74 | Run "rm -rf $grasscutter_path" "Removing Folder $nameFolder" "0" "Menu" "main_menu" 75 | fi 76 | sleep 1s 77 | cd $HOME || exit 1 78 | if [[ $Install_Grasscutter_process_grasscutter = "compile" ]]; then 79 | Run "git clone $(jq -r .Grasscutter $Path_Repojson)" "Clone Repository $nameFolder" "0" "Menu" "main_menu" 80 | fi 81 | sleep 1s 82 | cd $HOME || exit 1 83 | if [[ $Backup_Resources == "0" ]]; then 84 | Run "wget $(jq -r .Resources $Path_Repojson) -O resourcesGCAndroid.zip" "Download Resources" "0" "Menu" "main_menu" 85 | echo -n "Do you want to extract resources? (y/N) : " 86 | read -r Install_Grasscutter_process_grasscutter_extract 87 | if [[ $Install_Grasscutter_process_grasscutter_extract == "y" ]] || [[ $Install_Grasscutter_process_grasscutter_extract == "Y" ]]; then 88 | Run "unzip -o resourcesGCAndroid.zip" "Unzip Resources" "0" "Menu" "main_menu" 89 | mv GC*Resources*/Resources $grasscutter_path/resources 90 | rm -rf GC*Resources* 91 | rm resourcesGCAndroid.zip 92 | else 93 | Install_Grasscutter_process_grasscutter_extract="n" 94 | echo "${GC}Skip extracting Resources${WC}" 95 | mv resourcesGCAndroid.zip $nameFolder/ 96 | sleep 1s 97 | fi 98 | fi 99 | cd $grasscutter_path || exit 1 100 | credit_hah 101 | if [[ $Install_Grasscutter_process_grasscutter = "compile" ]]; then 102 | chmod +x gradlew 103 | Run "./gradlew jar" "Compiling grasscutter.jar" "0" "Menu" "main_menu" 104 | mv grasscutter*.jar grasscutter.jar 105 | fi 106 | echo "${GC}Generate config.json${WC}" 107 | timeout --foreground 8s java -jar grasscutter.jar &>/dev/null 108 | clear 109 | credit_hah 110 | if [[ $Backup_Resources == "1" ]]; then 111 | if [ -d $grasscutter_path/resources ]; then 112 | rm -rf $grasscutter_path/resources 113 | fi 114 | if test -f $HOME/resourcesBackupGCAndroid.zip && test -d $HOME/resourcesBackupGCAndroid ; then 115 | mv $HOME/resourcesBackupGCAndroid.zip $grasscutter_path/resourcesGCAndroid.zip 116 | Install_Grasscutter_process_grasscutter_extract="y" 117 | mv $HOME/resourcesBackupGCAndroid $grasscutter_path/resources 118 | else 119 | echo "${RC}Backup resources not found${WC}" 120 | fi 121 | fi 122 | echo "${GC}Editing config.json...${WC}" 123 | 124 | if [ ! -f "config.json" ]; then 125 | echo "${RC}config.json not found..." 126 | echo "${YC}Skip edit config.json...${WC}" 127 | else 128 | sed -i "s/\"bindPort\": 443/\"bindPort\": 54321/g" config.json 129 | if [[ $Install_Grasscutter_process_grasscutter_extract == "n" ]] || [[ $Install_Grasscutter_process_grasscutter_extract == "N" ]]; then 130 | sed -i "s/\"resources\": \".*\"/\"resources\": \".\/resourcesGCAndroid.zip\"/g" config.json 131 | fi 132 | sed -i "s/\"welcomeMessage\": \".*\"/\"welcomeMessage\": \"Localhost on Android using GCAndroid(Z3RO ElaXan)\\\n\\\nhttps:\/\/github.com\/Score-Inc\/GCAndroid\"/g" config.json 133 | sed -i "s/\"nickName\": \".*\"/\"nickName\": \"ElaXan\"/g" config.json 134 | sed -i "s/\"signature\": \".*\"/\"signature\": \"Welcome to GCAndroid, run with Grasscutter!\"/g" config.json 135 | sleep 1s 136 | echo "${GC}Done Set All" 137 | echo "Address : 127.0.0.1" 138 | echo "Port : 54321${WC}" 139 | fi 140 | echo "" 141 | echo -n "Press enter for back to Menu!" 142 | read 143 | main_menu 144 | } 145 | 146 | Download_Resources() { 147 | credit_hah 148 | echo -n "${CCB}Are you sure want to download resources only?${WC} (y/N) : " 149 | read -r Download_Resources_process 150 | if [[ $Download_Resources_process == "y" ]] || [[ $Download_Resources_process == "Y" ]]; then 151 | # Check if folder $grasscutter_path exist but empty, if yes then return 152 | check_folder_empty=$(ls -A "$grasscutter_path") 153 | if [ -d "$grasscutter_path" ] && [ -z "$check_folder_empty" ]; then 154 | echo "${RC}Looks like you haven't installed Grasscutter yet${WC}" 155 | echo -n "Do you want to continue? (y/N) : " 156 | read -r Download_Resources_process_continue 157 | if [[ $Download_Resources_process_continue == "y" ]] || [[ $Download_Resources_process_continue == "Y" ]]; then 158 | echo "${GC}Continue...${WC}" 159 | else 160 | echo "${RC}Skip...${WC}" 161 | sleep 1s 162 | main_menu 163 | fi 164 | elif [ ! -d "$grasscutter_path" ]; then 165 | mkdir -p "$grasscutter_path" 166 | fi 167 | sleep 1s 168 | cd $grasscutter_path || exit 1 169 | Run "wget $(jq -r .Resources $Path_Repojson) -O resourcesGCAndroid.zip" "Download Resources" "0" "Menu" "main_menu" 170 | echo -n "Do you want to extract resources? (y/N) : " 171 | read -r Download_Resources_process_extract 172 | if [[ $Download_Resources_process_extract == "y" ]] || [[ $Download_Resources_process_extract == "Y" ]]; then 173 | Run "unzip -o resourcesGCAndroid.zip" "Unzip Resources" "0" "Menu" "main_menu" 174 | mv GC*Resources*3.3*/Resources Grasscutter/resources 175 | rm -rf GC*Resources*3.3* 176 | rm resourcesGCAndroid.zip 177 | else 178 | Download_Resources_process_extract="n" 179 | echo "${GC}Skip extracting Resources${WC}" 180 | sleep 1s 181 | fi 182 | echo "${GC}Success Download Resources${WC}" 183 | echo "" 184 | echo -n "Press enter for back to Menu!" 185 | read 186 | main_menu 187 | else 188 | echo "${GC}Skip Download Resources${WC}" 189 | sleep 1s 190 | main_menu 191 | fi 192 | } 193 | 194 | Download_Grasscutter() { 195 | credit_hah 196 | Center_Text "Download Grasscutter" 197 | if [ -z "$docker_zip_name" ]; then 198 | echo "${RC}Error${WC}: docker_zip_name is not set" 199 | read 200 | Docker 201 | fi 202 | echo -n "${CCB}Are you sure want to download Grasscutter?${WC} (y/N) : " 203 | read -r Download_Grasscutter_process 204 | if [[ $Download_Grasscutter_process == "y" ]] || [[ $Download_Grasscutter_process == "Y" ]]; then 205 | if [ -d "$grasscutter_path" ]; then 206 | echo "${RC}Looks like you have installed Grasscutter already${WC}" 207 | echo -n "Do you want to delete old Grasscutter and continue? (y/N) : " 208 | read -r Download_Grasscutter_process_continue 209 | if [[ $Download_Grasscutter_process_continue == "y" ]] || [[ $Download_Grasscutter_process_continue == "Y" ]]; then 210 | echo "${GC}Continue...${WC}" 211 | rm -rf "$grasscutter_path" 212 | mkdir -p "$grasscutter_path" 213 | else 214 | echo "${RC}Cancel...${WC}" 215 | sleep 1s 216 | main_menu 217 | fi 218 | else 219 | mkdir -p "$grasscutter_path" 220 | fi 221 | cd $grasscutter_path || exit 1 222 | Run "wget https://github.com/Score-Inc/GCAndroid/releases/download/DockerGS/$docker_zip_name -O $docker_zip_name" "Download Grasscutter" "0" "Menu" "main_menu" 223 | Run "unzip -o $docker_zip_name" "Unzip Grasscutter" "0" "Menu" "main_menu" 224 | rm $docker_zip_name 225 | Run "wget $(jq -r .Resources $Path_Repojson) -O resourcesGCAndroid.zip" "Download Resources" "0" "Menu" "main_menu" 226 | Run "unzip -o resourcesGCAndroid.zip" "Unzip Resources" "0" "Menu" "main_menu" 227 | mv GC*Resources*/Resources $grasscutter_path/resources 228 | rm -rf GC*Resources* 229 | rm resourcesGCAndroid.zip 230 | echo "${GC}Generate config.json${WC}" 231 | timeout --foreground 8s java -jar grasscutter.jar &>/dev/null 232 | echo "${GC}Editing config.json...${WC}" 233 | if [ ! -f "config.json" ]; then 234 | echo "${RC}config.json not found..." 235 | echo "${YC}Skip edit config.json...${WC}" 236 | else 237 | sed -i "s/\"bindPort\": 443/\"bindPort\": 54321/g" config.json 238 | sed -i "s/\"welcomeMessage\": \".*\"/\"welcomeMessage\": \"Localhost on Android using GCAndroid(Z3RO ElaXan)\\\n\\\nhttps:\/\/github.com\/Score-Inc\/GCAndroid\"/g" config.json 239 | sed -i "s/\"nickName\": \".*\"/\"nickName\": \"ElaXan\"/g" config.json 240 | sed -i "s/\"signature\": \".*\"/\"signature\": \"Welcome to GCAndroid, run with Grasscutter!\"/g" config.json 241 | sleep 1s 242 | echo "${GC}Done Set All" 243 | echo "Address : 127.0.0.1" 244 | echo "Port : 54321${WC}" 245 | fi 246 | echo "${GC}Success Download Grasscutter${WC}" 247 | echo "" 248 | echo -n "Press enter for back to Menu!" 249 | read 250 | main_menu 251 | else 252 | echo "${GC}Skip Download Grasscutter${WC}" 253 | sleep 1s 254 | main_menu 255 | fi 256 | } 257 | 258 | Pull_DockerGS_Image() { 259 | credit_hah 260 | Center_Text "Pull DockerGS Image" 261 | if ! su -c echo &>/dev/null; then 262 | echo "${RC}Error${WC}: Your phone is not rooted for pull Docker Image!" 263 | echo 264 | echo -n "Press enter for back to Menu!" 265 | read 266 | main_menu 267 | fi 268 | if ! command -v docker &>/dev/null; then 269 | Run "apt install root-repo -y" "Install Root Repo" "0" "Menu" "main_menu" 270 | Run "apt install docker -y" "Install Docker" "0" "Menu" "main_menu" 271 | fi 272 | if ! command -v sudo &>/dev/null; then 273 | Run "apt install tsu -y" "Install Tsu/Sudo" "0" "Menu" "main_menu" 274 | fi 275 | echo -n "${CCB}Are you sure want to pull DockerGS Image?${WC} (y/N) : " 276 | read -r Pull_DockerGS_Image_process 277 | if [[ $Pull_DockerGS_Image_process == "y" ]] || [[ $Pull_DockerGS_Image_process == "Y" ]]; then 278 | if [ -d "$grasscutter_path" ]; then 279 | echo "${RC}Looks like you have installed Grasscutter already${WC}" 280 | echo -n "Do you want to delete old Grasscutter and continue? (y/N) : " 281 | read -r Pull_DockerGS_Image_process_continue 282 | if [[ $Pull_DockerGS_Image_process_continue == "y" ]] || [[ $Pull_DockerGS_Image_process_continue == "Y" ]]; then 283 | echo "${GC}Continue...${WC}" 284 | rm -rf "$grasscutter_path" 285 | else 286 | echo "${RC}Cancel...${WC}" 287 | sleep 1s 288 | main_menu 289 | fi 290 | fi 291 | sudo dockerd --iptables=false &>/dev/null & 292 | sleep 2s 293 | Run "sudo docker pull siakbary/dockergs:alpine-gc-3.4" "Pull DockerGS Image" "0" "Menu" "main_menu" 294 | pathDockerGS=$(sudo docker inspect --format='{{.GraphDriver.Data.LowerDir}}' "siakbary/dockergs:alpine-gc-3.4" | awk '{split($0,a,":"); print a[1]}') 295 | if [ ! -d "$grasscutter_path" ]; then 296 | mkdir -p "$grasscutter_path" 297 | fi 298 | cd $grasscutter_path || exit 1 299 | sudo mv -f $pathDockerGS/home/dockergs $HOME 300 | sudo mv -f $HOME/dockergs/* $grasscutter_path 301 | sudo rm -rf $HOME/dockergs 302 | 303 | for fileFolder in $(find "$grasscutter_path" -type d); do 304 | sudo chown $(whoami):$(whoami) "$fileFolder" 305 | done 306 | 307 | sudo chown $(whoami):$(whoami) $grasscutter_path/* 308 | Run "wget $(jq -r .Resources $Path_Repojson) -O resourcesGCAndroid.zip" "Download Resources" "0" "Menu" "main_menu" 309 | Run "unzip -o resourcesGCAndroid.zip" "Unzip Resources" "0" "Menu" "main_menu" 310 | mv GC*Resources*/Resources $grasscutter_path/resources 311 | rm -rf GC*Resources* 312 | rm resourcesGCAndroid.zip 313 | Run "sudo docker rmi siakbary/dockergs:alpine-gc-3.4" "Remove DockerGS Image" "0" "Menu" "main_menu" 314 | echo "${GC}Generate config.json${WC}" 315 | timeout --foreground 8s java -jar grasscutter.jar &>/dev/null 316 | echo "${GC}Editing config.json...${WC}" 317 | if [ ! -f "config.json" ]; then 318 | echo "${RC}config.json not found..." 319 | echo "${YC}Skip edit config.json...${WC}" 320 | else 321 | sed -i "s/\"bindPort\": 443/\"bindPort\": 54321/g" config.json 322 | sed -i "s/\"welcomeMessage\": \".*\"/\"welcomeMessage\": \"Localhost on Android using GCAndroid(Z3RO ElaXan)\\\n\\\nhttps:\/\/github.com\/Score-Inc\/GCAndroid\"/g" config.json 323 | sed -i "s/\"nickName\": \".*\"/\"nickName\": \"ElaXan\"/g" config.json 324 | sed -i "s/\"signature\": \".*\"/\"signature\": \"Welcome to GCAndroid, run with Grasscutter!\"/g" config.json 325 | sleep 1s 326 | echo "${GC}Done Set All" 327 | echo "Address : 127.0.0.1" 328 | echo "Port : 54321${WC}" 329 | fi 330 | sudo pkill dockerd 331 | echo "${GC}Success Pull DockerGS Image${WC}" 332 | echo "" 333 | echo -n "Press enter for back to Menu!" 334 | read 335 | main_menu 336 | else 337 | echo "${GC}Cancel Pull DockerGS Image${WC}" 338 | sleep 1s 339 | main_menu 340 | fi 341 | } -------------------------------------------------------------------------------- /gcandroid/getConfigjson.sh: -------------------------------------------------------------------------------- 1 | getConfigJson() { 2 | getArguments=$1 3 | if [ $getArguments = "folderStructure" ]; then 4 | folderStructure_resources=$(jq -r '.folderStructure.resources' config.json) 5 | folderStructure_data=$(jq -r '.folderStructure.data' config.json) 6 | folderStructure_packets=$(jq -r '.folderStructure.packets' config.json) 7 | folderStructure_scripts=$(jq -r '.folderStructure.scripts' config.json) 8 | folderStructure_plugins=$(jq -r '.folderStructure.plugins' config.json) 9 | elif [ $getArguments = "Server" ]; then 10 | logCommands=$(jq '.server.logCommands' config.json 2>/dev/null) 11 | if [[ $logCommands = "true" ]]; then 12 | logCommandsOut="${GC}True${WC}" 13 | elif [[ $logCommands = "false" ]]; then 14 | logCommandsOut="${RC}False${WC}" 15 | else 16 | logCommandsOut="${RC}Error${WC}" 17 | fi 18 | runMode=$(jq '.server.runMode' config.json 2>/dev/null) 19 | if [[ $runMode = "\"HYBRID\"" ]]; then 20 | runModeOut="${GC}HYBRID${WC}" 21 | elif [[ $runMode = "\"DISPATCH_ONLY\"" ]]; then 22 | runModeOut="${GC}DISPATCH_ONLY${WC}" 23 | elif [[ $runMode = "\"GAME_ONLY\"" ]]; then 24 | runModeOut="${GC}GAME_ONLY${WC}" 25 | else 26 | runModeOut="${RC}Error${WC}" 27 | fi 28 | elif [ $getArguments = "Server.HTTP" ]; then 29 | server_http_bindAddress=$(jq -r '.server.http.bindAddress' config.json 2>/dev/null) 30 | if [[ $server_http_bindAddress == "" ]]; then 31 | server_http_bindAddress="${RC}Error${WC}" 32 | fi 33 | server_http_accessAddress=$(jq -r '.server.http.accessAddress' config.json 2>/dev/null) 34 | if [[ $server_http_accessAddress == "" ]]; then 35 | server_http_accessAddress="${RC}Error${WC}" 36 | fi 37 | server_http_accessPort=$(jq '.server.http.accessPort' config.json 2>/dev/null) 38 | if [[ $server_http_accessPort == "" ]]; then 39 | server_http_accessPort="${RC}Error${WC}" 40 | fi 41 | elif [ $getArguments = "Server.HTTP.Encryption" ]; then 42 | server_http_encryption_useEncryption=$(jq '.server.http.encryption.useEncryption' config.json 2>/dev/null) 43 | if [[ $server_http_encryption_useEncryption == "false" ]]; then 44 | server_http_encryption_useEncryptionOut="${RC}False${WC}" 45 | elif [[ $server_http_encryption_useEncryption == "true" ]]; then 46 | server_http_encryption_useEncryptionOut="${GC}True${WC}" 47 | else 48 | server_http_encryption_useEncryptionOut="${RC}Error${WC}" 49 | fi 50 | server_http_encryption_useInRouting=$(jq '.server.http.encryption.useInRouting' config.json 2>/dev/null) 51 | if [[ $server_http_encryption_useInRouting == "false" ]]; then 52 | server_http_encryption_useInRoutingOut="${RC}False${WC}" 53 | elif [[ $server_http_encryption_useInRouting == "true" ]]; then 54 | server_http_encryption_useInRoutingOut="${GC}True${WC}" 55 | else 56 | server_http_encryption_useInRoutingOut="${RC}Error${WC}" 57 | fi 58 | server_http_encryption_keystore=$(jq -r '.server.http.encryption.keystore' config.json 2>/dev/null) 59 | if [[ $server_http_encryption_keystore == "" ]]; then 60 | server_http_encryption_keystore="${RC}Error${WC}" 61 | fi 62 | server_http_encryption_keystorePassword=$(jq -r '.server.http.encryption.keystorePassword' config.json 2>/dev/null) 63 | if [[ $server_http_encryption_keystorePassword == "" ]]; then 64 | server_http_encryption_keystorePassword="${RC}Error${WC}" 65 | fi 66 | elif [ $getArguments = "Server.http.policies.cors" ]; then 67 | server_http_policies_cors_enabled=$(jq '.server.http.policies.cors.enabled' config.json 2>/dev/null) 68 | if [[ $server_http_policies_cors_enabled == "false" ]]; then 69 | server_http_policies_cors_enabledOut="${RC}False${WC}" 70 | elif [[ $server_http_policies_cors_enabled == "true" ]]; then 71 | server_http_policies_cors_enabledOut="${GC}True${WC}" 72 | else 73 | server_http_policies_cors_enabledOut="${RC}Error${WC}" 74 | fi 75 | elif [ $getArguments = "server.http.files" ]; then 76 | server_http_files_indexFile=$(jq -r '.server.http.files.indexFile' config.json 2>/dev/null) 77 | if [[ $server_http_files_indexFile == "" ]]; then 78 | server_http_files_indexFile="${RC}Error${WC}" 79 | fi 80 | server_http_files_errorFIle=$(jq -r '.server.http.files.errorFile' config.json 2>/dev/null) 81 | if [[ $server_http_files_errorFIle == "" ]]; then 82 | server_http_files_errorFIle="${RC}Error${WC}" 83 | fi 84 | elif [ $getArguments = "server.http.game" ]; then 85 | server_game_bindAddress=$(jq -r '.server.game.bindAddress' config.json 2>/dev/null) 86 | if [[ $server_game_bindAddress == "" ]]; then 87 | server_game_bindAddress="${RC}Error${WC}" 88 | fi 89 | server_game_bindPort=$(jq '.server.game.bindPort' config.json 2>/dev/null) 90 | if [[ $server_game_bindPort == "" ]]; then 91 | server_game_bindPort="${RC}Error${WC}" 92 | fi 93 | server_game_accessAddress=$(jq -r '.server.game.accessAddress' config.json 2>/dev/null) 94 | if [[ $server_game_accessAddress == "" ]]; then 95 | server_game_accessAddress="${RC}Error${WC}" 96 | fi 97 | server_game_accessPort=$(jq -r '.server.game.accessPort' config.json 2>/dev/null) 98 | if [[ $server_game_accessPort == "" ]]; then 99 | server_game_accessPort="${RC}Error${WC}" 100 | fi 101 | server_game_loadEntitiesForPlayerRange=$(jq '.server.game.loadEntitiesForPlayerRange' config.json 2>/dev/null) 102 | if [[ $server_game_loadEntitiesForPlayerRange == "" ]]; then 103 | server_game_loadEntitiesForPlayerRange="${RC}Error${WC}" 104 | fi 105 | server_game_enableScriptInBigWorld=$(jq '.server.game.enableScriptInBigWorld' config.json 2>/dev/null) 106 | if [[ $server_game_enableScriptInBigWorld = "true" ]]; then 107 | server_game_enableScriptInBigWorldOut="${GC}True${WC}" 108 | elif [[ $server_game_enableScriptInBigWorld = "false" ]]; then 109 | server_game_enableScriptInBigWorldOut="${RC}False${WC}" 110 | fi 111 | server_game_enableConsole=$(jq '.server.game.enableConsole' config.json 2>/dev/null) 112 | if [[ $server_game_enableConsole == "true" ]]; then 113 | server_game_enableConsoleOut="${GC}True${WC}" 114 | elif [[ $server_game_enableConsole == "false" ]]; then 115 | server_game_enableConsoleOut="${RC}False${WC}" 116 | else 117 | server_game_enableConsoleOut="${RC}Error${WC}" 118 | fi 119 | server_game_kcpInterval=$(jq '.server.game.kcpInterval' config.json 2>/dev/null) 120 | if [[ $server_game_kcpInterval == "" ]]; then 121 | server_game_kcpInterval="${RC}Error${WC}" 122 | fi 123 | server_game_logPackets=$(jq -r '.server.game.logPackets' config.json 2>/dev/null) 124 | if [[ $server_game_logPackets == "" ]]; then 125 | server_game_logPackets="${RC}Error${WC}" 126 | fi 127 | server_game_isShowPacketPayload=$(jq '.server.game.isShowPacketPayload' config.json 2>/dev/null) 128 | if [[ $server_game_isShowPacketPayload == "false" ]]; then 129 | server_game_isShowPacketPayloadOut="${RC}False${WC}" 130 | elif [[ $server_game_isShowPacketPayload == "true" ]]; then 131 | server_game_isShowPacketPayloadOut="${GC}True${WC}" 132 | else 133 | server_game_isShowPacketPayloadOut="${RC}Error${WC}" 134 | fi 135 | server_game_isShowLoopPackets=$(jq '.server.game.isShowLoopPackets' config.json 2>/dev/null) 136 | if [[ $server_game_isShowLoopPackets == "true" ]]; then 137 | server_game_isShowLoopPacketsOut="${GC}True${WC}" 138 | elif [[ $server_game_isShowLoopPackets == "false" ]]; then 139 | server_game_isShowLoopPacketsOut="${RC}False${WC}" 140 | else 141 | server_game_isShowLoopPacketsOut="${RC}Error${WC}" 142 | fi 143 | elif [ $getArguments == "server.game.gameOptions" ]; then 144 | server_game_gameOptions_sceneEntityLimit=$(jq '.server.game.gameOptions.sceneEntityLimit' config.json 2>/dev/null) 145 | if [[ $server_game_gameOptions_sceneEntityLimit == "" ]]; then 146 | server_game_gameOptions_sceneEntityLimit="${RC}Error${WC}" 147 | fi 148 | server_game_gameOptions_watchGachaConfig=$(jq '.server.game.gameOptions.watchGachaConfig' config.json 2>/dev/null) 149 | if [[ $server_game_gameOptions_watchGachaConfig == "true" ]]; then 150 | server_game_gameOptions_watchGachaConfigOut="${GC}True${WC}" 151 | elif [[ $server_game_gameOptions_watchGachaConfig == "false" ]]; then 152 | server_game_gameOptions_watchGachaConfigOut="${RC}False${WC}" 153 | else 154 | server_game_gameOptions_watchGachaConfigOut="${RC}Error${WC}" 155 | fi 156 | server_game_gameOptions_enableShopItems=$(jq '.server.game.gameOptions.enableShopItems' config.json 2>/dev/null) 157 | if [[ $server_game_gameOptions_enableShopItems == "true" ]]; then 158 | server_game_gameOptions_enableShopItemsOut="${GC}True${WC}" 159 | elif [[ $server_game_gameOptions_enableShopItems == "false" ]]; then 160 | server_game_gameOptions_enableShopItemsOut="${RC}False${WC}" 161 | else 162 | server_game_gameOptions_enableShopItemsOut="${RC}Error${WC}" 163 | fi 164 | server_game_gameOptions_staminaUsage=$(jq '.server.game.gameOptions.staminaUsage' config.json 2>/dev/null) 165 | if [[ $server_game_gameOptions_staminaUsage == "true" ]]; then 166 | server_game_gameOptions_staminaUsageOut="${GC}True${WC}" 167 | elif [[ $server_game_gameOptions_staminaUsage == "false" ]]; then 168 | server_game_gameOptions_staminaUsageOut="${RC}False${WC}" 169 | else 170 | server_game_gameOptions_staminaUsageOut="${RC}Error${WC}" 171 | fi 172 | server_game_gameOptions_energyUsage=$(jq '.server.game.gameOptions.energyUsage' config.json 2>/dev/null) 173 | if [[ $server_game_gameOptions_energyUsage == "true" ]]; then 174 | server_game_gameOptions_energyUsageOut="${GC}True${WC}" 175 | elif [[ $server_game_gameOptions_energyUsage == "false" ]]; then 176 | server_game_gameOptions_energyUsageOut="${RC}False${WC}" 177 | else 178 | server_game_gameOptions_energyUsageOut="${RC}Error${WC}" 179 | fi 180 | server_game_gameOptions_fishhookTeleport=$(jq '.server.game.gameOptions.fishhookTeleport' config.json 2>/dev/null) 181 | if [[ $server_game_gameOptions_fishhookTeleport == "true" ]]; then 182 | server_game_gameOptions_fishhookTeleportOut="${GC}True${WC}" 183 | elif [[ $server_game_gameOptions_fishhookTeleport == "false" ]]; then 184 | server_game_gameOptions_fishhookTeleportOut="${RC}False${WC}" 185 | else 186 | server_game_gameOptions_fishhookTeleportOut="${RC}Error${WC}" 187 | fi 188 | elif [ $getArguments == "server.game.gameOptions.inventoryLimits" ]; then 189 | server_game_gameOptions_inventoryLimits_weapons=$(jq '.server.game.gameOptions.inventoryLimits.weapons' config.json 2>/dev/null) 190 | if [[ $server_game_gameOptions_inventoryLimits_weapons == "" ]]; then 191 | server_game_gameOptions_inventoryLimits_weapons="${RC}Error${WC}" 192 | fi 193 | server_game_gameOptions_inventoryLimits_relics=$(jq '.server.game.gameOptions.inventoryLimits.relics' config.json 2>/dev/null) 194 | if [[ $server_game_gameOptions_inventoryLimits_relics == "" ]]; then 195 | server_game_gameOptions_inventoryLimits_relics="${RC}Error${WC}" 196 | fi 197 | server_game_gameOptions_inventoryLimits_materials=$(jq '.server.game.gameOptions.inventoryLimits.materials' config.json 2>/dev/null) 198 | if [[ $server_game_gameOptions_inventoryLimits_materials == "" ]]; then 199 | server_game_gameOptions_inventoryLimits_materials="${RC}Error${WC}" 200 | fi 201 | server_game_gameOptions_inventoryLimits_furniture=$(jq '.server.game.gameOptions.inventoryLimits.furniture' config.json 2>/dev/null) 202 | if [[ $server_game_gameOptions_inventoryLimits_furniture == "" ]]; then 203 | server_game_gameOptions_inventoryLimits_furniture="${RC}Error${WC}" 204 | fi 205 | server_game_gameOptions_inventoryLimits_all=$(jq '.server.game.gameOptions.inventoryLimits.all' config.json 2>/dev/null) 206 | if [[ $server_game_gameOptions_inventoryLimits_all == "" ]]; then 207 | server_game_gameOptions_inventoryLimits_all="${RC}Error${WC}" 208 | fi 209 | elif [ $getArguments == "server.game.gameOptions.avatarLimits" ]; then 210 | server_game_gameOptions_avatarLimits_singlePlayerTeam=$(jq '.server.game.gameOptions.avatarLimits.singlePlayerTeam' config.json 2>/dev/null) 211 | if [[ $server_game_gameOptions_avatarLimits_singlePlayerTeam == "" ]]; then 212 | server_game_gameOptions_avatarLimits_singlePlayerTeam="${RC}Error${WC}" 213 | fi 214 | server_game_gameOptions_avatarLimits_multiplayerTeam=$(jq '.server.game.gameOptions.avatarLimits.multiplayerTeam' config.json 2>/dev/null) 215 | if [[ $server_game_gameOptions_avatarLimits_multiplayerTeam == "" ]]; then 216 | server_game_gameOptions_avatarLimits_multiplayerTeam="${RC}Error${WC}" 217 | fi 218 | elif [ $getArguments == "server.game.gameOptions.resinOptions" ]; then 219 | server_game_gameOptions_resinOptions_resinUsage=$(jq '.server.game.gameOptions.resinOptions.resinUsage' config.json 2>/dev/null) 220 | if [[ $server_game_gameOptions_resinOptions_resinUsage == "true" ]]; then 221 | server_game_gameOptions_resinOptions_resinUsageOut="${GC}True${WC}" 222 | elif [[ $server_game_gameOptions_resinOptions_resinUsage == "false" ]]; then 223 | server_game_gameOptions_resinOptions_resinUsageOut="${RC}False${WC}" 224 | else 225 | server_game_gameOptions_resinOptions_resinUsageOut="${RC}Error${WC}" 226 | fi 227 | server_game_gameOptions_resinOptions_cap=$(jq '.server.game.gameOptions.resinOptions.cap' config.json 2>/dev/null) 228 | if [[ $server_game_gameOptions_resinOptions_cap == "" ]]; then 229 | echo "${RC}Error${WC}" 230 | fi 231 | server_game_gameOptions_resinOptions_rechargeTime=$(jq '.server.game.gameOptions.resinOptions.rechargeTime' config.json 2>/dev/null) 232 | if [[ $server_game_gameOptions_resinOptions_rechargeTime == "" ]]; then 233 | server_game_gameOptions_resinOptions_rechargeTime="${RC}Error${WC}" 234 | fi 235 | elif [ $getArguments == "server.game.gameOptions.rates" ]; then 236 | server_game_gameOptions_rates_adventureExp=$(jq '.server.game.gameOptions.rates.adventureExp' config.json 2>/dev/null) 237 | if [[ $server_game_gameOptions_rates_adventureExp == "" ]]; then 238 | server_game_gameOptions_rates_adventureExp="${RC}Error${WC}" 239 | fi 240 | server_game_gameOptions_rates_mora=$(jq '.server.game.gameOptions.rates.mora' config.json 2>/dev/null) 241 | if [[ $server_game_gameOptions_rates_mora == "" ]]; then 242 | server_game_gameOptions_rates_mora="${RC}Error${WC}" 243 | fi 244 | server_game_gameOptions_rates_leyLines=$(jq '.server.game.gameOptions.rates.leyLines' config.json 2>/dev/null) 245 | if [[ $server_game_gameOptions_rates_leyLines == "" ]]; then 246 | server_game_gameOptions_rates_leyLines="${RC}Error${WC}" 247 | fi 248 | elif [ $getArguments == "databaseInfo.game" ]; then 249 | databaseInfo_game_connectionUri=$(jq -r '.databaseInfo.game.connectionUri' config.json 2>/dev/null) 250 | if [[ $databaseInfo_game_connectionUri == "" ]]; then 251 | databaseInfo_game_connectionUri="${RC}Error${WC}" 252 | fi 253 | databaseInfo_game_collection=$(jq -r '.databaseInfo.game.collection' config.json 2>/dev/null) 254 | if [[ $databaseInfo_game_collection == "" ]]; then 255 | databaseInfo_game_collection="${RC}Error${WC}" 256 | fi 257 | elif [ $getArguments == "databaseInfo.server" ]; then 258 | databaseInfo_server_connectionUri=$(jq -r '.databaseInfo.server.connectionUri' config.json 2>/dev/null) 259 | if [[ $databaseInfo_server_connectionUri == "" ]]; then 260 | databaseInfo_server_connectionUri="${RC}Error${WC}" 261 | fi 262 | databaseInfo_server_collection=$(jq -r '.databaseInfo.server.collection' config.json 2>/dev/null) 263 | if [[ $databaseInfo_server_collection == "" ]]; then 264 | databaseInfo_server_collection="${RC}Error${WC}" 265 | fi 266 | elif [ $getArguments == "language" ]; then 267 | language_language=$(jq -r '.language.language' config.json 2>/dev/null) 268 | if [[ $language_language == "" ]]; then 269 | language_language="${RC}Error${WC}" 270 | fi 271 | language_fallback=$(jq -r '.language.fallback' config.json 2>/dev/null) 272 | if [[ $language_fallback == "" ]]; then 273 | language_fallback="${RC}Error${WC}" 274 | fi 275 | language_document=$(jq -r '.language.document' config.json 2>/dev/null) 276 | if [[ $language_document == "" ]]; then 277 | language_document="${RC}Error${WC}" 278 | fi 279 | else 280 | echo "${RC}Cant Load, Unknown Error!${WC}" 281 | fi 282 | } 283 | -------------------------------------------------------------------------------- /Code/gcandroid.sh: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | # Score-Inc/GCAndroid is licensed under the 4 | # GNU General Public License v3.0 5 | 6 | GC="$(printf '\033[1;32m')" 7 | RC="$(printf '\033[1;31m')" 8 | YC="$(printf '\033[1;33m')" 9 | CCB="$(printf '\033[1;36m')" 10 | CCU="$(printf '\033[4;36m')" 11 | WC="$(printf '\033[0;37m')" 12 | 13 | GCAndroid=$HOME/.ElaXan/GCAndroid 14 | Path_Repojson=$GCAndroid/repo.json 15 | Path_Shell=$GCAndroid/gcandroid 16 | linksDocs="https://docs.elaxan.com/project/GCAndroid" 17 | line="=====================================" 18 | 19 | isThisLinux=$(uname -o) 20 | if [ $isThisLinux = "GNU/Linux" ]; then 21 | echo "${RC}Please run on Termux Environment!\n${GC}Try to reinstall and see GCAndroid Github for more information's...${WC}" 22 | exit 2 23 | fi 24 | 25 | inpscript=$1 26 | 27 | # check dependencies without run in inside array 28 | dependencies_apt=( 29 | "perl" 30 | "wget" 31 | "jq" 32 | "tput" 33 | "nc" 34 | "php" 35 | ) 36 | 37 | dependencies_apt_install=( 38 | "perl" 39 | "wget" 40 | "jq" 41 | "ncurses-utils" 42 | "netcat-openbsd" 43 | "php" 44 | ) 45 | 46 | for package in "${dependencies_apt[@]}"; do 47 | if ! command -v $package &>/dev/null; then 48 | echo "Install : $package" 49 | for i in "${dependencies_apt_install[@]}"; do 50 | apt install $i -y 51 | done 52 | fi 53 | done 54 | 55 | # Check if install dependencies is failed by checking package not found 56 | for package in "${dependencies_apt[@]}"; do 57 | if ! command -v $package &>/dev/null; then 58 | echo "${RC}Error${WC} : $package not found!" 59 | echo 60 | echo -n "Press enter for exit" 61 | read 62 | exit 1 63 | fi 64 | done 65 | 66 | Center_Text() { 67 | textss=$1 68 | 69 | lines=$(echo $line | wc -c) 70 | textss=$(echo $1 | wc -c) 71 | space=$((lines - textss)) 72 | space=$((space / 2)) 73 | space=$(printf "%${space}s") 74 | case $2 in 75 | link) 76 | if [ $3 = Cyan ]; then 77 | echo "${space}${CCU}$1${WC}" 78 | fi 79 | ;; 80 | error) 81 | if [ $3 = Red ]; then 82 | echo "${space}${RC}$1${WC}" 83 | fi 84 | ;; 85 | *) 86 | echo "${GC}${space}$1${WC}" 87 | ;; 88 | esac 89 | echo $line 90 | } 91 | 92 | clear 93 | echo -n "${WC}" 94 | echo $line 95 | Center_Text "Project Owner by ElaXan" 96 | Center_Text "LOADING..." 97 | echo "${CCU}https://github.com/Score-Inc/GCAndroid${WC}" 98 | echo $line 99 | echo "${GC}Contact me at zero@elaxan.com${WC}" 100 | echo $line 101 | 102 | if [ ! -f $Path_Repojson ]; then 103 | echo "{ 104 | \"Grasscutter\": \"https://github.com/Grasscutters/Grasscutter.git\", 105 | \"Resources\": \"https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.4/GC-Resources-3.4.zip\" 106 | }" >$Path_Repojson 107 | else 108 | if [ ! -s $Path_Repojson ]; then 109 | echo "{ 110 | \"Grasscutter\": \"https://github.com/Grasscutters/Grasscutter.git\", 111 | \"Resources\": \"https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.4/GC-Resources-3.4.zip\" 112 | }" >$Path_Repojson 113 | echo "${RC}Error${WC} : repo.json is empty! We have fixed it for you!" 114 | fi 115 | 116 | if ! (jq . $Path_Repojson &>/dev/null); then 117 | echo "{ 118 | \"Grasscutter\": \"https://github.com/Grasscutters/Grasscutter.git\", 119 | \"Resources\": \"https://gitlab.com/YuukiPS/GC-Resources/-/archive/3.4/GC-Resources-3.4.zip\" 120 | }" >$Path_Repojson 121 | echo "${RC}Error${WC} : repo.json is broken! We have fixed it for you to default!" 122 | fi 123 | fi 124 | 125 | credit_hah() { 126 | clear 127 | echo -n "${WC}" 128 | echo $line 129 | Center_Text "Project Owner by ElaXan" 130 | echo -e "$note_credit" 131 | echo $line 132 | echo "${CCU}https://github.com/Score-Inc/GCAndroid${WC}" 133 | echo $line 134 | echo "${GC} Join our Discord Server!${WC}" 135 | Center_Text "https://discord.gg/2TTSUZZ" "link" "Cyan" 136 | } 137 | 138 | menu_config_editManual() { 139 | if ! command -v micro &>/dev/null; then 140 | apt install micro -y 141 | fi 142 | echo "${GC}Press CTRL + Q on your keyboard for exit${WC}" 143 | sleep 2s 144 | micro $configpath 145 | menu_config 146 | } 147 | 148 | Reset_Config_Json() { 149 | credit_hah 150 | Center_Text "Reset config.json" 151 | if ! (command -v java &>/dev/null); then 152 | echo "${RC}Error${WC} : Java not found!" 153 | echo "See : ${CCU}${linksDocs}/Error#error-java-not-found${WC}" 154 | echo 155 | read -p "Press enter for back to Edit Config Json" 156 | menu_config 157 | fi 158 | if [ ! -f $wherethegrassss ]; then 159 | echo "${RC}Error${WC} : grasscutter.jar not found!" 160 | echo "See : ${CCU}${linksDocs}/Error#error-java-not-found${WC}" 161 | echo 162 | read -p "Press enter for back to Edit Config Json" 163 | menu_config 164 | fi 165 | if [ ! -f $configpath ]; then 166 | echo "${RC}Error${WC} : config.json not found!" 167 | echo "See : ${CCU}${linksDocs}/Error#error-configjson-not-found${WC}" 168 | echo 169 | read -p "Press enter for back to Edit Config Json" 170 | menu_config 171 | fi 172 | echo "${RC}This will reset your config.json to default!${WC}" 173 | echo -n "${RC}Are you sure? [y/N] : ${WC}" 174 | read -r Reset_Config_Json_Input 175 | if [ $Reset_Config_Json_Input = y ]; then 176 | cd $grasscutter_path || exit 1 177 | rm "config.json" 178 | Run "timeout --foreground 8s java -jar grasscutter.jar" "Resetting config.json" "124" "Main Config" "menu_config" 179 | echo "${YC}Enter custom port for $nameFolder${WC}" 180 | read -p "Port : " port 181 | if [ $port -lt 1024 ] || [ -z $port ]; then 182 | echo "${RC}Port must be higher than 1024!${WC}" 183 | echo "${GC}Port will be set to 54321${WC}" 184 | port=54321 185 | else 186 | echo "${GC}Port will be set to $port${WC}" 187 | fi 188 | echo 189 | echo "${YC}Enter custom folderStructure for $nameFolder${WC}" 190 | read -p "resources : " custom_resources 191 | if [ -z $custom_resources ]; then 192 | echo "${RC}resources cannot be empty!${WC}" 193 | echo "${GC}skip edit resources${WC}" 194 | custom_resources="" 195 | else 196 | echo "${GC}resources will be set to $custom_resources${WC}" 197 | fi 198 | if [ ! -f $configpath ]; then 199 | echo "${RC}Error${WC} : Failed to reset config.json!" 200 | echo "See : ${CCU}${linksDocs}/Error#error--failed-to-reset-configjson${WC}" 201 | echo 202 | read -p "Press enter for back to Edit Config Json" 203 | menu_config 204 | fi 205 | editJsonJqs() { 206 | jq "$1" $configpath >$HOME/temp.json 207 | mv $HOME/temp.json $configpath 208 | } 209 | editJsonJqs ".server.http.bindPort=$port" 210 | if [ ! -z $custom_resources ]; then 211 | editJsonJqs ".folderStructure.resources=\"$custom_resources\"" 212 | fi 213 | 214 | editJsonJqs '.server.game.joinOptions.welcomeMessage="localhost on Android using GCAndroid\n\n\rhttps://github.com/Score-Inc/GCAndroid"' 215 | 216 | echo 217 | echo -n "Press enter for back to Edit Config Json" 218 | read -r 219 | menu_config 220 | else 221 | menu_config 222 | fi 223 | } 224 | 225 | menu_config_editThirdParty() { 226 | credit_hah 227 | Center_Text "Edit config.json with third-party App" 228 | if [ ! -f $configpath ]; then 229 | echo "${RC}Error${WC} : config.json not found!" 230 | echo "See : ${CCU}${linksDocs}/Error#error-configjson-not-found${WC}" 231 | echo 232 | echo -n "Press enter for back to Edit Config Json" 233 | read -r 234 | menu_config 235 | fi 236 | mv $configpath /sdcard/config.json 237 | echo "${GC}config.json has been moved to /sdcard/config.json${WC}" 238 | echo 239 | echo "${GC}Please edit config.json with your favorite text editor${WC}" 240 | echo 241 | echo "${GC}After you finish editing, press enter to move config.json back to $nameFolder folder${WC}" 242 | read -r 243 | if [ ! -f /sdcard/config.json ]; then 244 | echo "${RC}Error${WC} : config.json not found in /sdcard/config.json!" 245 | echo "See : ${CCU}${linksDocs}/Error#error--configjson-not-found-in-sdcardconfigjson${WC}" 246 | echo 247 | echo -n "Press enter for back to Edit Config Json" 248 | read -r 249 | menu_config 250 | fi 251 | mv /sdcard/config.json $configpath 252 | echo "${GC}config.json has been moved back to Grasscutter folder${WC}" 253 | echo 254 | echo -n "Press enter for back to Edit Config Json" 255 | read -r 256 | menu_config 257 | } 258 | 259 | import_configjson() { 260 | credit_hah 261 | Center_Text "Import config.json" 262 | echo "${YC}Enter b/b for back to Edit Config Json${WC}" 263 | echo -n "${YC}Enter path to config.json : ${WC}" 264 | read -r import_configjson_path 265 | if [ $import_configjson == "b" ] || [ $import_configjson == "B" ]; then 266 | menu_config 267 | fi 268 | if [ ! -f $import_configjson_path ]; then 269 | echo "${RC}Error${WC} : $import_configjson_path not found!" 270 | echo 271 | echo -n "Press enter for back to Edit Config Json" 272 | read -r 273 | menu_config 274 | fi 275 | rm $configpath 276 | cp $import_configjson_path $configpath 277 | echo "${GC}config.json has been imported!${WC}" 278 | echo 279 | echo -n "Press enter for back to Edit Config Json" 280 | read -r 281 | menu_config 282 | } 283 | 284 | export_configjson() { 285 | credit_hah 286 | Center_Text "Export config.json" 287 | # check if /sdcard cant access 288 | if ! ls /sdcard >/dev/null 2>&1; then 289 | echo "${RC}Error${WC} : /sdcard cant access!" 290 | echo "See : ${CCU}${linksDocs}/Error#error--configjson-already-exist-in-sdcardconfigjson${WC}" 291 | echo 292 | echo -n "Press enter for back to Edit Config Json" 293 | read -r 294 | menu_config 295 | fi 296 | if [ -f "/sdcard/config.json" ]; then 297 | echo "${RC}Error${WC} : config.json already exist in /sdcard/config.json!" 298 | echo "See : ${CCU}${linksDocs}/Error#error--configjson-already-exist-in-sdcardconfigjson${WC}" 299 | echo 300 | echo -n "Press enter for back to Edit Config Json" 301 | read -r 302 | menu_config 303 | fi 304 | cp $configpath /sdcard/config.json 305 | echo "${GC}config.json has been exported to /sdcard/config.json${WC}" 306 | echo 307 | echo -n "Press enter for back to Edit Config Json" 308 | read -r 309 | menu_config 310 | } 311 | 312 | menu_config() { 313 | if [ ! -f $configpath ]; then 314 | credit_hah 315 | echo "${RC}Error${WC} : $configpath not found!" 316 | echo "See : ${CCU}${linksDocs}/Error#error-configjson-not-found${WC}" 317 | echo 318 | echo -n "Press enter for back to Menu!" 319 | read 320 | main_menu 321 | return 322 | fi 323 | credit_hah 324 | Center_Text "Edit config.json" 325 | echo "1. ${CCB}Edit using this Script${WC}" 326 | echo "2. ${CCB}Edit Manual${WC}" 327 | echo "3. ${CCB}Change Port${WC}" 328 | echo "4. ${CCB}Reset config.json${WC}" 329 | echo "5. ${CCB}Edit with third-party App${WC}" 330 | echo "6. ${CCB}Import config.json${WC}" 331 | echo "7. ${CCB}Export config.json${WC}" 332 | echo "0. ${RC}Back${WC}" 333 | echo 334 | echo -n "Enter input : " 335 | read menu_config_input 336 | case $menu_config_input in 337 | "1") edit_configjson ;; 338 | "2") menu_config_editManual ;; 339 | "3") changePort ;; 340 | "4") Reset_Config_Json ;; 341 | "5") menu_config_editThirdParty ;; 342 | "6") import_configjson ;; 343 | "7") export_configjson ;; 344 | "0") Grasscutter_Tools ;; 345 | *) 346 | echo "${RC}Wrong Input!${WC}" 347 | sleep 1s 348 | menu_config 349 | ;; 350 | esac 351 | } 352 | 353 | installMongodb() { 354 | credit_hah 355 | if command -v mongo &>/dev/null; then 356 | echo "${RC}Mongodb already installed" 357 | echo "${YC}Do you want reinstall?${WC}" 358 | echo 359 | echo -n "Enter input (y/N) : " 360 | read mongodbAsk 361 | case $mongodbAsk in 362 | "y" | "Y" | "") 363 | credit_hah 364 | Center_Text "Mongodb Install" 365 | Run "apt install tur-repo -y" "Installing Tur Repo" "0" "Install Menu" "installMenu" 366 | Run "apt reinstall mongodb -y" "Reinstalling Mongodb" "0" "Install Menu" "installMenu" 367 | echo 368 | echo -n "Press enter for back to Main Menu" 369 | read -r 370 | main_menu 371 | ;; 372 | "n" | "N") main_menu ;; 373 | *) 374 | echo "Wrong Input!" 375 | sleep 1s 376 | installMongodb 377 | ;; 378 | esac 379 | else 380 | Run "apt install tur-repo -y" "Installing Tur Repo" "0" "Install Menu" "installMenu" 381 | Run "apt install mongodb -y" "Installing Mongodb" "0" "Install Menu" "installMenu" 382 | echo 383 | echo -n "Press enter for back to Main Menu" 384 | read 385 | main_menu 386 | fi 387 | } 388 | 389 | Docker() { 390 | credit_hah 391 | Center_Text "Docker" 392 | echo "1. ${CCB}Download grasscutter.jar${WC}" 393 | echo "2. ${CCB}Pull DockerGS image${WC}" 394 | echo "0. ${RC}Back${WC}" 395 | echo 396 | echo -n "Enter input : " 397 | read Docker_input 398 | case $Docker_input in 399 | "1") Download_Grasscutter ;; 400 | "2") Pull_DockerGS_Image ;; 401 | "0") Grasscutter_Tools ;; 402 | *) 403 | echo "${RC}Wrong Input!${WC}" 404 | sleep 1s 405 | Docker 406 | ;; 407 | esac 408 | } 409 | 410 | Install_Grasscutter_Menu() { 411 | credit_hah 412 | Center_Text "Install $nameFolder" 413 | echo "1. ${CCB}Compile from $namePemotongJembud${WC}" 414 | echo "2. ${CCB}Download from Github (Docker)${WC}" 415 | echo "0. ${RC}Back${WC}" 416 | echo 417 | echo -n "Enter input : " 418 | read Install_Grasscutter_Menu_input 419 | case $Install_Grasscutter_Menu_input in 420 | "1") Install_Grasscutter ;; 421 | "2") Docker ;; 422 | "0") Grasscutter_Menu ;; 423 | *) 424 | echo "${RC}Wrong Input!${WC}" 425 | sleep 1s 426 | Install_Grasscutter_Menu 427 | ;; 428 | esac 429 | } 430 | 431 | Install_Grasscutter() { 432 | credit_hah 433 | if [ -d "$grasscutter_path" ]; then 434 | echo "${RC}$nameFolder already installed${WC}" 435 | echo 436 | echo "${YC}Do you want reinstall?${WC}" 437 | echo 438 | echo -n "Enter input (y/N) : ${CCB}" 439 | read Install_Grasscutter_input 440 | echo -n "${WC}" 441 | case $Install_Grasscutter_input in 442 | "y" | "Y") 443 | Grasscutter_Already_Installed=1 444 | Install_Grasscutter_process 445 | ;; 446 | "n" | "N") Grasscutter_Menu ;; 447 | *) 448 | echo "${RC}Wrong Input!${WC}" 449 | sleep 0.5s 450 | Install_Grasscutter 451 | ;; 452 | esac 453 | else 454 | Backup_Resources="0" 455 | Install_Grasscutter_process 456 | fi 457 | } 458 | 459 | Grasscutter_Menu() { 460 | credit_hah 461 | Center_Text "Grasscutter Menu" 462 | echo "1. ${CCB}Install Grasscutter${WC}" 463 | echo "2. ${CCB}Compile .jar${WC}" 464 | echo "3. ${CCB}Update Grasscutter${WC}" 465 | echo "4. ${CCB}Download Resources Only${WC}" 466 | echo "0. ${RC}Back${WC}" 467 | echo 468 | echo -n "Enter input : " 469 | read -r Grasscutter_Menu_Input 470 | case $Grasscutter_Menu_Input in 471 | "1") Install_Grasscutter_Menu ;; 472 | "2") Compile_Grasscutter ;; 473 | "3") Update_Grasscutter ;; 474 | "4") Download_Resources ;; 475 | "0") main_menu ;; 476 | *) 477 | echo "${RC}Wrong Input!${WC}" 478 | sleep 1s 479 | Grasscutter_Menu 480 | ;; 481 | esac 482 | } 483 | 484 | Grasscutter_Tools() { 485 | credit_hah 486 | Center_Text "Grasscutter Tools" 487 | echo "1. ${CCB}Edit config.json${WC}" 488 | echo "2. ${CCB}Edit Banners.tsj${WC}" 489 | echo "3. ${CCB}Generate Keystore.p12${WC}" 490 | echo "4. ${CCB}Install Plugin${WC}" 491 | echo "5. ${CCB}Remove Plugin${WC}" 492 | echo "6. ${CCB}Get GM Handbook${WC}" 493 | echo "0. ${RC}Back${WC}" 494 | echo 495 | echo -n "Enter input : " 496 | read -r Grasscutter_Tools_Input 497 | case $Grasscutter_Tools_Input in 498 | "1") menu_config ;; 499 | "2") Edit_Banners ;; 500 | "3") Generate_Keystore ;; 501 | "4") installPlugin ;; 502 | "5") removePlugin ;; 503 | "6") generateHandbook ;; 504 | "0") main_menu ;; 505 | *) 506 | echo "${RC}Wrong Input!${WC}" 507 | sleep 1s 508 | Grasscutter_Tools 509 | ;; 510 | esac 511 | } 512 | 513 | installJavaJDK17() { 514 | credit_hah 515 | Center_Text "Install Java JDK 17" 516 | if (command -v java &>/dev/null); then 517 | echo "${YC}You already installed Java" 518 | echo "${YC}Want to reinstall?${WC}" 519 | echo 520 | echo -n "Enter input (y/N) : " 521 | read -r installJavaJDK17_input 522 | if [[ $installJavaJDK17_input = "n" ]] || [[ $installJavaJDK17_input = "N" ]]; then 523 | InstallMenu 524 | elif [[ $installJavaJDK17_input = "y" ]] || [[ $installJavaJDK17_input = "Y" ]]; then 525 | credit_hah 526 | Center_Text "Installing Java JDK 17" 527 | Run "apt reinstall openjdk-17 -y" "Install Java JDK 17" "0" "Install Menu" "InstallMenu" 528 | else 529 | echo "${RC}Wrong Input!${WC}" 530 | sleep 1s 531 | installJavaJDK17 532 | fi 533 | else 534 | Run "apt reinstall openjdk-17 -y" "Install Java JDK 17" "0" "Install Menu" "InstallMenu" 535 | fi 536 | echo 537 | echo -n "Press enter for back to Install Menu!" 538 | read -r 539 | InstallMenu 540 | } 541 | 542 | InstallMenu() { 543 | credit_hah 544 | Center_Text "Install Menu" 545 | echo "1. ${CCB}Install Mongodb${WC}" 546 | echo "2. ${CCB}Install Java JDK 17${WC}" 547 | echo "0. ${RC}Back${WC}" 548 | echo 549 | echo -n "Enter input : " 550 | read -r InstallMenu_input 551 | case $InstallMenu_input in 552 | "1") installMongodb ;; 553 | "2") installJavaJDK17 ;; 554 | "0") main_menu ;; 555 | *) 556 | echo "${RC}Wrong input!${WC}" 557 | sleep 1s 558 | InstallMenu 559 | ;; 560 | esac 561 | } 562 | 563 | license() { 564 | credit_hah 565 | Center_Text "License" 566 | echo "${GC}GNU General Public License v3.0${WC}" 567 | echo 568 | echo "This program is free software:" 569 | echo "you can redistribute it and/or modify" 570 | echo "it under the terms of the" 571 | echo "GNU General Public License as published by" 572 | echo "the Free Software Foundation," 573 | echo "either version 3 of the License, or" 574 | echo "(at your option) any later version." 575 | echo 576 | echo "This program is distributed in the" 577 | echo "hope that it will be useful," 578 | echo "but WITHOUT ANY WARRANTY; without even" 579 | echo "the implied warranty of" 580 | echo "MERCHANTABILITY or FITNESS FOR A" 581 | echo "PARTICULAR PURPOSE." 582 | echo "See theGNU General Public License" 583 | echo "for more details." 584 | echo 585 | echo "You should have received a copy of" 586 | echo "the GNU General Public License" 587 | echo "along with this program." 588 | echo "If not, see ." 589 | echo 590 | echo -n "Press enter for back to About Us!" 591 | read -r 592 | about_us 593 | } 594 | 595 | credits() { 596 | credit_hah 597 | Center_Text "Credits" 598 | echo "${CCB}Creator :${WC} ${GC}ElaXan${WC}" 599 | echo "${CCB}Github :${WC} ${CCU}https://github.com/ElaXan${WC}" 600 | echo "${CCB}Telegram :${WC} ${CCU}https://t.me/ElashXander${WC}" 601 | echo "${CCB}Discord :${WC} ${CCU}https://discord.com/users/506212044152897546${WC}" 602 | echo 603 | echo -n "Press enter for back to About Us!" 604 | read -r 605 | about_us 606 | } 607 | 608 | about_us2() { 609 | credit_hah 610 | Center_Text "About Me" 611 | echo -e "${GC}I am an ordinary person who learns about programming.\nand I made this at will, without payment or free.\nso, if you buy this project or GCAndroid,\nPlease refund you got scam\n\n" 612 | echo "${CCB}Website Score-Inc: ${CCU}https://scoreps.xyz${WC}" 613 | echo "${CCB}Github: ${CCU}https://github.com/Score-Inc${WC}" 614 | echo "${CCB}Documentation: ${CCU}https://docs.elaxan.com${WC}" 615 | echo 616 | echo -n "Press enter for back to About Us" 617 | read -r 618 | about_us 619 | } 620 | 621 | about_us() { 622 | credit_hah 623 | Center_Text "About Us" 624 | echo "1. ${CCB}About Me${WC}" 625 | echo "2. ${CCB}Credits${WC}" 626 | echo "3. ${CCB}License${WC}" 627 | echo "0. ${RC}Back${WC}" 628 | echo 629 | echo -n "Enter input : " 630 | read -r about_us_input 631 | case $about_us_input in 632 | "1") about_us2 ;; 633 | "2") credits ;; 634 | "3") license ;; 635 | "0") main_menu ;; 636 | *) 637 | echo "${RC}Wrong input!${WC}" 638 | sleep 1s 639 | about_us 640 | ;; 641 | esac 642 | } 643 | 644 | settingsMenu() { 645 | credit_hah 646 | Center_Text "Settings Menu" 647 | echo "1. ${CCB}Grasscutter Repo${WC}" 648 | echo "2. ${CCB}Resources Repo${WC}" 649 | echo "3. ${YC}Reset settings.json${WC}" 650 | echo "0. ${RC}Back${WC}" 651 | echo 652 | echo -n "Enter input : " 653 | read -r about_us_input 654 | case $about_us_input in 655 | "1") GrasscutterRepo ;; 656 | "2") ResourcesRepo ;; 657 | "3") ResetSettingsJSON ;; 658 | "0") main_menu ;; 659 | *) 660 | echo "Wrong input!${WC}" 661 | sleep 1s 662 | settingsMenu 663 | ;; 664 | esac 665 | } 666 | 667 | main_menu() { 668 | credit_hah 669 | Center_Text "Main Menu" 670 | echo "1. ${CCB}Run Grasscutter${WC}" 671 | echo "2. ${CCB}Grasscutter Menu${WC}" 672 | echo "3. ${CCB}Grasscutter Tools${WC}" 673 | echo "4. ${CCB}GCAndroid Tools${WC}" 674 | echo "5. ${CCB}Install Menu${WC}" 675 | echo "6. ${CCB}Setting Repo${WC}" 676 | echo "7. ${CCB}About Us!${WC}" 677 | echo "0. ${RC}Exit${WC}" 678 | echo 679 | echo -n "Enter input : " 680 | read -r inputmain 681 | case $inputmain in 682 | "1") GoTouchGrass ;; 683 | "2") Grasscutter_Menu ;; 684 | "3") Grasscutter_Tools ;; 685 | "4") gcandroidTools ;; 686 | "5") InstallMenu ;; 687 | "6") settingsMenu ;; 688 | "7") about_us ;; 689 | "0") 690 | clear 691 | exit 0 692 | ;; 693 | *) 694 | echo "${RC}Wrong Input!${WC}" 695 | sleep 1s 696 | main_menu 697 | ;; 698 | esac 699 | } 700 | for file in $Path_Shell/*.sh; do 701 | echo -ne "\033[2K\r${GC}Load : ${CCB}$(echo $file | cut -c 1-$(($(tput cols) - 10)))${WC}" 702 | source $file 703 | done 704 | for i in $(find "$Path_Shell/Edit_Config_Json" -type d); do 705 | for j in $(find "$i" -maxdepth 1 -type f); do 706 | . "$j" 707 | done 708 | done 709 | 710 | nameFolder=$(basename $(jq .Grasscutter -r $Path_Repojson)) 711 | nameFolder=${nameFolder%.git} 712 | grasscutter_path=$HOME/$nameFolder 713 | configpath=$grasscutter_path/config.json 714 | wherethegrassss=$grasscutter_path/grasscutter.jar 715 | 716 | newVersionScript="" 717 | versionScript="3.6" 718 | echo -en "\033[2K\r${GC}Load${WC} : ${CCB}getInfoUpdate [FROM SERVER]${WC}" 719 | source <(curl -s https://raw.githubusercontent.com/Score-Inc/GCAndroid/Server/getInfoUpdate) 720 | echo -en "\033[2K\r${GC}Load${WC} : ${CCB}updateScript.sh [FROM SERVER]${WC}" 721 | source <(curl -s https://raw.githubusercontent.com/Score-Inc/GCAndroid/Server/updateScript.sh) 722 | if [[ $newVersionScript = "" ]]; then 723 | clear 724 | note_credit=$(Center "Can't connect to server!") 725 | echo "$note_credit" 726 | echo 727 | echo "Press enter for continue!" 728 | main_menu 729 | return 730 | elif [[ $versionScript < $newVersionScript ]]; then 731 | clear 732 | echo "There is update to Version : $newVersionScript" 733 | echo "New Update : " 734 | echo -e "$noteUpdate" 735 | echo -n "Enter input (y/N) : " 736 | read -r update_input 737 | case $update_input in 738 | "y" | "Y") 739 | update 740 | return 741 | ;; 742 | "n" | "N") 743 | note_credit="${YC}New Version : ${GC}$newVersionScript${YC}\nCurrent Version : ${RC}$versionScript${WC}" 744 | main_menu 745 | ;; 746 | *) 747 | echo "${RC}Wrong input!${WC}" 748 | exit 1 749 | ;; 750 | esac 751 | elif [[ $versionScript = $newVersionScript ]]; then 752 | note_credit="$noteLatestVersion" 753 | else 754 | note_credit="${RC}Unknown Version${WC}" 755 | fi 756 | 757 | # WIP: Add more subcommands 758 | 759 | case $inpscript in 760 | --install | -i) 761 | case $2 in 762 | grasscutter) 763 | InstallGrasscutter 764 | ;; 765 | dockergs) 766 | Download_Grasscutter 767 | ;; 768 | dockergspull) 769 | Pull_DockerGS_Image 770 | ;; 771 | *) 772 | echo -n "Usage : gcandroid --install \n\nName:\n\tgrasscutter\n\tdockergs\n\tdockergspull\n" 773 | exit 1 774 | ;; 775 | esac 776 | ;; 777 | --run | -r) 778 | GoTouchGrass 779 | ;; 780 | --help) 781 | echo 782 | echo "Usage : gcandroid [OPTION] [ARGUMENT]" 783 | echo "Options :" 784 | echo " --install, -i : Install Grasscutter or DockerGS" 785 | echo " --run, -r : Run Grasscutter" 786 | echo " --help : Show this help" 787 | exit 0 788 | ;; 789 | "") 790 | main_menu 791 | ;; 792 | *) 793 | echo 794 | echo "Usage : gcandroid [OPTION] [ARGUMENT]" 795 | echo "Options :" 796 | echo " --install, -i : Install Grasscutter or DockerGS" 797 | echo " --run, -r : Run Grasscutter" 798 | echo " --help : Show this help" 799 | exit 1 800 | ;; 801 | esac -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------