diff --git a/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Max b/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Max new file mode 100644 index 0000000..7d5b9c7 --- /dev/null +++ b/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Max @@ -0,0 +1,13 @@ +\x00\xf0\x20\xe3@2331884 +\x00\xf0\x20\xe3@2332088 +\x00\xf0\x20\xe3@2332144 +\x00\xf0\x20\xe3@2332176 +\x00\xf0\x20\xe3@2332360 +\x00\xf0\x20\xe3@2332396 +\x00\xf0\x20\xe3@2332432 +\x00\xf0\x20\xe3@2332572 +\x00\xf0\x20\xe3@2332652 +\x00\xf0\x20\xe3@2332776 +\x00\xf0\x20\xe3@2332884 +\x00\xf0\x20\xe3@2330404 +\x00\xf0\x20\xe3@2330472 diff --git a/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Plus b/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Plus new file mode 100644 index 0000000..4fdef80 --- /dev/null +++ b/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Plus @@ -0,0 +1,13 @@ +\x00\xf0\x20\xe3@2330404 +\x00\xf0\x20\xe3@2330472 +\x00\xf0\x20\xe3@2331884 +\x00\xf0\x20\xe3@2332088 +\x00\xf0\x20\xe3@2332144 +\x00\xf0\x20\xe3@2332176 +\x00\xf0\x20\xe3@2332360 +\x00\xf0\x20\xe3@2332396 +\x00\xf0\x20\xe3@2332432 +\x00\xf0\x20\xe3@2332572 +\x00\xf0\x20\xe3@2332652 +\x00\xf0\x20\xe3@2332776 +\x00\xf0\x20\xe3@2332884 diff --git a/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Pro b/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Pro new file mode 100644 index 0000000..e6754fb --- /dev/null +++ b/RESOURCES/OPTIONS/bluetooth/3.0.9/K2Pro @@ -0,0 +1,13 @@ +\x00\xf0\x20\xe3@2330364 +\x00\xf0\x20\xe3@2330432 +\x00\xf0\x20\xe3@2331844 +\x00\xf0\x20\xe3@2332048 +\x00\xf0\x20\xe3@2332104 +\x00\xf0\x20\xe3@2332136 +\x00\xf0\x20\xe3@2332320 +\x00\xf0\x20\xe3@2332356 +\x00\xf0\x20\xe3@2332392 +\x00\xf0\x20\xe3@2332532 +\x00\xf0\x20\xe3@2332612 +\x00\xf0\x20\xe3@2332736 +\x00\xf0\x20\xe3@2332844 diff --git a/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Max b/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Max new file mode 100644 index 0000000..9e27675 --- /dev/null +++ b/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Max @@ -0,0 +1,13 @@ +\x00\xf0\x20\xe3@2329812 +\x00\xf0\x20\xe3@2329880 +\x00\xf0\x20\xe3@2331292 +\x00\xf0\x20\xe3@2331496 +\x00\xf0\x20\xe3@2331552 +\x00\xf0\x20\xe3@2331584 +\x00\xf0\x20\xe3@2331768 +\x00\xf0\x20\xe3@2331804 +\x00\xf0\x20\xe3@2331840 +\x00\xf0\x20\xe3@2331980 +\x00\xf0\x20\xe3@2332060 +\x00\xf0\x20\xe3@2332184 +\x00\xf0\x20\xe3@2332292 diff --git a/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Plus b/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Plus new file mode 100644 index 0000000..9e27675 --- /dev/null +++ b/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Plus @@ -0,0 +1,13 @@ +\x00\xf0\x20\xe3@2329812 +\x00\xf0\x20\xe3@2329880 +\x00\xf0\x20\xe3@2331292 +\x00\xf0\x20\xe3@2331496 +\x00\xf0\x20\xe3@2331552 +\x00\xf0\x20\xe3@2331584 +\x00\xf0\x20\xe3@2331768 +\x00\xf0\x20\xe3@2331804 +\x00\xf0\x20\xe3@2331840 +\x00\xf0\x20\xe3@2331980 +\x00\xf0\x20\xe3@2332060 +\x00\xf0\x20\xe3@2332184 +\x00\xf0\x20\xe3@2332292 diff --git a/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Pro b/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Pro new file mode 100644 index 0000000..f2d1caa --- /dev/null +++ b/RESOURCES/OPTIONS/bluetooth/3.1.0/K2Pro @@ -0,0 +1,13 @@ +\x00\xf0\x20\xe3@2331244 +\x00\xf0\x20\xe3@2331448 +\x00\xf0\x20\xe3@2331504 +\x00\xf0\x20\xe3@2331536 +\x00\xf0\x20\xe3@2331720 +\x00\xf0\x20\xe3@2331756 +\x00\xf0\x20\xe3@2331792 +\x00\xf0\x20\xe3@2331932 +\x00\xf0\x20\xe3@2332012 +\x00\xf0\x20\xe3@2332136 +\x00\xf0\x20\xe3@2332244 +\x00\xf0\x20\xe3@2329764 +\x00\xf0\x20\xe3@2329832 diff --git a/RESOURCES/OPTIONS/bluetooth/bluetooth.sh b/RESOURCES/OPTIONS/bluetooth/bluetooth.sh index 2b5bd0f..576efb5 100755 --- a/RESOURCES/OPTIONS/bluetooth/bluetooth.sh +++ b/RESOURCES/OPTIONS/bluetooth/bluetooth.sh @@ -2,14 +2,14 @@ # check the parameters if [ $# != 2 ]; then - echo "usage : $0 " + echo "usage : $0 " exit 1 fi project_root="$1" # check the required tools -check_tools "rm" +check_tools "app_version.sh app_model.sh rm cut dd" # check the project root folder if [ ! -d "$project_root" ]; then @@ -17,6 +17,42 @@ if [ ! -d "$project_root" ]; then exit 2 fi +# check the target folder +target_folder="$ROOTFS_DIR" +if [ ! -d "$target_folder" ]; then + echo -e "${RED}ERROR: Cannot find the target folder '$target_folder' ${NC}" + exit 3 +fi + +# try to find out the app version (like app_ver="309") +def_target="$ROOTFS_DIR/app/app" +app_ver=$("$app_version_tool" "$def_target") +if [ $? != 0 ]; then + echo -e "${RED}ERROR: Cannot find the app version ${NC}" + exit 4 +fi + +# try to find out the model +app_model=$("$app_model_tool" "$def_target") +if [ $? != 0 ]; then + echo -e "${RED}ERROR: Cannot find the app model ${NC}" + exit 5 +fi + +# find if the selected setting file exists +settings_file="$OPTIONS_DIR/bluetooth/${app_ver}/${app_model}" +if [ ! -f "$settings_file" ]; then + echo -e "${RED}ERROR: Unsupported model and version! Cannot find the settings file '$settings_file' ${NC}" + exit 6 +fi + +# patch the app based on the model and the version +while read -r line; do + settings_data=$(echo -n "$line" | cut -d "@" -f 1) + settings_addr=$(echo -n "$line" | cut -d "@" -f 2) + printf "$settings_data" | dd of="$def_target" bs=1 seek="$settings_addr" conv=notrunc +done <"$settings_file" + # Check the bluetooth folder and if exist then remove it # A list of folders to remove