cd$HOME/.var/app/com.usebottles.bottles/data/bottles/bottles/Line/drive_c/users/$USER/AppData/Local/LINE/bin/ rm -rf LineUpdater.exe old/ current/ touch LineUpdater.exe old current
2026-04-07 Update 經驗證後,old 與 current 資料夾可以使用唯獨空檔(read-only empty file)卡位,我們只需要使用腳本來實時監測 LineUpdater.exe 以及更新檔案是否被建立,詳細方式請參考LineUpdater-exe - Issue and Solution。
$ sudo vi /usr/local/bin/line-updater-cleaner.sh #!/usr/bin/env bash
# Target directory to monitor USERNAME="FILL—YOUR—USERNAME—HERE" TARGET_DIR="/home/$USERNAME/.var/app/com.usebottles.bottles/data/bottles/bottles/Line/drive_c/users/$USERNAME/AppData/Local/LINE/bin"
echo"Monitoring started in: $TARGET_DIR"
# Monitor for creation of files or directories inotifywait -m -e create,moved_to --format '%f'"$TARGET_DIR" | whileread NEW_ITEM do # 1. Check for LineUpdater.exe # 2. Check for version-style names (e.g., 9.2.0.3431) using Regex # Regex explanation: ^[0-9.]+ matches strings containing only digits and dots if [[ "$NEW_ITEM" == "LineUpdater.exe" ]] || [[ "$NEW_ITEM" =~ ^[0-9.]+$ && "$NEW_ITEM" != "$VERSION" ]]; then FULL_PATH="$TARGET_DIR/$NEW_ITEM"
# Determine if it's a directory or a file for proper deletion if [ -d "$FULL_PATH" ]; then rm -rf "$FULL_PATH" echo"Removed directory: $NEW_ITEM" elif [ -f "$FULL_PATH" ]; then rm -f "$FULL_PATH" echo"Removed file: $NEW_ITEM" fi fi done $ sudochmod +x /usr/local/bin/line-updater-cleaner.sh
Create Systemd Service for Startup
首先先建立 Systemd Service:
1 2 3 4 5 6 7 8 9 10 11 12
$ sudo vi /etc/systemd/system/line-updater-cleaner.service [Unit] Description=Auto Delete LineUpdater.exe For Line (Bottles) After=network.target
# Exit immediately if a command exits with a non-zero status set -e
# Define color codes BLUE='\033[0;34m' GREEN='\033[0;32m' ORANGE='\033[0;33m' RED='\033[0;31m' YELLOW='\033[0;33m' PURPLE='\033[0;35m' NC='\033[0m'# No Color (Reset)
# Log function: log <level_color> <level_text> <message> log() { local color="$1" local level="$2" local message="$3" echo -e "[${color}${level}${NC}] ${message}" } # Wrapper functions for cleaner syntax info() { log"${BLUE}"" INFO ""$1"; } ok () { log"${GREEN}"" OK ""$1"; } warn() { log"${ORANGE}"" WARN ""$1"; } fail() { log"${RED}"" FAIL ""$1"; } note() { log"${YELLOW}"" NOTE ""$1"; }
# Preparing to reset LINE by removing specific entries from LINE.ini info "Resetting LINE by removing specific entries from LINE.ini..." deep_remove=0 for arg in"$@"; do if [ "$arg" == "--help" ]; then echo"Usage: $0 [--deep-remove]" echo" --deep-remove: Remove all entries without first section of LINE.ini, not just the specified keys." exit 0 fi if [ "$arg" == "--deep-remove" ]; then deep_remove=1 info "Deep remove enabled: All entries without first section of LINE.ini will be removed." break fi done
# Input and output configuration input_file="$HOME/.var/app/com.usebottles.bottles/data/bottles/bottles/Line/drive_c/users/$(whoami)/AppData/Local/LINE/Data/LINE.ini" output_file="$HOME/.var/app/com.usebottles.bottles/data/bottles/bottles/Line/drive_c/users/$(whoami)/AppData/Local/LINE/Data/LINE_fixed.ini"
# Use awk to filter the second section awk -v deep="$deep_remove"' BEGIN { # Allowed keys list list = "windowstore_app_dbfile_checked|up|is_main_profile_keep_confirm|app_version|app_install_time|last_notify_updated_version|lockscreen_login|acf|disabled_mobile_alarm_while_using_pc|notification_mention_enabled|allow_call_alarm|privacy_receive_mesages_from_not_friend|recognized_expand_panel_guide" # Pattern: (Backslash OR Start of line) + (Key) + (Equal sign) pattern = "(\\\\|^)(" list ")[[:space:]]*=" section_count = 0 } # Detect section headers /^\[.*\]/ { section_count++ # If deep-remove is ON, we only print the first section header if (deep == 1 && section_count > 1) { # Skip printing other headers next } print $0 next } { if (section_count == 2) { # Filtering logic for the second block if ($0 ~ /=/) { if ($0 ~ pattern) { print $0 } } else { # Keep empty lines or comments in the second block print $0 } } else if (section_count == 0 || section_count == 1) { # Always keep everything before the first block and inside the first block print $0 } else { # For section 3, 4, etc. # If deep-remove is OFF (0), keep them. If ON (1), they are effectively removed. if (deep == 0) { print $0 } } }'"$input_file" > "$output_file"
mv"$input_file""$input_file.bak" mv"$output_file""$input_file" ok "LINE reset complete! You can now launch LINE and it should start fresh without previous chat history or settings."
接著給與腳本執行權限:
1
chmod +w line-crash-reset.sh
腳本會有兩種模式,可以先直接執行後登入 Line 看問題是否已被解決:
1
./line-creash-reset.sh
若重新登入後仍然遇到一樣問題,則可以使用 --deep-remove 模式來完整清除,使用這個模式登入 Line 可能會需要重新輸入 PIN 碼: