Full Code of OpenListTeam/OpenList-Mobile for AI

main 48aab08afc2d cached
164 files
818.7 KB
229.9k tokens
517 symbols
1 requests
Download .txt
Showing preview only (897K chars total). Download the full file or copy to clipboard to get everything.
Repository: OpenListTeam/OpenList-Mobile
Branch: main
Commit: 48aab08afc2d
Files: 164
Total size: 818.7 KB

Directory structure:
gitextract_oqnk2mes/

├── .github/
│   ├── scripts/
│   │   ├── check_openlist.sh
│   │   ├── lzy_web.py
│   │   └── update_pubspec_version.sh
│   └── workflows/
│       ├── build.yaml
│       ├── build_openlist.yaml
│       ├── release.yaml
│       └── sync_openlist.yaml
├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── README_EN.md
├── analysis_options.yaml
├── android/
│   ├── .gitignore
│   ├── app/
│   │   ├── build.gradle
│   │   └── src/
│   │       ├── debug/
│   │       │   └── AndroidManifest.xml
│   │       ├── main/
│   │       │   ├── AndroidManifest.xml
│   │       │   ├── java/
│   │       │   │   └── com/
│   │       │   │       └── openlist/
│   │       │   │           └── pigeon/
│   │       │   │               └── GeneratedApi.java
│   │       │   ├── kotlin/
│   │       │   │   └── com/
│   │       │   │       └── openlist/
│   │       │   │           └── mobile/
│   │       │   │               ├── App.kt
│   │       │   │               ├── BootReceiver.kt
│   │       │   │               ├── MainActivity.kt
│   │       │   │               ├── OpenListService.kt
│   │       │   │               ├── OpenListTileService.kt
│   │       │   │               ├── SwitchServerActivity.kt
│   │       │   │               ├── bridge/
│   │       │   │               │   ├── AndroidBridge.kt
│   │       │   │               │   ├── AppConfigBridge.kt
│   │       │   │               │   ├── CommonBridge.kt
│   │       │   │               │   └── ServiceBridge.kt
│   │       │   │               ├── config/
│   │       │   │               │   └── AppConfig.kt
│   │       │   │               ├── constant/
│   │       │   │               │   ├── AppConst.kt
│   │       │   │               │   └── LogLevel.kt
│   │       │   │               ├── data/
│   │       │   │               │   ├── AppDatabase.kt
│   │       │   │               │   └── entities/
│   │       │   │               │       └── ServerLog.kt
│   │       │   │               ├── model/
│   │       │   │               │   ├── ShortCuts.kt
│   │       │   │               │   ├── UpdateResult.kt
│   │       │   │               │   └── openlist/
│   │       │   │               │       ├── Logger.kt
│   │       │   │               │       ├── OpenList.kt
│   │       │   │               │       ├── OpenListConfig.kt
│   │       │   │               │       └── OpenListConfigManager.kt
│   │       │   │               └── utils/
│   │       │   │                   ├── AndroidUtils.kt
│   │       │   │                   ├── BatteryOptimizationUtils.kt
│   │       │   │                   ├── ClipBoardUtils.kt
│   │       │   │                   ├── FileUtils.kt
│   │       │   │                   ├── MyTools.kt
│   │       │   │                   ├── StringUtils.kt
│   │       │   │                   └── ToastUtils.kt
│   │       │   └── res/
│   │       │       ├── drawable/
│   │       │       │   ├── ic_download.xml
│   │       │       │   ├── ic_female.xml
│   │       │       │   ├── ic_launcher_foreground.xml
│   │       │       │   ├── launch_background.xml
│   │       │       │   ├── openlist_logo.xml
│   │       │       │   ├── openlist_switch.xml
│   │       │       │   ├── server.xml
│   │       │       │   └── server2.xml
│   │       │       ├── mipmap-anydpi-v26/
│   │       │       │   ├── ic_launcher.xml
│   │       │       │   └── ic_launcher_round.xml
│   │       │       ├── values/
│   │       │       │   ├── ic_launcher_background.xml
│   │       │       │   ├── strings.xml
│   │       │       │   ├── styles.xml
│   │       │       │   └── themes.xml
│   │       │       ├── values-en/
│   │       │       │   └── strings.xml
│   │       │       ├── values-night/
│   │       │       │   └── styles.xml
│   │       │       └── xml/
│   │       │           ├── backup_rules.xml
│   │       │           ├── data_extraction_rules.xml
│   │       │           ├── file_path_data.xml
│   │       │           ├── file_paths.xml
│   │       │           └── network_security_config.xml
│   │       └── profile/
│   │           └── AndroidManifest.xml
│   ├── build/
│   │   └── reports/
│   │       └── problems/
│   │           └── problems-report.html
│   ├── build.gradle
│   ├── gradle/
│   │   └── wrapper/
│   │       └── gradle-wrapper.properties
│   ├── gradle.properties
│   ├── settings.gradle
│   └── utils/
│       ├── .gitignore
│       ├── build.gradle
│       ├── consumer-rules.pro
│       ├── proguard-rules.pro
│       └── src/
│           ├── androidTest/
│           │   └── java/
│           │       └── com/
│           │           └── github/
│           │               └── jing332/
│           │                   └── utils/
│           │                       └── ExampleInstrumentedTest.kt
│           ├── main/
│           │   ├── AndroidManifest.xml
│           │   ├── cpp/
│           │   │   ├── CMakeLists.txt
│           │   │   └── utils.cpp
│           │   └── java/
│           │       └── com/
│           │           └── github/
│           │               └── jing332/
│           │                   └── utils/
│           │                       └── NativeLib.kt
│           └── test/
│               └── java/
│                   └── com/
│                       └── github/
│                           └── jing332/
│                               └── utils/
│                                   └── ExampleUnitTest.kt
├── ios/
│   ├── .gitignore
│   ├── Flutter/
│   │   ├── AppFrameworkInfo.plist
│   │   ├── Debug.xcconfig
│   │   └── Release.xcconfig
│   ├── Podfile
│   ├── README_iOS_CONFIG.md
│   ├── Runner/
│   │   ├── AppDelegate.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   └── LaunchImage.imageset/
│   │   │       ├── Contents.json
│   │   │       └── README.md
│   │   ├── Base.lproj/
│   │   │   ├── LaunchScreen.storyboard
│   │   │   └── Main.storyboard
│   │   ├── Bridges/
│   │   │   ├── AppConfigBridge.swift
│   │   │   ├── AppStoreUpdateBridge.swift
│   │   │   ├── CommonBridge.swift
│   │   │   └── OpenListBridge.swift
│   │   ├── Info.plist
│   │   ├── OpenListManager.swift
│   │   ├── PigeonApi.swift
│   │   └── Runner-Bridging-Header.h
│   ├── Runner.xcodeproj/
│   │   ├── project.pbxproj
│   │   ├── project.xcworkspace/
│   │   │   ├── contents.xcworkspacedata
│   │   │   └── xcshareddata/
│   │   │       ├── IDEWorkspaceChecks.plist
│   │   │       └── WorkspaceSettings.xcsettings
│   │   └── xcshareddata/
│   │       └── xcschemes/
│   │           └── Runner.xcscheme
│   ├── Runner.xcworkspace/
│   │   ├── contents.xcworkspacedata
│   │   └── xcshareddata/
│   │       ├── IDEWorkspaceChecks.plist
│   │       └── WorkspaceSettings.xcsettings
│   ├── RunnerTests/
│   │   └── RunnerTests.swift
│   └── scripts/
│       └── generate_ios_icons.py
├── lib/
│   ├── contant/
│   │   ├── log_level.dart
│   │   └── native_bridge.dart
│   ├── generated/
│   │   ├── intl/
│   │   │   ├── messages_all.dart
│   │   │   ├── messages_en.dart
│   │   │   └── messages_zh.dart
│   │   └── l10n.dart
│   ├── generated_api.dart
│   ├── l10n/
│   │   ├── intl_en.arb
│   │   └── intl_zh.arb
│   ├── main.dart
│   ├── pages/
│   │   ├── app_update_dialog.dart
│   │   ├── download_manager_page.dart
│   │   ├── openlist/
│   │   │   ├── about_dialog.dart
│   │   │   ├── config_editor_page.dart
│   │   │   ├── log_level_view.dart
│   │   │   ├── log_list_view.dart
│   │   │   ├── openlist.dart
│   │   │   └── pwd_edit_dialog.dart
│   │   ├── settings/
│   │   │   ├── preference_widgets.dart
│   │   │   ├── settings.dart
│   │   │   └── troubleshooting_page.dart
│   │   └── web/
│   │       └── web.dart
│   ├── utils/
│   │   ├── app_store_update.dart
│   │   ├── download_examples.dart
│   │   ├── download_manager.dart
│   │   ├── download_test.dart
│   │   ├── intent_utils.dart
│   │   ├── language_controller.dart
│   │   ├── language_manager.dart
│   │   ├── notification_manager.dart
│   │   ├── service_manager.dart
│   │   └── update_checker.dart
│   └── widgets/
│       └── switch_floating_action_button.dart
├── openlist-lib/
│   ├── openlistlib/
│   │   ├── common.go
│   │   ├── internal/
│   │   │   └── log.go
│   │   ├── server.go
│   │   └── settings.go
│   └── scripts/
│       ├── clear.sh
│       ├── fix_ios_dependencies.sh
│       ├── gobind.sh
│       ├── gobind_ios.sh
│       ├── init_gomobile.sh
│       ├── init_openlist.sh
│       ├── init_web.sh
│       └── init_web_ios.sh
├── openlist_version
├── pigeon_config.yaml
├── pigeons/
│   ├── pigeon.dart
│   └── run.cmd
├── pubspec.yaml
└── test/
    └── widget_test.dart

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/scripts/check_openlist.sh
================================================
#!/bin/bash

GIT_REPO="https://github.com/OpenListTeam/OpenList.git"

function compare_versions() {
  local v1="${1#v}"
  local v2="${2#v}"
  local max_len=0

  IFS='.' read -r -a v1_parts <<< "$v1"
  IFS='.' read -r -a v2_parts <<< "$v2"

  if [ "${#v1_parts[@]}" -gt "${#v2_parts[@]}" ]; then
    max_len="${#v1_parts[@]}"
  else
    max_len="${#v2_parts[@]}"
  fi

  for ((i=0; i<max_len; i++)); do
    local p1="${v1_parts[i]:-0}"
    local p2="${v2_parts[i]:-0}"

    p1=$(echo "$p1" | grep -oE '^[0-9]+' || echo 0)
    p2=$(echo "$p2" | grep -oE '^[0-9]+' || echo 0)

    if ((10#$p1 > 10#$p2)); then
      echo 1
      return
    fi

    if ((10#$p1 < 10#$p2)); then
      echo -1
      return
    fi
  done

  echo 0
}

function get_latest_version() {
    echo $(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $GIT_REPO | tail --lines=1 | cut --delimiter='/' --fields=3)
}

LATEST_VER=""
for index in $(seq 5)
do
    echo "Try to get latest version, index=$index"
    LATEST_VER=$(get_latest_version)
    if [ -z "$LATEST_VER" ]; then
      if [ "$index" -ge 5 ]; then
        echo "Failed to get latest version, exit"
        exit 1
      fi
      echo "Failed to get latest version, sleep 15s and retry"
      sleep 15
    else
      break
    fi

done

echo "Latest OpenList version $LATEST_VER"

echo "openlist_version=$LATEST_VER" >> "$GITHUB_ENV"
# VERSION_FILE="$GITHUB_WORKSPACE/openlist_version.txt"

VER=$(cat "$VERSION_FILE")

if [ -z "$VER" ]; then
  VER="v3.25.1"
  echo "No version file, use default version ${VER}"
fi

echo "Current OpenList version: $VER"

COMPARE_RESULT=$(compare_versions "$VER" "$LATEST_VER")

if [ "$COMPARE_RESULT" -ge 0 ]; then
    echo "Current >= Latest"
    echo "openlist_update=0" >> "$GITHUB_ENV"
else
    echo "Current < Latest"
    echo "openlist_update=1" >> "$GITHUB_ENV"
fi


================================================
FILE: .github/scripts/lzy_web.py
================================================
import requests, os, datetime, sys

# Cookie 中 phpdisk_info 的值
cookie_phpdisk_info = os.environ.get('phpdisk_info')
# Cookie 中 ylogin 的值
cookie_ylogin = os.environ.get('ylogin')

# 请求头
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Edg/89.0.774.45',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Referer': 'https://pc.woozooo.com/account.php?action=login'
}

# 小饼干
cookie = {
    'ylogin': cookie_ylogin,
    'phpdisk_info': cookie_phpdisk_info
}


# 日志打印
def log(msg):
    utc_time = datetime.datetime.utcnow()
    china_time = utc_time + datetime.timedelta(hours=8)
    print(f"[{china_time.strftime('%Y.%m.%d %H:%M:%S')}] {msg}")


# 检查是否已登录
def login_by_cookie():
    url_account = "https://pc.woozooo.com/account.php"
    if cookie['phpdisk_info'] is None:
        log('ERROR: 请指定 Cookie 中 phpdisk_info 的值!')
        return False
    if cookie['ylogin'] is None:
        log('ERROR: 请指定 Cookie 中 ylogin 的值!')
        return False
    res = requests.get(url_account, headers=headers, cookies=cookie, verify=True)
    if '网盘用户登录' in res.text:
        log('ERROR: 登录失败,请更新Cookie')
        return False
    else:
        log('登录成功')
        return True


# 上传文件
def upload_file(file_dir, folder_id):
    file_name = os.path.basename(file_dir)
    url_upload = "https://up.woozooo.com/fileup.php"
    headers['Referer'] = f'https://up.woozooo.com/mydisk.php?item=files&action=index&u={cookie_ylogin}'
    post_data = {
        "task": "1",
        "folder_id": folder_id,
        "id": "WU_FILE_0",
        "name": file_name,
    }
    files = {'upload_file': (file_name, open(file_dir, "rb"), 'application/octet-stream')}
    res = requests.post(url_upload, data=post_data, files=files, headers=headers, cookies=cookie, timeout=120).json()
    log(f"{file_dir} -> {res['info']}")
    return res['zt'] == 1


# 上传文件夹内的文件
def upload_folder(folder_dir, folder_id):
    file_list = sorted(os.listdir(folder_dir), reverse=True)
    for file in file_list:
        path = os.path.join(folder_dir, file)
        if os.path.isfile(path):
            upload_file(path, folder_id)
        else:
            upload_folder(path, folder_id)


# 上传
def upload(dir, folder_id):
    if dir is None:
        log('ERROR: 请指定上传的文件路径')
        return
    if folder_id is None:
        log('ERROR: 请指定蓝奏云的文件夹id')
        return
    if os.path.isfile(dir):
        upload_file(dir, str(folder_id))
    else:
        upload_folder(dir, str(folder_id))


if __name__ == '__main__':
    argv = sys.argv[1:]
    if len(argv) != 2:
        log('ERROR: 参数错误,请以这种格式重新尝试\npython lzy_web.py 需上传的路径 蓝奏云文件夹id')
    # 需上传的路径
    upload_path = argv[0]
    # 蓝奏云文件夹id
    lzy_folder_id = argv[1]
    if login_by_cookie():
        upload(upload_path, lzy_folder_id)

================================================
FILE: .github/scripts/update_pubspec_version.sh
================================================
#!/bin/bash

VERSION_FILE="$GITHUB_WORKSPACE/openlist_version"
PUBSPEC_FILE="$GITHUB_WORKSPACE/pubspec.yaml"

if [ ! -f "$VERSION_FILE" ]; then
    echo "Error: openlist_version file not found"
    exit 1
fi

if [ ! -f "$PUBSPEC_FILE" ]; then
    echo "Error: pubspec.yaml file not found"
    exit 1
fi

OPENLIST_VERSION=$(cat "$VERSION_FILE")

BASE_VERSION=${OPENLIST_VERSION#v}

echo "Updating pubspec.yaml version to: $BASE_VERSION"

sed -i "s/^version: [0-9]\+\.[0-9]\+\.[0-9]\++[0-9]\+.*/version: ${BASE_VERSION}+1/" "$PUBSPEC_FILE"

echo "pubspec.yaml version updated successfully"

================================================
FILE: .github/workflows/build.yaml
================================================
name: Build

on:
  push:
    branches:
      - "main"
    paths-ignore:
      - "*.md"
      - "*.sh"
      - "release.yaml"
  #      - "sync_frp.yaml"
  pull_request:
    branches: ["main"]

  workflow_dispatch:

jobs:
  version:
    name: Get OpenList Version Information
    runs-on: ubuntu-latest
    outputs:
      version_name: ${{ steps.generate.outputs.version_name }}
      openlist_version: ${{ steps.openlist_version.outputs.openlist_version }}
      openlist_git_commit: ${{ steps.openlist_version.outputs.openlist_git_commit }}
      openlist_web_version: ${{ steps.openlist_version.outputs.openlist_web_version }}
      openlist_built_at: ${{ steps.openlist_version.outputs.openlist_built_at }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Generate Version Name
        id: generate
        run: |
          # Generate unified version with timestamp for entire workflow
          BASE_VERSION=$(cat openlist_version)
          TIMESTAMP=$(date +%y%m%d%H)
          VERSION_NAME="${BASE_VERSION}.${TIMESTAMP}"
          echo "version_name=${VERSION_NAME}" >> $GITHUB_OUTPUT

      - name: Download OpenList Source Code
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_openlist.sh

      - name: Extract OpenList Version Info
        id: openlist_version
        run: |
          # After init_openlist.sh, OpenList backend source is in openlist-lib/ with .git directory removed
          # We need to get version info from the latest remote tag that was cloned
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          
          # Re-fetch the tag information from remote (since .git was removed by init_openlist.sh)
          GIT_REPO="https://github.com/OpenListTeam/OpenList.git"
          OPENLIST_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $GIT_REPO | tail -n 1 | cut -d'/' -f3)
          
          # Get the commit hash for this tag from remote
          OPENLIST_GIT_COMMIT=$(git ls-remote $GIT_REPO "refs/tags/${OPENLIST_VERSION}" | cut -f1 | cut -c1-7)
          
          # Get frontend version from OpenList-Frontend latest release
          OPENLIST_WEB_VERSION=$(curl -fsSL --max-time 10 "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/"//g;s/,//g;s/ //g' || echo "rolling")
          
          # Build timestamp
          OPENLIST_BUILT_AT=$(date +'%F %T %z')
          
          echo "openlist_version=${OPENLIST_VERSION}" >> $GITHUB_OUTPUT
          echo "openlist_git_commit=${OPENLIST_GIT_COMMIT}" >> $GITHUB_OUTPUT
          echo "openlist_web_version=${OPENLIST_WEB_VERSION}" >> $GITHUB_OUTPUT
          echo "openlist_built_at=${OPENLIST_BUILT_AT}" >> $GITHUB_OUTPUT

  android:
    name: Build OpenList Android APK (Dev)
    needs: [version]
    runs-on: ubuntu-latest
    env:
      release_output: "${{ github.workspace }}/build/app/outputs/apk/release"
      debug_output: "${{ github.workspace }}/build/app/outputs/flutter-apk"
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Download OpenList Android AAR from latest build
        uses: dawidd6/action-download-artifact@v6
        with:
          workflow: sync_openlist.yaml
          name: openlist-android-aar
          path: ${{ github.workspace }}/android/app/libs/
          check_artifacts: true
          search_artifacts: true

      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 17

      - name: Setup Gradle
        uses: gradle/gradle-build-action@v3

      - name: Init Signature (Release only)
        if: github.event_name != 'pull_request'
        run: |
          touch local.properties
          cd android
          echo ALIAS_NAME='${{ secrets.ALIAS_NAME }}' >> local.properties
          echo ALIAS_PASSWORD='${{ secrets.ALIAS_PASSWORD }}' >> local.properties
          echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties
          echo KEY_PATH='./key.jks' >> local.properties
          # 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks
          echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/android/app/key.jks

      - uses: subosito/flutter-action@v2
        with:
          flutter-version: '3.32.7'

      - name: Generate iOS Build Number
        run: |
          IOS_BUILD_NUMBER=$(date +%y%m%d%H)
          echo "ios_build_number=$IOS_BUILD_NUMBER" >> $GITHUB_ENV
      
      - name: Build Release APK
        if: github.event_name != 'pull_request'
        env:
          BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
        run: flutter build apk --split-per-abi --release --target-platform android-arm,android-arm64,android-x64
      
      - name: Build Debug APK
        if: github.event_name == 'pull_request'
        env:
          BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
        run: flutter build apk --split-per-abi --debug --target-platform android-arm,android-arm64,android-x64

      - name: Upload missing_rules.txt
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: "missing_rules"
          path: "${{ github.workspace }}/build/app/outputs/mapping/release/missing_rules.txt"

      - name: Set Build Paths and Version
        run: |
          if [ "${{ github.event_name }}" == "pull_request" ]; then
            OUTPUT_DIR="${{ env.debug_output }}"
            BUILD_TYPE="debug"
            echo "ver_name=${{ needs.version.outputs.version_name }}-debug" >> $GITHUB_ENV
          else
            OUTPUT_DIR="${{ env.release_output }}"
            BUILD_TYPE="release"
            echo "ver_name=${{ needs.version.outputs.version_name }}" >> $GITHUB_ENV
          fi
          
          echo "output_path=$OUTPUT_DIR" >> $GITHUB_ENV
          echo "build_type=$BUILD_TYPE" >> $GITHUB_ENV

      - name: Upload App To Artifact arm64-v8a
        if: success () || failure ()
        uses: actions/upload-artifact@v4
        with:
          name: "OpenList-Mobile-${{ env.ver_name }}_arm64-v8a"
          path: |
            ${{ env.output_path }}/*arm64-v8a*.apk
            ${{ env.output_path }}/*v8a.apk

      - name: Upload App To Artifact arm-v7a
        if: success () || failure ()
        uses: actions/upload-artifact@v4
        with:
          name: "OpenList-Mobile-${{ env.ver_name }}_arm-v7a"
          path: |
            ${{ env.output_path }}/*armeabi-v7a*.apk
            ${{ env.output_path }}/*v7a.apk

      - name: Upload App To Artifact x86_64
        if: success () || failure ()
        uses: actions/upload-artifact@v4
        with:
          name: "OpenList-Mobile-${{ env.ver_name }}_x86_64"
          path: |
            ${{ env.output_path }}/*x86_64*.apk
            ${{ env.output_path }}/*x64*.apk

  ios:
    name: Build OpenList iOS App (Dev)
    needs: [version]
    runs-on: macos-latest
    env:
      output: "${{ github.workspace }}/build/ios/ipa"
      testflight_ready: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.TESTFLIGHT_UPLOAD_ENABLED == 'true' && secrets.APP_STORE_CONNECT_KEY_ID != '' && secrets.APP_STORE_CONNECT_ISSUER_ID != '' && secrets.APP_STORE_CONNECT_KEY_P8 != '' && secrets.IOS_CERT_PFX != '' && secrets.IOS_CERT_PASSWORD != '' && secrets.IOS_PROVISION_PROFILE != '' }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Select Xcode 26.3.0
        run: |
          XCODE_APP="/Applications/Xcode_26.3.0.app"
          if [ ! -d "$XCODE_APP" ]; then
            echo "Xcode_26.3.0 not found at $XCODE_APP"
            echo "Installed Xcode apps:"
            ls -1 /Applications | grep '^Xcode' || true
            exit 1
          fi
          sudo xcode-select -s "$XCODE_APP/Contents/Developer"
          xcodebuild -version

      - name: Download OpenList iOS Framework from latest build
        uses: dawidd6/action-download-artifact@v6
        with:
          workflow: sync_openlist.yaml
          name: openlist-ios-xcframework
          path: ${{ github.workspace }}/ios/Frameworks/
          check_artifacts: true
          search_artifacts: true

      - uses: subosito/flutter-action@v2
        with:
          flutter-version: '3.32.7'

      - name: Generate iOS Build Number
        run: |
          IOS_BUILD_NUMBER=$(date +%y%m%d%H)
          echo "ios_build_number=$IOS_BUILD_NUMBER" >> $GITHUB_ENV

      - name: Install iOS Signing Assets
        if: ${{ env.testflight_ready == 'true' }}
        env:
          IOS_CERT_PFX: ${{ secrets.IOS_CERT_PFX }}
          IOS_CERT_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
          IOS_PROVISION_PROFILE: ${{ secrets.IOS_PROVISION_PROFILE }}
        run: |
          KEYCHAIN_PATH="${RUNNER_TEMP}/openlist.keychain-db"
          KEYCHAIN_PASSWORD="temp_keychain_password"

          security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
          security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
          security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
          security list-keychains -d user -s "$KEYCHAIN_PATH" login.keychain-db
          security default-keychain -s "$KEYCHAIN_PATH"

          CERT_PATH="${RUNNER_TEMP}/ios_signing.pfx"
          CERT_PEM_PATH="${RUNNER_TEMP}/ios_signing.pem"
          CERT_P12_PATH="${RUNNER_TEMP}/ios_signing_mac.p12"
          echo "$IOS_CERT_PFX" | base64 --decode > "$CERT_PATH"

          if openssl pkcs12 -in "$CERT_PATH" -out "$CERT_PEM_PATH" -nodes -legacy -passin pass:"$IOS_CERT_PASSWORD"; then
            openssl pkcs12 -export -in "$CERT_PEM_PATH" -out "$CERT_P12_PATH" -passout pass:"$IOS_CERT_PASSWORD" -legacy
          else
            openssl pkcs12 -in "$CERT_PATH" -out "$CERT_PEM_PATH" -nodes -passin pass:"$IOS_CERT_PASSWORD"
            openssl pkcs12 -export -in "$CERT_PEM_PATH" -out "$CERT_P12_PATH" -passout pass:"$IOS_CERT_PASSWORD"
          fi

          security import "$CERT_P12_PATH" -k "$KEYCHAIN_PATH" -P "$IOS_CERT_PASSWORD" -A
          security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"

          security find-identity -v -p codesigning "$KEYCHAIN_PATH"
          SIGNING_IDENTITY=$(security find-identity -v -p codesigning "$KEYCHAIN_PATH" | head -n 1 | sed -E 's/.*"(.*)"/\1/')
          echo "signing_identity=$SIGNING_IDENTITY" >> $GITHUB_ENV
          echo "keychain_path=$KEYCHAIN_PATH" >> $GITHUB_ENV

          PROFILE_PATH="${RUNNER_TEMP}/openlist.mobileprovision"
          echo "$IOS_PROVISION_PROFILE" | base64 --decode > "$PROFILE_PATH"

          PROFILE_PLIST="${RUNNER_TEMP}/profile.plist"
          security cms -D -i "$PROFILE_PATH" > "$PROFILE_PLIST"

          PROFILE_UUID=$(/usr/libexec/PlistBuddy -c "Print UUID" "$PROFILE_PLIST")
          PROFILE_NAME=$(/usr/libexec/PlistBuddy -c "Print Name" "$PROFILE_PLIST")
          TEAM_ID=$(/usr/libexec/PlistBuddy -c "Print TeamIdentifier:0" "$PROFILE_PLIST")

          mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
          cp "$PROFILE_PATH" "$HOME/Library/MobileDevice/Provisioning Profiles/${PROFILE_UUID}.mobileprovision"

          echo "profile_name=$PROFILE_NAME" >> $GITHUB_ENV
          echo "team_id=$TEAM_ID" >> $GITHUB_ENV

      - name: Build iOS App (No CodeSign)
        if: ${{ env.testflight_ready != 'true' }}
        env:
          BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
        run: |
          echo "Building iOS app with CocoaPods..."
          flutter build ios --release --no-codesign --build-number "$ios_build_number"

      - name: Build iOS App (Signed for TestFlight)
        if: ${{ env.testflight_ready == 'true' }}
        env:
          BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
        run: |
          echo "Building signed iOS IPA for TestFlight..."
          BUNDLE_ID="${{ secrets.IOS_BUNDLE_ID }}"
          if [ -z "$BUNDLE_ID" ]; then
            BUNDLE_ID="org.oplist.app"
          fi

          flutter build ios --release --no-codesign --build-number "$ios_build_number"

          EXPORT_OPTIONS_PATH="${RUNNER_TEMP}/exportOptions.plist"
          /usr/libexec/PlistBuddy -c "Clear dict" "$EXPORT_OPTIONS_PATH" || true
          /usr/libexec/PlistBuddy -c "Add :method string app-store" "$EXPORT_OPTIONS_PATH"
          /usr/libexec/PlistBuddy -c "Add :signingStyle string manual" "$EXPORT_OPTIONS_PATH"
          /usr/libexec/PlistBuddy -c "Add :teamID string $team_id" "$EXPORT_OPTIONS_PATH"
          /usr/libexec/PlistBuddy -c "Add :signingCertificate string $signing_identity" "$EXPORT_OPTIONS_PATH"
          /usr/libexec/PlistBuddy -c "Add :provisioningProfiles dict" "$EXPORT_OPTIONS_PATH"
          /usr/libexec/PlistBuddy -c "Add :provisioningProfiles:$BUNDLE_ID string $profile_name" "$EXPORT_OPTIONS_PATH"

          ARCHIVE_PATH="${RUNNER_TEMP}/OpenList.xcarchive"
          xcodebuild \
            -workspace ios/Runner.xcworkspace \
            -scheme Runner \
            -configuration Release \
            -sdk iphoneos \
            -archivePath "$ARCHIVE_PATH" \
            archive \
            CODE_SIGNING_ALLOWED=NO \
            CODE_SIGNING_REQUIRED=NO

          xcodebuild \
            -exportArchive \
            -archivePath "$ARCHIVE_PATH" \
            -exportOptionsPlist "$EXPORT_OPTIONS_PATH" \
            -exportPath "${{ env.output }}" \
            OTHER_CODE_SIGN_FLAGS="--keychain $keychain_path"

      - name: Create IPA
        if: ${{ env.testflight_ready != 'true' }}
        run: |
          mkdir -p ${{ env.output }}

          APP_PATH=""
          for candidate in \
            "build/ios/iphoneos/Runner.app" \
            "build/ios/Release-iphoneos/Runner.app" \
            "build/ios/Release-unknown/Runner.app" \
            "build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app"
          do
            if [ -d "$candidate" ]; then
              APP_PATH="$candidate"
              break
            fi
          done

          if [ -z "$APP_PATH" ]; then
            echo "Runner.app not found in expected locations."
            echo "Available build/ios directories for diagnostics:"
            find build/ios -maxdepth 5 -type d || true
            exit 1
          fi

          TMP_DIR=$(mktemp -d)
          mkdir -p "$TMP_DIR/Payload"
          cp -R "$APP_PATH" "$TMP_DIR/Payload/"
          (
            cd "$TMP_DIR"
            zip -qry "${{ env.output }}/OpenList-Mobile.ipa" Payload/
          )

      - name: Normalize IPA Name
        if: ${{ env.testflight_ready == 'true' }}
        run: |
          mkdir -p ${{ env.output }}
          IPA_PATH=$(ls ${{ env.output }}/*.ipa | head -n 1)
          cp "$IPA_PATH" "${{ env.output }}/OpenList-Mobile.ipa"

      - name: Install Fastlane
        if: ${{ env.testflight_ready == 'true' }}
        run: sudo gem install fastlane -N

      - name: Prepare App Store Connect API Key
        if: ${{ env.testflight_ready == 'true' }}
        env:
          APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
          APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
        run: |
          mkdir -p ${{ runner.temp }}/asc_key
          echo "${{ secrets.APP_STORE_CONNECT_KEY_P8 }}" | base64 --decode > ${{ runner.temp }}/asc_key/AuthKey.p8
          python3 - <<'PY'
          import json
          import os

          key_path = os.path.join(os.environ['RUNNER_TEMP'], 'asc_key', 'AuthKey.p8')
          with open(key_path, 'r', encoding='utf-8') as f:
            key_content = f.read().strip()

          data = {
            'key_id': os.environ.get('APP_STORE_CONNECT_KEY_ID', ''),
            'issuer_id': os.environ.get('APP_STORE_CONNECT_ISSUER_ID', ''),
            'key': key_content,
          }

          out_path = os.path.join(os.environ['RUNNER_TEMP'], 'asc_key', 'api_key.json')
          with open(out_path, 'w', encoding='utf-8') as f:
            json.dump(data, f)
          PY

      - name: Upload to TestFlight
        if: ${{ env.testflight_ready == 'true' }}
        run: |
          fastlane pilot upload \
            --api_key_path "${{ runner.temp }}/asc_key/api_key.json" \
            --ipa "${{ env.output }}/OpenList-Mobile.ipa" \
            --skip_waiting_for_build_processing true

      - name: Set iOS Version
        run: |
          if [ "${{ github.event_name }}" == "pull_request" ]; then
            echo "ver_name=${{ needs.version.outputs.version_name }}-debug" >> $GITHUB_ENV
          else
            echo "ver_name=${{ needs.version.outputs.version_name }}" >> $GITHUB_ENV
          fi

      - name: Upload iOS App To Artifact
        if: success() || failure()
        uses: actions/upload-artifact@v4
        with:
          name: "OpenList-Mobile-iOS-${{ env.ver_name }}"
          path: "${{ env.output }}/OpenList-Mobile.ipa"


================================================
FILE: .github/workflows/build_openlist.yaml
================================================
name: Build OpenList Libraries

on:
  workflow_dispatch:
  workflow_call:

permissions:
  contents: read

jobs:
  version:
    name: Get OpenList Version Information
    runs-on: ubuntu-latest
    outputs:
      openlist_version: ${{ steps.openlist_version.outputs.openlist_version }}
      openlist_git_commit: ${{ steps.openlist_version.outputs.openlist_git_commit }}
      openlist_web_version: ${{ steps.openlist_version.outputs.openlist_web_version }}
      openlist_built_at: ${{ steps.openlist_version.outputs.openlist_built_at }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Download OpenList Source Code
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_openlist.sh

      - name: Extract OpenList Version Info
        id: openlist_version
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          
          GIT_REPO="https://github.com/OpenListTeam/OpenList.git"
          OPENLIST_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $GIT_REPO | tail -n 1 | cut -d'/' -f3)
          OPENLIST_GIT_COMMIT=$(git ls-remote $GIT_REPO "refs/tags/${OPENLIST_VERSION}" | cut -f1 | cut -c1-7)
          OPENLIST_WEB_VERSION=$(curl -fsSL --max-time 10 "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/"//g;s/,//g;s/ //g' || echo "rolling")
          OPENLIST_BUILT_AT=$(date +'%F %T %z')
          
          echo "openlist_version=${OPENLIST_VERSION}" >> $GITHUB_OUTPUT
          echo "openlist_git_commit=${OPENLIST_GIT_COMMIT}" >> $GITHUB_OUTPUT
          echo "openlist_web_version=${OPENLIST_WEB_VERSION}" >> $GITHUB_OUTPUT
          echo "openlist_built_at=${OPENLIST_BUILT_AT}" >> $GITHUB_OUTPUT

  build_android:
    name: Build OpenList Android AAR
    needs: [version]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Download OpenList Source Code
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_openlist.sh
          ./init_web.sh

      - uses: actions/setup-go@v5
        with:
          go-version: 1.25.0

      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 17

      - uses: nttld/setup-ndk@v1
        id: setup-ndk
        with:
          ndk-version: r25c

      - name: Setup Gradle
        uses: gradle/gradle-build-action@v3

      - name: Build OpenList Android AAR
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_gomobile.sh
          ./gobind.sh
        env:
          ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
          OPENLIST_VERSION: ${{ needs.version.outputs.openlist_version }}
          OPENLIST_WEB_VERSION: ${{ needs.version.outputs.openlist_web_version }}
          OPENLIST_BUILT_AT: ${{ needs.version.outputs.openlist_built_at }}
          OPENLIST_GIT_COMMIT: ${{ needs.version.outputs.openlist_git_commit }}
          OPENLIST_GIT_AUTHOR: The OpenList Projects Contributors <noreply@openlist.team>

      - name: Upload OpenList Android AAR
        uses: actions/upload-artifact@v4
        with:
          name: "openlist-android-aar"
          path: "${{ github.workspace }}/android/app/libs/*.aar"
          retention-days: 50

  build_ios:
    name: Build OpenList iOS Framework
    needs: [version]
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: actions/setup-go@v5
        with:
          go-version: 1.25.0

      - name: Download OpenList Source Code
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_openlist.sh
          ./init_web_ios.sh

      - name: Build OpenList iOS Framework
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_gomobile.sh
          ./gobind_ios.sh
        env:
          OPENLIST_VERSION: ${{ needs.version.outputs.openlist_version }}
          OPENLIST_WEB_VERSION: ${{ needs.version.outputs.openlist_web_version }}
          OPENLIST_BUILT_AT: ${{ needs.version.outputs.openlist_built_at }}
          OPENLIST_GIT_COMMIT: ${{ needs.version.outputs.openlist_git_commit }}
          OPENLIST_GIT_AUTHOR: The OpenList Projects Contributors <noreply@openlist.team>

      - name: Upload OpenList iOS Framework
        uses: actions/upload-artifact@v4
        with:
          name: "openlist-ios-xcframework"
          path: "${{ github.workspace }}/ios/Frameworks/*.xcframework"
          retention-days: 50


================================================
FILE: .github/workflows/release.yaml
================================================
name: Release

on:
  workflow_dispatch:

permissions:
  contents: write

jobs:
  version:
    name: Get OpenList Version Information
    runs-on: ubuntu-latest
    outputs:
      version_name: ${{ steps.generate.outputs.version_name }}
      openlist_version: ${{ steps.openlist_version.outputs.openlist_version }}
      openlist_git_commit: ${{ steps.openlist_version.outputs.openlist_git_commit }}
      openlist_web_version: ${{ steps.openlist_version.outputs.openlist_web_version }}
      openlist_built_at: ${{ steps.openlist_version.outputs.openlist_built_at }}
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Generate Version Name
        id: generate
        run: |
          # Generate unified version with timestamp for entire workflow
          BASE_VERSION=$(cat openlist_version)
          TIMESTAMP=$(date +%y%m%d%H)
          VERSION_NAME="${BASE_VERSION}.${TIMESTAMP}"
          echo "version_name=${VERSION_NAME}" >> $GITHUB_OUTPUT

      - name: Download OpenList Source Code
        run: |
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          chmod +x *.sh
          ./init_openlist.sh

      - name: Extract OpenList Version Info
        id: openlist_version
        run: |
          # After init_openlist.sh, OpenList backend source is in openlist-lib/ with .git directory removed
          # We need to get version info from the latest remote tag that was cloned
          cd $GITHUB_WORKSPACE/openlist-lib/scripts
          
          # Re-fetch the tag information from remote (since .git was removed by init_openlist.sh)
          GIT_REPO="https://github.com/OpenListTeam/OpenList.git"
          OPENLIST_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags $GIT_REPO | tail -n 1 | cut -d'/' -f3)
          
          # Get the commit hash for this tag from remote
          OPENLIST_GIT_COMMIT=$(git ls-remote $GIT_REPO "refs/tags/${OPENLIST_VERSION}" | cut -f1 | cut -c1-7)
          
          # Get frontend version from OpenList-Frontend latest release
          OPENLIST_WEB_VERSION=$(curl -fsSL --max-time 10 "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/"//g;s/,//g;s/ //g' || echo "rolling")
          
          # Build timestamp
          OPENLIST_BUILT_AT=$(date +'%F %T %z')
          
          echo "openlist_version=${OPENLIST_VERSION}" >> $GITHUB_OUTPUT
          echo "openlist_git_commit=${OPENLIST_GIT_COMMIT}" >> $GITHUB_OUTPUT
          echo "openlist_web_version=${OPENLIST_WEB_VERSION}" >> $GITHUB_OUTPUT
          echo "openlist_built_at=${OPENLIST_BUILT_AT}" >> $GITHUB_OUTPUT

  android:
    name: Build OpenList Android APK
    needs: [version]
    runs-on: ubuntu-latest
    env:
      output: "${{ github.workspace }}/build/app/outputs/apk/release"
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Download OpenList Android AAR from latest build
        uses: dawidd6/action-download-artifact@v6
        with:
          workflow: sync_openlist.yaml
          name: openlist-android-aar
          path: ${{ github.workspace }}/android/app/libs/
          check_artifacts: true
          search_artifacts: true

      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 17

      - name: Setup Gradle
        uses: gradle/gradle-build-action@v3

      - name: Init Signature
        run: |
          touch local.properties
          cd android
          echo ALIAS_NAME='${{ secrets.ALIAS_NAME }}' >> local.properties
          echo ALIAS_PASSWORD='${{ secrets.ALIAS_PASSWORD }}' >> local.properties
          echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties
          echo KEY_PATH='./key.jks' >> local.properties
          # 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks
          echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/android/app/key.jks

      - uses: subosito/flutter-action@v2
        with:
          flutter-version: '3.32.7'
          
      - name: Build APK with Version
        env:
          BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
        run: flutter build apk --split-per-abi --release

      - name: Upload missing_rules.txt
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: "missing_rules"
          path: "${{ github.workspace }}/build/app/outputs/mapping/release/missing_rules.txt"

      - name: Upload Android APKs for Release
        uses: actions/upload-artifact@v4
        with:
          name: "android-release-files"
          path: "${{ env.output }}/*.apk"

  # ios:
  #   name: Build OpenList iOS App
  #   needs: [version]
  #   runs-on: macos-latest
  #   env:
  #     output: "${{ github.workspace }}/build/ios/ipa"
  #   steps:
  #      - uses: actions/checkout@v3
  #        with:
  #          fetch-depth: 0
  #
  #      - name: Download OpenList iOS Framework from latest build
  #        uses: dawidd6/action-download-artifact@v6
  #        with:
  #          workflow: sync_openlist.yaml
  #          name: openlist-ios-xcframework
  #          path: ${{ github.workspace }}/ios/Frameworks/
  #          check_artifacts: true
  #          search_artifacts: true

  #     - uses: subosito/flutter-action@v2
  #       with:
  #         flutter-version: '3.32.7'

  #     - name: Build iOS App
  #       env:
  #         BUILD_VERSION_NAME: ${{ needs.version.outputs.version_name }}
  #       run: |
  #         flutter build ios --release --no-codesign

  #     - name: Create IPA
  #       run: |
  #         mkdir -p ${{ env.output }}
  #         cd build/ios/iphoneos
  #         mkdir Payload
  #         cp -r Runner.app Payload/
  #         zip -r ${{ env.output }}/OpenList-Mobile.ipa Payload/

  #     - name: Upload iOS IPA for Release
  #       uses: actions/upload-artifact@v4
  #       with:
  #         name: "ios-release-files"
  #         path: "${{ env.output }}/OpenList-Mobile.ipa"

  release:
    name: Create GitHub Release
    needs: [version, android] # Add ios when iOS build is enabled: [version, android, ios]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "22"

      - name: Prepare changelog generation
        id: prepare_changelog
        run: |
          git tag -d rolling 2>/dev/null || true
          PRE_RELEASE_TAGS=$(git tag -l | grep -E "(-|\+)" || true)
          if [ -n "$PRE_RELEASE_TAGS" ]; then
            echo "$PRE_RELEASE_TAGS" | xargs -r git tag -d
          fi

      - name: Generate changelog
        id: generate_changelog
        run: |
          npx changelogithub --output ${{ github.workspace }}/GENERATED_CHANGELOG.txt || echo "" > ${{ github.workspace }}/GENERATED_CHANGELOG.txt

      - name: Create final changelog
        id: create_changelog
        run: |
          echo "[Auto Sync OpenList] ${{ needs.version.outputs.openlist_version }}" > ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "**OpenList Backend:** ${{ needs.version.outputs.openlist_version }} (${{ needs.version.outputs.openlist_git_commit }})" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "**OpenList Frontend:** ${{ needs.version.outputs.openlist_web_version }}" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "**Built at:** ${{ needs.version.outputs.openlist_built_at }}" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "---" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          echo "" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt

          if [ -s "${{ github.workspace }}/GENERATED_CHANGELOG.txt" ]; then
            cat ${{ github.workspace }}/GENERATED_CHANGELOG.txt >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          else
            echo "No changes in this release." >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
          fi

      - name: Download Android artifacts
        uses: actions/download-artifact@v4
        with:
          name: android-release-files
          path: release_files/

      # - name: Download iOS artifacts
      #   uses: actions/download-artifact@v4
      #   with:
      #     name: ios-release-files
      #     path: release_files/

      - uses: softprops/action-gh-release@v1
        with:
          name: ${{ needs.version.outputs.version_name }}
          tag_name: ${{ needs.version.outputs.version_name }}
          body_path: ${{ github.workspace }}/FINAL_CHANGELOG.txt
          draft: false
          prerelease: false
          files: release_files/*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


================================================
FILE: .github/workflows/sync_openlist.yaml
================================================
name: Check Updates

on:
  schedule:
    - cron: "0 5,17 * * *" # 每日5点和17点执行
  workflow_dispatch:
    inputs:
      force_build:
        description: 'Force build OpenList libraries'
        required: false
        type: boolean
        default: false
  push:
    branches:
      - "master"
    paths:
      - "sync_openlist.yaml"  

permissions:
  contents: write
  actions: write

jobs:
  check_and_update:
    name: Check for version updates
    runs-on: ubuntu-latest
    outputs:
      openlist_update: ${{ steps.set_output.outputs.openlist_update }}
      openlist_version: ${{ steps.set_output.outputs.openlist_version }}
    env:
      VERSION_FILE: ${{ github.workspace }}/openlist_version
    steps:
      - uses: actions/checkout@v3
      
      - name: Check OpenList Version
        run: |
          cd $GITHUB_WORKSPACE/.github/scripts
          chmod +x ./*.sh

          touch ${{ env.VERSION_FILE }}
          ./check_openlist.sh

      - name: Set Output Variables
        id: set_output
        run: |
          echo "openlist_version=${{ env.openlist_version }}" >> $GITHUB_OUTPUT
          echo "openlist_update=${{ env.openlist_update }}" >> $GITHUB_OUTPUT

      - name: Import GPG key
        if: env.openlist_update == '1'
        uses: crazy-max/ghaction-import-gpg@v6
        with:
          gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
          passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
          git_user_signingkey: true
          git_commit_gpgsign: true
          git_tag_gpgsign: true

      - name: Update Version Files
        if: env.openlist_update == '1'
        run: |
          echo -e "${{ env.openlist_version }}" > ${{ env.VERSION_FILE }}
          
          chmod +x $GITHUB_WORKSPACE/.github/scripts/update_pubspec_version.sh
          $GITHUB_WORKSPACE/.github/scripts/update_pubspec_version.sh

          git config user.name "${{ secrets.BOT_USERNAME }}"
          git config user.email "${{ secrets.BOT_USEREMAIL }}"
          git add .
          git commit -m "[bot] Update openlist to ${{ env.openlist_version }}"
          git push

  build_openlist_libraries:
    name: Build OpenList Libraries
    needs: [check_and_update]
    if: needs.check_and_update.outputs.openlist_update == '1' || inputs.force_build == true
    uses: ./.github/workflows/build_openlist.yaml

  trigger_release:
    name: Trigger Release Workflow
    needs: [check_and_update, build_openlist_libraries]
    if: needs.check_and_update.outputs.openlist_update == '1' && ( success() || failure() )
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Release Workflow
        run: |
          gh workflow run release.yaml -R ${{ github.repository }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  


================================================
FILE: .gitignore
================================================
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
docs/
.github/prompts/
CHANGELOG.md

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

local.properties

*.aar
*.exe
*.tgz
*.jar
*.zip
*.so

android/app/.cxx
android/app/build

================================================
FILE: .metadata
================================================
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
  revision: "fcf2c11572af6f390246c056bc905eca609533a0"
  channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
  platforms:
    - platform: root
      create_revision: fcf2c11572af6f390246c056bc905eca609533a0
      base_revision: fcf2c11572af6f390246c056bc905eca609533a0
    - platform: ios
      create_revision: fcf2c11572af6f390246c056bc905eca609533a0
      base_revision: fcf2c11572af6f390246c056bc905eca609533a0

  # User provided section

  # List of Local paths (relative to this file) that should be
  # ignored by the migrate tool.
  #
  # Files that are not part of the templates will be ignored by default.
  unmanaged_files:
    - 'lib/main.dart'
    - 'ios/Runner.xcodeproj/project.pbxproj'


================================================
FILE: LICENSE
================================================
                    GNU AFFERO GENERAL PUBLIC LICENSE
                       Version 3, 19 November 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.

  A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate.  Many developers of free software are heartened and
encouraged by the resulting cooperation.  However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.

  The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community.  It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server.  Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.

  An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals.  This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU Affero General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Remote Network Interaction; Use with the GNU General Public License.

  Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software.  This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published
    by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source.  For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code.  There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.


================================================
FILE: README.md
================================================


<div align="center">
  <img src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/logo.svg" height="100px" alt="OpenList Logo">
  <h1>OpenList-Mobile</h1>
</div>


<div align="center">

[![Release](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/release.yaml/badge.svg)](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/release.yaml)
[![Build](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/build.yaml/badge.svg)](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/build.yaml)
[![Sync OpenList](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/sync_openlist.yaml/badge.svg)](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/sync_openlist.yaml)
[![License](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)
[![Flutter](https://img.shields.io/badge/Flutter-3.32.7-blue.svg)](https://flutter.dev/)
[![OpenList](https://img.shields.io/github/v/release/OpenListTeam/OpenList?label=OpenList)](https://github.com/OpenListTeam/OpenList)

</div>


<div align="center">
  <a href="README.md">🇨🇳 中文</a> | <a href="README_EN.md">🇺🇸 English</a>
</div>


**OpenList-Mobile** 是一个基于 [OpenList](https://github.com/OpenListTeam/OpenList) 的移动端文件服务器应用,使用 Flutter 框架开发。支持局域网文件共享、远程访问和在线管理。

### 下载安装

#### 稳定版本
- [📱 发布版](https://github.com/OpenListTeam/OpenList-Mobile/releases/latest) - 推荐使用

#### 开发版本
- [🔧 构建版](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/build.yaml) - 最新功能

> **自动更新**:[GitHub Actions](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/sync_openlist.yaml) 每日早晚五点自动检查最新的 [OpenList](https://github.com/OpenListTeam/OpenList/releases) 版本并构建发布,确保始终使用最新版本。


### 支持平台
- Android
- iOS (实验性,仍在开发)


================================================
FILE: README_EN.md
================================================
<div align="center">
  <img src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/logo.svg" height="100px" alt="OpenList Logo">
  <h1>OpenList-Mobile</h1>
</div>


<div align="center">

[![Release](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/release.yaml/badge.svg)](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/release.yaml)
[![Build](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/build.yaml/badge.svg)](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/build.yaml)
[![Sync OpenList](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/sync_openlist.yaml/badge.svg)](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/sync_openlist.yaml)
[![License](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)
[![Flutter](https://img.shields.io/badge/Flutter-3.32.7-blue.svg)](https://flutter.dev/)
[![OpenList](https://img.shields.io/github/v/release/OpenListTeam/OpenList?label=OpenList)](https://github.com/OpenListTeam/OpenList)

</div>

<div align="center">
  <a href="README.md">🇨🇳 中文</a> | <a href="README_EN.md">🇺🇸 English</a>
</div>


**OpenList-Mobile** is a mobile file server application based on [OpenList](https://github.com/OpenListTeam/OpenList), built with Flutter framework. Turn your phone into a powerful file server with LAN file sharing, remote access, and online management capabilities.

### Download & Installation

#### Stable Release
- [📱 Latest Release](https://github.com/OpenListTeam/OpenList-Mobile/releases/latest) - Recommended

#### Development Build
- [🔧 Development Build](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/build.yaml) - Latest Features

> **Auto-Update**: [GitHub Actions](https://github.com/OpenListTeam/OpenList-Mobile/actions/workflows/sync_openlist.yaml) automatically checks for the latest [OpenList](https://github.com/OpenListTeam/OpenList/releases) version twice daily (5 AM & 5 PM) and builds releases, ensuring always have access to the latest version.

### Supported Platforms
- Android
- iOS (Experimental, still in development)

================================================
FILE: analysis_options.yaml
================================================
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
  # The lint rules applied to this project can be customized in the
  # section below to disable rules from the `package:flutter_lints/flutter.yaml`
  # included above or to enable additional rules. A list of all available lints
  # and their documentation is published at https://dart.dev/lints.
  #
  # Instead of disabling a lint rule for the entire project in the
  # section below, it can also be suppressed for a single line of code
  # or a specific dart file by using the `// ignore: name_of_lint` and
  # `// ignore_for_file: name_of_lint` syntax on the line or in the file
  # producing the lint.
  rules:
    # avoid_print: false  # Uncomment to disable the `avoid_print` rule
    # prefer_single_quotes: true  # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options


================================================
FILE: android/.gitignore
================================================
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks

*.aar
*.exe
*.tgz
*.jar
*.zip
*.so



================================================
FILE: android/app/build.gradle
================================================
plugins {
    id "com.android.application"
    id "kotlin-android"
    id "kotlin-parcelize"
    id "kotlin-kapt"
    id "dev.flutter.flutter-gradle-plugin"
    id "kotlinx-serialization"
}

def pro = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        pro.load(reader)
    }
}

static def releaseTime() {
    return new Date().format("yyMMddHH", TimeZone.getTimeZone("GMT+8"))
}

def openlistVersionFile = rootProject.file("../openlist_version")
def openlistVersion = openlistVersionFile.exists() ? openlistVersionFile.readLines()[0] : "1.0.0"

// Check if version is provided via environment variable (from CI/CD)
def providedVersion = System.getenv('BUILD_VERSION_NAME')
def baseVersion = openlistVersion.startsWith('v') ? openlistVersion.substring(1) : openlistVersion

// Use provided version if available, otherwise generate with timestamp
def version = providedVersion ?: (baseVersion + "." + releaseTime())
def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim())

android {
    namespace "com.openlist.mobile"
    compileSdk = 35
    ndkVersion = "27.0.12077973"

    signingConfigs {
        release {
            if (pro["KEY_PATH"] != null && pro["KEY_PASSWORD"] != null && 
                pro["ALIAS_NAME"] != null && pro["ALIAS_PASSWORD"] != null) {
                storeFile file(pro["KEY_PATH"])
                storePassword pro["KEY_PASSWORD"]
                keyAlias pro["ALIAS_NAME"]
                keyPassword pro["ALIAS_PASSWORD"]
            }
        }
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.openlist.mobile"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdk 21
        targetSdk flutter.targetSdkVersion
        versionCode gitCommits
        versionName version

        
        buildConfigField("String", "OPENLIST_VERSION", "\"${openlistVersion}\"")
    }


    buildFeatures {
        buildConfig true
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
        coreLibraryDesugaringEnabled true
    }


    kotlinOptions {
        jvmTarget = '17'
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
            java.srcDirs = ['src/main/java', 'src/main/kotlin']
        }
    }

    splits {
        abi {
            enable true  // 改为始终启用,而不是根据任务名判断
            reset()
            include 'armeabi-v7a', 'arm64-v8a', 'x86_64'
            universalApk false  // 改为false避免生成通用APK
        }
    }

//    kotlin {
//        jvmToolchain  = 17
//    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            if (pro["KEY_PATH"] != null && pro["KEY_PASSWORD"] != null && 
                pro["ALIAS_NAME"] != null && pro["ALIAS_PASSWORD"] != null) {
                signingConfig signingConfigs.release
            }
        }

        debug {
            ndk {
                //noinspection ChromeOsAbiSupport
//                abiFilters "arm64-v8a"
//                abiFilters "x86"
            }
        }
    }
}

androidComponents {
    onVariants(selector().all()) { variant ->
        variant.outputs.forEach { output ->
            def versionName = output.versionName.orNull ?: "1.0.0"
            def abi = ""
            // 简化ABI过滤器检查逻辑
            if (output.filters != null && !output.filters.isEmpty()) {
                for (filter in output.filters) {
                    if (filter.filterType.name() == "ABI") {
                        abi = "_${filter.identifier}"
                        break
                    }
                }
            }
            output.outputFileName.set("OpenList-Mobile-${versionName}${abi}.apk")
        }
    }
}


flutter {
    source '../..'
}
////获取flutter的sdk路径
//def flutterRoot = localProperties.getProperty('flutter.sdk')
//if (flutterRoot == null) {
//    throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
//}
dependencies {
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

//    compileOnly files("$flutterRoot/bin/cache/artifacts/engine/android-arm/flutter.jar")
    implementation project(":utils")
    //noinspection GradleDependency
    implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'

    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'

    implementation 'com.louiscad.splitties:splitties-systemservices:3.0.0'

    implementation 'com.github.cioccarellia:ksprefs:2.4.0'

    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")

    // Core library desugaring for flutter_local_notifications
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

    // WorkManager for background tasks
    implementation 'androidx.work:work-runtime-ktx:2.9.0'

    // Room
//    implementation("androidx.room:room-runtime:$room_version")
//    implementation("androidx.room:room-ktx:$room_version")
//    ksp("androidx.room:room-compiler:$room_version")
//    androidTestImplementation("androidx.room:room-testing:$room_version")

}

================================================
FILE: android/app/src/debug/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- The INTERNET permission is required for development. Specifically,
         the Flutter tool needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>


================================================
FILE: android/app/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!-- 前台服务权限 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
    
    <!-- 开机启动权限 -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    
    <!-- 查询包权限 -->
    <uses-permission
        android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />

    <!-- 通知权限 -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    
    <!-- 网络权限 -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    
    <!-- 存储权限 -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission
        android:name="android.permission.READ_INTERNAL_STORAGE"
        tools:ignore="SystemPermissionTypo" />
    <uses-permission
        android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />
    
    <!-- 电池优化和唤醒锁权限 -->
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    
    <!-- 安装权限 -->
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

    <application
        android:name="com.openlist.mobile.App"
        android:icon="@mipmap/ic_launcher"

        android:label="OpenList"
        android:networkSecurityConfig="@xml/network_security_config"
        android:requestLegacyExternalStorage="true"
        android:roundIcon="@mipmap/ic_launcher"
        android:supportsRtl="true"


        android:usesCleartextTraffic="true"
        tools:ignore="UnusedAttribute">
        <activity
            android:name=".SwitchServerActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:taskAffinity="openlist.switch"
            android:theme="@android:style/Theme.NoDisplay" />
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:exported="true"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />

        <!-- OpenList background service -->
        <service
            android:name=".OpenListService"
            android:exported="false"
            android:enabled="true"
            android:foregroundServiceType="dataSync" />

        <!-- Boot receiver -->
        <receiver
            android:name=".BootReceiver"
            android:exported="true"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>

        <!-- OpenList Tile -->
        <service
            android:name=".OpenListTileService"
            android:exported="true"
            android:icon="@mipmap/ic_launcher"
            android:label="OpenList"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>

    </application>
</manifest>

================================================
FILE: android/app/src/main/java/com/openlist/pigeon/GeneratedApi.java
================================================
// Autogenerated from Pigeon (v16.0.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon

package com.openlist.pigeon;

import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MessageCodec;
import io.flutter.plugin.common.StandardMessageCodec;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/** Generated class from Pigeon. */
@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"})
public class GeneratedApi {

  /** Error class for passing custom error details to Flutter via a thrown PlatformException. */
  public static class FlutterError extends RuntimeException {

    /** The error code. */
    public final String code;

    /** The error details. Must be a datatype supported by the api codec. */
    public final Object details;

    public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) 
    {
      super(message);
      this.code = code;
      this.details = details;
    }
  }

  @NonNull
  protected static ArrayList<Object> wrapError(@NonNull Throwable exception) {
    ArrayList<Object> errorList = new ArrayList<Object>(3);
    if (exception instanceof FlutterError) {
      FlutterError error = (FlutterError) exception;
      errorList.add(error.code);
      errorList.add(error.getMessage());
      errorList.add(error.details);
    } else {
      errorList.add(exception.toString());
      errorList.add(exception.getClass().getSimpleName());
      errorList.add(
        "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception));
    }
    return errorList;
  }

  @NonNull
  protected static FlutterError createConnectionError(@NonNull String channelName) {
    return new FlutterError("channel-error",  "Unable to establish connection on channel: " + channelName + ".", "");
  }

  /** Asynchronous error handling return type for non-nullable API method returns. */
  public interface Result<T> {
    /** Success case callback method for handling returns. */
    void success(@NonNull T result);

    /** Failure case callback method for handling errors. */
    void error(@NonNull Throwable error);
  }
  /** Asynchronous error handling return type for nullable API method returns. */
  public interface NullableResult<T> {
    /** Success case callback method for handling returns. */
    void success(@Nullable T result);

    /** Failure case callback method for handling errors. */
    void error(@NonNull Throwable error);
  }
  /** Asynchronous error handling return type for void API method returns. */
  public interface VoidResult {
    /** Success case callback method for handling returns. */
    void success();

    /** Failure case callback method for handling errors. */
    void error(@NonNull Throwable error);
  }
  /** Generated interface from Pigeon that represents a handler of messages from Flutter. */
  public interface AppConfig {

    @NonNull 
    Boolean isWakeLockEnabled();

    void setWakeLockEnabled(@NonNull Boolean enabled);

    @NonNull 
    Boolean isStartAtBootEnabled();

    void setStartAtBootEnabled(@NonNull Boolean enabled);

    @NonNull 
    Boolean isAutoCheckUpdateEnabled();

    void setAutoCheckUpdateEnabled(@NonNull Boolean enabled);

    @NonNull 
    Boolean isAutoOpenWebPageEnabled();

    void setAutoOpenWebPageEnabled(@NonNull Boolean enabled);

    @NonNull 
    String getDataDir();

    void setDataDir(@NonNull String dir);

    @NonNull 
    Boolean isSilentJumpAppEnabled();

    void setSilentJumpAppEnabled(@NonNull Boolean enabled);

    /** The codec used by AppConfig. */
    static @NonNull MessageCodec<Object> getCodec() {
      return new StandardMessageCodec();
    }
    /**Sets up an instance of `AppConfig` to handle messages through the `binaryMessenger`. */
    static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable AppConfig api) {
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.isWakeLockEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Boolean output = api.isWakeLockEnabled();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.setWakeLockEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                Boolean enabledArg = (Boolean) args.get(0);
                try {
                  api.setWakeLockEnabled(enabledArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.isStartAtBootEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Boolean output = api.isStartAtBootEnabled();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.setStartAtBootEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                Boolean enabledArg = (Boolean) args.get(0);
                try {
                  api.setStartAtBootEnabled(enabledArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.isAutoCheckUpdateEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Boolean output = api.isAutoCheckUpdateEnabled();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.setAutoCheckUpdateEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                Boolean enabledArg = (Boolean) args.get(0);
                try {
                  api.setAutoCheckUpdateEnabled(enabledArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.isAutoOpenWebPageEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Boolean output = api.isAutoOpenWebPageEnabled();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.setAutoOpenWebPageEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                Boolean enabledArg = (Boolean) args.get(0);
                try {
                  api.setAutoOpenWebPageEnabled(enabledArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.getDataDir", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  String output = api.getDataDir();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.setDataDir", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                String dirArg = (String) args.get(0);
                try {
                  api.setDataDir(dirArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.isSilentJumpAppEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Boolean output = api.isSilentJumpAppEnabled();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.AppConfig.setSilentJumpAppEnabled", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                Boolean enabledArg = (Boolean) args.get(0);
                try {
                  api.setSilentJumpAppEnabled(enabledArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
    }
  }
  /** Generated interface from Pigeon that represents a handler of messages from Flutter. */
  public interface NativeCommon {

    @NonNull 
    Boolean startActivityFromUri(@NonNull String intentUri);

    @NonNull 
    Long getDeviceSdkInt();

    @NonNull 
    String getDeviceCPUABI();

    @NonNull 
    String getVersionName();

    @NonNull 
    Long getVersionCode();

    void toast(@NonNull String msg);

    void longToast(@NonNull String msg);

    /** The codec used by NativeCommon. */
    static @NonNull MessageCodec<Object> getCodec() {
      return new StandardMessageCodec();
    }
    /**Sets up an instance of `NativeCommon` to handle messages through the `binaryMessenger`. */
    static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable NativeCommon api) {
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.startActivityFromUri", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                String intentUriArg = (String) args.get(0);
                try {
                  Boolean output = api.startActivityFromUri(intentUriArg);
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.getDeviceSdkInt", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Long output = api.getDeviceSdkInt();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.getDeviceCPUABI", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  String output = api.getDeviceCPUABI();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.getVersionName", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  String output = api.getVersionName();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.getVersionCode", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Long output = api.getVersionCode();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.toast", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                String msgArg = (String) args.get(0);
                try {
                  api.toast(msgArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.NativeCommon.longToast", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                String msgArg = (String) args.get(0);
                try {
                  api.longToast(msgArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
    }
  }
  /** Generated interface from Pigeon that represents a handler of messages from Flutter. */
  public interface Android {

    void addShortcut();

    void startService();

    void setAdminPwd(@NonNull String pwd);

    @NonNull 
    Long getOpenListHttpPort();

    @NonNull 
    Boolean isRunning();

    @NonNull 
    String getOpenListVersion();

    /** The codec used by Android. */
    static @NonNull MessageCodec<Object> getCodec() {
      return new StandardMessageCodec();
    }
    /**Sets up an instance of `Android` to handle messages through the `binaryMessenger`. */
    static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable Android api) {
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.Android.addShortcut", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  api.addShortcut();
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.Android.startService", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  api.startService();
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.Android.setAdminPwd", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                ArrayList<Object> args = (ArrayList<Object>) message;
                String pwdArg = (String) args.get(0);
                try {
                  api.setAdminPwd(pwdArg);
                  wrapped.add(0, null);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.Android.getOpenListHttpPort", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Long output = api.getOpenListHttpPort();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.Android.isRunning", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  Boolean output = api.isRunning();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
      {
        BasicMessageChannel<Object> channel =
            new BasicMessageChannel<>(
                binaryMessenger, "dev.flutter.pigeon.openlist_mobile.Android.getOpenListVersion", getCodec());
        if (api != null) {
          channel.setMessageHandler(
              (message, reply) -> {
                ArrayList<Object> wrapped = new ArrayList<Object>();
                try {
                  String output = api.getOpenListVersion();
                  wrapped.add(0, output);
                }
 catch (Throwable exception) {
                  ArrayList<Object> wrappedError = wrapError(exception);
                  wrapped = wrappedError;
                }
                reply.reply(wrapped);
              });
        } else {
          channel.setMessageHandler(null);
        }
      }
    }
  }
  /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */
  public static class Event {
    private final @NonNull BinaryMessenger binaryMessenger;

    public Event(@NonNull BinaryMessenger argBinaryMessenger) {
      this.binaryMessenger = argBinaryMessenger;
    }

    /** Public interface for sending reply. */ 
    /** The codec used by Event. */
    static @NonNull MessageCodec<Object> getCodec() {
      return new StandardMessageCodec();
    }
    public void onServiceStatusChanged(@NonNull Boolean isRunningArg, @NonNull VoidResult result) {
      final String channelName = "dev.flutter.pigeon.openlist_mobile.Event.onServiceStatusChanged";
      BasicMessageChannel<Object> channel =
          new BasicMessageChannel<>(
              binaryMessenger, channelName, getCodec());
      channel.send(
          new ArrayList<Object>(Collections.singletonList(isRunningArg)),
          channelReply -> {
            if (channelReply instanceof List) {
              List<Object> listReply = (List<Object>) channelReply;
              if (listReply.size() > 1) {
                result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2)));
              } else {
                result.success();
              }
            }  else {
              result.error(createConnectionError(channelName));
            } 
          });
    }
    public void onServerLog(@NonNull Long levelArg, @NonNull String timeArg, @NonNull String logArg, @NonNull VoidResult result) {
      final String channelName = "dev.flutter.pigeon.openlist_mobile.Event.onServerLog";
      BasicMessageChannel<Object> channel =
          new BasicMessageChannel<>(
              binaryMessenger, channelName, getCodec());
      channel.send(
          new ArrayList<Object>(Arrays.asList(levelArg, timeArg, logArg)),
          channelReply -> {
            if (channelReply instanceof List) {
              List<Object> listReply = (List<Object>) channelReply;
              if (listReply.size() > 1) {
                result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2)));
              } else {
                result.success();
              }
            }  else {
              result.error(createConnectionError(channelName));
            } 
          });
    }
  }
}


================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/App.kt
================================================
package com.openlist.mobile

import android.app.Application
import android.util.Log
import com.openlist.mobile.model.openlist.OpenList
import com.openlist.mobile.utils.ToastUtils.longToast
import io.flutter.app.FlutterApplication

val app by lazy { App.app }

class App : FlutterApplication() {
    companion object {
        private const val TAG = "App"
        lateinit var app: Application
    }


    override fun onCreate() {
        super.onCreate()

        app = this
        
        // Early initialization of OpenList to prepare for boot startup
        try {
            Log.d(TAG, "Performing early OpenList initialization")
            OpenList.init()
            Log.d(TAG, "OpenList early initialization completed")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to initialize OpenList early", e)
        }
        
        // Set global exception handler to catch uncaught exceptions
        Thread.setDefaultUncaughtExceptionHandler { thread, throwable ->
            Log.e(TAG, "Uncaught exception in thread ${thread.name}", throwable)
            
            // Log detailed info for JNI related errors
            if (throwable.message?.contains("JNI") == true || 
                throwable.message?.contains("native") == true ||
                throwable is UnsatisfiedLinkError) {
                Log.e(TAG, "Native/JNI related crash detected")
            }
            
            // Call default exception handler
            val defaultHandler = Thread.getDefaultUncaughtExceptionHandler()
            defaultHandler?.uncaughtException(thread, throwable)
        }
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/BootReceiver.kt
================================================
package com.openlist.mobile

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import com.openlist.mobile.config.AppConfig

/**
 * Boot receiver - handles device boot and package update events
 */
class BootReceiver : BroadcastReceiver() {
    companion object {
        private const val TAG = "BootReceiver"
    }

    override fun onReceive(context: Context?, intent: Intent?) {
        if (context == null || intent?.action == null) return
        
        Log.d(TAG, "Received broadcast: ${intent.action}")

        when (intent.action) {
            Intent.ACTION_BOOT_COMPLETED -> {
                handleBootCompleted(context)
            }
            Intent.ACTION_MY_PACKAGE_REPLACED -> {
                handlePackageReplaced(context)
            }
        }
    }

    private fun handleBootCompleted(context: Context) {
        if (!AppConfig.isStartAtBootEnabled) {
            Log.d(TAG, "Auto-start disabled, skipping")
            return
        }

        // Clear manual stop flag on boot
        AppConfig.isManuallyStoppedByUser = false
        
        Log.d(TAG, "Starting OpenList service")
        startService(context)
    }

    private fun handlePackageReplaced(context: Context) {
        if (!AppConfig.isStartAtBootEnabled) {
            Log.d(TAG, "Auto-start disabled, skipping package update restart")
            return
        }
        
        Log.d(TAG, "Starting OpenList service after package update")
        startService(context)
    }

    private fun startService(context: Context) {
        try {
            val serviceIntent = Intent(context, OpenListService::class.java)
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                context.startForegroundService(serviceIntent)
            } else {
                context.startService(serviceIntent)
            }
            Log.d(TAG, "Service start command sent")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to start service", e)
        }
    }
}


================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/MainActivity.kt
================================================
package com.openlist.mobile

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.util.Log
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.openlist.mobile.bridge.AndroidBridge
import com.openlist.mobile.bridge.AppConfigBridge
import com.openlist.mobile.bridge.CommonBridge
import com.openlist.mobile.bridge.ServiceBridge
import com.openlist.mobile.model.ShortCuts
import com.openlist.mobile.model.openlist.Logger
import com.openlist.pigeon.GeneratedApi
import com.openlist.pigeon.GeneratedApi.VoidResult
import io.flutter.embedding.android.FlutterActivity
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugins.GeneratedPluginRegistrant
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

class MainActivity : FlutterActivity() {
    companion object {
        private const val TAG = "MainActivity"
        
        // 静态引用,供其他组件访问
        @Volatile
        var serviceBridge: ServiceBridge? = null
            private set
    }

    private val receiver by lazy { MyReceiver() }
    private var mEvent: GeneratedApi.Event? = null

    @OptIn(DelicateCoroutinesApi::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        ShortCuts.buildShortCuts(this)
        LocalBroadcastManager.getInstance(this)
            .registerReceiver(receiver, IntentFilter(OpenListService.ACTION_STATUS_CHANGED))

        GeneratedPluginRegistrant.registerWith(this.flutterEngine!!)

        val binaryMessage = flutterEngine!!.dartExecutor.binaryMessenger
        GeneratedApi.AppConfig.setUp(binaryMessage, AppConfigBridge)
        GeneratedApi.Android.setUp(binaryMessage, AndroidBridge(this))
        GeneratedApi.NativeCommon.setUp(binaryMessage, CommonBridge(this))
        mEvent = GeneratedApi.Event(binaryMessage)

        // 设置服务桥接
        val serviceChannel = MethodChannel(binaryMessage, "com.openlist.mobile/service")
        serviceBridge = ServiceBridge(this, serviceChannel)

        Logger.addListener(object : Logger.Listener {
            override fun onLog(level: Int, time: String, msg: String) {
                GlobalScope.launch(Dispatchers.Main) {
                    mEvent?.onServerLog(level.toLong(), time, msg, object : VoidResult {
                        override fun success() {

                        }

                        override fun error(error: Throwable) {
                        }

                    })
                }
            }

        })
    }

    override fun onPause() {
        super.onPause()
        // Trigger database sync when app goes to background
        triggerDatabaseSync("onPause")
    }

    override fun onStop() {
        super.onStop()
        // Trigger database sync when app is stopped
        triggerDatabaseSync("onStop")
    }

    override fun onTrimMemory(level: Int) {
        super.onTrimMemory(level)
        // Trigger database sync on memory pressure
        when (level) {
            TRIM_MEMORY_UI_HIDDEN,
            TRIM_MEMORY_BACKGROUND,
            TRIM_MEMORY_MODERATE,
            TRIM_MEMORY_COMPLETE -> {
                triggerDatabaseSync("onTrimMemory:$level")
            }
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        // Trigger database sync before activity is destroyed
        triggerDatabaseSync("onDestroy")
        
        LocalBroadcastManager.getInstance(this).unregisterReceiver(receiver)
    }

    /**
     * Trigger database synchronization through the service
     */
    private fun triggerDatabaseSync(reason: String) {
        try {
            val serviceInstance = OpenListService.serviceInstance
            if (serviceInstance != null && OpenListService.isRunning) {
                Log.d(TAG, "Triggering database sync due to: $reason")
                serviceInstance.forceImmediateDbSync()
            } else {
                Log.d(TAG, "Service not running, skipping database sync for: $reason")
            }
        } catch (e: Exception) {
            Log.e(TAG, "Failed to trigger database sync for $reason", e)
        }
    }


    inner class MyReceiver : BroadcastReceiver() {
        override fun onReceive(context: Context, intent: Intent) {
            when (intent.action) {
                OpenListService.ACTION_STATUS_CHANGED -> {
                    Log.d(TAG, "onReceive: ACTION_STATUS_CHANGED")

                    mEvent?.onServiceStatusChanged(OpenListService.isRunning, object : VoidResult {
                        override fun success() {}
                        override fun error(error: Throwable) {
                        }
                    })
                }



            }

        }
    }

}


================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/OpenListService.kt
================================================
package com.openlist.mobile

import openlistlib.Openlistlib
import android.annotation.SuppressLint
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.IBinder
import android.os.PowerManager
import android.util.Log
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.openlist.mobile.config.AppConfig
import com.openlist.mobile.model.openlist.OpenList
import com.openlist.mobile.utils.AndroidUtils.registerReceiverCompat
import com.openlist.mobile.utils.ClipboardUtils
import com.openlist.mobile.utils.ToastUtils.toast
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import splitties.systemservices.powerManager

/**
 * OpenList后台服务 - 提供OpenList核心功能并实现保活机制
 */
class OpenListService : Service(), OpenList.Listener {
    companion object {
        const val TAG = "OpenListService"
        const val ACTION_SHUTDOWN =
            "com.openlist.openlistandroid.service.OpenListService.ACTION_SHUTDOWN"

        const val ACTION_COPY_ADDRESS =
            "com.openlist.openlistandroid.service.OpenListService.ACTION_COPY_ADDRESS"

        const val ACTION_STATUS_CHANGED =
            "com.openlist.openlistandroid.service.OpenListService.ACTION_STATUS_CHANGED"

        const val NOTIFICATION_CHAN_ID = "openlist_server"
        const val FOREGROUND_ID = 5224

        @Volatile
        var isRunning: Boolean = false
            private set

        @Volatile
        var serviceInstance: OpenListService? = null
            private set
    }

    private val mScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
    private val mNotificationReceiver = NotificationActionReceiver()
    private val mReceiver = MyReceiver()
    private var mWakeLock: PowerManager.WakeLock? = null
    private var mLocalAddress: String = ""
    private var mDbSyncJob: Job? = null

    // Database sync interval in milliseconds (5 minutes)
    private val DB_SYNC_INTERVAL = 5 * 60 * 1000L

    override fun onBind(p0: Intent?): IBinder? = null

    @Suppress("DEPRECATION")
    private fun notifyStatusChanged() {
        Log.d(TAG, "notifyStatusChanged: isRunning=$isRunning")
        
        LocalBroadcastManager.getInstance(this)
            .sendBroadcast(Intent(ACTION_STATUS_CHANGED))

        // Notify ServiceBridge of status change
        try {
            MainActivity.serviceBridge?.notifyServiceStatusChanged(isRunning)
        } catch (e: Exception) {
            Log.e(TAG, "Failed to notify ServiceBridge", e)
        }

        if (!isRunning) {
            // Stop foreground service and remove notification
            stopForeground(true)
            cancelNotification()
            stopSelf()
        } else {
            // Update notification with current status
            Log.d(TAG, "Updating notification after status change")
            updateNotification()
        }
    }

    @SuppressLint("WakelockTimeout")
    override fun onCreate() {
        super.onCreate()
        Log.d(TAG, "OpenListService created")

        serviceInstance = this

        // Android 8.0+ must start foreground notification immediately
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            initOrUpdateNotification()
        }

        // Register broadcast receivers
        try {
            LocalBroadcastManager.getInstance(this)
                .registerReceiver(mReceiver, IntentFilter(ACTION_STATUS_CHANGED))
            registerReceiverCompat(mNotificationReceiver, ACTION_SHUTDOWN, ACTION_COPY_ADDRESS)
        } catch (e: Exception) {
            Log.e(TAG, "Failed to register receivers", e)
        }

        // Add OpenList listener
        OpenList.addListener(this)

        // Acquire wake lock if enabled
        if (AppConfig.isWakeLockEnabled) {
            try {
                mWakeLock = powerManager.newWakeLock(
                    PowerManager.PARTIAL_WAKE_LOCK,
                    "openlist::service"
                )
                mWakeLock?.acquire()
            } catch (e: Exception) {
                Log.e(TAG, "Failed to acquire wake lock", e)
            }
        }

        Log.d(TAG, "Service onCreate completed")
    }

    @Suppress("DEPRECATION")
    override fun onDestroy() {
        super.onDestroy()
        Log.d(TAG, "OpenListService destroyed")

        serviceInstance = null

        // 取消所有协程作业
        mScope.coroutineContext[Job]?.cancel()

        // 释放唤醒锁
        try {
            mWakeLock?.release()
            mWakeLock = null
            Log.d(TAG, "Wake lock released")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to release wake lock", e)
        }

        // 停止前台服务并取消通知
        stopForeground(true)
        cancelNotification()

        // 注销广播接收器
        try {
            LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver)
            unregisterReceiver(mNotificationReceiver)
            Log.d(TAG, "Broadcast receivers unregistered")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to unregister receivers", e)
        }

        // 移除OpenList监听器
        OpenList.removeListener(this)
        
        // Stop database sync task
        stopDatabaseSyncTask()
    }

    override fun onShutdown(type: String) {
        Log.d(TAG, "OpenList shutdown: $type")
        if (!OpenList.isRunning()) {
            isRunning = false
            // Stop database sync task when service shuts down
            stopDatabaseSyncTask()
            notifyStatusChanged()
        }
    }

    /**
     * Start periodic database synchronization task
     */
    private fun startDatabaseSyncTask() {
        stopDatabaseSyncTask() // Stop any existing task first
        
        mDbSyncJob = mScope.launch(Dispatchers.IO) {
            while (isActive && isRunning) {
                try {
                    delay(DB_SYNC_INTERVAL)
                    if (isRunning && OpenList.isRunning()) {
                        Log.d(TAG, "Performing periodic database sync")
                        OpenList.forceDatabaseSync()
                    }
                } catch (e: Exception) {
                    Log.e(TAG, "Error during periodic database sync", e)
                }
            }
        }
        Log.d(TAG, "Database sync task started")
    }

    /**
     * Stop database synchronization task
     */
    private fun stopDatabaseSyncTask() {
        mDbSyncJob?.cancel()
        mDbSyncJob = null
        Log.d(TAG, "Database sync task stopped")
    }

    /**
     * Force immediate database synchronization
     */
    fun forceImmediateDbSync() {
        mScope.launch(Dispatchers.IO) {
            try {
                if (isRunning && OpenList.isRunning()) {
                    Log.d(TAG, "Performing immediate database sync")
                    OpenList.forceDatabaseSync()
                }
            } catch (e: Exception) {
                Log.e(TAG, "Error during immediate database sync", e)
            }
        }
    }

    /**
     * Public method: Stop OpenList service manually
     */
    fun stopOpenListService() {
        if (isRunning) {
            Log.d(TAG, "User manually stopping service")
            // Set flag to indicate user manually stopped the service
            AppConfig.isManuallyStoppedByUser = true
            startOrShutdown()
        }
    }

    /**
     * Start or shutdown OpenList service
     */
    private fun startOrShutdown() {
        if (isRunning) {
            Log.d(TAG, "Shutting down OpenList")
            mScope.launch(Dispatchers.IO) {
                try {
                    if (OpenList.isRunning()) {
                        Log.d(TAG, "Forcing database sync before shutdown")
                        OpenList.forceDatabaseSync()
                    }
                    
                    OpenList.shutdown()
                    isRunning = false
                    launch(Dispatchers.Main) {
                        notifyStatusChanged()
                    }
                } catch (e: Exception) {
                    Log.e(TAG, "Shutdown error", e)
                    launch(Dispatchers.Main) {
                        toast("关闭失败: ${e.message}")
                    }
                }
            }
        } else {
            Log.d(TAG, "Starting OpenList from user action")
            AppConfig.isManuallyStoppedByUser = false
            toast(getString(R.string.starting))
            startOpenListBackend()
        }
    }

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        Log.d(TAG, "onStartCommand called")

        // Check manual stop flag
        if (AppConfig.isManuallyStoppedByUser) {
            Log.d(TAG, "Service was manually stopped by user, not starting")
            stopSelf()
            return START_NOT_STICKY
        }

        // Start OpenList if not running
        if (!isRunning) {
            Log.d(TAG, "Starting OpenList backend")
            startOpenListBackend()
        }

        return START_STICKY
    }

    /**
     * Start OpenList backend service
     */
    private fun startOpenListBackend() {
        if (isRunning) {
            Log.d(TAG, "OpenList already running")
            return
        }
        
        Log.d(TAG, "Initializing and starting OpenList")
        isRunning = true
        
        mScope.launch(Dispatchers.IO) {
            try {
                // Initialize OpenList
                OpenList.init()
                delay(100)
                
                // Start OpenList
                OpenList.startup()
                
                // Clear cached address to force refresh
                mLocalAddress = ""
                
                // Update UI on success
                launch(Dispatchers.Main) {
                    notifyStatusChanged()
                    startDatabaseSyncTask()
                }
                
                Log.d(TAG, "OpenList started successfully")
            } catch (e: Exception) {
                Log.e(TAG, "Failed to start OpenList", e)
                isRunning = false
                launch(Dispatchers.Main) {
                    toast("启动失败: ${e.message}")
                    notifyStatusChanged()
                }
            }
        }
    }

    inner class MyReceiver : BroadcastReceiver() {
        override fun onReceive(context: Context?, intent: Intent) {
            when (intent.action) {
                ACTION_STATUS_CHANGED -> {
                    Log.d(TAG, "Status changed broadcast received")
                }
            }
        }
    }

    /**
     * Get local address safely
     */
    private fun localAddress(): String {
        return try {
            if (mLocalAddress.isEmpty()) {
                Log.d(TAG, "Fetching local address...")
                mLocalAddress = Openlistlib.getOutboundIPString()
                Log.d(TAG, "Local address: $mLocalAddress")
            }
            mLocalAddress
        } catch (e: Exception) {
            Log.e(TAG, "Failed to get local address", e)
            "Initializing..."
        }
    }

    /**
     * Initialize or update notification
     */
    @Suppress("DEPRECATION")
    private fun initOrUpdateNotification() {
        try {
            Log.d(TAG, "Creating/updating notification with address: ${localAddress()}")
            
            val pendingIntentFlags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
                PendingIntent.FLAG_IMMUTABLE
            } else {
                0
            }

            val pendingIntent = PendingIntent.getActivity(
                this, 0, Intent(this, MainActivity::class.java), pendingIntentFlags
            )

            val shutdownAction = PendingIntent.getBroadcast(
                this, 0, Intent(ACTION_SHUTDOWN), pendingIntentFlags
            )

            val copyAddressPendingIntent = PendingIntent.getBroadcast(
                this, 0, Intent(ACTION_COPY_ADDRESS), pendingIntentFlags
            )

            val builder = Notification.Builder(applicationContext)

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                val chan = NotificationChannel(
                    NOTIFICATION_CHAN_ID,
                    getString(R.string.openlist_server),
                    NotificationManager.IMPORTANCE_LOW
                )
                chan.lockscreenVisibility = Notification.VISIBILITY_PRIVATE
                chan.setShowBadge(false)
                
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                    chan.setBlockable(false)
                }
                
                val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
                notificationManager.createNotificationChannel(chan)
                
                builder.setChannelId(NOTIFICATION_CHAN_ID)
            }

            val smallIconRes = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                R.drawable.server
            } else {
                R.mipmap.ic_launcher_round
            }

            val notification = builder
                .setContentTitle(getString(R.string.openlist_server_running))
                .setContentText("地址: ${localAddress()}")
                .setSmallIcon(smallIconRes)
                .setContentIntent(pendingIntent)
                .addAction(0, getString(R.string.shutdown), shutdownAction)
                .addAction(0, getString(R.string.copy_address), copyAddressPendingIntent)
                .setOngoing(true)
                .setAutoCancel(false)
                .build()

            notification.flags = notification.flags or 
                Notification.FLAG_NO_CLEAR or
                Notification.FLAG_ONGOING_EVENT

            startForeground(FOREGROUND_ID, notification)
        } catch (e: Exception) {
            Log.e(TAG, "Failed to create notification", e)
            // Minimal fallback
            try {
                val minimal = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                    Notification.Builder(applicationContext, NOTIFICATION_CHAN_ID)
                } else {
                    Notification.Builder(applicationContext)
                }.setContentTitle("OpenList")
                    .setContentText("Starting...")
                    .setSmallIcon(R.mipmap.ic_launcher_round)
                    .build()
                startForeground(FOREGROUND_ID, minimal)
            } catch (fallbackError: Exception) {
                Log.e(TAG, "Failed to create minimal notification", fallbackError)
            }
        }
    }

    /**
     * 更新通知
     */
    private fun updateNotification() {
        initOrUpdateNotification()
    }

    /**
     * 取消通知
     */
    private fun cancelNotification() {
        try {
            val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
            notificationManager.cancel(FOREGROUND_ID)
            Log.d(TAG, "Notification cancelled")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to cancel notification", e)
        }
    }

    inner class NotificationActionReceiver : BroadcastReceiver() {
        override fun onReceive(ctx: Context?, intent: Intent?) {
            when (intent?.action) {
                ACTION_SHUTDOWN -> {
                    Log.d(TAG, "Shutdown action received from notification")
                    startOrShutdown()
                }

                ACTION_COPY_ADDRESS -> {
                    Log.d(TAG, "Copy address action received from notification")
                    ClipboardUtils.copyText("OpenList", localAddress())
                    toast(R.string.address_copied)
                }
            }
        }
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/OpenListTileService.kt
================================================
package com.openlist.mobile

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.graphics.drawable.Icon
import android.os.Build
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.openlist.mobile.config.AppConfig


@RequiresApi(Build.VERSION_CODES.N)
class OpenListTileService : TileService() {
    companion object {
        private const val TAG = "OpenListTileService"
        private const val CLICK_DEBOUNCE_TIME = 2000L // 2秒防重复点击
    }

    private var lastClickTime = 0L

    private val statusReceiver = object : BroadcastReceiver() {
        override fun onReceive(context: Context, intent: Intent) {
            when (intent.action) {
                OpenListService.ACTION_STATUS_CHANGED -> {
                    Log.d(TAG, "Service status changed, updating tile")
                    // 添加小延迟确保状态稳定
                    qsTile?.let {
                        android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
                            updateTileState()
                        }, 100)
                    }
                }
            }
        }
    }

    override fun onStartListening() {
        super.onStartListening()
        Log.d(TAG, "Tile started listening")
        LocalBroadcastManager.getInstance(this)
            .registerReceiver(statusReceiver, IntentFilter(OpenListService.ACTION_STATUS_CHANGED))

        updateTileState()
    }

    override fun onStopListening() {
        super.onStopListening()
        Log.d(TAG, "Tile stopped listening")
        try {
            LocalBroadcastManager.getInstance(this).unregisterReceiver(statusReceiver)
        } catch (e: Exception) {
            Log.w(TAG, "Failed to unregister receiver", e)
        }
    }

    override fun onClick() {
        super.onClick()
        
        // 防重复点击
        val currentTime = System.currentTimeMillis()
        if (currentTime - lastClickTime < CLICK_DEBOUNCE_TIME) {
            Log.d(TAG, "Click ignored due to debounce")
            return
        }
        lastClickTime = currentTime
        
        val isRunning = OpenListService.isRunning
        Log.d(TAG, "Tile clicked, service running: $isRunning")
        
        // 设置瓦片为过渡状态,显示操作进行中
        setTileTransitionState(!isRunning)
        
        if (isRunning) {
            stopOpenListService()
        } else {
            startOpenListService()
        }
        // 移除立即状态更新,依赖广播接收器异步更新
        // updateTileState() - 现在由广播接收器处理
    }

    private fun startOpenListService() {
        try {
            AppConfig.isManuallyStoppedByUser = false
            val intent = Intent(this, OpenListService::class.java)
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                startForegroundService(intent)
            } else {
                startService(intent)
            }

            Log.d(TAG, "Service start command sent from tile")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to start service from tile", e)
        }
    }

    private fun stopOpenListService() {
        try {
            AppConfig.isManuallyStoppedByUser = true
            val serviceInstance = OpenListService.serviceInstance
            if (serviceInstance != null && OpenListService.isRunning) {
                serviceInstance.stopOpenListService()
            }
            // 移除else分支的冗余stopService调用
            Log.d(TAG, "Service stop command sent from tile")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to stop service from tile", e)
            // 出错时恢复瓦片状态
            updateTileState()
        }
    }

    /**
     * 设置瓦片过渡状态,显示操作正在进行中
     */
    private fun setTileTransitionState(targetActiveState: Boolean) {
        val tile = qsTile ?: return
        
        // 设置过渡状态
        tile.state = if (targetActiveState) Tile.STATE_UNAVAILABLE else Tile.STATE_UNAVAILABLE
        tile.label = if (targetActiveState) "启动中..." else "停止中..."
        tile.contentDescription = if (targetActiveState) "OpenList Starting" else "OpenList Stopping"
        
        try {
            val icon = Icon.createWithResource(this, R.mipmap.ic_launcher)
            tile.icon = icon
        } catch (e: Exception) {
            Log.w(TAG, "Failed to set tile icon during transition", e)
        }
        
        tile.updateTile()
        Log.d(TAG, "Tile set to transition state: ${if (targetActiveState) "starting" else "stopping"}")
    }

    private fun updateTileState() {
        val tile = qsTile ?: return
        val isRunning = OpenListService.isRunning
        Log.d(TAG, "Updating tile state, service running: $isRunning")

        if (isRunning) {
            tile.state = Tile.STATE_ACTIVE
            tile.label = "OpenList"
            tile.contentDescription = "OpenList Running"
        } else {
            tile.state = Tile.STATE_INACTIVE
            tile.label = "OpenList"
            tile.contentDescription = "OpenList Stopped"
        }
        try {
            val icon = Icon.createWithResource(this, R.mipmap.ic_launcher)
            tile.icon = icon
        } catch (e: Exception) {
            Log.w(TAG, "Failed to set tile icon", e)
        }

        tile.updateTile()
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/SwitchServerActivity.kt
================================================
package com.openlist.mobile

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import com.openlist.mobile.config.AppConfig
import com.openlist.mobile.utils.ToastUtils.toast

class SwitchServerActivity : Activity() {
    companion object {
        private const val TAG = "SwitchServerActivity"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        if (OpenListService.isRunning) {
            Log.d(TAG, "Service is running, stopping it")
            // 设置手动停止标志
            AppConfig.isManuallyStoppedByUser = true
            startService(Intent(this, OpenListService::class.java).apply {
                action = OpenListService.ACTION_SHUTDOWN
            })
        } else {
            // 检查是否被手动停止
            if (AppConfig.isManuallyStoppedByUser) {
                Log.d(TAG, "Service was manually stopped, clearing flag and starting")
                // 清除手动停止标志
                AppConfig.isManuallyStoppedByUser = false
            }
            Log.d(TAG, "Starting service")
            startService(Intent(this, OpenListService::class.java))
        }

        finish()
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/bridge/AndroidBridge.kt
================================================
package com.openlist.mobile.bridge

import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import com.openlist.mobile.OpenListService
import com.openlist.mobile.BuildConfig
import com.openlist.mobile.R
import com.openlist.mobile.SwitchServerActivity
import com.openlist.mobile.config.AppConfig
import com.openlist.mobile.model.openlist.OpenList
import com.openlist.mobile.utils.MyTools
import com.openlist.mobile.utils.ToastUtils.longToast
import com.openlist.mobile.utils.ToastUtils.toast
import com.openlist.pigeon.GeneratedApi

class AndroidBridge(private val context: Context) : GeneratedApi.Android {
    companion object {
        private const val TAG = "AndroidBridge"
    }

    override fun addShortcut() {
        MyTools.addShortcut(
            context,
            context.getString(R.string.app_switch),
            "openlist_mobile_switch",
            R.drawable.openlist_switch,
            Intent(context, SwitchServerActivity::class.java)
        )
    }

    override fun startService() {
        // 清除手动停止标志,表示用户手动启动了服务
        AppConfig.isManuallyStoppedByUser = false
        Log.d(TAG, "Starting service via AndroidBridge, manual stop flag cleared")
        context.startService(Intent(context, OpenListService::class.java))
    }

    override fun setAdminPwd(pwd: String) {
        OpenList.setAdminPassword(pwd)
    }

    override fun getOpenListHttpPort(): Long {
        return OpenList.getHttpPort().toLong()
    }

    override fun isRunning() = OpenListService.isRunning


    override fun getOpenListVersion() = BuildConfig.OPENLIST_VERSION
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/bridge/AppConfigBridge.kt
================================================
package com.openlist.mobile.bridge

import com.openlist.mobile.config.AppConfig
import com.openlist.pigeon.GeneratedApi


object AppConfigBridge : GeneratedApi.AppConfig {
    override fun isWakeLockEnabled() = AppConfig.isWakeLockEnabled

    override fun isStartAtBootEnabled() = AppConfig.isStartAtBootEnabled

    override fun isAutoCheckUpdateEnabled() = AppConfig.isAutoCheckUpdateEnabled
    override fun isAutoOpenWebPageEnabled() = AppConfig.isAutoOpenWebPageEnabled
    override fun getDataDir() = AppConfig.dataDir

    override fun setDataDir(dir: String) {
        AppConfig.dataDir = dir
    }

    override fun isSilentJumpAppEnabled(): Boolean = AppConfig.isSilentJumpAppEnabled

    override fun setSilentJumpAppEnabled(enabled: Boolean) {
        AppConfig.isSilentJumpAppEnabled = enabled
    }

    override fun setAutoOpenWebPageEnabled(enabled: Boolean) {
        AppConfig.isAutoOpenWebPageEnabled = enabled
    }

    override fun setAutoCheckUpdateEnabled(enabled: Boolean) {
        AppConfig.isAutoCheckUpdateEnabled = enabled
    }

    override fun setStartAtBootEnabled(enabled: Boolean) {
        AppConfig.isStartAtBootEnabled = enabled
    }

    override fun setWakeLockEnabled(enabled: Boolean) {
        AppConfig.isWakeLockEnabled = enabled
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/bridge/CommonBridge.kt
================================================
package com.openlist.mobile.bridge

import android.content.Context
import android.content.Intent
import android.os.Build
import com.openlist.mobile.BuildConfig
import com.openlist.mobile.utils.ToastUtils.longToast
import com.openlist.mobile.utils.ToastUtils.toast
import com.openlist.pigeon.GeneratedApi

class CommonBridge(private val context: Context) : GeneratedApi.NativeCommon {
    override fun startActivityFromUri(intentUri: String): Boolean {
        val intent = Intent.parseUri(intentUri, Intent.URI_INTENT_SCHEME)
        return if (intent.resolveActivity(context.packageManager) != null){
            context.startActivity(intent)
            true
        }else{
            false
        }
    }

    override fun getDeviceSdkInt(): Long {
        return Build.VERSION.SDK_INT.toLong()
    }


    override fun getDeviceCPUABI(): String {
        return Build.SUPPORTED_ABIS[0]
    }

    override fun getVersionName() = BuildConfig.VERSION_NAME
    override fun getVersionCode() = BuildConfig.VERSION_CODE.toLong()


    override fun toast(msg: String) {
        context.toast(msg)
    }

    override fun longToast(msg: String) {
        context.longToast(msg)
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/bridge/ServiceBridge.kt
================================================
package com.openlist.mobile.bridge

import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import com.openlist.mobile.OpenListService
import com.openlist.mobile.config.AppConfig
import com.openlist.mobile.utils.BatteryOptimizationUtils
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import openlistlib.Openlistlib

/**
 * 服务桥接类 - 连接Flutter和Android服务
 */
class ServiceBridge(private val context: Context, private val channel: MethodChannel) : MethodCallHandler {
    companion object {
        private const val TAG = "ServiceBridge"
        private const val CHANNEL_NAME = "com.openlist.mobile/service"
    }

    init {
        channel.setMethodCallHandler(this)
        Log.d(TAG, "ServiceBridge initialized")
    }

    override fun onMethodCall(call: MethodCall, result: Result) {
        try {
            when (call.method) {
                "startService" -> {
                    val success = startOpenListService()
                    result.success(success)
                }
                
                "stopService" -> {
                    val success = stopOpenListService()
                    result.success(success)
                }
                
                "isServiceRunning" -> {
                    val isRunning = isOpenListServiceRunning()
                    result.success(isRunning)
                }
                
                "isBatteryOptimizationIgnored" -> {
                    val isIgnored = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                        BatteryOptimizationUtils.isIgnoringBatteryOptimizations(context)
                    } else {
                        true
                    }
                    result.success(isIgnored)
                }
                
                "requestIgnoreBatteryOptimization" -> {
                    val success = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                        BatteryOptimizationUtils.requestIgnoreBatteryOptimizations(context)
                    } else {
                        true
                    }
                    result.success(success)
                }
                
                "openBatteryOptimizationSettings" -> {
                    val success = BatteryOptimizationUtils.openBatteryOptimizationSettings(context)
                    result.success(success)
                }
                
                "openAutoStartSettings" -> {
                    val success = BatteryOptimizationUtils.openAutoStartSettings(context)
                    result.success(success)
                }
                
                "getServiceAddress" -> {
                    val address = getServiceAddress()
                    result.success(address)
                }
                
                else -> {
                    Log.w(TAG, "Unknown method: ${call.method}")
                    result.notImplemented()
                }
            }
        } catch (e: Exception) {
            Log.e(TAG, "Error handling method call: ${call.method}", e)
            result.error("ERROR", e.message, e.toString())
        }
    }

    /**
     * 启动OpenList服务
     */
    private fun startOpenListService(): Boolean {
        return try {
            // 清除手动停止标志,表示用户手动启动了服务
            AppConfig.isManuallyStoppedByUser = false
            
            val intent = Intent(context, OpenListService::class.java)
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                context.startForegroundService(intent)
            } else {
                context.startService(intent)
            }
            
            Log.d(TAG, "OpenList service start command sent, manual stop flag cleared")
            true
        } catch (e: Exception) {
            Log.e(TAG, "Failed to start OpenList service", e)
            false
        }
    }

    /**
     * 停止OpenList服务
     */
    private fun stopOpenListService(): Boolean {
        return try {
            // 设置手动停止标志,阻止保活机制重启服务
            AppConfig.isManuallyStoppedByUser = true
            
            // 首先尝试通过服务实例直接停止OpenList
            val serviceInstance = OpenListService.serviceInstance
            if (serviceInstance != null && OpenListService.isRunning) {
                Log.d(TAG, "Calling service stopOpenListService method directly")
                // 直接调用服务的停止方法
                serviceInstance.stopOpenListService()
            } else {
                Log.w(TAG, "Service instance not available or not running, using stopService")
                // 如果服务实例不可用,直接停止服务
                val intent = Intent(context, OpenListService::class.java)
                context.stopService(intent)
            }
            
            Log.d(TAG, "OpenList service stop command sent, manual stop flag set")
            true
        } catch (e: Exception) {
            Log.e(TAG, "Failed to stop OpenList service", e)
            false
        }
    }

    /**
     * 检查OpenList服务是否运行
     */
    private fun isOpenListServiceRunning(): Boolean {
        return try {
            OpenListService.isRunning
        } catch (e: Exception) {
            Log.e(TAG, "Failed to check service status", e)
            false
        }
    }

    /**
     * 获取服务地址
     */
    private fun getServiceAddress(): String {
        return try {
            if (OpenListService.isRunning) {
                Openlistlib.getOutboundIPString()
            } else {
                ""
            }
        } catch (e: Exception) {
            Log.e(TAG, "Failed to get service address", e)
            ""
        }
    }

    /**
     * 通知Flutter服务状态变化
     */
    fun notifyServiceStatusChanged(isRunning: Boolean) {
        try {
            val arguments = mapOf("isRunning" to isRunning)
            channel.invokeMethod("onServiceStatusChanged", arguments)
            Log.d(TAG, "Service status change notified: $isRunning")
        } catch (e: Exception) {
            Log.e(TAG, "Failed to notify service status change", e)
        }
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/config/AppConfig.kt
================================================
package com.openlist.mobile.config

import com.cioccarellia.ksprefs.KsPrefs
import com.cioccarellia.ksprefs.dynamic
import com.openlist.mobile.app

object AppConfig {
    val prefs by lazy { KsPrefs(app, "app") }

    var isSilentJumpAppEnabled by prefs.dynamic("isSilentJumpAppEnabled", fallback = false)

    var isWakeLockEnabled: Boolean by prefs.dynamic("isWakeLockEnabled", fallback = false)
    var isStartAtBootEnabled: Boolean by prefs.dynamic("isStartAtBootEnabled", fallback = false)
    var isAutoCheckUpdateEnabled: Boolean by prefs.dynamic(
        "isAutoCheckUpdateEnabled",
        fallback = false
    )

    var isAutoOpenWebPageEnabled: Boolean by prefs.dynamic(
        "isAutoOpenWebPageEnabled",
        fallback = false
    )

    // 用户手动停止服务的标志,当为true时,保活机制不会重启服务
    var isManuallyStoppedByUser: Boolean by prefs.dynamic("isManuallyStoppedByUser", fallback = false)

    val defaultDataDir by lazy { app.getExternalFilesDir("data")?.absolutePath!! }

    private var mDataDir: String by prefs.dynamic("dataDir", fallback = defaultDataDir)


    var dataDir: String
        get() {
            if (mDataDir.isBlank()) mDataDir = defaultDataDir
            return mDataDir
        }
        set(value) {
            if (value.isBlank()) {
                mDataDir = defaultDataDir
                return
            }

            mDataDir = value
        }

}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/constant/AppConst.kt
================================================
package com.openlist.mobile.constant

import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.openlist.mobile.app
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json

object AppConst {
    @OptIn(ExperimentalSerializationApi::class)
    val json = Json {
        ignoreUnknownKeys = true
        allowStructuredMapKeys = true
        prettyPrint = true
        isLenient = true
        explicitNulls = false
    }

    val localBroadcast by lazy {
        LocalBroadcastManager.getInstance(app)
    }

//    val fileProviderAuthor = BuildConfig.APPLICATION_ID + ".fileprovider"
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/constant/LogLevel.kt
================================================
package com.openlist.mobile.constant

import androidx.annotation.IntDef

@IntDef(
    LogLevel.PANIC,
    LogLevel.FATAL,
    LogLevel.ERROR,
    LogLevel.WARN,
    LogLevel.INFO,
    LogLevel.DEBUG,
    LogLevel.TRACE
)
annotation class LogLevel {
    companion object {
        const val PANIC = 0
        const val FATAL = 1
        const val ERROR = 2
        const val WARN = 3
        const val INFO = 4
        const val DEBUG = 5
        const val TRACE = 6

        fun Int.toLevelString(): String {
            return when (this) {
                PANIC -> "PANIC"
                FATAL -> "FATAL"
                ERROR -> "ERROR"
                WARN -> "WARN"
                INFO -> "INFO"
                DEBUG -> "DEBUG"
                TRACE -> "TRACE"
                else -> "UNKNOWN"
            }
        }
    }

}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/data/AppDatabase.kt
================================================
/*
package com.openlist.mobile.data

import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.openlist.openlistandroid.data.dao.ServerLogDao
import com.openlist.mobile.data.entities.ServerLog
import com.openlist.mobile.App.Companion.app

val appDb by lazy { AppDatabase.create() }

@Database(
    version = 2,
    entities = [ServerLog::class],
    autoMigrations = [
        AutoMigration(from = 1, to = 2)
    ]
)
abstract class AppDatabase : RoomDatabase() {
    abstract val serverLogDao: ServerLogDao

    companion object {
        fun create() = Room.databaseBuilder(
            app,
            AppDatabase::class.java,
            "openlistandroid.db"
        )
            .allowMainThreadQueries()
            .build()
    }
}*/


================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/data/entities/ServerLog.kt
================================================
package com.openlist.mobile.data.entities

import com.openlist.mobile.constant.LogLevel

data class ServerLog(

    @LogLevel val level: Int,
    val message: String,
    val time: String,
) {
    companion object {

        @Suppress("RegExpRedundantEscape")
        fun String.evalLog(): ServerLog? {
            val logPattern = """(\w+)\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\] (.+)""".toRegex()
            val result = logPattern.find(this)
            if (result != null) {
                val (level, time, msg) = result.destructured
                val l = when (level[0].toString()) {
                    "D" -> LogLevel.DEBUG
                    "I" -> LogLevel.INFO
                    "W" -> LogLevel.WARN
                    "E" -> LogLevel.ERROR
                    else -> LogLevel.INFO
                }
                return ServerLog(level = l, message = msg, time = time)
            }
            return null
        }
    }
}


================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/model/ShortCuts.kt
================================================
package com.openlist.mobile.model

import android.content.Context
import android.content.Intent
import androidx.core.content.pm.ShortcutInfoCompat
import androidx.core.content.pm.ShortcutManagerCompat
import androidx.core.graphics.drawable.IconCompat
import com.openlist.mobile.R
import com.openlist.mobile.SwitchServerActivity


object ShortCuts {
    private inline fun <reified T> buildIntent(context: Context): Intent {
        val intent = Intent(context, T::class.java)
        intent.action = Intent.ACTION_VIEW
        return intent
    }


    private fun buildOpenListSwitchShortCutInfo(context: Context): ShortcutInfoCompat {
        val msSwitchIntent = buildIntent<SwitchServerActivity>(context)
        return ShortcutInfoCompat.Builder(context, "openlist_switch")
            .setShortLabel(context.getString(R.string.app_switch))
            .setLongLabel(context.getString(R.string.app_switch))
            .setIcon(IconCompat.createWithResource(context, R.drawable.openlist_switch))
            .setIntent(msSwitchIntent)
            .build()
    }


    fun buildShortCuts(context: Context) {
        ShortcutManagerCompat.setDynamicShortcuts(
            context, listOf(
                buildOpenListSwitchShortCutInfo(context),
            )
        )
    }


}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/model/UpdateResult.kt
================================================
package com.openlist.openlistandroid.model

data class UpdateResult(
    val version: String = "",
    val time: String = "",
    val content: String = "",
    val downloadUrl: String = "",
    val size: Long = 0,
) {
    fun hasUpdate() = version.isNotBlank() && downloadUrl.isNotBlank()
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/model/openlist/Logger.kt
================================================
package com.openlist.mobile.model.openlist

object Logger {
    private var listeners = mutableListOf<Listener>()

    fun addListener(listener: Listener) {
        listeners.add(listener)
    }

    fun removeListener(listener: Listener) {
        listeners.remove(listener)
    }

    interface Listener {
        fun onLog(level: Int, time: String, msg: String)
    }

    fun log(level: Int, time: String, msg: String) {
        listeners.forEach {
            it.onLog(level, time, msg)
        }
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/model/openlist/OpenList.kt
================================================
package com.openlist.mobile.model.openlist

import openlistlib.Openlistlib
import openlistlib.Event
import openlistlib.LogCallback
import android.annotation.SuppressLint
import android.util.Log
import com.openlist.mobile.R
import com.openlist.mobile.app
import com.openlist.mobile.config.AppConfig
import com.openlist.mobile.constant.LogLevel
import com.openlist.mobile.utils.ToastUtils.longToast
import java.io.File
import java.text.SimpleDateFormat
import java.util.Locale

object OpenList : Event, LogCallback {
    const val TAG = "OpenList"

    val context = app

    val dataDir: String
        get() = AppConfig.dataDir

    val configPath: String
        get() = "$dataDir${File.separator}config.json"


    fun init() {
        runCatching {
            Openlistlib.setConfigData(dataDir)
            Openlistlib.setConfigLogStd(true)
            Openlistlib.init(this, this)
        }.onFailure {
            Log.e(TAG, "init:", it)
        }
    }

    interface Listener {
        fun onShutdown(type: String)
    }

    private val mListeners = mutableListOf<Listener>()

    fun addListener(listener: Listener) {
        mListeners.add(listener)
    }

    fun removeListener(listener: Listener) {
        mListeners.remove(listener)
    }

    override fun onShutdown(p0: String) {
        Log.d(TAG, "onShutdown: $p0")
        mListeners.forEach { it.onShutdown(p0) }
    }

    override fun onStartError(type: String, msg: String) {
        Log.e(TAG, "onStartError: $type, $msg")
        Logger.log(LogLevel.FATAL, type, msg)
    }

    private val mDateFormatter by lazy  { SimpleDateFormat("MM-dd HH:mm:ss", Locale.getDefault())}

    override fun onLog(level: Short, time: Long, log: String) {
        Log.d(TAG, "onLog: $level, $time, $log")
        Logger.log(level.toInt(), mDateFormatter.format(time), log)
    }

    override fun onProcessExit(code: Long) {

    }

    fun isRunning(): Boolean {
        return Openlistlib.isRunning("")
    }

    fun setAdminPassword(pwd: String) {
        if (!isRunning()) init()

        Log.d(TAG, "setAdminPassword: $dataDir")
        Openlistlib.setConfigData(dataDir)
        Openlistlib.setAdminPassword(pwd)
    }


    fun shutdown() {
        Log.d(TAG, "shutdown")
        runCatching {
            Openlistlib.shutdown(5000)
        }.onFailure {
            context.longToast(R.string.shutdown_failed)
        }
    }

    /**
     * Force database synchronization (WAL checkpoint)
     * This ensures SQLite WAL files are merged into the main database file
     */
    fun forceDatabaseSync() {
        Log.d(TAG, "forceDatabaseSync")
        runCatching {
            Openlistlib.forceDBSync()
            Log.d(TAG, "Database sync completed successfully")
        }.onFailure { e ->
            Log.e(TAG, "Failed to sync database", e)
        }
    }

    @SuppressLint("SdCardPath")
    @Synchronized
    fun startup() {
        Log.d(TAG, "startup: $dataDir")
        try {
            // 确保数据目录存在
            val dataDirFile = File(dataDir)
            if (!dataDirFile.exists()) {
                dataDirFile.mkdirs()
                Log.d(TAG, "Created data directory: $dataDir")
            }
            
            // 重新初始化以确保配置正确
            init()
            
            // 多重检查是否已经在运行,防止重复启动
            if (isRunning()) {
                Log.w(TAG, "OpenList is already running, skipping startup")
                return
            }
            
            // 再次检查以确保安全
            Thread.sleep(100) // 短暂等待以避免竞态条件
            if (isRunning()) {
                Log.w(TAG, "OpenList started by another thread, skipping startup")
                return
            }
            
            Log.d(TAG, "Starting OpenList...")
            Openlistlib.start()
            
            // 验证启动是否成功
            Thread.sleep(1000) // 等待1秒让服务完全启动
            if (isRunning()) {
                Log.d(TAG, "OpenList started successfully and confirmed running")
            } else {
                Log.w(TAG, "OpenList startup command sent but status check failed")
            }
        } catch (e: Exception) {
            Log.e(TAG, "Failed to start OpenList", e)
            throw e
        } catch (t: Throwable) {
            Log.e(TAG, "Fatal error starting OpenList", t)
            throw RuntimeException("Fatal error starting OpenList", t)
        }
    }

    fun getHttpPort(): Int {
        return OpenListConfigManager.config().scheme.httpPort
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/model/openlist/OpenListConfig.kt
================================================
package com.openlist.mobile.model.openlist

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


@Serializable
data class OpenListConfig(
    @SerialName("bleve_dir")
    val bleveDir: String = "", // /storage/emulated/0/Android/data/com.openlist.openlistandroid.debug/files/data/bleve
    @SerialName("cdn")
    val cdn: String = "",
//    @SerialName("database")
//    val database: Database = Database(),
    @SerialName("delayed_start")
    val delayedStart: Int = 0, // 0
    @SerialName("force")
    val force: Boolean = false, // false
    @SerialName("jwt_secret")
    val jwtSecret: String = "", //
//    @SerialName("log")
//    val log: Log = Log(),
    @SerialName("max_connections")
    val maxConnections: Int = 0, // 0
    @SerialName("scheme")
    val scheme: Scheme = Scheme(),
    @SerialName("site_url")
    val siteUrl: String = "",
    @SerialName("temp_dir")
    val tempDir: String = "", // /storage/emulated/0/Android/data/com.openlist.openlistandroid.debug/files/data/temp
    @SerialName("tls_insecure_skip_verify")
    val tlsInsecureSkipVerify: Boolean = true, // true
    @SerialName("token_expires_in")
    val tokenExpiresIn: Int = 48 // 48
) {
    @Serializable
    data class Database(
        @SerialName("db_file")
        val dbFile: String = "", // /storage/emulated/0/Android/data/com.openlist.openlistandroid.debug/files/data/data.db
        @SerialName("host")
        val host: String = "",
        @SerialName("name")
        val name: String = "",
        @SerialName("password")
        val password: String = "",
        @SerialName("port")
        val port: Int = 0, // 0
        @SerialName("ssl_mode")
        val sslMode: String = "",
        @SerialName("table_prefix")
        val tablePrefix: String = "x_", // x_
        @SerialName("type")
        val type: String = "sqlite3", // sqlite3
        @SerialName("user")
        val user: String = ""
    )

    @Serializable
    data class Log(
        @SerialName("compress")
        val compress: Boolean = false, // false
        @SerialName("enable")
        val enable: Boolean = true, // true
        @SerialName("max_age")
        val maxAge: Int = 28, // 28
        @SerialName("max_backups")
        val maxBackups: Int = 5, // 5
        @SerialName("max_size")
        val maxSize: Int = 10, // 10
        @SerialName("name")
        val name: String = "" // /storage/emulated/0/Android/data/com.openlist.openlistandroid.debug/files/data/log/log.log
    )

    @Serializable
    data class Scheme(
        @SerialName("address")
        val address: String = "0.0.0.0", // 0.0.0.0
        @SerialName("cert_file")
        val certFile: String = "",
        @SerialName("force_https")
        val forceHttps: Boolean = false, // false
        @SerialName("http_port")
        val httpPort: Int = 5244, // 5244
        @SerialName("https_port")
        val httpsPort: Int = -1, // -1
        @SerialName("key_file")
        val keyFile: String = "",
        @SerialName("unix_file")
        val unixFile: String = "",
        @SerialName("unix_file_perm")
        val unixFilePerm: String = ""
    )
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/model/openlist/OpenListConfigManager.kt
================================================
package com.openlist.mobile.model.openlist

import android.os.FileObserver
import android.util.Log
import com.openlist.mobile.app
import com.openlist.mobile.constant.AppConst
import com.openlist.mobile.utils.ToastUtils.longToast
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.channelFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.decodeFromStream
import kotlinx.serialization.json.encodeToStream
import java.io.File

@Suppress("DEPRECATION")
object OpenListConfigManager {
    const val TAG = "OpenListConfigManager"

    val context
        get() = app

    suspend fun flowConfig(): Flow<OpenListConfig> = channelFlow {
        val obs = object : FileObserver(OpenList.configPath) {
            override fun onEvent(event: Int, p1: String?) {
                if (listOf(CLOSE_NOWRITE, CLOSE_WRITE).contains(event))
                    runBlocking {
                        Log.d(TAG, "config.json changed: $event")
                        send((config()))
                    }
            }
        }
        coroutineScope {
            val waitJob = launch {
                obs.startWatching()
                try {
                    awaitCancellation()
                } catch (_: CancellationException) {
                }

                obs.stopWatching()
            }
            waitJob.join()
        }
    }

    @OptIn(ExperimentalSerializationApi::class)
    fun config(): OpenListConfig {
        try {
            File(OpenList.configPath).inputStream().use {
                return AppConst.json.decodeFromStream<OpenListConfig>(it)
            }
        } catch (e: Exception) {
            OpenList.context.longToast("读取 config.json 失败:\n$e")
            return OpenListConfig()
        }
    }

    @OptIn(ExperimentalSerializationApi::class)
    fun update(cfg: OpenListConfig) {
        try {
            File(OpenList.configPath).outputStream().use {
                AppConst.json.encodeToStream(cfg, it)
            }
        } catch (e: Exception) {
            OpenList.context.longToast("更新 config.json 失败:\n$e")
        }
    }

}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/utils/AndroidUtils.kt
================================================
package com.openlist.mobile.utils

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Context.RECEIVER_EXPORTED
import android.content.IntentFilter
import android.os.Build

object AndroidUtils {
    fun Context.registerReceiverCompat(
        receiver: BroadcastReceiver,
        vararg actions: String
    ) {
        val intentFilter = IntentFilter()
        actions.forEach { intentFilter.addAction(it) }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            registerReceiver(receiver, intentFilter, RECEIVER_EXPORTED)
        } else {
            registerReceiver(receiver, intentFilter)
        }
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/utils/BatteryOptimizationUtils.kt
================================================
package com.openlist.mobile.utils

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.PowerManager
import android.provider.Settings
import android.util.Log
import androidx.annotation.RequiresApi

/**
 * 电池优化管理工具类
 * 帮助应用获得电池优化白名单,提高后台服务存活率
 */
object BatteryOptimizationUtils {
    private const val TAG = "BatteryOptimization"

    /**
     * 检查是否在电池优化白名单中
     */
    @RequiresApi(Build.VERSION_CODES.M)
    fun isIgnoringBatteryOptimizations(context: Context): Boolean {
        return try {
            val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
            powerManager.isIgnoringBatteryOptimizations(context.packageName)
        } catch (e: Exception) {
            Log.e(TAG, "Failed to check battery optimization status", e)
            false
        }
    }

    /**
     * 请求忽略电池优化
     */
    @SuppressLint("BatteryLife")
    @RequiresApi(Build.VERSION_CODES.M)
    fun requestIgnoreBatteryOptimizations(context: Context): Boolean {
        return try {
            if (isIgnoringBatteryOptimizations(context)) {
                Log.d(TAG, "Already ignoring battery optimizations")
                return true
            }

            val intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).apply {
                data = Uri.parse("package:${context.packageName}")
            }
            
            if (intent.resolveActivity(context.packageManager) != null) {
                context.startActivity(intent)
                Log.d(TAG, "Battery optimization request sent")
                true
            } else {
                Log.w(TAG, "No activity found to handle battery optimization request")
                false
            }
        } catch (e: Exception) {
            Log.e(TAG, "Failed to request battery optimization exemption", e)
            false
        }
    }

    /**
     * 打开电池优化设置页面
     */
    fun openBatteryOptimizationSettings(context: Context): Boolean {
        return try {
            val intent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS)
            } else {
                Intent(Settings.ACTION_APPLICATION_SETTINGS)
            }
            
            if (intent.resolveActivity(context.packageManager) != null) {
                context.startActivity(intent)
                Log.d(TAG, "Battery optimization settings opened")
                true
            } else {
                Log.w(TAG, "No activity found to handle battery optimization settings")
                false
            }
        } catch (e: Exception) {
            Log.e(TAG, "Failed to open battery optimization settings", e)
            false
        }
    }

    /**
     * 打开应用详情页面
     */
    fun openAppDetailsSettings(context: Context): Boolean {
        return try {
            val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
                data = Uri.parse("package:${context.packageName}")
            }
            
            if (intent.resolveActivity(context.packageManager) != null) {
                context.startActivity(intent)
                Log.d(TAG, "App details settings opened")
                true
            } else {
                Log.w(TAG, "No activity found to handle app details settings")
                false
            }
        } catch (e: Exception) {
            Log.e(TAG, "Failed to open app details settings", e)
            false
        }
    }

    /**
     * 尝试打开自启动管理页面(针对不同厂商)
     */
    fun openAutoStartSettings(context: Context): Boolean {
        return try {
            val autoStartIntents = listOf(
                // 华为
                Intent().setClassName(
                    "com.huawei.systemmanager",
                    "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity"
                ),
                Intent().setClassName(
                    "com.huawei.systemmanager",
                    "com.huawei.systemmanager.optimize.process.ProtectActivity"
                ),
                // 小米
                Intent().setClassName(
                    "com.miui.securitycenter",
                    "com.miui.permcenter.autostart.AutoStartManagementActivity"
                ),
                Intent().setClassName(
                    "com.xiaomi.mipicks",
                    "com.xiaomi.mipicks.ui.AppPicksTabActivity"
                ),
                // OPPO
                Intent().setClassName(
                    "com.coloros.safecenter",
                    "com.coloros.safecenter.permission.startup.FakeActivity"
                ),
                Intent().setClassName(
                    "com.oppo.safe",
                    "com.oppo.safe.permission.startup.StartupAppListActivity"
                ),
                // Vivo
                Intent().setClassName(
                    "com.iqoo.secure",
                    "com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity"
                ),
                Intent().setClassName(
                    "com.vivo.permissionmanager",
                    "com.vivo.permissionmanager.activity.BgStartUpManagerActivity"
                ),
                // 魅族
                Intent().setClassName(
                    "com.meizu.safe",
                    "com.meizu.safe.security.SHOW_APPSEC"
                ).apply {
                    addCategory(Intent.CATEGORY_DEFAULT)
                    putExtra("packageName", context.packageName)
                },
                // 三星
                Intent().setClassName(
                    "com.samsung.android.lool",
                    "com.samsung.android.sm.ui.battery.BatteryActivity"
                ),
                // 一加
                Intent().setClassName(
                    "com.oneplus.security",
                    "com.oneplus.security.chainlaunch.view.ChainLaunchAppListActivity"
                )
            )

            for (intent in autoStartIntents) {
                try {
                    if (intent.resolveActivity(context.packageManager) != null) {
                        context.startActivity(intent)
                        Log.d(TAG, "Auto start settings opened: ${intent.component}")
                        return true
                    }
                } catch (e: Exception) {
                    Log.d(TAG, "Failed to open auto start settings: ${intent.component}", e)
                }
            }

            Log.w(TAG, "No auto start settings activity found")
            false
        } catch (e: Exception) {
            Log.e(TAG, "Failed to open auto start settings", e)
            false
        }
    }

    /**
     * 获取电池优化状态描述
     */
    fun getBatteryOptimizationStatus(context: Context): String {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (isIgnoringBatteryOptimizations(context)) {
                "已加入电池优化白名单"
            } else {
                "未加入电池优化白名单"
            }
        } else {
            "系统版本过低,无需设置"
        }
    }

    /**
     * 检查是否需要设置电池优化
     */
    fun needsBatteryOptimizationSetup(context: Context): Boolean {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            !isIgnoringBatteryOptimizations(context)
        } else {
            false
        }
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/utils/ClipBoardUtils.kt
================================================
package com.openlist.mobile.utils

import android.content.ClipData
import android.content.ClipboardManager
import android.content.ClipboardManager.OnPrimaryClipChangedListener
import android.content.Context
import com.openlist.mobile.app


/**
 * <pre>
 * author: Blankj
 * blog  : http://blankj.com
 * time  : 2016/09/25
 * desc  : utils about clipboard
</pre> *
 */
object ClipboardUtils {

    /**
     * Copy the text to clipboard.
     *
     * The label equals name of package.
     *
     * @param text The text.
     */
    fun copyText(text: CharSequence?) {
        val cm = app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        cm.setPrimaryClip(ClipData.newPlainText(app.getPackageName(), text))
    }

    /**
     * Copy the text to clipboard.
     *
     * @param label The label.
     * @param text  The text.
     */
    fun copyText(label: CharSequence?, text: CharSequence?) {
        val cm = app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        cm.setPrimaryClip(ClipData.newPlainText(label, text))
    }

    /**
     * Clear the clipboard.
     */
    fun clear() {
        val cm = app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        cm.setPrimaryClip(ClipData.newPlainText(null, ""))
    }

    /**
     * Return the label for clipboard.
     *
     * @return the label for clipboard
     */
    fun getLabel(): CharSequence {
        val cm = app
            .getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        val des = cm.primaryClipDescription ?: return ""
        return des.label ?: return ""
    }

    /**
     * Return the text for clipboard.
     *
     * @return the text for clipboard
     */
    val text: CharSequence
        get() {
            val cm =
                app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
            val clip = cm.primaryClip
            if (clip != null && clip.itemCount > 0) {
                val text = clip.getItemAt(0).coerceToText(app)
                if (text != null) {
                    return text
                }
            }
            return ""
        }

    /**
     * Add the clipboard changed listener.
     */
    fun addChangedListener(listener: OnPrimaryClipChangedListener?) {
        val cm = app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        cm.addPrimaryClipChangedListener(listener)
    }

    /**
     * Remove the clipboard changed listener.
     */
    fun removeChangedListener(listener: OnPrimaryClipChangedListener?) {
        val cm = app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        cm.removePrimaryClipChangedListener(listener)
    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/utils/FileUtils.kt
================================================
package com.openlist.mobile.utils

import java.io.File
import java.io.InputStream
import java.net.URLConnection

object FileUtils {
    val File.mimeType: String?
        get() {
            val fileNameMap = URLConnection.getFileNameMap()
            return fileNameMap.getContentTypeFor(name)
        }

    /**
     * 按行读取txt
     */
    fun InputStream.readAllText(): String {
        val bufferedReader = this.bufferedReader()
        val buffer = StringBuffer("")
        var str: String?
        while (bufferedReader.readLine().also { str = it } != null) {
            buffer.append(str)
            buffer.append("\n")
        }
        return buffer.toString()
    }

    fun copyFolder(src: File, target: File, overwrite: Boolean = true) {
        val folder = File(target.absolutePath + File.separator + src.name)
        folder.mkdirs()

        src.listFiles()?.forEach {
            if (it.isFile) {
                val newFile = File(folder.absolutePath + File.separator + it.name)
                it.copyTo(newFile, overwrite)
            } else if (it.isDirectory) {
                copyFolder(it, folder)
            }
        }

    }
}

================================================
FILE: android/app/src/main/kotlin/com/openlist/mobile/utils/MyTools.kt
================================================
package com.openlist.mobile.utils

import android.annotation.SuppressLint
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.content.pm.ShortcutInfo
import android.content.pm.ShortcutManager
import android.graphics.drawable.Icon
import android.net.Uri
import android.os.Build
import android.provider.Settings
import com.openlist.mobile.utils.ToastUtils.longToast
import splitties.systemservices.powerManager

object MyTools {
    fun Context.isIgnoringBatteryOptimizations(): Boolean {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
                powerManager.isIgnoringBatteryOptimizations(packageName)
    }

    @SuppressLint("BatteryLife")
    fun Context.killBattery() {
        runCatching {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isIgnoringBatteryOptimizations()) {
                startActivity(Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).apply {
                    data = Uri.parse("package:$packageName")
                })
            }
        }
    }

    /* 添加快捷方式 */
    @SuppressLint("UnspecifiedImmutableFlag")
    @Suppress("DEPRECATION")
    fun addShortcut(
        ctx: Context,
        name: String,
        id: String,
        iconResId: Int,
        launcherIntent: Intent
Download .txt
gitextract_oqnk2mes/

├── .github/
│   ├── scripts/
│   │   ├── check_openlist.sh
│   │   ├── lzy_web.py
│   │   └── update_pubspec_version.sh
│   └── workflows/
│       ├── build.yaml
│       ├── build_openlist.yaml
│       ├── release.yaml
│       └── sync_openlist.yaml
├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── README_EN.md
├── analysis_options.yaml
├── android/
│   ├── .gitignore
│   ├── app/
│   │   ├── build.gradle
│   │   └── src/
│   │       ├── debug/
│   │       │   └── AndroidManifest.xml
│   │       ├── main/
│   │       │   ├── AndroidManifest.xml
│   │       │   ├── java/
│   │       │   │   └── com/
│   │       │   │       └── openlist/
│   │       │   │           └── pigeon/
│   │       │   │               └── GeneratedApi.java
│   │       │   ├── kotlin/
│   │       │   │   └── com/
│   │       │   │       └── openlist/
│   │       │   │           └── mobile/
│   │       │   │               ├── App.kt
│   │       │   │               ├── BootReceiver.kt
│   │       │   │               ├── MainActivity.kt
│   │       │   │               ├── OpenListService.kt
│   │       │   │               ├── OpenListTileService.kt
│   │       │   │               ├── SwitchServerActivity.kt
│   │       │   │               ├── bridge/
│   │       │   │               │   ├── AndroidBridge.kt
│   │       │   │               │   ├── AppConfigBridge.kt
│   │       │   │               │   ├── CommonBridge.kt
│   │       │   │               │   └── ServiceBridge.kt
│   │       │   │               ├── config/
│   │       │   │               │   └── AppConfig.kt
│   │       │   │               ├── constant/
│   │       │   │               │   ├── AppConst.kt
│   │       │   │               │   └── LogLevel.kt
│   │       │   │               ├── data/
│   │       │   │               │   ├── AppDatabase.kt
│   │       │   │               │   └── entities/
│   │       │   │               │       └── ServerLog.kt
│   │       │   │               ├── model/
│   │       │   │               │   ├── ShortCuts.kt
│   │       │   │               │   ├── UpdateResult.kt
│   │       │   │               │   └── openlist/
│   │       │   │               │       ├── Logger.kt
│   │       │   │               │       ├── OpenList.kt
│   │       │   │               │       ├── OpenListConfig.kt
│   │       │   │               │       └── OpenListConfigManager.kt
│   │       │   │               └── utils/
│   │       │   │                   ├── AndroidUtils.kt
│   │       │   │                   ├── BatteryOptimizationUtils.kt
│   │       │   │                   ├── ClipBoardUtils.kt
│   │       │   │                   ├── FileUtils.kt
│   │       │   │                   ├── MyTools.kt
│   │       │   │                   ├── StringUtils.kt
│   │       │   │                   └── ToastUtils.kt
│   │       │   └── res/
│   │       │       ├── drawable/
│   │       │       │   ├── ic_download.xml
│   │       │       │   ├── ic_female.xml
│   │       │       │   ├── ic_launcher_foreground.xml
│   │       │       │   ├── launch_background.xml
│   │       │       │   ├── openlist_logo.xml
│   │       │       │   ├── openlist_switch.xml
│   │       │       │   ├── server.xml
│   │       │       │   └── server2.xml
│   │       │       ├── mipmap-anydpi-v26/
│   │       │       │   ├── ic_launcher.xml
│   │       │       │   └── ic_launcher_round.xml
│   │       │       ├── values/
│   │       │       │   ├── ic_launcher_background.xml
│   │       │       │   ├── strings.xml
│   │       │       │   ├── styles.xml
│   │       │       │   └── themes.xml
│   │       │       ├── values-en/
│   │       │       │   └── strings.xml
│   │       │       ├── values-night/
│   │       │       │   └── styles.xml
│   │       │       └── xml/
│   │       │           ├── backup_rules.xml
│   │       │           ├── data_extraction_rules.xml
│   │       │           ├── file_path_data.xml
│   │       │           ├── file_paths.xml
│   │       │           └── network_security_config.xml
│   │       └── profile/
│   │           └── AndroidManifest.xml
│   ├── build/
│   │   └── reports/
│   │       └── problems/
│   │           └── problems-report.html
│   ├── build.gradle
│   ├── gradle/
│   │   └── wrapper/
│   │       └── gradle-wrapper.properties
│   ├── gradle.properties
│   ├── settings.gradle
│   └── utils/
│       ├── .gitignore
│       ├── build.gradle
│       ├── consumer-rules.pro
│       ├── proguard-rules.pro
│       └── src/
│           ├── androidTest/
│           │   └── java/
│           │       └── com/
│           │           └── github/
│           │               └── jing332/
│           │                   └── utils/
│           │                       └── ExampleInstrumentedTest.kt
│           ├── main/
│           │   ├── AndroidManifest.xml
│           │   ├── cpp/
│           │   │   ├── CMakeLists.txt
│           │   │   └── utils.cpp
│           │   └── java/
│           │       └── com/
│           │           └── github/
│           │               └── jing332/
│           │                   └── utils/
│           │                       └── NativeLib.kt
│           └── test/
│               └── java/
│                   └── com/
│                       └── github/
│                           └── jing332/
│                               └── utils/
│                                   └── ExampleUnitTest.kt
├── ios/
│   ├── .gitignore
│   ├── Flutter/
│   │   ├── AppFrameworkInfo.plist
│   │   ├── Debug.xcconfig
│   │   └── Release.xcconfig
│   ├── Podfile
│   ├── README_iOS_CONFIG.md
│   ├── Runner/
│   │   ├── AppDelegate.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   └── LaunchImage.imageset/
│   │   │       ├── Contents.json
│   │   │       └── README.md
│   │   ├── Base.lproj/
│   │   │   ├── LaunchScreen.storyboard
│   │   │   └── Main.storyboard
│   │   ├── Bridges/
│   │   │   ├── AppConfigBridge.swift
│   │   │   ├── AppStoreUpdateBridge.swift
│   │   │   ├── CommonBridge.swift
│   │   │   └── OpenListBridge.swift
│   │   ├── Info.plist
│   │   ├── OpenListManager.swift
│   │   ├── PigeonApi.swift
│   │   └── Runner-Bridging-Header.h
│   ├── Runner.xcodeproj/
│   │   ├── project.pbxproj
│   │   ├── project.xcworkspace/
│   │   │   ├── contents.xcworkspacedata
│   │   │   └── xcshareddata/
│   │   │       ├── IDEWorkspaceChecks.plist
│   │   │       └── WorkspaceSettings.xcsettings
│   │   └── xcshareddata/
│   │       └── xcschemes/
│   │           └── Runner.xcscheme
│   ├── Runner.xcworkspace/
│   │   ├── contents.xcworkspacedata
│   │   └── xcshareddata/
│   │       ├── IDEWorkspaceChecks.plist
│   │       └── WorkspaceSettings.xcsettings
│   ├── RunnerTests/
│   │   └── RunnerTests.swift
│   └── scripts/
│       └── generate_ios_icons.py
├── lib/
│   ├── contant/
│   │   ├── log_level.dart
│   │   └── native_bridge.dart
│   ├── generated/
│   │   ├── intl/
│   │   │   ├── messages_all.dart
│   │   │   ├── messages_en.dart
│   │   │   └── messages_zh.dart
│   │   └── l10n.dart
│   ├── generated_api.dart
│   ├── l10n/
│   │   ├── intl_en.arb
│   │   └── intl_zh.arb
│   ├── main.dart
│   ├── pages/
│   │   ├── app_update_dialog.dart
│   │   ├── download_manager_page.dart
│   │   ├── openlist/
│   │   │   ├── about_dialog.dart
│   │   │   ├── config_editor_page.dart
│   │   │   ├── log_level_view.dart
│   │   │   ├── log_list_view.dart
│   │   │   ├── openlist.dart
│   │   │   └── pwd_edit_dialog.dart
│   │   ├── settings/
│   │   │   ├── preference_widgets.dart
│   │   │   ├── settings.dart
│   │   │   └── troubleshooting_page.dart
│   │   └── web/
│   │       └── web.dart
│   ├── utils/
│   │   ├── app_store_update.dart
│   │   ├── download_examples.dart
│   │   ├── download_manager.dart
│   │   ├── download_test.dart
│   │   ├── intent_utils.dart
│   │   ├── language_controller.dart
│   │   ├── language_manager.dart
│   │   ├── notification_manager.dart
│   │   ├── service_manager.dart
│   │   └── update_checker.dart
│   └── widgets/
│       └── switch_floating_action_button.dart
├── openlist-lib/
│   ├── openlistlib/
│   │   ├── common.go
│   │   ├── internal/
│   │   │   └── log.go
│   │   ├── server.go
│   │   └── settings.go
│   └── scripts/
│       ├── clear.sh
│       ├── fix_ios_dependencies.sh
│       ├── gobind.sh
│       ├── gobind_ios.sh
│       ├── init_gomobile.sh
│       ├── init_openlist.sh
│       ├── init_web.sh
│       └── init_web_ios.sh
├── openlist_version
├── pigeon_config.yaml
├── pigeons/
│   ├── pigeon.dart
│   └── run.cmd
├── pubspec.yaml
└── test/
    └── widget_test.dart
Download .txt
SYMBOL INDEX (517 symbols across 41 files)

FILE: .github/scripts/lzy_web.py
  function log (line 23) | def log(msg):
  function login_by_cookie (line 30) | def login_by_cookie():
  function upload_file (line 48) | def upload_file(file_dir, folder_id):
  function upload_folder (line 65) | def upload_folder(folder_dir, folder_id):
  function upload (line 76) | def upload(dir, folder_id):

FILE: android/app/src/main/java/com/openlist/pigeon/GeneratedApi.java
  class GeneratedApi (line 23) | @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSu...
    class FlutterError (line 27) | public static class FlutterError extends RuntimeException {
      method FlutterError (line 35) | public FlutterError(@NonNull String code, @Nullable String message, ...
    method wrapError (line 43) | @NonNull
    method createConnectionError (line 60) | @NonNull
    type Result (line 66) | public interface Result<T> {
      method success (line 68) | void success(@NonNull T result);
      method error (line 71) | void error(@NonNull Throwable error);
    type NullableResult (line 74) | public interface NullableResult<T> {
      method success (line 76) | void success(@Nullable T result);
      method error (line 79) | void error(@NonNull Throwable error);
    type VoidResult (line 82) | public interface VoidResult {
      method success (line 84) | void success();
      method error (line 87) | void error(@NonNull Throwable error);
    type AppConfig (line 90) | public interface AppConfig {
      method isWakeLockEnabled (line 92) | @NonNull
      method setWakeLockEnabled (line 95) | void setWakeLockEnabled(@NonNull Boolean enabled);
      method isStartAtBootEnabled (line 97) | @NonNull
      method setStartAtBootEnabled (line 100) | void setStartAtBootEnabled(@NonNull Boolean enabled);
      method isAutoCheckUpdateEnabled (line 102) | @NonNull
      method setAutoCheckUpdateEnabled (line 105) | void setAutoCheckUpdateEnabled(@NonNull Boolean enabled);
      method isAutoOpenWebPageEnabled (line 107) | @NonNull
      method setAutoOpenWebPageEnabled (line 110) | void setAutoOpenWebPageEnabled(@NonNull Boolean enabled);
      method getDataDir (line 112) | @NonNull
      method setDataDir (line 115) | void setDataDir(@NonNull String dir);
      method isSilentJumpAppEnabled (line 117) | @NonNull
      method setSilentJumpAppEnabled (line 120) | void setSilentJumpAppEnabled(@NonNull Boolean enabled);
      method getCodec (line 123) | static @NonNull MessageCodec<Object> getCodec() {
      method setUp (line 127) | static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullabl...
    type NativeCommon (line 407) | public interface NativeCommon {
      method startActivityFromUri (line 409) | @NonNull
      method getDeviceSdkInt (line 412) | @NonNull
      method getDeviceCPUABI (line 415) | @NonNull
      method getVersionName (line 418) | @NonNull
      method getVersionCode (line 421) | @NonNull
      method toast (line 424) | void toast(@NonNull String msg);
      method longToast (line 426) | void longToast(@NonNull String msg);
      method getCodec (line 429) | static @NonNull MessageCodec<Object> getCodec() {
      method setUp (line 433) | static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullabl...
    type Android (line 597) | public interface Android {
      method addShortcut (line 599) | void addShortcut();
      method startService (line 601) | void startService();
      method setAdminPwd (line 603) | void setAdminPwd(@NonNull String pwd);
      method getOpenListHttpPort (line 605) | @NonNull
      method isRunning (line 608) | @NonNull
      method getOpenListVersion (line 611) | @NonNull
      method getCodec (line 615) | static @NonNull MessageCodec<Object> getCodec() {
      method setUp (line 619) | static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullabl...
    class Event (line 757) | public static class Event {
      method Event (line 760) | public Event(@NonNull BinaryMessenger argBinaryMessenger) {
      method getCodec (line 766) | static @NonNull MessageCodec<Object> getCodec() {
      method onServiceStatusChanged (line 769) | public void onServiceStatusChanged(@NonNull Boolean isRunningArg, @N...
      method onServerLog (line 789) | public void onServerLog(@NonNull Long levelArg, @NonNull String time...

FILE: android/utils/src/main/cpp/utils.cpp
  function get_local_ip_using_ifconf (line 17) | int get_local_ip_using_ifconf(char *str_ip)
  function JNIEXPORT (line 56) | JNIEXPORT jstring JNICALL

FILE: ios/scripts/generate_ios_icons.py
  function find_best_source_image (line 30) | def find_best_source_image(logo_dir, target_size):
  function generate_icon (line 44) | def generate_icon(source_path, output_path, target_size):
  function main (line 56) | def main():

FILE: lib/contant/log_level.dart
  class LogLevel (line 3) | class LogLevel {
    method toColor (line 13) | Color toColor(int level)
    method toStr (line 27) | String toStr(int level)

FILE: lib/contant/native_bridge.dart
  class NativeBridge (line 3) | class NativeBridge {

FILE: lib/generated/intl/messages_all.dart
  type Future (line 22) | typedef Future<dynamic> LibraryLoader();
  function _findExact (line 28) | MessageLookupByLibrary? _findExact(String localeName)
  function initializeMessages (line 40) | Future<bool> initializeMessages(String localeName)
  function _messagesExistFor (line 56) | bool _messagesExistFor(String locale)
  function _findGeneratedMessagesFor (line 64) | MessageLookupByLibrary? _findGeneratedMessagesFor(String locale)

FILE: lib/generated/intl/messages_en.dart
  type String (line 18) | typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
  class MessageLookup (line 20) | class MessageLookup extends MessageLookupByLibrary {
    method m0 (line 23) | String m0(error)
    method m1 (line 25) | String m1(error)
    method m2 (line 27) | String m2(error)
    method m3 (line 29) | String m3(error)
    method m4 (line 31) | String m4(filename)
    method m5 (line 34) | String m5(filename)
    method m6 (line 37) | String m6(filename)
    method m7 (line 40) | String m7(error)
    method m8 (line 42) | String m8(path)
    method m9 (line 44) | String m9(count)
    method m10 (line 46) | String m10(error)
    method m11 (line 48) | String m11(url)
    method m12 (line 50) | String m12(filename)
    method m13 (line 52) | String m13(filename)
    method m14 (line 54) | String m14(filename)
    method m15 (line 56) | String m15(filename)
    method m16 (line 58) | String m16(filename)
    method m17 (line 60) | String m17(count)
    method m18 (line 62) | String m18(progress)
    method m19 (line 64) | String m19(current, total)
    method m20 (line 66) | String m20(filename)
    method m21 (line 68) | String m21(index)
    method m22 (line 70) | String m22(size)
    method m23 (line 72) | String m23(time)
    method m24 (line 74) | String m24(error)
    method m25 (line 76) | String m25(error)
    method m26 (line 78) | String m26(line, error)
    method m27 (line 81) | String m27(error)
    method m28 (line 83) | String m28(count)
    method m29 (line 86) | String m29(payload)
    method m30 (line 88) | String m30(error)
    method m31 (line 91) | String m31(error)
    method m32 (line 93) | String m32(error)
    method m33 (line 95) | String m33(error)
    method m34 (line 97) | String m34(error)
    method m35 (line 99) | String m35(type, message)
    method m36 (line 101) | String m36(path)
    method m37 (line 103) | String m37(error)
    method m38 (line 105) | String m38(error)
    method m39 (line 107) | String m39(error)
    method m40 (line 109) | String m40(error)
    method m41 (line 112) | String m41(error)
    method m42 (line 115) | String m42(error)
    method m43 (line 118) | String m43(filename)
    method m44 (line 120) | String m44(filename)
    method m45 (line 122) | String m45(path)
    method _notInlinedMessages (line 125) | Map<String, Function> _notInlinedMessages(_)

FILE: lib/generated/intl/messages_zh.dart
  type String (line 18) | typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
  class MessageLookup (line 20) | class MessageLookup extends MessageLookupByLibrary {
    method m0 (line 23) | String m0(error)
    method m1 (line 25) | String m1(error)
    method m2 (line 27) | String m2(error)
    method m3 (line 29) | String m3(error)
    method m4 (line 31) | String m4(filename)
    method m5 (line 33) | String m5(filename)
    method m6 (line 35) | String m6(filename)
    method m7 (line 37) | String m7(error)
    method m8 (line 39) | String m8(path)
    method m9 (line 41) | String m9(count)
    method m10 (line 43) | String m10(error)
    method m11 (line 45) | String m11(url)
    method m12 (line 47) | String m12(filename)
    method m13 (line 49) | String m13(filename)
    method m14 (line 51) | String m14(filename)
    method m15 (line 53) | String m15(filename)
    method m16 (line 55) | String m16(filename)
    method m17 (line 57) | String m17(count)
    method m18 (line 59) | String m18(progress)
    method m19 (line 61) | String m19(current, total)
    method m20 (line 63) | String m20(filename)
    method m21 (line 65) | String m21(index)
    method m22 (line 67) | String m22(size)
    method m23 (line 69) | String m23(time)
    method m24 (line 71) | String m24(error)
    method m25 (line 73) | String m25(error)
    method m26 (line 75) | String m26(line, error)
    method m27 (line 77) | String m27(error)
    method m28 (line 79) | String m28(count)
    method m29 (line 81) | String m29(payload)
    method m30 (line 83) | String m30(error)
    method m31 (line 85) | String m31(error)
    method m32 (line 87) | String m32(error)
    method m33 (line 89) | String m33(error)
    method m34 (line 91) | String m34(error)
    method m35 (line 93) | String m35(type, message)
    method m36 (line 95) | String m36(path)
    method m37 (line 97) | String m37(error)
    method m38 (line 99) | String m38(error)
    method m39 (line 101) | String m39(error)
    method m40 (line 103) | String m40(error)
    method m41 (line 105) | String m41(error)
    method m42 (line 107) | String m42(error)
    method m43 (line 109) | String m43(filename)
    method m44 (line 111) | String m44(filename)
    method m45 (line 113) | String m45(path)
    method _notInlinedMessages (line 116) | Map<String, Function> _notInlinedMessages(_)

FILE: lib/generated/l10n.dart
  class S (line 15) | class S {
    method load (line 30) | Future<S> load(Locale locale)
    method of (line 44) | S of(BuildContext context)
    method maybeOf (line 53) | S? maybeOf(BuildContext context)
    method downloadManagerWithCount (line 383) | String downloadManagerWithCount(int count)
    method confirmCancelDownload (line 508) | String confirmCancelDownload(String filename)
    method confirmDeleteRecord (line 523) | String confirmDeleteRecord(String filename)
    method confirmDeleteFile (line 578) | String confirmDeleteFile(String filename)
    method openFileFailed (line 633) | String openFileFailed(String error)
    method startDownload (line 738) | String startDownload(String filename)
    method downloadProgress (line 748) | String downloadProgress(String progress)
    method downloadComplete (line 758) | String downloadComplete(String filename)
    method downloadCancelled (line 773) | String downloadCancelled(String url)
    method downloadFailedWithError (line 783) | String downloadFailedWithError(String filename)
    method createOpenListDownloadDirectory (line 813) | String createOpenListDownloadDirectory(String path)
    method createOpenListDirectoryFailed (line 823) | String createOpenListDirectoryFailed(String error)
    method openListDownloadDirectory (line 833) | String openListDownloadDirectory(String path)
    method getDownloadDirectoryFailed (line 843) | String getDownloadDirectoryFailed(String error)
    method parseFilenameFailed (line 853) | String parseFilenameFailed(String error)
    method checkInstallPermissionFailed (line 898) | String checkInstallPermissionFailed(String error)
    method tryToOpenFile (line 908) | String tryToOpenFile(String path)
    method openFileResult (line 918) | String openFileResult(String type, String message)
    method openFileException (line 948) | String openFileException(String error)
    method getDownloadFileListFailed (line 958) | String getDownloadFileListFailed(String error)
    method clearDownloadDirectoryFailed (line 978) | String clearDownloadDirectoryFailed(String error)
    method fileDeletedLog (line 988) | String fileDeletedLog(String filename)
    method deleteFileFailedLog (line 998) | String deleteFileFailedLog(String error)
    method notificationManagerInitFailed (line 1038) | String notificationManagerInitFailed(String error)
    method notificationClicked (line 1048) | String notificationClicked(String payload)
    method currentDownloadingFiles (line 1058) | String currentDownloadingFiles(int count)
    method showDownloadProgressNotificationFailed (line 1083) | String showDownloadProgressNotificationFailed(String error)
    method downloadCompleteNotificationTitle (line 1093) | String downloadCompleteNotificationTitle(String filename)
    method multipleFilesCompleted (line 1123) | String multipleFilesCompleted(int count)
    method showDownloadCompleteNotificationFailed (line 1163) | String showDownloadCompleteNotificationFailed(String error)
    method showSingleFileCompleteNotificationFailed (line 1173) | String showSingleFileCompleteNotificationFailed(String error)
    method cancelDownloadNotificationFailed (line 1183) | String cancelDownloadNotificationFailed(String error)
    method cancelAllNotificationsFailed (line 1193) | String cancelAllNotificationsFailed(String error)
    method fileSize (line 1213) | String fileSize(String size)
    method fileTime (line 1218) | String fileTime(String time)
    method openFileManagerFailed (line 1243) | String openFileManagerFailed(String error)
    method openDownloadDirectoryFailed (line 1263) | String openDownloadDirectoryFailed(String error)
    method startDownloadFile (line 1293) | String startDownloadFile(String filename)
    method downloadCompleteFile (line 1303) | String downloadCompleteFile(String filename)
    method downloadFailedFile (line 1313) | String downloadFailedFile(String filename)
    method downloadingFileProgress (line 1733) | String downloadingFileProgress(int current, int total)
    method fileDownloadFailed (line 1743) | String fileDownloadFailed(int index)
    method loadFailed (line 1838) | String loadFailed(String error)
    method saveFailed (line 1848) | String saveFailed(String error)
    method invalidJsonFormat (line 1858) | String invalidJsonFormat(int line, String error)
    method restoreBackupFailed (line 1933) | String restoreBackupFailed(String error)
  class AppLocalizationDelegate (line 1983) | class AppLocalizationDelegate extends LocalizationsDelegate<S> {
    method isSupported (line 1994) | bool isSupported(Locale locale)
    method load (line 1996) | Future<S> load(Locale locale)
    method shouldReload (line 1998) | bool shouldReload(AppLocalizationDelegate old)
    method _isSupported (line 2000) | bool _isSupported(Locale locale)

FILE: lib/generated_api.dart
  function _createConnectionError (line 11) | PlatformException _createConnectionError(String channelName)
  function wrapResponse (line 18) | List<Object?> wrapResponse({Object? result, PlatformException? error, bo...
  class _PigeonCodec (line 29) | class _PigeonCodec extends StandardMessageCodec {
    method writeValue (line 32) | void writeValue(WriteBuffer buffer, Object? value)
    method readValueOfType (line 42) | Object? readValueOfType(int type, ReadBuffer buffer)
  class AppConfig (line 50) | class AppConfig {
    method isWakeLockEnabled (line 63) | Future<bool> isWakeLockEnabled()
    method setWakeLockEnabled (line 91) | Future<void> setWakeLockEnabled(bool enabled)
    method isStartAtBootEnabled (line 114) | Future<bool> isStartAtBootEnabled()
    method setStartAtBootEnabled (line 142) | Future<void> setStartAtBootEnabled(bool enabled)
    method isAutoCheckUpdateEnabled (line 165) | Future<bool> isAutoCheckUpdateEnabled()
    method setAutoCheckUpdateEnabled (line 193) | Future<void> setAutoCheckUpdateEnabled(bool enabled)
    method isAutoOpenWebPageEnabled (line 216) | Future<bool> isAutoOpenWebPageEnabled()
    method setAutoOpenWebPageEnabled (line 244) | Future<void> setAutoOpenWebPageEnabled(bool enabled)
    method getDataDir (line 267) | Future<String> getDataDir()
    method setDataDir (line 295) | Future<void> setDataDir(String dir)
    method isSilentJumpAppEnabled (line 318) | Future<bool> isSilentJumpAppEnabled()
    method setSilentJumpAppEnabled (line 346) | Future<void> setSilentJumpAppEnabled(bool enabled)
  class NativeCommon (line 370) | class NativeCommon {
    method startActivityFromUri (line 383) | Future<bool> startActivityFromUri(String intentUri)
    method getDeviceSdkInt (line 411) | Future<int> getDeviceSdkInt()
    method getDeviceCPUABI (line 439) | Future<String> getDeviceCPUABI()
    method getVersionName (line 467) | Future<String> getVersionName()
    method getVersionCode (line 495) | Future<int> getVersionCode()
    method toast (line 523) | Future<void> toast(String msg)
    method longToast (line 546) | Future<void> longToast(String msg)
  class Android (line 570) | class Android {
    method addShortcut (line 583) | Future<void> addShortcut()
    method startService (line 606) | Future<void> startService()
    method setAdminPwd (line 629) | Future<void> setAdminPwd(String pwd)
    method getOpenListHttpPort (line 652) | Future<int> getOpenListHttpPort()
    method isRunning (line 680) | Future<bool> isRunning()
    method getOpenListVersion (line 708) | Future<String> getOpenListVersion()
  class Event (line 737) | abstract class Event {
    method onServiceStatusChanged (line 740) | void onServiceStatusChanged(bool isRunning)
    method onServerLog (line 742) | void onServerLog(int level, String time, String log)
    method setUp (line 744) | void setUp(Event? api, {BinaryMessenger? binaryMessenger, String messa...

FILE: lib/main.dart
  function main (line 21) | void main()
  class MyApp (line 57) | class MyApp extends StatelessWidget {
    method build (line 62) | Widget build(BuildContext context)
  class MyHomePage (line 101) | class MyHomePage extends StatelessWidget {
    method build (line 108) | Widget build(BuildContext context)
    method _getDownloadLabel (line 160) | String _getDownloadLabel()
  class _MainController (line 170) | class _MainController extends GetxController {
    method onInit (line 178) | void onInit()

FILE: lib/pages/app_update_dialog.dart
  class AppUpdateDialog (line 11) | class AppUpdateDialog extends StatelessWidget {
    method checkUpdateAndShowDialog (line 24) | checkUpdateAndShowDialog(
    method build (line 60) | Widget build(BuildContext context)

FILE: lib/pages/download_manager_page.dart
  class DownloadManagerPage (line 10) | class DownloadManagerPage extends StatefulWidget {
    method createState (line 14) | State<DownloadManagerPage> createState()
  class _DownloadManagerPageState (line 17) | class _DownloadManagerPageState extends State<DownloadManagerPage>
    method initState (line 25) | void initState()
    method dispose (line 35) | void dispose()
    method _startPeriodicRefresh (line 40) | void _startPeriodicRefresh()
    method _loadDownloadedFiles (line 49) | Future<void> _loadDownloadedFiles()
    method _formatFileSize (line 66) | String _formatFileSize(int bytes)
    method _formatDateTime (line 73) | String _formatDateTime(DateTime dateTime)
    method _getFileIcon (line 78) | IconData _getFileIcon(String filename)
    method _getStatusColor (line 112) | Color _getStatusColor(DownloadStatus status)
    method _buildActiveTasksTab (line 127) | Widget _buildActiveTasksTab()
    method _buildCompletedTasksTab (line 268) | Widget _buildCompletedTasksTab()
    method _confirmCancelDownload (line 440) | void _confirmCancelDownload(DownloadTask task)
    method _confirmDeleteTaskRecord (line 464) | void _confirmDeleteTaskRecord(DownloadTask task)
    method _showFileOptions (line 488) | void _showFileOptions(FileSystemEntity file)
    method _showFileInfo (line 555) | void _showFileInfo(FileSystemEntity file)
    method _confirmDeleteFile (line 586) | void _confirmDeleteFile(String filename)
    method _confirmClearAll (line 621) | void _confirmClearAll()
    method _openFile (line 659) | Future<void> _openFile(String filePath)
    method _openFileManager (line 719) | Future<void> _openFileManager(String filePath)
    method _openDownloadDirectory (line 749) | Future<void> _openDownloadDirectory()
    method _showFileLocation (line 781) | void _showFileLocation(String filePath)
    method build (line 820) | Widget build(BuildContext context)

FILE: lib/pages/openlist/about_dialog.dart
  class AppAboutDialog (line 13) | class AppAboutDialog extends StatefulWidget {
    method createState (line 17) | State<AppAboutDialog> createState()
  class _AppAboutDialogState (line 22) | class _AppAboutDialogState extends State<AppAboutDialog> {
    method updateVer (line 27) | Future<Void?> updateVer()
    method initState (line 35) | void initState()
    method build (line 42) | Widget build(BuildContext context)

FILE: lib/pages/openlist/config_editor_page.dart
  class ConfigEditorPage (line 14) | class ConfigEditorPage extends StatefulWidget {
    method createState (line 18) | State<ConfigEditorPage> createState()
  class _ConfigEditorPageState (line 21) | class _ConfigEditorPageState extends State<ConfigEditorPage> {
    method initState (line 33) | void initState()
    method _validateJson (line 41) | void _validateJson()
    method _loadConfigFile (line 82) | Future<void> _loadConfigFile()
    method _restoreBackup (line 126) | Future<void> _restoreBackup()
    method _showSaveConfirmation (line 162) | Future<void> _showSaveConfirmation()
    method _restartOpenListService (line 198) | Future<void> _restartOpenListService()
    method _saveConfigFile (line 249) | Future<bool> _saveConfigFile()
    method build (line 333) | Widget build(BuildContext context)
    method dispose (line 469) | void dispose()

FILE: lib/pages/openlist/log_level_view.dart
  class LogLevelView (line 5) | class LogLevelView extends StatefulWidget {
    method createState (line 11) | State<LogLevelView> createState()
  class _LogLevelViewState (line 14) | class _LogLevelViewState extends State<LogLevelView> {
    method build (line 16) | Widget build(BuildContext context)

FILE: lib/pages/openlist/log_list_view.dart
  class Log (line 4) | class Log {
  class LogListView (line 12) | class LogListView extends StatefulWidget {
    method createState (line 19) | State<LogListView> createState()
  class _LogListViewState (line 22) | class _LogListViewState extends State<LogListView> {
    method build (line 24) | Widget build(BuildContext context)

FILE: lib/pages/openlist/openlist.dart
  class OpenListScreen (line 15) | class OpenListScreen extends StatelessWidget {
    method build (line 19) | Widget build(BuildContext context)
  class MyEventReceiver (line 123) | class MyEventReceiver extends Event {
    method onServiceStatusChanged (line 130) | void onServiceStatusChanged(bool isRunning)
    method onServerLog (line 135) | void onServerLog(int level, String time, String log)
  class OpenListController (line 140) | class OpenListController extends GetxController {
    method clearLog (line 147) | void clearLog()
    method addLog (line 151) | void addLog(Log log)
    method onInit (line 159) | void onInit()

FILE: lib/pages/openlist/pwd_edit_dialog.dart
  class PwdEditDialog (line 5) | class PwdEditDialog extends StatefulWidget {
    method createState (line 11) | State<PwdEditDialog> createState()
  class _PwdEditDialogState (line 16) | class _PwdEditDialogState extends State<PwdEditDialog>
    method dispose (line 21) | void dispose()
    method build (line 27) | Widget build(BuildContext context)

FILE: lib/pages/settings/preference_widgets.dart
  class DividerPreference (line 3) | class DividerPreference extends StatelessWidget {
    method build (line 9) | Widget build(BuildContext context)
  class BasicPreference (line 26) | class BasicPreference extends StatelessWidget {
    method build (line 43) | Widget build(BuildContext context)
  class SwitchPreference (line 54) | class SwitchPreference extends StatelessWidget {
    method build (line 71) | Widget build(BuildContext context)

FILE: lib/pages/settings/settings.dart
  class SettingsScreen (line 14) | class SettingsScreen extends StatefulWidget {
    method createState (line 18) | State<SettingsScreen> createState()
  class _SettingsScreenState (line 23) | class _SettingsScreenState extends State<SettingsScreen> {
    method initState (line 27) | void initState()
    method dispose (line 38) | void dispose()
    method build (line 44) | Widget build(BuildContext context)
    method _getLanguageDisplayName (line 193) | String _getLanguageDisplayName()
    method _showLanguageSelectionDialog (line 209) | void _showLanguageSelectionDialog(BuildContext context)
  class _SettingsController (line 237) | class _SettingsController extends GetxController {
    method onInit (line 295) | void onInit()
    method updateData (line 301) | void updateData()

FILE: lib/pages/settings/troubleshooting_page.dart
  class TroubleshootingPage (line 4) | class TroubleshootingPage extends StatelessWidget {
    method build (line 8) | Widget build(BuildContext context)
    method _buildIssueCard (line 33) | Widget _buildIssueCard(

FILE: lib/pages/web/web.dart
  class WebScreen (line 17) | class WebScreen extends StatefulWidget {
    method createState (line 21) | State<StatefulWidget> createState()
  class WebScreenState (line 26) | class WebScreenState extends State<WebScreen> with WidgetsBindingObserver {
    method _isLoopbackHost (line 58) | bool _isLoopbackHost(String host)
    method _isAllowedInAppNavigation (line 65) | bool _isAllowedInAppNavigation(Uri uri)
    method _openExternalUri (line 82) | Future<void> _openExternalUri(String uriString)
    method initState (line 108) | void initState()
    method dispose (line 136) | void dispose()
    method didChangeAppLifecycleState (line 144) | void didChangeAppLifecycleState(AppLifecycleState state)
    method build (line 176) | Widget build(BuildContext context)

FILE: lib/utils/app_store_update.dart
  class AppStoreUpdate (line 5) | class AppStoreUpdate {
    method checkAndShowUpdate (line 8) | Future<bool> checkAndShowUpdate()

FILE: lib/utils/download_examples.dart
  class DownloadExamples (line 7) | class DownloadExamples {
    method downloadSimpleFile (line 10) | Future<void> downloadSimpleFile()
    method downloadWithProgress (line 18) | Future<void> downloadWithProgress()
    method downloadWithCustomProgress (line 26) | Future<void> downloadWithCustomProgress()
    method downloadMultipleFiles (line 34) | Future<void> downloadMultipleFiles(List<String> urls)
    method downloadWithCustomDialog (line 65) | Future<void> downloadWithCustomDialog(BuildContext context)
    method downloadImageWithPreview (line 94) | Future<void> downloadImageWithPreview(String imageUrl)
    method downloadApkAndInstall (line 136) | Future<void> downloadApkAndInstall(String apkUrl, String version)
  class DownloadUtils (line 171) | class DownloadUtils {
    method isDownloadUrl (line 174) | bool isDownloadUrl(String url)
    method getFileExtension (line 188) | String getFileExtension(String url)
    method formatFileSize (line 202) | String formatFileSize(int bytes)
    method showDownloadOptions (line 210) | void showDownloadOptions(BuildContext context, String url, {String? fi...

FILE: lib/utils/download_manager.dart
  type DownloadStatus (line 13) | enum DownloadStatus {
  class DownloadTask (line 22) | class DownloadTask {
    method _formatBytes (line 73) | String _formatBytes(int bytes)
  class DownloadManager (line 81) | class DownloadManager {
    method downloadFileWithProgress (line 96) | Future<bool> downloadFileWithProgress({
    method downloadFileInBackground (line 235) | Future<bool> downloadFileInBackground({
    method cancelDownload (line 246) | void cancelDownload(String taskId)
    method clearCompletedTasks (line 254) | void clearCompletedTasks()
    method removeTask (line 259) | void removeTask(String taskId)
    method _getOpenListDownloadDirectory (line 265) | Future<Directory?> _getOpenListDownloadDirectory()
    method _getFilenameFromUrl (line 317) | String _getFilenameFromUrl(String url)
    method _getUniqueFilePath (line 336) | String _getUniqueFilePath(String originalPath)
    method _isApkFile (line 359) | bool _isApkFile(String filePath)
    method _checkInstallPermission (line 364) | Future<bool> _checkInstallPermission()
    method _openFile (line 416) | Future<void> _openFile(String filePath)
    method _showFileLocation (line 517) | void _showFileLocation(String filePath)
    method getDownloadDirectoryPath (line 549) | Future<String?> getDownloadDirectoryPath()
    method getDownloadedFiles (line 555) | Future<List<FileSystemEntity>> getDownloadedFiles()
    method clearDownloadDirectory (line 568) | Future<bool> clearDownloadDirectory()
    method deleteFile (line 583) | Future<bool> deleteFile(String filename)
  class DownloadController (line 602) | class DownloadController extends getx.GetxController {
    method updateProgress (line 611) | void updateProgress(double progress, int received, int total)
    method cancelDownload (line 619) | void cancelDownload()
    method _formatBytes (line 625) | String _formatBytes(int bytes)

FILE: lib/utils/download_test.dart
  class DownloadTestPage (line 7) | class DownloadTestPage extends StatelessWidget {
    method build (line 11) | Widget build(BuildContext context)
  class DownloadTestHelper (line 106) | class DownloadTestHelper {
    method showTestDialog (line 107) | void showTestDialog(BuildContext context)

FILE: lib/utils/intent_utils.dart
  class IntentUtils (line 3) | class IntentUtils {
    method getUrlIntent (line 4) | AndroidIntent getUrlIntent(String url)

FILE: lib/utils/language_controller.dart
  class LanguageController (line 6) | class LanguageController extends GetxController {
    method onInit (line 16) | void onInit()
    method _loadSavedLanguage (line 22) | Future<void> _loadSavedLanguage()
    method changeLanguage (line 35) | Future<void> changeLanguage(LanguageOption option)
    method _getSupportedLocale (line 61) | Locale _getSupportedLocale(Locale deviceLocale)
    method getEffectiveLocale (line 74) | Locale getEffectiveLocale()
  class LanguageSelector (line 86) | class LanguageSelector extends StatelessWidget {
    method build (line 95) | Widget build(BuildContext context)
    method _getLocalizedLanguageName (line 120) | String _getLocalizedLanguageName(LanguageOption option)

FILE: lib/utils/language_manager.dart
  class LanguageManager (line 4) | class LanguageManager {
    method getSavedLanguageCode (line 33) | Future<String> getSavedLanguageCode()
    method saveLanguageCode (line 39) | Future<void> saveLanguageCode(String languageCode)
    method getSavedLanguageOption (line 45) | Future<LanguageOption> getSavedLanguageOption()
    method getLocaleFromCode (line 54) | Future<Locale?> getLocaleFromCode(String languageCode)
    method getCurrentLocale (line 68) | Future<Locale?> getCurrentLocale()
    method clearLanguageSetting (line 74) | Future<void> clearLanguageSetting()
  class LanguageOption (line 80) | class LanguageOption {

FILE: lib/utils/notification_manager.dart
  class NotificationManager (line 9) | class NotificationManager {
    method initialize (line 15) | Future<void> initialize()
    method _onNotificationTapped (line 65) | void _onNotificationTapped(NotificationResponse response)
    method showDownloadProgressNotification (line 75) | Future<void> showDownloadProgressNotification()
    method showDownloadCompleteNotification (line 169) | Future<void> showDownloadCompleteNotification()
    method showSingleFileCompleteNotification (line 254) | Future<void> showSingleFileCompleteNotification(DownloadTask task)
    method cancelDownloadNotification (line 321) | Future<void> cancelDownloadNotification()
    method cancelAllNotifications (line 330) | Future<void> cancelAllNotifications()
    method _formatBytes (line 339) | String _formatBytes(int bytes)

FILE: lib/utils/service_manager.dart
  class ServiceManager (line 8) | class ServiceManager {
    method initialize (line 30) | Future<void> initialize()
    method _handleMethodCall (line 49) | Future<dynamic> _handleMethodCall(MethodCall call)
    method startService (line 63) | Future<bool> startService()
    method stopService (line 92) | Future<bool> stopService()
    method checkServiceStatus (line 122) | Future<bool> checkServiceStatus()
    method restartService (line 142) | Future<bool> restartService()
    method isBatteryOptimizationIgnored (line 154) | Future<bool> isBatteryOptimizationIgnored()
    method requestIgnoreBatteryOptimization (line 167) | Future<bool> requestIgnoreBatteryOptimization()
    method openBatteryOptimizationSettings (line 180) | Future<bool> openBatteryOptimizationSettings()
    method openAutoStartSettings (line 193) | Future<bool> openAutoStartSettings()
    method getServiceAddress (line 206) | Future<String> getServiceAddress()
    method _startStatusCheck (line 219) | void _startStatusCheck()
    method _stopStatusCheck (line 227) | void _stopStatusCheck()
    method _updateServiceStatus (line 233) | void _updateServiceStatus(bool isRunning)
    method dispose (line 242) | void dispose()

FILE: lib/utils/update_checker.dart
  class UpdateChecker (line 8) | class UpdateChecker {
    method _getLatestRelease (line 32) | Future<Map<String, dynamic>> _getLatestRelease(
    method getTag (line 48) | String getTag()
    method hasNewVersion (line 52) | Future<bool> hasNewVersion()
    method getApkDownloadUrl (line 61) | String getApkDownloadUrl()
    method getUpdateContent (line 72) | String getUpdateContent()
    method getHtmlUrl (line 76) | String getHtmlUrl()
    method _extractNumbers (line 81) | int _extractNumbers(String input)

FILE: lib/widgets/switch_floating_action_button.dart
  class SwitchFloatingButton (line 3) | class SwitchFloatingButton extends StatefulWidget {
    method createState (line 11) | State<SwitchFloatingButton> createState()
  class _SwitchFloatingButtonState (line 14) | class _SwitchFloatingButtonState extends State<SwitchFloatingButton>
    method initState (line 20) | void initState()
    method build (line 31) | Widget build(BuildContext context)
    method dispose (line 58) | void dispose()

FILE: openlist-lib/openlistlib/common.go
  function GetOutboundIP (line 5) | func GetOutboundIP() (net.IP, error) {
  function GetOutboundIPString (line 16) | func GetOutboundIPString() string {

FILE: openlist-lib/openlistlib/internal/log.go
  type MyFormatter (line 5) | type MyFormatter struct
    method Format (line 10) | func (f *MyFormatter) Format(entry *log.Entry) ([]byte, error) {

FILE: openlist-lib/openlistlib/server.go
  type LogCallback (line 14) | type LogCallback interface
  type Event (line 18) | type Event interface
  function Init (line 28) | func Init(event Event, cb LogCallback) error {
  function IsRunning (line 54) | func IsRunning(t string) bool {
  function Start (line 59) | func Start() {
  function Shutdown (line 64) | func Shutdown(timeout int64) (err error) {
  function ForceDBSync (line 75) | func ForceDBSync() error {

FILE: openlist-lib/openlistlib/settings.go
  function SetConfigData (line 10) | func SetConfigData(path string) {
  function SetConfigLogStd (line 14) | func SetConfigLogStd(b bool) {
  function SetConfigDebug (line 18) | func SetConfigDebug(b bool) {
  function SetConfigNoPrefix (line 22) | func SetConfigNoPrefix(b bool) {
  function SetAdminPassword (line 26) | func SetAdminPassword(pwd string) {

FILE: pigeons/pigeon.dart
  class AppConfig (line 3) | @HostApi()
    method isWakeLockEnabled (line 5) | bool isWakeLockEnabled()
    method setWakeLockEnabled (line 7) | void setWakeLockEnabled(bool enabled)
    method isStartAtBootEnabled (line 9) | bool isStartAtBootEnabled()
    method setStartAtBootEnabled (line 11) | void setStartAtBootEnabled(bool enabled)
    method isAutoCheckUpdateEnabled (line 13) | bool isAutoCheckUpdateEnabled()
    method setAutoCheckUpdateEnabled (line 15) | void setAutoCheckUpdateEnabled(bool enabled)
    method isAutoOpenWebPageEnabled (line 17) | bool isAutoOpenWebPageEnabled()
    method setAutoOpenWebPageEnabled (line 19) | void setAutoOpenWebPageEnabled(bool enabled)
    method getDataDir (line 21) | String getDataDir()
    method setDataDir (line 23) | void setDataDir(String dir)
    method isSilentJumpAppEnabled (line 25) | bool isSilentJumpAppEnabled()
    method setSilentJumpAppEnabled (line 27) | void setSilentJumpAppEnabled(bool enabled)
  class NativeCommon (line 30) | @HostApi()
    method startActivityFromUri (line 32) | bool startActivityFromUri(String intentUri)
    method getDeviceSdkInt (line 34) | int getDeviceSdkInt()
    method getDeviceCPUABI (line 36) | String getDeviceCPUABI()
    method getVersionName (line 38) | String getVersionName()
    method getVersionCode (line 40) | int getVersionCode()
    method toast (line 42) | void toast(String msg)
    method longToast (line 44) | void longToast(String msg)
  class Android (line 47) | @HostApi()
    method addShortcut (line 49) | void addShortcut()
    method startService (line 51) | void startService()
    method setAdminPwd (line 53) | void setAdminPwd(String pwd)
    method getOpenListHttpPort (line 55) | int getOpenListHttpPort()
    method isRunning (line 57) | bool isRunning()
    method getOpenListVersion (line 59) | String getOpenListVersion()
  class Event (line 62) | @FlutterApi()
    method onServiceStatusChanged (line 64) | void onServiceStatusChanged(bool isRunning)
    method onServerLog (line 66) | void onServerLog(

FILE: test/widget_test.dart
  function main (line 13) | void main()
Condensed preview — 164 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (908K chars).
[
  {
    "path": ".github/scripts/check_openlist.sh",
    "chars": 1876,
    "preview": "#!/bin/bash\n\nGIT_REPO=\"https://github.com/OpenListTeam/OpenList.git\"\n\nfunction compare_versions() {\n  local v1=\"${1#v}\"\n"
  },
  {
    "path": ".github/scripts/lzy_web.py",
    "chars": 2827,
    "preview": "import requests, os, datetime, sys\n\n# Cookie 中 phpdisk_info 的值\ncookie_phpdisk_info = os.environ.get('phpdisk_info')\n# Co"
  },
  {
    "path": ".github/scripts/update_pubspec_version.sh",
    "chars": 587,
    "preview": "#!/bin/bash\n\nVERSION_FILE=\"$GITHUB_WORKSPACE/openlist_version\"\nPUBSPEC_FILE=\"$GITHUB_WORKSPACE/pubspec.yaml\"\n\nif [ ! -f "
  },
  {
    "path": ".github/workflows/build.yaml",
    "chars": 17061,
    "preview": "name: Build\n\non:\n  push:\n    branches:\n      - \"main\"\n    paths-ignore:\n      - \"*.md\"\n      - \"*.sh\"\n      - \"release.y"
  },
  {
    "path": ".github/workflows/build_openlist.yaml",
    "chars": 4813,
    "preview": "name: Build OpenList Libraries\n\non:\n  workflow_dispatch:\n  workflow_call:\n\npermissions:\n  contents: read\n\njobs:\n  versio"
  },
  {
    "path": ".github/workflows/release.yaml",
    "chars": 8967,
    "preview": "name: Release\n\non:\n  workflow_dispatch:\n\npermissions:\n  contents: write\n\njobs:\n  version:\n    name: Get OpenList Version"
  },
  {
    "path": ".github/workflows/sync_openlist.yaml",
    "chars": 2762,
    "preview": "name: Check Updates\n\non:\n  schedule:\n    - cron: \"0 5,17 * * *\" # 每日5点和17点执行\n  workflow_dispatch:\n    inputs:\n      forc"
  },
  {
    "path": ".gitignore",
    "chars": 816,
    "preview": "# Miscellaneous\n*.class\n*.log\n*.pyc\n*.swp\n.DS_Store\n.atom/\n.buildlog/\n.history\n.svn/\nmigrate_working_dir/\ndocs/\n.github/"
  },
  {
    "path": ".metadata",
    "chars": 964,
    "preview": "# This file tracks properties of this Flutter project.\n# Used by Flutter tool to assess capabilities and perform upgrade"
  },
  {
    "path": "LICENSE",
    "chars": 34523,
    "preview": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C)"
  },
  {
    "path": "README.md",
    "chars": 1757,
    "preview": "\n\n<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/OpenListTeam/Logo/main/logo.svg\" height=\"100px\" alt"
  },
  {
    "path": "README_EN.md",
    "chars": 2133,
    "preview": "<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/OpenListTeam/Logo/main/logo.svg\" height=\"100px\" alt=\""
  },
  {
    "path": "analysis_options.yaml",
    "chars": 1420,
    "preview": "# This file configures the analyzer, which statically analyzes Dart code to\n# check for errors, warnings, and lints.\n#\n#"
  },
  {
    "path": "android/.gitignore",
    "chars": 322,
    "preview": "gradle-wrapper.jar\n/.gradle\n/captures/\n/gradlew\n/gradlew.bat\n/local.properties\nGeneratedPluginRegistrant.java\n\n# Remembe"
  },
  {
    "path": "android/app/build.gradle",
    "chars": 5609,
    "preview": "plugins {\n    id \"com.android.application\"\n    id \"kotlin-android\"\n    id \"kotlin-parcelize\"\n    id \"kotlin-kapt\"\n    id"
  },
  {
    "path": "android/app/src/debug/AndroidManifest.xml",
    "chars": 378,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- The INTERNET permission is required for d"
  },
  {
    "path": "android/app/src/main/AndroidManifest.xml",
    "chars": 4786,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\">"
  },
  {
    "path": "android/app/src/main/java/com/openlist/pigeon/GeneratedApi.java",
    "chars": 29611,
    "preview": "// Autogenerated from Pigeon (v16.0.0), do not edit directly.\n// See also: https://pub.dev/packages/pigeon\n\npackage com."
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/App.kt",
    "chars": 1619,
    "preview": "package com.openlist.mobile\n\nimport android.app.Application\nimport android.util.Log\nimport com.openlist.mobile.model.ope"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/BootReceiver.kt",
    "chars": 2093,
    "preview": "package com.openlist.mobile\n\nimport android.content.BroadcastReceiver\nimport android.content.Context\nimport android.cont"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/MainActivity.kt",
    "chars": 4923,
    "preview": "package com.openlist.mobile\n\nimport android.content.BroadcastReceiver\nimport android.content.Context\nimport android.cont"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/OpenListService.kt",
    "chars": 16209,
    "preview": "package com.openlist.mobile\n\nimport openlistlib.Openlistlib\nimport android.annotation.SuppressLint\nimport android.app.No"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/OpenListTileService.kt",
    "chars": 5437,
    "preview": "package com.openlist.mobile\n\nimport android.content.BroadcastReceiver\nimport android.content.Context\nimport android.cont"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/SwitchServerActivity.kt",
    "chars": 1210,
    "preview": "package com.openlist.mobile\n\nimport android.app.Activity\nimport android.content.Intent\nimport android.os.Bundle\nimport a"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/bridge/AndroidBridge.kt",
    "chars": 1631,
    "preview": "package com.openlist.mobile.bridge\n\nimport android.content.Context\nimport android.content.Intent\nimport android.os.Build"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/bridge/AppConfigBridge.kt",
    "chars": 1285,
    "preview": "package com.openlist.mobile.bridge\n\nimport com.openlist.mobile.config.AppConfig\nimport com.openlist.pigeon.GeneratedApi\n"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/bridge/CommonBridge.kt",
    "chars": 1184,
    "preview": "package com.openlist.mobile.bridge\n\nimport android.content.Context\nimport android.content.Intent\nimport android.os.Build"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/bridge/ServiceBridge.kt",
    "chars": 6212,
    "preview": "package com.openlist.mobile.bridge\n\nimport android.content.Context\nimport android.content.Intent\nimport android.os.Build"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/config/AppConfig.kt",
    "chars": 1384,
    "preview": "package com.openlist.mobile.config\n\nimport com.cioccarellia.ksprefs.KsPrefs\nimport com.cioccarellia.ksprefs.dynamic\nimpo"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/constant/AppConst.kt",
    "chars": 647,
    "preview": "package com.openlist.mobile.constant\n\nimport androidx.localbroadcastmanager.content.LocalBroadcastManager\nimport com.ope"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/constant/LogLevel.kt",
    "chars": 835,
    "preview": "package com.openlist.mobile.constant\n\nimport androidx.annotation.IntDef\n\n@IntDef(\n    LogLevel.PANIC,\n    LogLevel.FATAL"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/data/AppDatabase.kt",
    "chars": 820,
    "preview": "/*\npackage com.openlist.mobile.data\n\nimport androidx.room.AutoMigration\nimport androidx.room.Database\nimport androidx.ro"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/data/entities/ServerLog.kt",
    "chars": 949,
    "preview": "package com.openlist.mobile.data.entities\n\nimport com.openlist.mobile.constant.LogLevel\n\ndata class ServerLog(\n\n    @Log"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/model/ShortCuts.kt",
    "chars": 1283,
    "preview": "package com.openlist.mobile.model\n\nimport android.content.Context\nimport android.content.Intent\nimport androidx.core.con"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/model/UpdateResult.kt",
    "chars": 290,
    "preview": "package com.openlist.openlistandroid.model\n\ndata class UpdateResult(\n    val version: String = \"\",\n    val time: String "
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/model/openlist/Logger.kt",
    "chars": 509,
    "preview": "package com.openlist.mobile.model.openlist\n\nobject Logger {\n    private var listeners = mutableListOf<Listener>()\n\n    f"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/model/openlist/OpenList.kt",
    "chars": 4457,
    "preview": "package com.openlist.mobile.model.openlist\n\nimport openlistlib.Openlistlib\nimport openlistlib.Event\nimport openlistlib.L"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/model/openlist/OpenListConfig.kt",
    "chars": 3141,
    "preview": "package com.openlist.mobile.model.openlist\n\nimport kotlinx.serialization.SerialName\nimport kotlinx.serialization.Seriali"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/model/openlist/OpenListConfigManager.kt",
    "chars": 2338,
    "preview": "package com.openlist.mobile.model.openlist\n\nimport android.os.FileObserver\nimport android.util.Log\nimport com.openlist.m"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/AndroidUtils.kt",
    "chars": 680,
    "preview": "package com.openlist.mobile.utils\n\nimport android.content.BroadcastReceiver\nimport android.content.Context\nimport androi"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/BatteryOptimizationUtils.kt",
    "chars": 7461,
    "preview": "package com.openlist.mobile.utils\n\nimport android.annotation.SuppressLint\nimport android.content.Context\nimport android."
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/ClipBoardUtils.kt",
    "chars": 2709,
    "preview": "package com.openlist.mobile.utils\n\nimport android.content.ClipData\nimport android.content.ClipboardManager\nimport androi"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/FileUtils.kt",
    "chars": 1156,
    "preview": "package com.openlist.mobile.utils\n\nimport java.io.File\nimport java.io.InputStream\nimport java.net.URLConnection\n\nobject "
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/MyTools.kt",
    "chars": 3488,
    "preview": "package com.openlist.mobile.utils\n\nimport android.annotation.SuppressLint\nimport android.app.PendingIntent\nimport androi"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/StringUtils.kt",
    "chars": 1220,
    "preview": "package com.openlist.mobile.utils\n\nobject StringUtils {\n    private fun paramsParseInternal(params: String): HashMap<Str"
  },
  {
    "path": "android/app/src/main/kotlin/com/openlist/mobile/utils/ToastUtils.kt",
    "chars": 1397,
    "preview": "package com.openlist.mobile.utils\n\nimport android.content.Context\nimport android.widget.Toast\nimport androidx.annotation"
  },
  {
    "path": "android/app/src/main/res/drawable/ic_download.xml",
    "chars": 549,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\" android:height=\"24dp\" android:viewportHeight=\"1024\" a"
  },
  {
    "path": "android/app/src/main/res/drawable/ic_female.xml",
    "chars": 807,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "android/app/src/main/res/drawable/ic_launcher_foreground.xml",
    "chars": 4953,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\" android:height=\"72dp\" android:viewportHeight=\"1024\" a"
  },
  {
    "path": "android/app/src/main/res/drawable/launch_background.xml",
    "chars": 434,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Modify this file to customize your launch splash screen -->\n<layer-list xmln"
  },
  {
    "path": "android/app/src/main/res/drawable/openlist_logo.xml",
    "chars": 4974,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"1024dp\"\n    android:height=\"1024dp"
  },
  {
    "path": "android/app/src/main/res/drawable/openlist_switch.xml",
    "chars": 739,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"24dp\"\n    android:height=\"24dp\"\n  "
  },
  {
    "path": "android/app/src/main/res/drawable/server.xml",
    "chars": 1139,
    "preview": "<vector android:autoMirrored=\"true\" android:height=\"24dp\"\n    android:viewportHeight=\"1024\" android:viewportWidth=\"1024\""
  },
  {
    "path": "android/app/src/main/res/drawable/server2.xml",
    "chars": 686,
    "preview": "<vector android:height=\"24dp\" android:tint=\"#000000\"\n    android:viewportHeight=\"24\" android:viewportWidth=\"24\"\n    andr"
  },
  {
    "path": "android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 265,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 265,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "android/app/src/main/res/values/ic_launcher_background.xml",
    "chars": 120,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"ic_launcher_background\">#FFFFFF</color>\n</resources>"
  },
  {
    "path": "android/app/src/main/res/values/strings.xml",
    "chars": 3786,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">OpenList Mobile</string>\n\n    <string nam"
  },
  {
    "path": "android/app/src/main/res/values/styles.xml",
    "chars": 996,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- Theme applied to the Android Window while the process is sta"
  },
  {
    "path": "android/app/src/main/res/values/themes.xml",
    "chars": 150,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"Theme.OpenList\" parent=\"android:Theme.Material.Light"
  },
  {
    "path": "android/app/src/main/res/values-en/strings.xml",
    "chars": 4725,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">OpenList Mobile</string>\n\n    <string nam"
  },
  {
    "path": "android/app/src/main/res/values-night/styles.xml",
    "chars": 995,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <!-- Theme applied to the Android Window while the process is sta"
  },
  {
    "path": "android/app/src/main/res/xml/backup_rules.xml",
    "chars": 62,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<full-backup-content/>\n"
  },
  {
    "path": "android/app/src/main/res/xml/data_extraction_rules.xml",
    "chars": 108,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<data-extraction-rules>\n    <cloud-backup/>\n</data-extraction-rules>\n"
  },
  {
    "path": "android/app/src/main/res/xml/file_path_data.xml",
    "chars": 101,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<paths>\n    <files-path name=\"files\" path=\"./data\"/>\n</paths>\n"
  },
  {
    "path": "android/app/src/main/res/xml/file_paths.xml",
    "chars": 298,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<paths>\n    <external-path name=\"external\" path=\".\"/>\n    <external-files-path na"
  },
  {
    "path": "android/app/src/main/res/xml/network_security_config.xml",
    "chars": 209,
    "preview": "<network-security-config xmlns:tools=\"http://schemas.android.com/tools\">\n    <base-config\n        cleartextTrafficPermit"
  },
  {
    "path": "android/app/src/profile/AndroidManifest.xml",
    "chars": 378,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- The INTERNET permission is required for d"
  },
  {
    "path": "android/build/reports/problems/problems-report.html",
    "chars": 147973,
    "preview": "<!DOCTYPE html>\n\n<html lang=\"en\">\n<head>\n    <!-- Required meta tags -->\n    <meta charset=\"utf-8\">\n    <meta name=\"view"
  },
  {
    "path": "android/build.gradle",
    "chars": 802,
    "preview": "buildscript {\n    ext{\n        kotlin_version = '1.8.0'\n        agp_version = '8.1.4'\n        room_version = '2.6.1'\n   "
  },
  {
    "path": "android/gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Tue Jul 15 12:22:13 CST 2025\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://"
  },
  {
    "path": "android/gradle.properties",
    "chars": 79,
    "preview": "org.gradle.jvmargs=-Xmx4G\nandroid.useAndroidX=true\nandroid.enableJetifier=true\n"
  },
  {
    "path": "android/settings.gradle",
    "chars": 836,
    "preview": "pluginManagement {\n    def flutterSdkPath = {\n        def properties = new Properties()\n        file(\"local.properties\")"
  },
  {
    "path": "android/utils/.gitignore",
    "chars": 12,
    "preview": "/build\n/.cxx"
  },
  {
    "path": "android/utils/build.gradle",
    "chars": 771,
    "preview": "plugins {\n    id(\"com.android.library\")\n    id(\"kotlin-android\")\n}\n\nandroid {\n    namespace \"com.openlist.utils\"\n    com"
  },
  {
    "path": "android/utils/consumer-rules.pro",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "android/utils/proguard-rules.pro",
    "chars": 750,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "android/utils/src/androidTest/java/com/github/jing332/utils/ExampleInstrumentedTest.kt",
    "chars": 668,
    "preview": "package com.openlist.utils\n\nimport androidx.test.platform.app.InstrumentationRegistry\nimport androidx.test.ext.junit.run"
  },
  {
    "path": "android/utils/src/main/AndroidManifest.xml",
    "chars": 121,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n</manifest"
  },
  {
    "path": "android/utils/src/main/cpp/CMakeLists.txt",
    "chars": 1830,
    "preview": "# For more information about using CMake with Android Studio, read the\n# documentation: https://d.android.com/studio/pro"
  },
  {
    "path": "android/utils/src/main/cpp/utils.cpp",
    "chars": 1703,
    "preview": "#include <jni.h>\n#include <string>\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <arpa/inet.h>\n#include <string.h>\n#i"
  },
  {
    "path": "android/utils/src/main/java/com/github/jing332/utils/NativeLib.kt",
    "chars": 141,
    "preview": "package com.openlist.utils\n\nobject NativeLib {\n    external fun getLocalIp(): String\n\n    init {\n        System.loadLibr"
  },
  {
    "path": "android/utils/src/test/java/com/github/jing332/utils/ExampleUnitTest.kt",
    "chars": 342,
    "preview": "package com.openlist.utils\n\nimport org.junit.Test\n\nimport org.junit.Assert.*\n\n/**\n * Example local unit test, which will"
  },
  {
    "path": "ios/.gitignore",
    "chars": 569,
    "preview": "**/dgph\n*.mode1v3\n*.mode2v3\n*.moved-aside\n*.pbxuser\n*.perspectivev3\n**/*sync/\n.sconsign.dblite\n.tags*\n**/.vagrant/\n**/De"
  },
  {
    "path": "ios/Flutter/AppFrameworkInfo.plist",
    "chars": 774,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "ios/Flutter/Debug.xcconfig",
    "chars": 30,
    "preview": "#include \"Generated.xcconfig\"\n"
  },
  {
    "path": "ios/Flutter/Release.xcconfig",
    "chars": 30,
    "preview": "#include \"Generated.xcconfig\"\n"
  },
  {
    "path": "ios/Podfile",
    "chars": 3236,
    "preview": "# Uncomment this line to define a global platform for your project\nplatform :ios, '12.0'\n\n# CocoaPods analytics sends ne"
  },
  {
    "path": "ios/README_iOS_CONFIG.md",
    "chars": 3193,
    "preview": "# iOS特定配置指南\n\n## 1. 应用图标配置\n\n### 自动生成图标(推荐)\n使用提供的Python脚本自动从Logo文件夹生成所有所需尺寸的iOS图标:\n\n```bash\n# 在项目根目录运行\npython ios/scripts/"
  },
  {
    "path": "ios/Runner/AppDelegate.swift",
    "chars": 3538,
    "preview": "import Flutter\nimport UIKit\n\n@main\n@objc class AppDelegate: FlutterAppDelegate {\n  var eventAPI: Event?\n  private var ba"
  },
  {
    "path": "ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 2519,
    "preview": "{\n  \"images\" : [\n    {\n      \"size\" : \"20x20\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-20x20@2x.png\",\n   "
  },
  {
    "path": "ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json",
    "chars": 391,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchImage.png\",\n      \"scale\" : \"1x\"\n    },\n  "
  },
  {
    "path": "ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md",
    "chars": 336,
    "preview": "# Launch Screen Assets\n\nYou can customize the launch screen with your own desired assets by replacing the image files in"
  },
  {
    "path": "ios/Runner/Base.lproj/LaunchScreen.storyboard",
    "chars": 2377,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
  },
  {
    "path": "ios/Runner/Base.lproj/Main.storyboard",
    "chars": 1605,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
  },
  {
    "path": "ios/Runner/Bridges/AppConfigBridge.swift",
    "chars": 4468,
    "preview": "import Flutter\nimport Foundation\n\n/// Bridge implementation for App Configuration APIs\nclass AppConfigBridge: NSObject, "
  },
  {
    "path": "ios/Runner/Bridges/AppStoreUpdateBridge.swift",
    "chars": 3752,
    "preview": "import Foundation\nimport StoreKit\nimport UIKit\nimport Flutter\n\nfinal class AppStoreUpdateBridge: NSObject, SKStoreProduc"
  },
  {
    "path": "ios/Runner/Bridges/CommonBridge.swift",
    "chars": 4541,
    "preview": "import Flutter\nimport Foundation\nimport UIKit\n\n/// Bridge implementation for common native APIs\nclass CommonBridge: NSOb"
  },
  {
    "path": "ios/Runner/Bridges/OpenListBridge.swift",
    "chars": 1555,
    "preview": "import Flutter\nimport Foundation\n\n/// Bridge implementation for Android-specific APIs (iOS equivalent)\nclass OpenListBri"
  },
  {
    "path": "ios/Runner/Info.plist",
    "chars": 3292,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "ios/Runner/OpenListManager.swift",
    "chars": 7692,
    "preview": "import Foundation\nimport Openlistlib\n\n/// Manages OpenList core server lifecycle\nclass OpenListManager: NSObject {\n    s"
  },
  {
    "path": "ios/Runner/PigeonApi.swift",
    "chars": 21889,
    "preview": "// Autogenerated from Pigeon (v26.0.2), do not edit directly.\n// See also: https://pub.dev/packages/pigeon\n\nimport Found"
  },
  {
    "path": "ios/Runner/Runner-Bridging-Header.h",
    "chars": 38,
    "preview": "#import \"GeneratedPluginRegistrant.h\"\n"
  },
  {
    "path": "ios/Runner.xcodeproj/project.pbxproj",
    "chars": 26544,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 54;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 135,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef"
  },
  {
    "path": "ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "chars": 238,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings",
    "chars": 226,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme",
    "chars": 3833,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1510\"\n   version = \"1.3\">\n   <BuildAction\n      "
  },
  {
    "path": "ios/Runner.xcworkspace/contents.xcworkspacedata",
    "chars": 152,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:Runner.xcodepr"
  },
  {
    "path": "ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "chars": 238,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings",
    "chars": 226,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "ios/RunnerTests/RunnerTests.swift",
    "chars": 285,
    "preview": "import Flutter\nimport UIKit\nimport XCTest\n\nclass RunnerTests: XCTestCase {\n\n  func testExample() {\n    // If you add cod"
  },
  {
    "path": "ios/scripts/generate_ios_icons.py",
    "chars": 3330,
    "preview": "#!/usr/bin/env python3\n\"\"\"\niOS App Icon Generator\nGenerates all required iOS app icon sizes from source PNG files\n\"\"\"\n\ni"
  },
  {
    "path": "lib/contant/log_level.dart",
    "chars": 1150,
    "preview": "import 'dart:ui';\n\nclass LogLevel {\n  static const int panic = 0;\n  static const int fatal = 1;\n  static const int error"
  },
  {
    "path": "lib/contant/native_bridge.dart",
    "chars": 206,
    "preview": "import 'package:openlist_mobile/generated_api.dart';\n\nclass NativeBridge {\n  static NativeCommon common = NativeCommon()"
  },
  {
    "path": "lib/generated/intl/messages_all.dart",
    "chars": 2282,
    "preview": "// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart\n// This is a library that looks up messa"
  },
  {
    "path": "lib/generated/intl/messages_en.dart",
    "chars": 25877,
    "preview": "// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart\n// This is a library that provides messa"
  },
  {
    "path": "lib/generated/intl/messages_zh.dart",
    "chars": 20342,
    "preview": "// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart\n// This is a library that provides messa"
  },
  {
    "path": "lib/generated/l10n.dart",
    "chars": 42257,
    "preview": "// GENERATED CODE - DO NOT MODIFY BY HAND\nimport 'package:flutter/material.dart';\nimport 'package:intl/intl.dart';\nimpor"
  },
  {
    "path": "lib/generated_api.dart",
    "chars": 33431,
    "preview": "// Autogenerated from Pigeon (v26.0.2), do not edit directly.\n// See also: https://pub.dev/packages/pigeon\n// ignore_for"
  },
  {
    "path": "lib/l10n/intl_en.arb",
    "chars": 19121,
    "preview": "{\n  \"@@locale\": \"en\",\n  \"appName\": \"OpenList\",\n  \"desktopShortcut\": \"Desktop shortcut\",\n  \"setAdminPassword\": \"Set Admin"
  },
  {
    "path": "lib/l10n/intl_zh.arb",
    "chars": 14513,
    "preview": "{\n  \"@@locale\": \"zh\",\n  \"appName\": \"OpenList\",\n  \"desktopShortcut\": \"桌面快捷方式\",\n  \"setAdminPassword\": \"设置Admin密码\",\n  \"more"
  },
  {
    "path": "lib/main.dart",
    "chars": 6241,
    "preview": "import 'package:openlist_mobile/generated/l10n.dart';\nimport 'package:openlist_mobile/pages/openlist/openlist.dart';\nimp"
  },
  {
    "path": "lib/pages/app_update_dialog.dart",
    "chars": 6041,
    "preview": "import 'package:flutter/material.dart';\nimport 'dart:io' show Platform;\nimport 'package:flutter_smooth_markdown/flutter_"
  },
  {
    "path": "lib/pages/download_manager_page.dart",
    "chars": 29481,
    "preview": "import 'dart:io';\nimport 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport 'package:open_filex/open"
  },
  {
    "path": "lib/pages/openlist/about_dialog.dart",
    "chars": 6128,
    "preview": "import 'dart:ffi';\n\nimport 'package:openlist_mobile/contant/native_bridge.dart';\nimport 'package:flutter/material.dart';"
  },
  {
    "path": "lib/pages/openlist/config_editor_page.dart",
    "chars": 15203,
    "preview": "import 'dart:io';\nimport 'dart:async';\nimport 'dart:convert';\nimport 'package:flutter/material.dart';\nimport 'package:fl"
  },
  {
    "path": "lib/pages/openlist/log_level_view.dart",
    "chars": 529,
    "preview": "import 'package:flutter/cupertino.dart';\n\nimport '../../contant/log_level.dart';\n\nclass LogLevelView extends StatefulWid"
  },
  {
    "path": "lib/pages/openlist/log_list_view.dart",
    "chars": 1012,
    "preview": "import 'package:openlist_mobile/pages/openlist/log_level_view.dart';\nimport 'package:flutter/material.dart';\n\nclass Log "
  },
  {
    "path": "lib/pages/openlist/openlist.dart",
    "chars": 6537,
    "preview": "import 'dart:io';\nimport 'package:openlist_mobile/generated_api.dart';\nimport 'package:openlist_mobile/pages/openlist/ab"
  },
  {
    "path": "lib/pages/openlist/pwd_edit_dialog.dart",
    "chars": 1352,
    "preview": "import 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport '../../generated/l10n.dart';\n\nclass PwdEdi"
  },
  {
    "path": "lib/pages/settings/preference_widgets.dart",
    "chars": 1769,
    "preview": "import 'package:flutter/material.dart';\n\nclass DividerPreference extends StatelessWidget {\n  const DividerPreference({su"
  },
  {
    "path": "lib/pages/settings/settings.dart",
    "chars": 10358,
    "preview": "import 'dart:io';\nimport 'package:openlist_mobile/contant/native_bridge.dart';\nimport 'package:openlist_mobile/generated"
  },
  {
    "path": "lib/pages/settings/troubleshooting_page.dart",
    "chars": 2043,
    "preview": "import 'package:flutter/material.dart';\nimport '../../generated/l10n.dart';\n\nclass TroubleshootingPage extends Stateless"
  },
  {
    "path": "lib/pages/web/web.dart",
    "chars": 11334,
    "preview": "import 'dart:developer';\nimport 'dart:io' show Platform;\n\nimport 'package:openlist_mobile/contant/native_bridge.dart';\ni"
  },
  {
    "path": "lib/utils/app_store_update.dart",
    "chars": 383,
    "preview": "import 'dart:io';\n\nimport 'package:flutter/services.dart';\n\nclass AppStoreUpdate {\n  static const MethodChannel _channel"
  },
  {
    "path": "lib/utils/download_examples.dart",
    "chars": 7436,
    "preview": "import 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport 'download_manager.dart';\nimport '../genera"
  },
  {
    "path": "lib/utils/download_manager.dart",
    "chars": 17718,
    "preview": "import 'dart:io';\nimport 'dart:developer';\nimport 'package:dio/dio.dart';\nimport 'package:path_provider/path_provider.da"
  },
  {
    "path": "lib/utils/download_test.dart",
    "chars": 4118,
    "preview": "import 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport 'download_manager.dart';\nimport '../genera"
  },
  {
    "path": "lib/utils/intent_utils.dart",
    "chars": 195,
    "preview": "import 'package:android_intent_plus/android_intent.dart';\n\nclass IntentUtils {\n  static AndroidIntent getUrlIntent(Strin"
  },
  {
    "path": "lib/utils/language_controller.dart",
    "chars": 3719,
    "preview": "import 'package:flutter/material.dart';\nimport 'package:get/get.dart';\nimport 'package:openlist_mobile/utils/language_ma"
  },
  {
    "path": "lib/utils/language_manager.dart",
    "chars": 2555,
    "preview": "import 'package:flutter/material.dart';\nimport 'package:shared_preferences/shared_preferences.dart';\n\nclass LanguageMana"
  },
  {
    "path": "lib/utils/notification_manager.dart",
    "chars": 9666,
    "preview": "import 'dart:io';\nimport 'dart:developer';\nimport 'package:flutter_local_notifications/flutter_local_notifications.dart'"
  },
  {
    "path": "lib/utils/service_manager.dart",
    "chars": 6817,
    "preview": "import 'dart:async';\nimport 'dart:io';\nimport 'package:flutter/services.dart';\nimport 'package:flutter/foundation.dart';"
  },
  {
    "path": "lib/utils/update_checker.dart",
    "chars": 2147,
    "preview": "import 'dart:convert';\nimport 'dart:core';\nimport 'dart:developer';\nimport 'dart:io';\n\nimport 'package:openlist_mobile/c"
  },
  {
    "path": "lib/widgets/switch_floating_action_button.dart",
    "chars": 1657,
    "preview": "import 'package:flutter/material.dart';\n\nclass SwitchFloatingButton extends StatefulWidget {\n  final bool isSwitch;\n  fi"
  },
  {
    "path": "openlist-lib/openlistlib/common.go",
    "chars": 387,
    "preview": "package openlistlib\n\nimport \"net\"\n\nfunc GetOutboundIP() (net.IP, error) {\n\tconn, err := net.Dial(\"udp\", \"8.8.8.8:80\")\n\ti"
  },
  {
    "path": "openlist-lib/openlistlib/internal/log.go",
    "chars": 233,
    "preview": "package internal\n\nimport log \"github.com/sirupsen/logrus\"\n\ntype MyFormatter struct {\n\tlog.Formatter\n\tOnLog func(entry *l"
  },
  {
    "path": "openlist-lib/openlistlib/server.go",
    "chars": 2720,
    "preview": "package openlistlib\n\nimport (\n\t\"errors\"\n\t\"time\"\n\n\t\"github.com/OpenListTeam/OpenList/v4/internal/bootstrap\"\n\t\"github.com/"
  },
  {
    "path": "openlist-lib/openlistlib/settings.go",
    "chars": 894,
    "preview": "package openlistlib\n\nimport (\n\t\"github.com/OpenListTeam/OpenList/v4/cmd\"\n\t\"github.com/OpenListTeam/OpenList/v4/cmd/flags"
  },
  {
    "path": "openlist-lib/scripts/clear.sh",
    "chars": 161,
    "preview": "#!/bin/bash\n\nmkdir /tmp/openlist\nrm -rf /tmp/openlist/*\ncp -r ../scripts /tmp/openlist\ncp -r ../openlistlib /tmp/openlis"
  },
  {
    "path": "openlist-lib/scripts/fix_ios_dependencies.sh",
    "chars": 5439,
    "preview": "#!/bin/bash\n\necho \"Fixing iOS incompatible dependencies by patching rclone source...\"\n\n# Find the module root\nif [ -f go"
  },
  {
    "path": "openlist-lib/scripts/gobind.sh",
    "chars": 2696,
    "preview": "#!/bin/bash\n\n# Build version information\nbuiltAt=\"${OPENLIST_BUILT_AT:-$(date +'%F %T %z')}\"\ngitAuthor=\"${OPENLIST_GIT_A"
  },
  {
    "path": "openlist-lib/scripts/gobind_ios.sh",
    "chars": 7459,
    "preview": "#!/bin/bash\n\n# Build version information\nbuiltAt=\"${OPENLIST_BUILT_AT:-$(date +'%F %T %z')}\"\ngitAuthor=\"${OPENLIST_GIT_A"
  },
  {
    "path": "openlist-lib/scripts/init_gomobile.sh",
    "chars": 1120,
    "preview": "#!/bin/bash\n\necho \"Installing gomobile and dependencies...\"\n\n# Install gomobile command\necho \"Installing gomobile comman"
  },
  {
    "path": "openlist-lib/scripts/init_openlist.sh",
    "chars": 1027,
    "preview": "#!/bin/bash\n\nGIT_REPO=\"https://github.com/OpenListTeam/OpenList.git\"\nTAG_NAME=$(git -c 'versionsort.suffix=-' ls-remote "
  },
  {
    "path": "openlist-lib/scripts/init_web.sh",
    "chars": 6041,
    "preview": "#!/bin/bash\n\necho \"Initializing Web assets...\"\n\nmkdir -p dist\n\n# Function to fetch release info with retries and proxy f"
  },
  {
    "path": "openlist-lib/scripts/init_web_ios.sh",
    "chars": 7440,
    "preview": "#!/bin/bash\n\necho \"Initializing Web assets for iOS build...\"\n\n# Create dist directory\nmkdir -p dist\n\n# Use a more reliab"
  },
  {
    "path": "openlist_version",
    "chars": 7,
    "preview": "v4.2.1\n"
  },
  {
    "path": "pigeon_config.yaml",
    "chars": 328,
    "preview": "# Pigeon configuration for OpenList Mobile\n# Generate platform-specific API code from Dart definitions\n\ninput: pigeons/p"
  },
  {
    "path": "pigeons/pigeon.dart",
    "chars": 1151,
    "preview": "import 'package:pigeon/pigeon.dart';\n\n@HostApi()\nabstract class AppConfig {\n  bool isWakeLockEnabled();\n\n  void setWakeL"
  },
  {
    "path": "pigeons/run.cmd",
    "chars": 204,
    "preview": "flutter pub run pigeon --input pigeons/pigeon.dart^\n --dart_out lib/generated_api.dart^\n --java_out android/app/src/main"
  },
  {
    "path": "pubspec.yaml",
    "chars": 4509,
    "preview": "name: openlist_mobile\ndescription: \"OpenList for Android and iOS\"\n# The following line prevents the package from being a"
  },
  {
    "path": "test/widget_test.dart",
    "chars": 1066,
    "preview": "// This is a basic Flutter widget test.\n//\n// To perform an interaction with a widget in your test, use the WidgetTester"
  }
]

About this extraction

This page contains the full source code of the OpenListTeam/OpenList-Mobile GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 164 files (818.7 KB), approximately 229.9k tokens, and a symbol index with 517 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!