Full Code of Yos-X/ClashYou for AI

main 367b3292d3e1 cached
484 files
951.7 KB
250.7k tokens
214 symbols
1 requests
Download .txt
Showing preview only (1,093K chars total). Download the full file or copy to clipboard to get everything.
Repository: Yos-X/ClashYou
Branch: main
Commit: 367b3292d3e1
Files: 484
Total size: 951.7 KB

Directory structure:
gitextract_6w_2unif/

├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 01-bug-report-en.yml
│   │   ├── 02-feature-request-en.yml
│   │   ├── 03-bug-report-zh-cn.yml
│   │   ├── 04-feature-request-zh-cn.yml
│   │   └── config.yml
│   └── workflows/
│       └── build.yaml
├── .gitignore
├── .gitmodules
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── PRIVACY_POLICY.md
├── README.md
├── README_en.md
├── app/
│   ├── build.gradle.kts
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               ├── AccessControlActivity.kt
│           │               ├── ApkBrokenActivity.kt
│           │               ├── AppCrashedActivity.kt
│           │               ├── AppSettingsActivity.kt
│           │               ├── BaseActivity.kt
│           │               ├── ExternalImportActivity.kt
│           │               ├── FilesActivity.kt
│           │               ├── HelpActivity.kt
│           │               ├── LogcatActivity.kt
│           │               ├── LogcatService.kt
│           │               ├── LogsActivity.kt
│           │               ├── MainActivity.kt
│           │               ├── MainApplication.kt
│           │               ├── NetworkSettingsActivity.kt
│           │               ├── NewProfileActivity.kt
│           │               ├── OverrideSettingsActivity.kt
│           │               ├── ProfilesActivity.kt
│           │               ├── PropertiesActivity.kt
│           │               ├── ProvidersActivity.kt
│           │               ├── ProxyActivity.kt
│           │               ├── RestartReceiver.kt
│           │               ├── SettingsActivity.kt
│           │               ├── TileService.kt
│           │               ├── log/
│           │               │   ├── LogcatCache.kt
│           │               │   ├── LogcatFilter.kt
│           │               │   ├── LogcatReader.kt
│           │               │   ├── LogcatWriter.kt
│           │               │   └── SystemLogcat.kt
│           │               ├── remote/
│           │               │   ├── Broadcasts.kt
│           │               │   ├── FilesClient.kt
│           │               │   ├── Remote.kt
│           │               │   ├── Resource.kt
│           │               │   ├── Service.kt
│           │               │   └── StatusClient.kt
│           │               ├── store/
│           │               │   ├── AppStore.kt
│           │               │   └── TipsStore.kt
│           │               └── util/
│           │                   ├── Activity.kt
│           │                   ├── Application.kt
│           │                   ├── Clash.kt
│           │                   ├── Content.kt
│           │                   ├── Files.kt
│           │                   ├── Remote.kt
│           │                   ├── Service.kt
│           │                   └── Uri.kt
│           └── res/
│               ├── drawable/
│               │   └── ic_launcher_foreground.xml
│               ├── mipmap-anydpi-v26/
│               │   ├── ic_launcher.xml
│               │   └── ic_launcher_round.xml
│               ├── values/
│               │   ├── colors.xml
│               │   ├── ids.xml
│               │   └── themes.xml
│               ├── values-night/
│               │   └── themes.xml
│               └── xml/
│                   ├── full_backup_content.xml
│                   └── network_security_config.xml
├── build.gradle.kts
├── common/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               └── common/
│           │                   ├── Global.kt
│           │                   ├── compat/
│           │                   │   ├── App.kt
│           │                   │   ├── Context.kt
│           │                   │   ├── Html.kt
│           │                   │   ├── Intents.kt
│           │                   │   ├── Package.kt
│           │                   │   ├── Resource.kt
│           │                   │   ├── Services.kt
│           │                   │   ├── UI.kt
│           │                   │   └── View.kt
│           │                   ├── constants/
│           │                   │   ├── Authorities.kt
│           │                   │   ├── Components.kt
│           │                   │   ├── Intents.kt
│           │                   │   ├── Metadata.kt
│           │                   │   └── Permissions.kt
│           │                   ├── id/
│           │                   │   └── UndefinedIds.kt
│           │                   ├── log/
│           │                   │   └── Log.kt
│           │                   ├── store/
│           │                   │   ├── Providers.kt
│           │                   │   ├── Store.kt
│           │                   │   └── StoreProvider.kt
│           │                   └── util/
│           │                       ├── Components.kt
│           │                       ├── Global.kt
│           │                       ├── Intent.kt
│           │                       ├── Parcelable.kt
│           │                       ├── Patterns.kt
│           │                       └── Ticker.kt
│           └── res/
│               ├── values/
│               │   └── strings.xml
│               ├── values-zh/
│               │   └── strings.xml
│               └── values-zh-rTW/
│                   └── strings.xml
├── core/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       ├── foss/
│       │   └── golang/
│       │       ├── go.mod
│       │       ├── go.sum
│       │       └── main.go
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── cpp/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── bridge_helper.c
│       │   │   ├── bridge_helper.h
│       │   │   ├── jni_helper.c
│       │   │   ├── jni_helper.h
│       │   │   └── main.c
│       │   ├── golang/
│       │   │   ├── go.mod
│       │   │   ├── go.sum
│       │   │   └── native/
│       │   │       ├── all/
│       │   │       │   └── imports.go
│       │   │       ├── app/
│       │   │       │   ├── app.go
│       │   │       │   ├── content.go
│       │   │       │   ├── dns.go
│       │   │       │   ├── tun.go
│       │   │       │   └── ui.go
│       │   │       ├── app.go
│       │   │       ├── bridge.c
│       │   │       ├── bridge.h
│       │   │       ├── common/
│       │   │       │   └── path.go
│       │   │       ├── config/
│       │   │       │   ├── defaults.go
│       │   │       │   ├── fetch.go
│       │   │       │   ├── load.go
│       │   │       │   ├── override.go
│       │   │       │   ├── process.go
│       │   │       │   ├── process_open.go
│       │   │       │   ├── process_premium.go
│       │   │       │   ├── provider_open.go
│       │   │       │   └── provider_premium.go
│       │   │       ├── config.go
│       │   │       ├── debug.go
│       │   │       ├── delegate/
│       │   │       │   └── init.go
│       │   │       ├── log_open.go
│       │   │       ├── log_premium.go
│       │   │       ├── main.go
│       │   │       ├── platform/
│       │   │       │   ├── limit.go
│       │   │       │   └── procfs.go
│       │   │       ├── proxy/
│       │   │       │   └── http.go
│       │   │       ├── proxy.go
│       │   │       ├── trace.c
│       │   │       ├── trace.h
│       │   │       ├── tun/
│       │   │       │   ├── dns.go
│       │   │       │   ├── metadata_open.go
│       │   │       │   ├── metadata_premium.go
│       │   │       │   ├── tun.go
│       │   │       │   └── udp.go
│       │   │       ├── tun.go
│       │   │       ├── tunnel/
│       │   │       │   ├── conn.go
│       │   │       │   ├── connectivity.go
│       │   │       │   ├── geoip.go
│       │   │       │   ├── init.go
│       │   │       │   ├── loopback_open.go
│       │   │       │   ├── loopback_premium.go
│       │   │       │   ├── providers_open.go
│       │   │       │   ├── providers_premium.go
│       │   │       │   ├── proxies.go
│       │   │       │   ├── state.go
│       │   │       │   ├── statistic.go
│       │   │       │   └── suspend.go
│       │   │       ├── tunnel.go
│       │   │       └── utils.go
│       │   └── java/
│       │       └── com/
│       │           └── github/
│       │               └── kr328/
│       │                   └── clash/
│       │                       └── core/
│       │                           ├── Clash.kt
│       │                           ├── bridge/
│       │                           │   ├── Bridge.kt
│       │                           │   ├── ClashException.kt
│       │                           │   ├── Content.kt
│       │                           │   ├── FetchCallback.kt
│       │                           │   ├── LogcatInterface.kt
│       │                           │   └── TunInterface.kt
│       │                           ├── model/
│       │                           │   ├── ConfigurationOverride.kt
│       │                           │   ├── FetchStatus.kt
│       │                           │   ├── LogMessage.kt
│       │                           │   ├── Provider.kt
│       │                           │   ├── ProviderList.kt
│       │                           │   ├── Proxy.kt
│       │                           │   ├── ProxyGroup.kt
│       │                           │   ├── ProxySort.kt
│       │                           │   ├── Traffic.kt
│       │                           │   ├── TunnelState.kt
│       │                           │   └── UiConfiguration.kt
│       │                           └── util/
│       │                               ├── Net.kt
│       │                               ├── Parcelizer.kt
│       │                               ├── Serializers.kt
│       │                               └── Traffic.kt
│       └── premium/
│           └── golang/
│               ├── go.mod
│               ├── go.sum
│               └── main.go
├── design/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               └── design/
│           │                   ├── AccessControlDesign.kt
│           │                   ├── ApkBrokenDesign.kt
│           │                   ├── AppCrashedDesign.kt
│           │                   ├── AppSettingsDesign.kt
│           │                   ├── Design.kt
│           │                   ├── FilesDesign.kt
│           │                   ├── HelpDesign.kt
│           │                   ├── LogcatDesign.kt
│           │                   ├── LogsDesign.kt
│           │                   ├── MainDesign.kt
│           │                   ├── NetworkSettingsDesign.kt
│           │                   ├── NewProfileDesign.kt
│           │                   ├── OverrideSettingsDesign.kt
│           │                   ├── ProfilesDesign.kt
│           │                   ├── PropertiesDesign.kt
│           │                   ├── ProvidersDesign.kt
│           │                   ├── ProxyDesign.kt
│           │                   ├── SettingsDesign.kt
│           │                   ├── YosConfigAchieve.kt
│           │                   ├── adapter/
│           │                   │   ├── AppAdapter.kt
│           │                   │   ├── EditableTextListAdapter.kt
│           │                   │   ├── EditableTextMapAdapter.kt
│           │                   │   ├── FileAdapter.kt
│           │                   │   ├── LogFileAdapter.kt
│           │                   │   ├── LogMessageAdapter.kt
│           │                   │   ├── PopupListAdapter.kt
│           │                   │   ├── ProfileAdapter.kt
│           │                   │   ├── ProfileProviderAdapter.kt
│           │                   │   ├── ProviderAdapter.kt
│           │                   │   ├── ProxyAdapter.kt
│           │                   │   ├── ProxyPageAdapter.kt
│           │                   │   └── SideloadProviderAdapter.kt
│           │                   ├── component/
│           │                   │   ├── AccessControlMenu.kt
│           │                   │   ├── ProxyMenu.kt
│           │                   │   ├── ProxyPageFactory.kt
│           │                   │   ├── ProxyView.kt
│           │                   │   ├── ProxyViewConfig.kt
│           │                   │   └── ProxyViewState.kt
│           │                   ├── dialog/
│           │                   │   ├── Dialogs.kt
│           │                   │   ├── Input.kt
│           │                   │   └── Progress.kt
│           │                   ├── model/
│           │                   │   ├── AppInfo.kt
│           │                   │   ├── AppInfoSort.kt
│           │                   │   ├── Behavior.kt
│           │                   │   ├── DarkMode.kt
│           │                   │   ├── File.kt
│           │                   │   ├── LogFile.kt
│           │                   │   ├── ProfileProvider.kt
│           │                   │   ├── ProviderState.kt
│           │                   │   ├── ProxyPageState.kt
│           │                   │   └── ProxyState.kt
│           │                   ├── preference/
│           │                   │   ├── Category.kt
│           │                   │   ├── Clickable.kt
│           │                   │   ├── EditableText.kt
│           │                   │   ├── EditableTextList.kt
│           │                   │   ├── EditableTextMap.kt
│           │                   │   ├── Overlay.kt
│           │                   │   ├── Preference.kt
│           │                   │   ├── Screen.kt
│           │                   │   ├── SelectableList.kt
│           │                   │   ├── Switch.kt
│           │                   │   ├── Tips.kt
│           │                   │   └── Value.kt
│           │                   ├── store/
│           │                   │   └── UiStore.kt
│           │                   ├── ui/
│           │                   │   ├── DayNight.kt
│           │                   │   ├── Insets.kt
│           │                   │   ├── ObservableCurrentTime.kt
│           │                   │   ├── Surface.kt
│           │                   │   └── ToastDuration.kt
│           │                   ├── util/
│           │                   │   ├── ActivityBar.kt
│           │                   │   ├── App.kt
│           │                   │   ├── Binding.kt
│           │                   │   ├── Context.kt
│           │                   │   ├── Diff.kt
│           │                   │   ├── Elevation.kt
│           │                   │   ├── I18n.kt
│           │                   │   ├── Inserts.kt
│           │                   │   ├── Interval.kt
│           │                   │   ├── Landscape.kt
│           │                   │   ├── ListView.kt
│           │                   │   ├── RecyclerView.kt
│           │                   │   ├── ScrollView.kt
│           │                   │   ├── Theme.kt
│           │                   │   ├── Toast.kt
│           │                   │   ├── Validator.kt
│           │                   │   └── View.kt
│           │                   └── view/
│           │                       ├── ActionLabel.kt
│           │                       ├── ActionTextField.kt
│           │                       ├── ActivityBarLayout.kt
│           │                       ├── AppRecyclerView.kt
│           │                       ├── LargeActionCard.kt
│           │                       ├── LargeActionLabel.kt
│           │                       ├── ObservableScrollView.kt
│           │                       └── VerticalScrollableHost.kt
│           └── res/
│               ├── drawable/
│               │   ├── bg_bottom_sheet.xml
│               │   ├── ic_baseline_adb.xml
│               │   ├── ic_baseline_add.xml
│               │   ├── ic_baseline_apps.xml
│               │   ├── ic_baseline_arrow_back.xml
│               │   ├── ic_baseline_assignment.xml
│               │   ├── ic_baseline_attach_file.xml
│               │   ├── ic_baseline_brightness_4.xml
│               │   ├── ic_baseline_clear_all.xml
│               │   ├── ic_baseline_close.xml
│               │   ├── ic_baseline_cloud_download.xml
│               │   ├── ic_baseline_content_copy.xml
│               │   ├── ic_baseline_delete.xml
│               │   ├── ic_baseline_dns.xml
│               │   ├── ic_baseline_domain.xml
│               │   ├── ic_baseline_edit.xml
│               │   ├── ic_baseline_extension.xml
│               │   ├── ic_baseline_flash_on.xml
│               │   ├── ic_baseline_get_app.xml
│               │   ├── ic_baseline_help_center.xml
│               │   ├── ic_baseline_info.xml
│               │   ├── ic_baseline_more_vert.xml
│               │   ├── ic_baseline_publish.xml
│               │   ├── ic_baseline_replay.xml
│               │   ├── ic_baseline_restore.xml
│               │   ├── ic_baseline_save.xml
│               │   ├── ic_baseline_search.xml
│               │   ├── ic_baseline_settings.xml
│               │   ├── ic_baseline_stop.xml
│               │   ├── ic_baseline_swap_vert.xml
│               │   ├── ic_baseline_swap_vertical_circle.xml
│               │   ├── ic_baseline_sync.xml
│               │   ├── ic_baseline_update.xml
│               │   ├── ic_baseline_view_list.xml
│               │   ├── ic_baseline_vpn_lock.xml
│               │   ├── ic_baseline_work.xml
│               │   ├── ic_clash.xml
│               │   ├── ic_outline_article.xml
│               │   ├── ic_outline_check_circle.xml
│               │   ├── ic_outline_delete.xml
│               │   ├── ic_outline_folder.xml
│               │   ├── ic_outline_inbox.xml
│               │   ├── ic_outline_info.xml
│               │   ├── ic_outline_label.xml
│               │   ├── ic_outline_not_interested.xml
│               │   ├── ic_outline_update.xml
│               │   ├── yos_shape.xml
│               │   └── yos_shape_color.xml
│               ├── layout/
│               │   ├── adapter_app.xml
│               │   ├── adapter_editable_text_list.xml
│               │   ├── adapter_editable_text_map.xml
│               │   ├── adapter_file.xml
│               │   ├── adapter_log_message.xml
│               │   ├── adapter_profile.xml
│               │   ├── adapter_profile_provider.xml
│               │   ├── adapter_provider.xml
│               │   ├── adapter_sideload_provider.xml
│               │   ├── common_activity_bar.xml
│               │   ├── common_recycler_list.xml
│               │   ├── component_action_label.xml
│               │   ├── component_action_text_field.xml
│               │   ├── component_large_action_label.xml
│               │   ├── design_about.xml
│               │   ├── design_access_control.xml
│               │   ├── design_app_crashed.xml
│               │   ├── design_files.xml
│               │   ├── design_logcat.xml
│               │   ├── design_logs.xml
│               │   ├── design_main.xml
│               │   ├── design_new_profile.xml
│               │   ├── design_profiles.xml
│               │   ├── design_properties.xml
│               │   ├── design_providers.xml
│               │   ├── design_proxy.xml
│               │   ├── design_settings.xml
│               │   ├── design_settings_common.xml
│               │   ├── design_settings_overide.xml
│               │   ├── dialog_editable_map_text_field.xml
│               │   ├── dialog_fetch_status.xml
│               │   ├── dialog_files_menu.xml
│               │   ├── dialog_preference_list.xml
│               │   ├── dialog_profiles_menu.xml
│               │   ├── dialog_search.xml
│               │   ├── dialog_text_field.xml
│               │   ├── preference_category.xml
│               │   ├── preference_clickable.xml
│               │   ├── preference_switch.xml
│               │   └── preference_tips.xml
│               ├── menu/
│               │   ├── menu_access_control.xml
│               │   └── menu_proxy.xml
│               ├── values/
│               │   ├── attrs.xml
│               │   ├── colors.xml
│               │   ├── dimens.xml
│               │   ├── ids.xml
│               │   ├── strings.xml
│               │   ├── styles.xml
│               │   └── themes.xml
│               ├── values-v23/
│               │   └── themes.xml
│               ├── values-v27/
│               │   └── themes.xml
│               ├── values-v29/
│               │   └── themes.xml
│               ├── values-v31/
│               │   └── colors.xml
│               ├── values-v34/
│               │   └── colors.xml
│               ├── values-zh/
│               │   └── strings.xml
│               ├── values-zh-rHK/
│               │   └── strings.xml
│               └── values-zh-rTW/
│                   └── strings.xml
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hideapi/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── android/
│                   └── app/
│                       └── ActivityThread.java
├── service/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               └── service/
│           │                   ├── BaseService.kt
│           │                   ├── ClashManager.kt
│           │                   ├── ClashService.kt
│           │                   ├── FilesProvider.kt
│           │                   ├── PreferenceProvider.kt
│           │                   ├── ProfileManager.kt
│           │                   ├── ProfileProcessor.kt
│           │                   ├── ProfileReceiver.kt
│           │                   ├── ProfileWorker.kt
│           │                   ├── RemoteService.kt
│           │                   ├── StatusProvider.kt
│           │                   ├── TunService.kt
│           │                   ├── clash/
│           │                   │   ├── ClashRuntime.kt
│           │                   │   └── module/
│           │                   │       ├── AppListCacheModule.kt
│           │                   │       ├── CloseModule.kt
│           │                   │       ├── ConfigurationModule.kt
│           │                   │       ├── DynamicNotificationModule.kt
│           │                   │       ├── Module.kt
│           │                   │       ├── NetworkObserveModule.kt
│           │                   │       ├── SideloadDatabaseModule.kt
│           │                   │       ├── StaticNotificationModule.kt
│           │                   │       ├── SuspendModule.kt
│           │                   │       ├── TimeZoneModule.kt
│           │                   │       └── TunModule.kt
│           │                   ├── data/
│           │                   │   ├── Converters.kt
│           │                   │   ├── Daos.kt
│           │                   │   ├── Database.kt
│           │                   │   ├── Imported.kt
│           │                   │   ├── ImportedDao.kt
│           │                   │   ├── Pending.kt
│           │                   │   ├── PendingDao.kt
│           │                   │   ├── ProviderMoreInfo.kt
│           │                   │   ├── ProviderMoreInfoDao.kt
│           │                   │   ├── Selection.kt
│           │                   │   ├── SelectionDao.kt
│           │                   │   └── migrations/
│           │                   │       ├── LegacyMigration.kt
│           │                   │       └── Migrations.kt
│           │                   ├── document/
│           │                   │   ├── Document.kt
│           │                   │   ├── FileDocument.kt
│           │                   │   ├── Flag.kt
│           │                   │   ├── Path.kt
│           │                   │   ├── Paths.kt
│           │                   │   ├── Picker.kt
│           │                   │   └── VirtualDocument.kt
│           │                   ├── model/
│           │                   │   ├── AccessControlMode.kt
│           │                   │   └── Profile.kt
│           │                   ├── remote/
│           │                   │   ├── IClashManager.kt
│           │                   │   ├── IFetchObserver.kt
│           │                   │   ├── ILogObserver.kt
│           │                   │   ├── IProfileManager.kt
│           │                   │   └── IRemoteService.kt
│           │                   ├── sideload/
│           │                   │   └── ExternalGeoip.kt
│           │                   ├── store/
│           │                   │   └── ServiceStore.kt
│           │                   └── util/
│           │                       ├── Address.kt
│           │                       ├── Broadcast.kt
│           │                       ├── Connectivity.kt
│           │                       ├── Coroutine.kt
│           │                       ├── Database.kt
│           │                       ├── Files.kt
│           │                       ├── Intent.kt
│           │                       ├── Net.kt
│           │                       └── Serializers.kt
│           └── res/
│               ├── drawable/
│               │   └── ic_logo_service.xml
│               ├── values/
│               │   ├── arrays.xml
│               │   ├── colors.xml
│               │   ├── ids.xml
│               │   └── strings.xml
│               ├── values-zh/
│               │   └── strings.xml
│               ├── values-zh-rHK/
│               │   └── strings.xml
│               └── values-zh-rTW/
│                   └── strings.xml
└── settings.gradle.kts

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

================================================
FILE: .gitattributes
================================================
* text=auto eol=lf

*.bat text eol=crlf
*.jar binary


================================================
FILE: .github/ISSUE_TEMPLATE/01-bug-report-en.yml
================================================
name: "[English] Bug Report"
description: "Create a report to help us debug bugs"
title: "[BUG] "
body:
  - type: markdown
    attributes:
      value: |
        Thanks for taking the time to fill out this bug report!

        NOTE: Be sure to put a clear and concise title **AFTER** `[BUG]` in the text box above.

        NOTE: We do not provide any services such as proxies, DO NOT feedback any problems not caused by this application here.

        <!-- template -->
  - type: textarea
    id: description
    attributes:
      label: "Describe the bug"
      description: "A clear and concise description of what the bug is."
    validations:
      required: true
  - type: textarea
    id: reproduce
    attributes:
      label: "To Reproduce"
      description: "Steps to reproduce the behavior:"
      value: |
        Step 1: ...
        Step 2: ...
        Step 3: ...
        ...
    validations:
      required: true
  - type: textarea
    id: device-info
    attributes:
      label: "Device Info"
      description: |
        Input your device information.

        Example:
        - Device: Pixel 4
        - ROM: AOSP
        - Android Version: 10
      value: |
        - Device:
        - ROM:
        - Android Version:
    validations:
      required: true
  - type: textarea
    id: app-info
    attributes:
      label: "Application Info"
      description: |
        Input application you are using information.

        Example:
        ```
        - Version: 2.5.4-premium
        - APK filename: cfa-2.5.4-premium-arm64-v8a-release.apk
        - Distribution Channel: Google Play
        ```
      value: |
        - Version:
        - APK filename:
        - Distribution Channel:
    validations:
      required: true
  - type: textarea
    id: configure
    attributes:
      render: yml
      label: "Configure File"
      description: |
        Please paste or upload the configuration file here.

        TIPS: If you only have a subscription link, please use your browser to download it.

        **NOTE: Please remove proxies from the configuration file before uploading it.**
        **NOTE: Please remove proxies from the configuration file before uploading it.**
        **NOTE: Please remove proxies from the configuration file before uploading it.**
    validations:
      required: true
  - type: textarea
    id: logs
    attributes:
      render: raw
      label: "Logs"
      description: |
        Please paste or upload the log file here.

        TIPS: Please use the `Logcat` in application or `adb logcat`. `adb logcat` would be better.
    validations:
      required: true
  - type: textarea
    id: screenshot
    attributes:
      label: "Screenshot"
      description: "If applicable, add screenshots to help explain your problem."
      placeholder: "Optional"
  - type: textarea
    id: additional
    attributes:
      label: "Additional"
      description: "Add any other context about the problem here."


================================================
FILE: .github/ISSUE_TEMPLATE/02-feature-request-en.yml
================================================
name: "[English] Feature Request"
description: "Create a report to help us improve"
title: "[Feature Request] "
body:
  - type: markdown
    attributes:
      value: |
        Thanks for taking the time to fill out this feature request!

        NOTE: Be sure to put a clear and concise title **AFTER** `[Feature Request]` in the text box above.

        <!-- template -->
  - type: textarea
    id: "description"
    attributes:
      label: "Feature Description"
      description: |
        A clear and concise description of the feature.
    validations:
      required: true
  - type: textarea
    id: "additional"
    attributes:
      label: "Additional"
      description: |
        Add any other context or screenshots about the feature request here.


================================================
FILE: .github/ISSUE_TEMPLATE/03-bug-report-zh-cn.yml
================================================
name: "[简体中文] 错误报告"
description: "创建错误报告以帮助我们修正应用"
title: "[BUG] "
body:
  - type: markdown
    attributes:
      value: |
        感谢您在百忙之中填写此错误报告。

        注意: 请务必在上方文本框的 `[BUG]` **之后**填写清晰明了的标题。

        注意:这里不提供像是代理服务器之类的服务,请不要反馈非应用自身引起的问题。

        <!-- template -->
  - type: textarea
    id: description
    attributes:
      label: "描述此错误"
      description: "请清晰简洁的描述你遇到的错误。"
    validations:
      required: true
  - type: textarea
    id: reproduce
    attributes:
      label: "如何复现该错误"
      description: "复现步骤:"
      value: |
        步骤 1: ...
        步骤 2: ...
        步骤 3: ...
        ...
    validations:
      required: true
  - type: textarea
    id: device-info
    attributes:
      label: "设备信息"
      description: |
        输入您正在使用的设备信息。

        例子:
        - 机型: Pixel 4
        - 系统类型: MIUI/AOSP
        - Android 版本: 10
      value: |
        - 机型:
        - 系统类型:
        - Android 版本:
    validations:
      required: true
  - type: textarea
    id: app-info
    attributes:
      label: "应用信息"
      description: |
        输入您正在使用的应用信息。

        例子:
        ```
        - 版本: 2.5.4-premium
        - 安装包文件名: cfa-2.5.4-premium-arm64-v8a-release.apk
        - 应用来源: Google Play
        ```
      value: |
        - 版本:
        - 安装包文件名:
        - 应用来源:
    validations:
      required: true
  - type: textarea
    id: configure
    attributes:
      render: yml
      label: "配置文件"
      description: |
        请在此粘贴和上传配置文件。

        提示:如果您仅有一个订阅链接,请使用浏览器打开此链接以下载配置文件。

        **注意: 请在上传配置文件前,移除其中的代理服务器信息。**
        **注意: 请在上传配置文件前,移除其中的代理服务器信息。**
        **注意: 请在上传配置文件前,移除其中的代理服务器信息。**
    validations:
      required: true
  - type: textarea
    id: logs
    attributes:
      render: raw
      label: "日志"
      description: |
        请在此粘贴或上传日志。

        提示: 请使用应用内的 `Logcat` 或 `adb logcat` 捕获日志. `adb logcat` 能更好地帮助侦测问题.
    validations:
      required: true
  - type: textarea
    id: screenshot
    attributes:
      label: "屏幕截图"
      description: "如果适用,请在此粘贴或上传屏幕截图。"
      placeholder: "可选"
  - type: textarea
    id: additional
    attributes:
      label: "附加信息"
      description: "其他的可能与改错误相关的信息。"
      placeholder: "可选"


================================================
FILE: .github/ISSUE_TEMPLATE/04-feature-request-zh-cn.yml
================================================
name: "[简体中文] 功能请求"
description: "您希望的能够在应用中增加功能"
title: "[Feature Request] "
body:
  - type: markdown
    attributes:
      value: |
        感谢您在百忙之中填写此功能请求报告。

        注意: 请务必在上方文本框的 `[Feature Request]` **之后**填写清晰明了的标题。

        <!-- template -->
  - type: textarea
    id: "description"
    attributes:
      label: "功能描述"
      description: |
        简介明了的描述此功能。
    validations:
      required: true
  - type: textarea
    id: "additional"
    attributes:
      label: "附加信息"
      description: |
        与此功能相关的其他附加信息。


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false


================================================
FILE: .github/workflows/build.yaml
================================================
name: Android CI
on:
  push:
    branches:
      - main
    paths-ignore:
      # - '.github/**'
      - '.idea/**'
      - '.gitattributes'
      - '.gitignore'
      - '.gitmodules'
      - '**.md'
      - 'LICENSE'
      - 'NOTICE'
  pull_request:
    paths-ignore:
      # - '.github/**'
      - '.idea/**'
      - '.gitattributes'
      - '.gitignore'
      - '.gitmodules'
      - '**.md'
      - 'LICENSE'
      - 'NOTICE'
  workflow_dispatch:

jobs:
  Build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3
        with:
          submodules: recursive

      - name: Setup Java
        uses: actions/setup-java@v3
        with:
          distribution: 'oracle'
          java-version: 17

      - name: Setup Go
        uses: actions/setup-go@v3
        with:
          go-version: 'stable'

      - name: Cache Go Files
        uses: actions/cache@v3
        with:
          path: |
            ~/.cache/go-build
            ~/go/pkg/mod
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-

      - name: Setup Gradle
        uses: gradle/gradle-build-action@v2
        # with:
          # arguments: --no-daemon assemble

      - name: Create Sign File
        run: |
          echo ${{ secrets.SIGNING_KEY }} | base64 -d > keystore.jks
          echo ${{ secrets.SIGNING_PROPERTIES }} | base64 -d > signing.properties

      - name: Build with Gradle
        run: |
          ./gradlew --no-daemon assemble

      - name: Find APKs
        run: |
          echo "APK_FILE_RELEASE_ARM32=$(find app/build/outputs/apk/foss/release -name '*armeabi-v7a*')" >> $GITHUB_ENV
          echo "APK_FILE_RELEASE_ARM64=$(find app/build/outputs/apk/foss/release -name '*arm64-v8a*')" >> $GITHUB_ENV
          echo "APK_FILE_RELEASE_X86=$(find app/build/outputs/apk/foss/release -name '*x86-*')" >> $GITHUB_ENV
          echo "APK_FILE_RELEASE_X64=$(find app/build/outputs/apk/foss/release -name '*x86_64*')" >> $GITHUB_ENV
          echo "APK_FILE_RELEASE_UNIVERSAL=$(find app/build/outputs/apk/foss/release -name '*universal*')" >> $GITHUB_ENV
          echo "APK_FILE_DEBUG_ARM32=$(find app/build/outputs/apk/foss/debug -name '*armeabi-v7a*')" >> $GITHUB_ENV
          echo "APK_FILE_DEBUG_ARM64=$(find app/build/outputs/apk/foss/debug -name '*arm64-v8a*')" >> $GITHUB_ENV
          echo "APK_FILE_DEBUG_X86=$(find app/build/outputs/apk/foss/debug -name '*x86-*')" >> $GITHUB_ENV
          echo "APK_FILE_DEBUG_X64=$(find app/build/outputs/apk/foss/debug -name '*x86_64*')" >> $GITHUB_ENV
          echo "APK_FILE_DEBUG_UNIVERSAL=$(find app/build/outputs/apk/foss/debug -name '*universal*')" >> $GITHUB_ENV

      - name: Show Artifacts SHA256
        run: |
          echo "### Build Success" >> $GITHUB_STEP_SUMMARY
          echo "|Artifact|SHA256|" >> $GITHUB_STEP_SUMMARY
          echo "|:--------:|:----------|" >> $GITHUB_STEP_SUMMARY
          # Release Artifacts
          release_arm32=($(sha256sum ${{ env.APK_FILE_RELEASE_ARM32 }}))
          echo "|release_armeabi-v7a|$release_arm32" >> $GITHUB_STEP_SUMMARY
          release_arm64=($(sha256sum ${{ env.APK_FILE_RELEASE_ARM64 }}))
          echo "|release_arm64-v8a|$release_arm64" >> $GITHUB_STEP_SUMMARY
          release_x86=($(sha256sum ${{ env.APK_FILE_RELEASE_X86 }}))
          echo "|release_x86|$release_x86" >> $GITHUB_STEP_SUMMARY
          release_x64=($(sha256sum ${{ env.APK_FILE_RELEASE_X64 }}))
          echo "|release_x86_64|$release_x64" >> $GITHUB_STEP_SUMMARY
          release_universal=($(sha256sum ${{ env.APK_FILE_RELEASE_UNIVERSAL }}))
          echo "|release_universal|$release_universal" >> $GITHUB_STEP_SUMMARY
          # Debug Artifacts
          debug_arm32=($(sha256sum ${{ env.APK_FILE_DEBUG_ARM32 }}))
          echo "|debug_armeabi-v7a|$debug_arm32" >> $GITHUB_STEP_SUMMARY
          debug_arm64=($(sha256sum ${{ env.APK_FILE_DEBUG_ARM64 }}))
          echo "|debug_arm64-v8a|$debug_arm64" >> $GITHUB_STEP_SUMMARY
          debug_x86=($(sha256sum ${{ env.APK_FILE_DEBUG_X86 }}))
          echo "|debug_x86|$debug_x86" >> $GITHUB_STEP_SUMMARY
          debug_x64=($(sha256sum ${{ env.APK_FILE_DEBUG_X64 }}))
          echo "|debug_x86_64|$debug_x64" >> $GITHUB_STEP_SUMMARY
          debug_universal=($(sha256sum ${{ env.APK_FILE_DEBUG_UNIVERSAL }}))
          echo "|debug_universal|$debug_universal" >> $GITHUB_STEP_SUMMARY

      - name: Upload Release APK (armeabi-v7a)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_RELEASE_ARM32 }}
          name: ClashYou-release-armeabi-v7a-${{ github.event.head_commit.id }}

      - name: Upload Release APK (arm64-v8a)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_RELEASE_ARM64 }}
          name: ClashYou-release-arm64-v8a-${{ github.event.head_commit.id }}

      - name: Upload Release APK (x86)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_RELEASE_X86 }}
          name: ClashYou-release-x86-${{ github.event.head_commit.id }}

      - name: Upload Release APK (x86_64)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_RELEASE_X64 }}
          name: ClashYou-release-x86_64-${{ github.event.head_commit.id }}

      - name: Upload Release APK (Universal)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_RELEASE_UNIVERSAL }}
          name: ClashYou-release-universal-${{ github.event.head_commit.id }}

      - name: Upload Debug APK (armeabi-v7a)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_DEBUG_ARM32 }}
          name: ClashYou-debug-armeabi-v7a-${{ github.event.head_commit.id }}

      - name: Upload Debug APK (arm64-v8a)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_DEBUG_ARM64 }}
          name: ClashYou-debug-arm64-v8a-${{ github.event.head_commit.id }}

      - name: Upload Debug APK (x86)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_DEBUG_X86 }}
          name: ClashYou-debug-x86-${{ github.event.head_commit.id }}

      - name: Upload Debug APK (x86_64)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_DEBUG_X64 }}
          name: ClashYou-debug-x86_64-${{ github.event.head_commit.id }}

      - name: Upload Debug APK (Universal)
        uses: actions/upload-artifact@v3
        with:
          path: ${{ env.APK_FILE_DEBUG_UNIVERSAL }}
          name: ClashYou-debug-universal-${{ github.event.head_commit.id }}


================================================
FILE: .gitignore
================================================
.gradle
build/
/app/foss/release
/app/premium/release
/captures

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar targetFile (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

# Ignore IDEA config
*.iml
/.idea/*
/core/src/main/golang/.idea/*
/core/src/foss/golang/.idea/*
/core/src/premium/golang/.idea/*

# KeyStore
signing.properties
*.keystore
*.jks

# clion cmake build
cmake-build-*

# local.properties
local.properties


# tracker
tracker.properties

# vscode
.vscode

# cxx
.cxx

*.hprof

# firebase
google-services.json

# Dolphin
.directory

# logs
*.log

# MacOS
.DS_Store


================================================
FILE: .gitmodules
================================================
[submodule "clash-foss"]
	path = core/src/foss/golang/clash
	url = https://github.com/xuhaoyang/ClashForAndroid.git
[submodule "clash-premium"]
	path = core/src/premium/golang/clash
	url = https://github.com/xuhaoyang/ClashForAndroid.git


================================================
FILE: CONTRIBUTING.md
================================================
## Contributing to Clash for Android

#### Code Style

Please use `Android Studio` or `Intellij IDEA` to open the project and use the project code style profile.

`File` -> `Settings` -> `Editor` -> `Code Style` -> `C/C++ and Kotlin` -> `Scheme` -> `Project`



#### License

Contributing to Clash for Android that assumes you allow code to be merged into closed-source branch of Clash for Android. Other terms follow the [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)



================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 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 General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is 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.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  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.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  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 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. Use with the GNU Affero General Public License.

  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 Affero 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 special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU 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 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 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 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 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 General Public License for more details.

    You should have received a copy of the GNU 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 the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  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 GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: NOTICE
================================================
3th-party software licenses

 * Clash
==========================================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 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 General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is 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.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  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.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  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 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. Use with the GNU Affero General Public License.

  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 Affero 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 special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU 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 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 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 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 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 General Public License for more details.

    You should have received a copy of the GNU 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 the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  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 GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

 * Android Open Source Project
 * Android X Support Library
==========================================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/
   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
   1. Definitions.
      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.
      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.
      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.
      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.
      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.
      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.
      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).
      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.
      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."
      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.
   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.
   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.
   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:
      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and
      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and
      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and
      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.
      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.
   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.
   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.
   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.
   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.
   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.
   END OF TERMS AND CONDITIONS


================================================
FILE: PRIVACY_POLICY.md
================================================
## Privacy Policy

The Clash for Android is built as an Open Source software. This app is provided by personal at no cost and is intended for use as is.

This page is used to inform visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our app.

**Information Collection and Use**

We will not upload any of your personally information and that will be stored in the internal storage or memory.

We collect the following information and store it in memory, and such information will be destroyed when the application is fully exited.

- Installed Applications

  This data is used for the PROCESS-NAME rule.

**Log Data**

We do not collect log data unless you use log collector.

**Cookies**

Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.

This app does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this app.

**Security**

We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security.

**Links to Other Sites**

This app may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by us. Therefore, we strongly advise you to review the Privacy Policy of these websites. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.

**Changes to This Privacy Policy**

We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.

**Contact Us**

If you have any questions or suggestions about our Privacy Policy, do not hesitate to contact us.


================================================
FILE: README.md
================================================
## Clash You

📕 [English Version](./README_en.md)

基于 [Clash for Android](),为安卓设备设计的 [Clash]() GUI,使用 Material You 设计语言。

可在 [Releases](https://github.com/Yos-X/ClashYou/releases) 获取最新发布版本,也可在 [Actions](https://github.com/Yos-X/ClashYou/actions) 获取 CI 版(需要登录,感谢 [@淡い夏](https://github.com/lightsummer233))

### 版本特性

- 适配新安卓版本权限
- 应用主题支持动态取色
- 遵循 MD3 设计风格的 UI

### 注意

Clash You 基于的 Clash for Android **已是最终版本**,进入**长久不更新**状态。

因此 Clash You 使用的旧内核将可能**不支持**新 Clash 内核的部分特性。

若想使用 Clash 的**较新特性**,可以考虑~原作者~ ????? 正在开发的 ????? 项目。

Telegram Channel: ?????

### 特性

完整 [Clash]() 特性实现

### 运行环境要求

- Android 5.0+ (最低)
- Android 12.0+ (推荐)
- `armeabi-v7a` , `arm64-v8a`, `x86` 或 `x86_64` 架构

### 许可证

参见 [LICENSE](./LICENSE) 与 [NOTICE](./NOTICE)

### 隐私协议

参见 [隐私协议](./PRIVACY_POLICY.md)

### 构建

1. 更新子模块(IDEA 项目内 `终端`)
   ```sh
   git submodule update --init --recursive
   ```
2. 安装 **OpenJDK 11**, **Android SDK**, **CMake** 和 **Golang**
3. 在项目根目录新建 `local.properties`,并写入以下内容
   ```properties
   sdk.dir=/path/to/android-sdk
   ```
4. 在项目根目录新建 `signing.properties`,并写入以下内容
   ```properties
   keystore.path=/path/to/keystore/file(签名密钥路径)
   keystore.password=<签名密钥密码>
   key.alias=<签名密钥别名>
   key.password=<签名密钥密码>
   ```
5. 构建
   ```sh
   ./gradlew app:assembleFossRelease
   ```
6. 输出文件 `app-<version>-foss-<arch>-release.apk` 在 `app/build/outputs/apk/foss/release/` 目录下


================================================
FILE: README_en.md
================================================
## Clash You

**⚠ This page is translated by GPT 4.**

Based on [Clash for Android](),
a [Clash]() GUI designed for Android devices, using the Material
You design language.

The latest Release version can be obtained from
[Releases](https://github.com/Yos-X/ClashYou/releases)
and CI version can be obtained from
[Actions](https://github.com/Yos-X/ClashYou/actions) (login is required, thanks to [@Light_summer](https://github.com/lightsummer233)).

### Version Features

- Adapted to new Android version permissions
- Application theme supports dynamic color picking
- UI following MD3 design style

### Attention

Clash You is based on **the final version** of Clash for Android, which has entered **a long-term non update state**.

Therefore, the old core used by Clash You may **not support** some features of the new Clash core.

For **the newer features** of Clash, consider the ????? project being developed by ~the original author~ ?????.

Telegram Channel:?????

### Feature

Fully feature of [Clash]()

### Runtime Requirements

- Android 5.0+ (minimum)
- Android 12.0+ (recommended)
- `armeabi-v7a`, `arm64-v8a`, `x86` or `x86_64` architecture

### License

See [LICENSE](./LICENSE) and [NOTICE](./NOTICE)

### Privacy Policy

See [Privacy Policy](./PRIVACY_POLICY.md)

### Building

1. Update submodules (in IDEA project `terminal`)
   ```sh
   git submodule update --init --recursive
   ```
2. Install **OpenJDK 11**, **Android SDK**, **CMake** and **Golang**
3. Create a new `local.properties` file in the project root directory and write the following content
   ```properties
   sdk.dir=/path/to/android-sdk
   ```
4. Create a new `signing.properties` file in the project root directory and write the following content
   ```properties
   keystore.path=/path/to/keystore/file
   keystore.password=<keystore password>
   key.alias=<key alias>
   key.password=<key password>
   ```
5. Build
   ```sh
   ./gradlew app:assembleFossRelease
   ```
6. Output file `app-<version>-foss-<arch>-release.apk` is located in the `app/build/outputs/apk/foss/release/` directory.


================================================
FILE: app/build.gradle.kts
================================================
plugins {
    kotlin("android")
    kotlin("kapt")
    id("com.android.application")
}

dependencies {
    repositories {
        mavenLocal()
        mavenCentral()
        gradlePluginPortal()
        google()
        maven("https://jitpack.io")
        maven("https://oss.sonatype.org/content/repositories/snapshots/")
        maven("https://maven.kr328.app/releases")
    }
    compileOnly(project(":hideapi"))

    implementation(project(":core"))
    implementation(project(":service"))
    implementation(project(":design"))
    implementation(project(":common"))

    implementation(libs.kotlin.coroutine)
    implementation(libs.androidx.core)
    implementation(libs.androidx.activity)
    implementation(libs.androidx.fragment)
    implementation(libs.androidx.appcompat)
    implementation(libs.androidx.coordinator)
    implementation(libs.androidx.recyclerview)
    implementation(libs.google.material)
    implementation(libs.androidx.splashscreen)
    implementation(libs.getactivity.xxpermission)
}

tasks.getByName("clean", type = Delete::class) {
    delete(file("release"))
}
/*
android {
    defaultConfig {
        applicationId = "yos.clash.material"
    }
}
*/


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-dontobfuscate

-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
    public static void checkNotNull(...);
    public static void checkExpressionValueIsNotNull(...);
    public static void checkNotNullExpressionValue(...);
    public static void checkReturnedValueIsNotNull(...);
    public static void checkFieldIsNotNull(...);
    public static void checkParameterIsNotNull(...);
    public static void checkNotNullParameter(...);
}

# Kotlin Coroutine
# Allow R8 to optimize away the FastServiceLoader.
# Together with ServiceLoader optimization in R8
# this results in direct instantiation when loading Dispatchers.Main
-assumenosideeffects class kotlinx.coroutines.internal.MainDispatcherLoader {
    boolean FAST_SERVICE_LOADER_ENABLED return false;
}

-assumenosideeffects class kotlinx.coroutines.internal.FastServiceLoaderKt {
    boolean ANDROID_DETECTED return true;
}

-keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;}

# Disable support for "Missing Main Dispatcher", since we always have Android main dispatcher
-assumenosideeffects class kotlinx.coroutines.internal.MainDispatchersKt {
    boolean SUPPORT_MISSING return false;
}

# Statically turn off all debugging facilities and assertions
-assumenosideeffects class kotlinx.coroutines.DebugKt {
    boolean getASSERTIONS_ENABLED() return false;
    boolean getDEBUG() return false;
    boolean getRECOVER_STACK_TRACES() return false;
}

================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="yos.clash.material">

    <uses-feature
        android:name="android.software.leanback"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission
        android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission
        android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />
    <!--suppress AndroidDomInspection -->
    <application
        android:name=".MainApplication"
        android:allowBackup="true"
        android:banner="@mipmap/ic_banner"
        android:fullBackupContent="@xml/full_backup_content"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/application_name"
        android:networkSecurityConfig="@xml/network_security_config"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:requestLegacyExternalStorage="true"
        android:enableOnBackInvokedCallback="true"
        android:theme="@style/BootstrapTheme"
        tools:ignore="DataExtractionRules,GoogleAppIndexingWarning"
        tools:targetApi="tiramisu">
        <meta-data
            android:name="releaseName"
            android:value="@string/release_name" />
        <meta-data
            android:name="releaseCode"
            android:value="@integer/release_code" />

        <!--suppress AndroidDomInspection -->
        <activity
            android:name=".MainActivity"
            android:theme="@style/SplashTheme"
            android:configChanges="uiMode"
            android:exported="true"
            android:label="@string/launch_name"
            android:launchMode="singleTop">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ExternalImportActivity"
            android:exported="true"
            android:label="@string/import_from_file"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="install-config"
                    android:scheme="clash" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ApkBrokenActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/application_broken" />
        <activity
            android:name=".AppCrashedActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/application_crashed"
            android:launchMode="singleTask" />
        <activity
            android:name=".ProfilesActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/profiles" />
        <activity
            android:name=".NewProfileActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/create_profile" />
        <activity
            android:name=".PropertiesActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/profile" />
        <activity
            android:name=".ProxyActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/proxy" />
        <activity
            android:name=".ProvidersActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/providers" />
        <activity
            android:name=".LogsActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/logs" />
        <activity
            android:name=".LogcatActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/logcat" />
        <activity
            android:name=".SettingsActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/settings" />
        <activity
            android:name=".NetworkSettingsActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/network" />
        <activity
            android:name=".AppSettingsActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/app" />
        <activity
            android:name=".OverrideSettingsActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/override" />
        <activity
            android:name=".AccessControlActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/access_control_packages" />
        <activity
            android:name=".HelpActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/help" />
        <activity
            android:name=".FilesActivity"
            android:configChanges="uiMode"
            android:exported="false"
            android:label="@string/files" />

        <service
            android:name=".LogcatService"
            android:exported="false"
            android:foregroundServiceType="specialUse"
            android:label="@string/clash_logcat" />
        <service
            android:name=".TileService"
            android:foregroundServiceType="specialUse"
            android:exported="true"
            android:icon="@drawable/ic_logo_service"
            android:label="@string/launch_name"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>

        <receiver
            android:name=".RestartReceiver"
            android:foregroundServiceType="specialUse"
            android:enabled="false"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>
    </application>
</manifest>


================================================
FILE: app/src/main/java/yos/clash/material/AccessControlActivity.kt
================================================
package yos.clash.material

import android.Manifest.permission.INTERNET
import android.content.ClipData
import android.content.ClipboardManager
import android.content.pm.ApplicationInfo
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import androidx.core.content.getSystemService
import yos.clash.material.design.AccessControlDesign
import yos.clash.material.design.model.AppInfo
import yos.clash.material.design.util.toAppInfo
import yos.clash.material.service.store.ServiceStore
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext

class AccessControlActivity : BaseActivity<AccessControlDesign>() {
    override suspend fun main() {
        val service = ServiceStore(this)

        val selected = withContext(Dispatchers.IO) {
            service.accessControlPackages.toMutableSet()
        }

        defer {
            withContext(Dispatchers.IO) {
                service.accessControlPackages = selected
            }
        }

        val design = AccessControlDesign(this, uiStore, selected)

        setContentDesign(design)

        design.requests.send(AccessControlDesign.Request.ReloadApps)

        while (isActive) {
            select<Unit> {
                events.onReceive {

                }
                design.requests.onReceive {
                    when (it) {
                        AccessControlDesign.Request.ReloadApps -> {
                            design.patchApps(loadApps(selected))
                        }
                        AccessControlDesign.Request.SelectAll -> {
                            val all = withContext(Dispatchers.Default) {
                                design.apps.map(AppInfo::packageName)
                            }

                            selected.clear()
                            selected.addAll(all)

                            design.rebindAll()
                        }
                        AccessControlDesign.Request.SelectNone -> {
                            selected.clear()

                            design.rebindAll()
                        }
                        AccessControlDesign.Request.SelectInvert -> {
                            val all = withContext(Dispatchers.Default) {
                                design.apps.map(AppInfo::packageName).toSet() - selected
                            }

                            selected.clear()
                            selected.addAll(all)

                            design.rebindAll()
                        }
                        AccessControlDesign.Request.Import -> {
                            val clipboard = getSystemService<ClipboardManager>()
                            val data = clipboard?.primaryClip

                            if (data != null && data.itemCount > 0) {
                                val packages = data.getItemAt(0).text.split("\n").toSet()
                                val all = design.apps.map(AppInfo::packageName).intersect(packages)

                                selected.clear()
                                selected.addAll(all)
                            }

                            design.rebindAll()
                        }
                        AccessControlDesign.Request.Export -> {
                            val clipboard = getSystemService<ClipboardManager>()

                            val data = ClipData.newPlainText(
                                "packages",
                                selected.joinToString("\n")
                            )

                            clipboard?.setPrimaryClip(data)
                        }
                    }
                }
            }
        }
    }

    private suspend fun loadApps(selected: Set<String>): List<AppInfo> =
        withContext(Dispatchers.IO) {
            val reverse = uiStore.accessControlReverse
            val sort = uiStore.accessControlSort
            val systemApp = uiStore.accessControlSystemApp

            val base = compareByDescending<AppInfo> { it.packageName in selected }
            val comparator = if (reverse) base.thenDescending(sort) else base.then(sort)

            val pm = packageManager
            val packages = pm.getInstalledPackages(PackageManager.GET_PERMISSIONS)

            packages.asSequence()
                .filter {
                    it.packageName != packageName
                }
                .filter {
                    it.packageName == "android" || it.requestedPermissions?.contains(INTERNET) == true
                }
                .filter {
                    systemApp || !it.isSystemApp
                }
                .map {
                    it.toAppInfo(pm)
                }
                .sortedWith(comparator)
                .toList()
        }

    private val PackageInfo.isSystemApp: Boolean
        get() {
            return applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0
        }
}

================================================
FILE: app/src/main/java/yos/clash/material/ApkBrokenActivity.kt
================================================
package yos.clash.material

import android.content.Intent
import android.net.Uri
import yos.clash.material.design.ApkBrokenDesign
import kotlinx.coroutines.isActive

class ApkBrokenActivity : BaseActivity<ApkBrokenDesign>() {
    override suspend fun main() {
        val design = ApkBrokenDesign(this)

        setContentDesign(design)

        while (isActive) {
            val req = design.requests.receive()

            startActivity(Intent(Intent.ACTION_VIEW).setData(Uri.parse(req.url)))
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/AppCrashedActivity.kt
================================================
package yos.clash.material

import yos.clash.material.common.compat.versionCodeCompat
import yos.clash.material.common.log.Log
import yos.clash.material.design.AppCrashedDesign
import yos.clash.material.log.SystemLogcat
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext

class AppCrashedActivity : BaseActivity<AppCrashedDesign>() {
    override suspend fun main() {
        val design = AppCrashedDesign(this)

        setContentDesign(design)

        val packageInfo = withContext(Dispatchers.IO) {
            packageManager.getPackageInfo(packageName, 0)
        }

        Log.i("App version: versionName = ${packageInfo.versionName} versionCode = ${packageInfo.versionCodeCompat}")

        val logs = withContext(Dispatchers.IO) {
            SystemLogcat.dumpCrash()
        }

        design.setAppLogs(logs)

        while (isActive) {
            events.receive()
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/AppSettingsActivity.kt
================================================
package yos.clash.material

import android.content.pm.PackageManager
import yos.clash.material.common.util.componentName
import yos.clash.material.design.AppSettingsDesign
import yos.clash.material.design.model.Behavior
import yos.clash.material.service.store.ServiceStore
import yos.clash.material.util.ApplicationObserver
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select

class AppSettingsActivity : BaseActivity<AppSettingsDesign>(), Behavior {
    override suspend fun main() {
        val design = AppSettingsDesign(
            this,
            uiStore,
            ServiceStore(this),
            this,
            clashRunning,
        )

        setContentDesign(design)

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ClashStart, Event.ClashStop, Event.ServiceRecreated ->
                            recreate()
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    ApplicationObserver.createdActivities.forEach {
                        it.recreate()
                    }
                }
            }
        }
    }

    override var autoRestart: Boolean
        get() {
            val status = packageManager.getComponentEnabledSetting(
                RestartReceiver::class.componentName
            )

            return status == PackageManager.COMPONENT_ENABLED_STATE_ENABLED
        }
        set(value) {
            val status = if (value)
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED
            else
                PackageManager.COMPONENT_ENABLED_STATE_DISABLED

            packageManager.setComponentEnabledSetting(
                RestartReceiver::class.componentName,
                status,
                PackageManager.DONT_KILL_APP,
            )
        }
}

================================================
FILE: app/src/main/java/yos/clash/material/BaseActivity.kt
================================================
package yos.clash.material

import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContract
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.google.android.material.color.DynamicColors
import yos.clash.material.common.compat.isAllowForceDarkCompat
import yos.clash.material.common.compat.isLightNavigationBarCompat
import yos.clash.material.common.compat.isLightStatusBarsCompat
import yos.clash.material.common.compat.isSystemBarsTranslucentCompat
import com.github.kr328.clash.core.bridge.ClashException
import yos.clash.material.design.Design
import yos.clash.material.design.model.DarkMode
import yos.clash.material.design.store.UiStore
import yos.clash.material.design.ui.DayNight
import yos.clash.material.design.util.resolveThemedBoolean
import yos.clash.material.design.util.resolveThemedColor
import yos.clash.material.design.util.showExceptionToast
import yos.clash.material.remote.Broadcasts
import yos.clash.material.remote.Remote
import yos.clash.material.util.ActivityResultLifecycle
import yos.clash.material.util.ApplicationObserver
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import java.util.concurrent.atomic.AtomicInteger
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine

abstract class BaseActivity<D : Design<*>> :
    AppCompatActivity(),
    CoroutineScope by MainScope(),
    Broadcasts.Observer {
    enum class Event {
        ServiceRecreated,
        ActivityStart,
        ActivityStop,
        ClashStop,
        ClashStart,
        ProfileLoaded,
        ProfileChanged
    }


    protected val uiStore by lazy { UiStore(this) }
    protected val events = Channel<Event>(Channel.UNLIMITED)
    protected var activityStarted: Boolean = false
    protected val clashRunning: Boolean
        get() = Remote.broadcasts.clashRunning
    protected var design: D? = null
        private set(value) {
            field = value

            if (value != null) {
                setContentView(value.root)
            } else {
                setContentView(View(this))
            }
        }

    private var defer: suspend () -> Unit = {}
    private var deferRunning = false
    private val nextRequestKey = AtomicInteger(0)
    private var dayNight: DayNight = DayNight.Day

    protected abstract suspend fun main()

    fun defer(operation: suspend () -> Unit) {
        this.defer = operation
    }

    suspend fun <I, O> startActivityForResult(
        contracts: ActivityResultContract<I, O>,
        input: I
    ): O = withContext(Dispatchers.Main) {
        val requestKey = nextRequestKey.getAndIncrement().toString()

        ActivityResultLifecycle().use { lifecycle, start ->
            suspendCoroutine { c ->
                activityResultRegistry.register(requestKey, lifecycle, contracts) {
                    c.resumeWith(Result.success(it))
                }.apply { start() }.launch(input)
            }
        }
    }

    suspend fun setContentDesign(design: D) {
        suspendCoroutine<Unit> {
            window.decorView.post {
                this.design = design

                it.resume(Unit)
            }
        }
    }

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

        DynamicColors.applyToActivitiesIfAvailable(this.application)

        applyDayNight()

        launch {
            main()

            finish()
        }
    }

    override fun onStart() {
        super.onStart()

        activityStarted = true

        Remote.broadcasts.addObserver(this)

        events.trySend(Event.ActivityStart)
    }

    override fun onStop() {
        super.onStop()

        activityStarted = false

        Remote.broadcasts.removeObserver(this)

        events.trySend(Event.ActivityStop)
    }

    override fun onDestroy() {
        design?.cancel()

        cancel()

        super.onDestroy()
    }

    override fun finish() {
        if (deferRunning) {
            return
        }

        deferRunning = true

        launch {
            try {
                defer()
            } finally {
                withContext(NonCancellable) {
                    super.finish()
                }
            }
        }
    }

    override fun onConfigurationChanged(newConfig: Configuration) {
        super.onConfigurationChanged(newConfig)

        if (queryDayNight(newConfig) != dayNight) {
            ApplicationObserver.createdActivities.forEach {
                it.recreate()
            }
        }
    }

    open fun shouldDisplayHomeAsUpEnabled(): Boolean {
        return true
    }

    override fun onSupportNavigateUp(): Boolean {
        this.onBackPressed()

        return true
    }

    override fun onProfileChanged() {
        events.trySend(Event.ProfileChanged)
    }

    override fun onProfileLoaded() {
        events.trySend(Event.ProfileLoaded)
    }

    override fun onServiceRecreated() {
        events.trySend(Event.ServiceRecreated)
    }

    override fun onStarted() {
        events.trySend(Event.ClashStart)
    }

    override fun onStopped(cause: String?) {
        events.trySend(Event.ClashStop)

        if (cause != null && activityStarted) {
            launch {
                design?.showExceptionToast(ClashException(cause))
            }
        }
    }

    private fun queryDayNight(config: Configuration = resources.configuration): DayNight {
        return when (uiStore.darkMode) {
            DarkMode.Auto -> {
                if (config.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES)
                    DayNight.Night
                else
                    DayNight.Day
            }
            DarkMode.ForceLight -> {
                DayNight.Day
            }
            DarkMode.ForceDark -> {
                DayNight.Night
            }
        }
    }

    private fun applyDayNight(config: Configuration = resources.configuration) {
        val dayNight = queryDayNight(config)

        when (dayNight) {
            DayNight.Night -> {
                theme.applyStyle(R.style.AppThemeDark, true)
            }
            DayNight.Day -> {
                theme.applyStyle(R.style.AppThemeLight, true)
            }
        }

        window.isAllowForceDarkCompat = false
        window.isSystemBarsTranslucentCompat = true

        window.statusBarColor = resolveThemedColor(android.R.attr.statusBarColor)
        window.navigationBarColor = resolveThemedColor(android.R.attr.navigationBarColor)

        if (Build.VERSION.SDK_INT >= 23) {
            window.isLightStatusBarsCompat =
                resolveThemedBoolean(android.R.attr.windowLightStatusBar)
        }

        if (Build.VERSION.SDK_INT >= 27) {
            window.isLightNavigationBarCompat =
                resolveThemedBoolean(android.R.attr.windowLightNavigationBar)
        }

        this.dayNight = dayNight
    }
}


================================================
FILE: app/src/main/java/yos/clash/material/ExternalImportActivity.kt
================================================
package yos.clash.material

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import yos.clash.material.R
import yos.clash.material.common.util.intent
import yos.clash.material.common.util.setUUID
import yos.clash.material.service.model.Profile
import yos.clash.material.util.withProfile
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import java.util.*

class ExternalImportActivity : Activity(), CoroutineScope by MainScope() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        if (intent.action != Intent.ACTION_VIEW)
            return finish()

        val uri = intent.data ?: return finish()
        val url = uri.getQueryParameter("url") ?: return finish()

        launch {
            val uuid = withProfile {
                val type = when (uri.getQueryParameter("type")?.lowercase(Locale.getDefault())) {
                    "url" -> Profile.Type.Url
                    "file" -> Profile.Type.File
                    else -> Profile.Type.Url
                }
                val name = uri.getQueryParameter("name") ?: getString(R.string.new_profile)

                create(type, name).also {
                    patch(it, name, url, 0)
                }
            }

            startActivity(PropertiesActivity::class.intent.setUUID(uuid))

            finish()
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/FilesActivity.kt
================================================
@file:Suppress("BlockingMethodInNonBlockingContext")

package yos.clash.material

import android.content.Intent
import android.net.Uri
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.hjq.permissions.OnPermissionCallback
import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import yos.clash.material.common.util.grantPermissions
import yos.clash.material.common.util.ticker
import yos.clash.material.common.util.uuid
import yos.clash.material.design.FilesDesign
import yos.clash.material.design.util.showExceptionToast
import yos.clash.material.remote.FilesClient
import yos.clash.material.service.model.Profile
import yos.clash.material.util.fileName
import yos.clash.material.util.withProfile
import java.util.*
import java.util.concurrent.TimeUnit

class FilesActivity : BaseActivity<FilesDesign>() {
    override suspend fun main() {
        val uuid = intent.uuid ?: return finish()
        val profile = withProfile { queryByUUID(uuid) } ?: return finish()
        val root = uuid.toString()

        val design = FilesDesign(this)
        val client = FilesClient(this)
        val stack = Stack<String>()

        design.configurationEditable = profile.type != Profile.Type.Url
        design.fetch(client, stack, root)

        setContentDesign(design)

        val ticker = ticker(TimeUnit.MINUTES.toMillis(1))

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ActivityStart, Event.ActivityStop -> {
                            design.fetch(client, stack, root)
                        }

                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    try {
                        when (it) {
                            FilesDesign.Request.PopStack -> {
                                if (stack.empty()) {
                                    finish()
                                } else {
                                    stack.pop()
                                }
                            }

                            is FilesDesign.Request.OpenDirectory -> {
                                stack.push(it.file.id)
                            }

                            is FilesDesign.Request.OpenFile -> {
                                startActivityForResult(
                                    ActivityResultContracts.StartActivityForResult(),
                                    Intent(Intent.ACTION_VIEW).setDataAndType(
                                        client.buildDocumentUri(it.file.id),
                                        "text/plain"
                                    ).grantPermissions()
                                )
                            }

                            is FilesDesign.Request.DeleteFile -> {
                                client.deleteDocument(it.file.id)
                            }

                            is FilesDesign.Request.RenameFile -> {
                                val newName = design.requestFileName(it.file.name)

                                client.renameDocument(it.file.id, newName)
                            }

                            is FilesDesign.Request.ImportFile -> {
                                val hasPermission = XXPermissions.isGranted(
                                    this@FilesActivity,
                                    Permission.MANAGE_EXTERNAL_STORAGE
                                )

                                if (!hasPermission) {
                                    XXPermissions.with(this@FilesActivity)
                                        .permission(Permission.MANAGE_EXTERNAL_STORAGE)
                                        .request(object : OnPermissionCallback {
                                            override fun onGranted(
                                                permissions: MutableList<String>,
                                                allGranted: Boolean
                                            ) {
                                                /*if (!allGranted) {
                                                    Toast.makeText(this@MainActivity, "部分权限未授予,某些功能可能无法使用", Toast.LENGTH_SHORT).show()
                                                }*/
                                                //成功
                                                launch(Dispatchers.Main) {
                                                    val uri: Uri? = startActivityForResult(
                                                        ActivityResultContracts.GetContent(),
                                                        "*/*"
                                                    )

                                                    if (uri != null) {
                                                        if (it.file == null) {
                                                            val name = design.requestFileName(
                                                                uri.fileName ?: "File"
                                                            )

                                                            client.importDocument(
                                                                stack.last(),
                                                                uri,
                                                                name
                                                            )
                                                        } else {
                                                            client.copyDocument(
                                                                it.file!!.id,
                                                                uri
                                                            )
                                                        }
                                                        design.fetch(client, stack, root)
                                                    }
                                                }
                                            }

                                            override fun onDenied(
                                                permissions: MutableList<String>,
                                                doNotAskAgain: Boolean
                                            ) {
                                                if (doNotAskAgain) {
                                                    // 如果是被永久拒绝就跳转到应用权限系统设置页面
                                                    XXPermissions.startPermissionActivity(
                                                        this@FilesActivity,
                                                        permissions
                                                    )
                                                }
                                            }
                                        })
                                    /*val granted = startActivityForResult(
                                        ActivityResultContracts.RequestPermission(),
                                        Manifest.permission.READ_EXTERNAL_STORAGE,
                                    )

                                    if (!granted) {
                                        return@onReceive
                                    }*/
                                } else {
                                    val uri: Uri? = startActivityForResult(
                                        ActivityResultContracts.GetContent(),
                                        "*/*"
                                    )

                                    if (uri != null) {
                                        if (it.file == null) {
                                            val name = design.requestFileName(
                                                uri.fileName ?: "File"
                                            )
                                            client.importDocument(
                                                stack.last(),
                                                uri,
                                                name
                                            )
                                        } else {
                                            client.copyDocument(
                                                it.file!!.id,
                                                uri
                                            )
                                        }
                                        design.fetch(client, stack, root)
                                    }
                                }
                            }

                            is FilesDesign.Request.ExportFile -> {
                                val uri: Uri? = startActivityForResult(
                                    ActivityResultContracts.CreateDocument("text/plain"),
                                    it.file.name
                                )

                                if (uri != null) {
                                    client.copyDocument(uri, it.file.id)
                                }
                            }
                        }
                    } catch (e: Exception) {
                        design.showExceptionToast(e)
                    }

                    design.fetch(client, stack, root)
                }
                if (activityStarted) {
                    ticker.onReceive {
                        design.updateElapsed()
                    }
                }
            }
        }
    }

    override fun onBackPressed() {
        design?.requests?.trySend(FilesDesign.Request.PopStack)
    }

    private suspend fun FilesDesign.fetch(client: FilesClient, stack: Stack<String>, root: String) {
        val documentId = stack.lastOrNull() ?: root
        val files = if (stack.empty()) {
            val list = client.list(documentId)
            val config = list.firstOrNull { it.id.endsWith("config.yaml") }

            if (config == null || config.size > 0) list else listOf(config)
        } else {
            client.list(documentId)
        }

        swapFiles(files, stack.empty())
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/HelpActivity.kt
================================================
package yos.clash.material

import android.content.Intent
import yos.clash.material.design.HelpDesign
import kotlinx.coroutines.isActive

class HelpActivity : BaseActivity<HelpDesign>() {
    override suspend fun main() {
        val design = HelpDesign(this) {
            startActivity(Intent(Intent.ACTION_VIEW).setData(it))
        }

        setContentDesign(design)

        while (isActive) {
            events.receive()
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/LogcatActivity.kt
================================================
package yos.clash.material

import android.content.ComponentName
import android.content.Context
import android.content.ServiceConnection
import android.net.Uri
import android.os.IBinder
import android.widget.Toast
import androidx.activity.result.contract.ActivityResultContracts
import yos.clash.material.common.compat.startForegroundServiceCompat
import yos.clash.material.common.util.fileName
import yos.clash.material.common.util.intent
import yos.clash.material.common.util.ticker
import com.github.kr328.clash.core.model.LogMessage
import yos.clash.material.design.LogcatDesign
import yos.clash.material.design.dialog.withModelProgressBar
import yos.clash.material.design.model.LogFile
import yos.clash.material.design.ui.ToastDuration
import yos.clash.material.design.util.showExceptionToast
import yos.clash.material.log.LogcatFilter
import yos.clash.material.log.LogcatReader
import yos.clash.material.util.logsDir
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.io.OutputStreamWriter
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine

class LogcatActivity : BaseActivity<LogcatDesign>() {
    private var conn: ServiceConnection? = null

    override suspend fun main() {
        val fileName = intent?.fileName

        if (fileName != null) {
            val file = LogFile.parseFromFileName(fileName) ?: return showInvalid()

            return mainLocalFile(file)
        }

        return mainStreaming()
    }

    private suspend fun mainLocalFile(file: LogFile) {
        val messages = try {
            LogcatReader(this, file).readAll()
        } catch (e: Exception) {
            return showInvalid()
        }

        val design = LogcatDesign(this, false)

        setContentDesign(design)

        design.patchMessages(messages, 0, messages.size)

        while (isActive) {
            when (design.requests.receive()) {
                LogcatDesign.Request.Delete -> {
                    withContext(Dispatchers.IO) {
                        logsDir.resolve(file.fileName).delete()
                    }

                    finish()
                }
                LogcatDesign.Request.Export -> {
                    val output = startActivityForResult(
                        ActivityResultContracts.CreateDocument("text/plain"),
                        file.fileName
                    )

                    if (output != null) {
                        try {
                            withContext(Dispatchers.IO) {
                                writeLogTo(messages, file, output)
                            }

                            design.showToast(R.string.file_exported, ToastDuration.Long)
                        } catch (e: Exception) {
                            design.showExceptionToast(e)
                        }
                    }
                }
                else -> Unit
            }
        }
    }

    private suspend fun mainStreaming() {
        val design = LogcatDesign(this, true)

        setContentDesign(design)

        startForegroundServiceCompat(LogcatService::class.intent)

        val logcat = bindLogcatService()
        val ticker = ticker(500)

        var initial = true

        while (isActive) {
            select<Unit> {
                events.onReceive {

                }
                design.requests.onReceive {
                    when (it) {
                        LogcatDesign.Request.Close -> {
                            stopService(LogcatService::class.intent)

                            finish()
                        }
                        else -> Unit
                    }
                }
                if (activityStarted) {
                    ticker.onReceive {
                        val snapshot = logcat.snapshot(initial) ?: return@onReceive

                        design.patchMessages(snapshot.messages, snapshot.removed, snapshot.appended)

                        initial = false
                    }
                }
            }
        }
    }

    override fun onDestroy() {
        conn?.apply(this::unbindService)

        super.onDestroy()
    }

    private suspend fun bindLogcatService(): LogcatService {
        return suspendCoroutine { ctx ->
            bindService(LogcatService::class.intent, object : ServiceConnection {
                override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
                    val srv = service!!.queryLocalInterface("") as LogcatService

                    ctx.resume(srv)

                    conn = this
                }

                override fun onServiceDisconnected(name: ComponentName?) {
                    conn = null
                }
            }, Context.BIND_AUTO_CREATE)
        }
    }

    @Suppress("BlockingMethodInNonBlockingContext")
    private suspend fun writeLogTo(messages: List<LogMessage>, file: LogFile, uri: Uri) {
        LogcatFilter(OutputStreamWriter(contentResolver.openOutputStream(uri)), this).use {
            withContext(Dispatchers.Main) {
                withModelProgressBar {
                    configure {
                        isIndeterminate = true
                        max = messages.size
                    }

                    withContext(Dispatchers.IO) {
                        it.writeHeader(file.date)

                        messages.forEachIndexed { idx, msg ->
                            configure {
                                isIndeterminate = false
                                progress = idx
                            }

                            it.writeMessage(msg)
                        }
                    }
                }
            }
        }
    }

    private fun showInvalid() {
        Toast.makeText(this, R.string.invalid_log_file, Toast.LENGTH_LONG).show()
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/LogcatService.kt
================================================
package yos.clash.material

import android.app.PendingIntent
import android.app.Service
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
import android.os.Binder
import android.os.Build
import android.os.IBinder
import android.os.IInterface
import androidx.core.app.NotificationChannelCompat
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import com.github.kr328.clash.core.model.LogMessage
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.cancel
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import yos.clash.material.common.compat.getColorCompat
import yos.clash.material.common.compat.pendingIntentFlags
import yos.clash.material.common.log.Log
import yos.clash.material.common.util.intent
import yos.clash.material.log.LogcatCache
import yos.clash.material.log.LogcatWriter
import yos.clash.material.service.RemoteService
import yos.clash.material.service.remote.ILogObserver
import yos.clash.material.service.remote.IRemoteService
import yos.clash.material.service.remote.unwrap
import yos.clash.material.util.logsDir
import java.io.IOException

class LogcatService : Service(), CoroutineScope by CoroutineScope(Dispatchers.Default), IInterface {
    private val cache = LogcatCache()

    private val connection = object : ServiceConnection {
        override fun onServiceDisconnected(name: ComponentName?) {
            stopSelf()
        }

        override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
            startObserver(service ?: return stopSelf())
        }
    }

    override fun onCreate() {
        super.onCreate()

        running = true

        createNotificationChannel()

        showNotification()

        bindService(RemoteService::class.intent, connection, Context.BIND_AUTO_CREATE)
    }

    override fun onDestroy() {
        cancel()

        unbindService(connection)

        stopForeground(true)

        running = false

        super.onDestroy()
    }

    override fun onBind(intent: Intent?): IBinder {
        return this.asBinder()
    }

    override fun asBinder(): IBinder {
        return object : Binder() {
            override fun queryLocalInterface(descriptor: String): IInterface {
                return this@LogcatService
            }
        }
    }

    suspend fun snapshot(full: Boolean): LogcatCache.Snapshot? {
        return cache.snapshot(full)
    }

    private fun startObserver(binder: IBinder) {
        if (!binder.isBinderAlive)
            return stopSelf()

        launch(Dispatchers.IO) {
            val service = binder.unwrap(IRemoteService::class).clash()
            val channel = Channel<LogMessage>(CACHE_CAPACITY)

            try {
                logsDir.mkdirs()

                LogcatWriter(this@LogcatService).use {
                    val observer = object : ILogObserver {
                        override fun newItem(log: LogMessage) {
                            channel.trySend(log)
                        }
                    }

                    service.setLogObserver(observer)

                    while (isActive) {
                        val msg = channel.receive()

                        it.appendMessage(msg)

                        cache.append(msg)
                    }
                }
            } catch (e: IOException) {
                Log.e("Write log file: $e", e)
            } finally {
                withContext(NonCancellable) {
                    if (binder.isBinderAlive) {
                        service.setLogObserver(null)
                    }

                    stopSelf()
                }
            }
        }
    }

    private fun createNotificationChannel() {
        NotificationManagerCompat.from(this)
            .createNotificationChannel(
                NotificationChannelCompat.Builder(
                    CHANNEL_ID,
                    NotificationManagerCompat.IMPORTANCE_DEFAULT
                ).setName(getString(R.string.clash_logcat)).build()
            )
    }

    private fun showNotification() {
        val notification = NotificationCompat
            .Builder(this, CHANNEL_ID)
            .setSmallIcon(R.drawable.ic_logo_service)
            .setColor(getColorCompat(R.color.color_clash_light))
            .setContentTitle(getString(R.string.clash_logcat))
            .setContentText(getString(R.string.running))
            .setContentIntent(
                PendingIntent.getActivity(
                    this,
                    R.id.nf_logcat_status,
                    LogcatActivity::class.intent
                        .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP),
                    pendingIntentFlags(PendingIntent.FLAG_UPDATE_CURRENT)
                )
            )
            .build()

        // startForeground(R.id.nf_logcat_status, notification)
        if (Build.VERSION.SDK_INT >= 34) {
            startForeground(
                R.id.nf_logcat_status,
                notification,
                FOREGROUND_SERVICE_TYPE_SPECIAL_USE
            )
        } else {
            startForeground(R.id.nf_logcat_status, notification)
        }
        // Adapt to Android 14
    }

    companion object {
        private const val CHANNEL_ID = "clash_logcat_channel"
        private const val CACHE_CAPACITY = 128

        var running: Boolean = false
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/LogsActivity.kt
================================================
package yos.clash.material

import yos.clash.material.common.util.intent
import yos.clash.material.common.util.setFileName
import yos.clash.material.design.LogsDesign
import yos.clash.material.design.model.LogFile
import yos.clash.material.util.logsDir
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext

class LogsActivity : BaseActivity<LogsDesign>() {
    override suspend fun main() {
        if (LogcatService.running) {
            return startActivity(LogcatActivity::class.intent)
        }

        val design = LogsDesign(this)

        setContentDesign(design)

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ActivityStart -> {
                            val files = withContext(Dispatchers.IO) {
                                loadFiles()
                            }

                            design.patchLogs(files)
                        }
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        LogsDesign.Request.StartLogcat -> {
                            startActivity(LogcatActivity::class.intent)

                            finish()
                        }
                        LogsDesign.Request.DeleteAll -> {
                            if (design.requestDeleteAll()) {
                                withContext(Dispatchers.IO) {
                                    deleteAllLogs()
                                }

                                events.trySend(Event.ActivityStart)
                            }
                        }
                        is LogsDesign.Request.OpenFile -> {
                            startActivity(LogcatActivity::class.intent.setFileName(it.file.fileName))
                        }
                    }
                }
            }
        }
    }

    private fun loadFiles(): List<LogFile> {
        val list = cacheDir.resolve("logs").listFiles()?.toList() ?: emptyList()

        return list.mapNotNull { LogFile.parseFromFileName(it.name) }
    }

    private fun deleteAllLogs() {
        logsDir.deleteRecursively()
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/MainActivity.kt
================================================
package yos.clash.material

import android.content.Context
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.hjq.permissions.OnPermissionCallback
import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions
import yos.clash.material.R
import yos.clash.material.common.util.intent
import yos.clash.material.common.util.ticker
import yos.clash.material.design.MainDesign
import yos.clash.material.design.ui.ToastDuration
import yos.clash.material.store.TipsStore
import yos.clash.material.util.startClashService
import yos.clash.material.util.stopClashService
import yos.clash.material.util.withClash
import yos.clash.material.util.withProfile
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.util.concurrent.TimeUnit

class MainActivity : BaseActivity<MainDesign>() {
    override suspend fun main() {
        installSplashScreen()
        val design = MainDesign(this)

        setContentDesign(design)

        launch(Dispatchers.IO) {
            showUpdatedTips(design)
            checkNotificationPermission(design)
        }

        design.fetch()

        val ticker = ticker(TimeUnit.SECONDS.toMillis(1))

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ActivityStart,
                        Event.ServiceRecreated,
                        Event.ClashStop, Event.ClashStart,
                        Event.ProfileLoaded, Event.ProfileChanged -> design.fetch()
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        MainDesign.Request.ToggleStatus -> {
                            if (clashRunning)
                                stopClashService()
                            else
                                design.startClash()
                        }
                        MainDesign.Request.OpenProxy ->
                            startActivity(ProxyActivity::class.intent)
                        MainDesign.Request.OpenProfiles ->
                            startActivity(ProfilesActivity::class.intent)
                        MainDesign.Request.OpenProviders ->
                            startActivity(ProvidersActivity::class.intent)
                        MainDesign.Request.OpenLogs ->
                            startActivity(LogsActivity::class.intent)
                        MainDesign.Request.OpenSettings ->
                            startActivity(SettingsActivity::class.intent)
                        MainDesign.Request.OpenHelp ->
                            startActivity(HelpActivity::class.intent)
                        MainDesign.Request.OpenAbout ->
                            design.showAbout(queryAppVersionName())
                    }
                }
                if (clashRunning) {
                    ticker.onReceive {
                        design.fetchTraffic()
                    }
                }
            }
        }
    }

    private suspend fun showUpdatedTips(design: MainDesign) {
        val tips = TipsStore(this)

        if (tips.primaryVersion != TipsStore.CURRENT_PRIMARY_VERSION) {
            tips.primaryVersion = TipsStore.CURRENT_PRIMARY_VERSION

            val pkg = packageManager.getPackageInfo(packageName, 0)

            if (pkg.firstInstallTime != pkg.lastUpdateTime) {
                design.showUpdatedTips()
            }
        }
    }

    private suspend fun checkNotificationPermission(design: MainDesign) {
        val permission = XXPermissions.isGranted(this, Permission.POST_NOTIFICATIONS)
        if (!permission) {
            design.showPermissionRequest()
        }
    }


    private suspend fun MainDesign.fetch() {
        setClashRunning(clashRunning)

        val state = withClash {
            queryTunnelState()
        }
        val providers = withClash {
            queryProviders()
        }

        setMode(state.mode)
        setHasProviders(providers.isNotEmpty())

        withProfile {
            setProfileName(queryActive()?.name)
        }
    }

    private suspend fun MainDesign.fetchTraffic() {
        withClash {
            setForwarded(queryTrafficTotal())
        }
    }

    private suspend fun MainDesign.startClash() {
        val active = withProfile { queryActive() }

        if (active == null || !active.imported) {
            showToast(R.string.no_profile_selected, ToastDuration.Long) {
                setAction(R.string.profiles) {
                    startActivity(ProfilesActivity::class.intent)
                }
            }

            return
        }

        val vpnRequest = startClashService()

        try {
            if (vpnRequest != null) {
                val result = startActivityForResult(
                    ActivityResultContracts.StartActivityForResult(),
                    vpnRequest
                )

                if (result.resultCode == RESULT_OK)
                    startClashService()
            }
        } catch (e: Exception) {
            design?.showToast(R.string.unable_to_start_vpn, ToastDuration.Long)
        }
    }

    private suspend fun queryAppVersionName(): String {
        return withContext(Dispatchers.IO) {
            packageManager.getPackageInfo(packageName, 0).versionName
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/MainApplication.kt
================================================
package yos.clash.material

import android.app.Application
import android.content.Context
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import yos.clash.material.common.Global
import yos.clash.material.common.compat.currentProcessName
import yos.clash.material.common.log.Log
import yos.clash.material.remote.Remote
import yos.clash.material.service.util.sendServiceRecreated

@Suppress("unused")
class MainApplication : Application() {
    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)

        Global.init(this)
    }

    override fun onCreate() {
        super.onCreate()
        val processName = currentProcessName

        Log.d("Process $processName started")

        if (processName == packageName) {
            Remote.launch()
        } else {
            sendServiceRecreated()
        }
    }

    fun finalize() {
        Global.destroy()
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/NetworkSettingsActivity.kt
================================================
package yos.clash.material

import yos.clash.material.common.util.intent
import yos.clash.material.design.NetworkSettingsDesign
import yos.clash.material.service.store.ServiceStore
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select

class NetworkSettingsActivity : BaseActivity<NetworkSettingsDesign>() {
    override suspend fun main() {
        val design = NetworkSettingsDesign(
            this,
            uiStore,
            ServiceStore(this),
            clashRunning,
        )

        setContentDesign(design)

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ClashStart, Event.ClashStop, Event.ServiceRecreated ->
                            recreate()
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        NetworkSettingsDesign.Request.StartAccessControlList ->
                            startActivity(AccessControlActivity::class.intent)
                    }
                }
            }
        }
    }

}


================================================
FILE: app/src/main/java/yos/clash/material/NewProfileActivity.kt
================================================
package yos.clash.material

import android.app.Activity
import android.content.ComponentName
import android.content.Intent
import android.net.Uri
import android.provider.Settings
import androidx.activity.result.contract.ActivityResultContracts
import yos.clash.material.R
import yos.clash.material.common.constants.Intents
import yos.clash.material.common.util.intent
import yos.clash.material.common.util.setUUID
import yos.clash.material.design.NewProfileDesign
import yos.clash.material.design.model.ProfileProvider
import yos.clash.material.service.model.Profile
import yos.clash.material.util.withProfile
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext
import java.util.*

class NewProfileActivity : BaseActivity<NewProfileDesign>() {
    private val self: NewProfileActivity
        get() = this

    override suspend fun main() {
        val design = NewProfileDesign(this)

        design.patchProviders(queryProfileProviders())

        setContentDesign(design)

        while (isActive) {
            select<Unit> {
                events.onReceive {

                }
                design.requests.onReceive {
                    when (it) {
                        is NewProfileDesign.Request.Create -> {
                            withProfile {
                                val name = getString(R.string.new_profile)

                                val uuid: UUID? = when (val p = it.provider) {
                                    is ProfileProvider.File ->
                                        create(Profile.Type.File, name)
                                    is ProfileProvider.Url ->
                                        create(Profile.Type.Url, name)
                                    is ProfileProvider.External -> {
                                        val data = p.get()

                                        if (data != null) {
                                            val (uri, initialName) = data

                                            create(
                                                Profile.Type.External,
                                                initialName ?: name,
                                                uri.toString()
                                            )
                                        } else {
                                            null
                                        }
                                    }
                                }

                                if (uuid != null)
                                    launchProperties(uuid)
                            }
                        }
                        is NewProfileDesign.Request.OpenDetail -> {
                            launchAppDetailed(it.provider)
                        }
                    }
                }
            }
        }
    }

    private fun launchAppDetailed(provider: ProfileProvider.External) {
        val data = Uri.fromParts(
            "package",
            provider.intent.component?.packageName ?: return,
            null
        )

        startActivity(Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).setData(data))
    }

    private suspend fun launchProperties(uuid: UUID) {
        val r = startActivityForResult(
            ActivityResultContracts.StartActivityForResult(),
            PropertiesActivity::class.intent.setUUID(uuid)
        )

        if (r.resultCode == Activity.RESULT_OK)
            finish()
    }

    private suspend fun ProfileProvider.External.get(): Pair<Uri, String?>? {
        val result = startActivityForResult(
            ActivityResultContracts.StartActivityForResult(),
            intent
        )

        if (result.resultCode != RESULT_OK)
            return null

        val uri = result.data?.data
        val name = result.data?.getStringExtra(Intents.EXTRA_NAME)

        if (uri != null) {
            return uri to name
        }

        return null
    }

    private suspend fun queryProfileProviders(): List<ProfileProvider> {
        return withContext(Dispatchers.IO) {
            val providers = packageManager.queryIntentActivities(
                Intent(Intents.ACTION_PROVIDE_URL),
                0
            ).map {
                val activity = it.activityInfo

                val name = activity.applicationInfo.loadLabel(packageManager)
                val summary = activity.loadLabel(packageManager)
                val icon = activity.loadIcon(packageManager)
                val intent = Intent(Intents.ACTION_PROVIDE_URL)
                    .setComponent(
                        ComponentName(
                            activity.packageName,
                            activity.name
                        )
                    )

                ProfileProvider.External(name.toString(), summary.toString(), icon, intent)
            }

            listOf(ProfileProvider.File(self), ProfileProvider.Url(self)) + providers
        }
    }
}


================================================
FILE: app/src/main/java/yos/clash/material/OverrideSettingsActivity.kt
================================================
package yos.clash.material

import android.content.pm.PackageManager
import yos.clash.material.common.compat.getDrawableCompat
import yos.clash.material.common.constants.Metadata
import com.github.kr328.clash.core.Clash
import yos.clash.material.design.OverrideSettingsDesign
import yos.clash.material.design.model.AppInfo
import yos.clash.material.design.util.toAppInfo
import yos.clash.material.service.store.ServiceStore
import yos.clash.material.util.withClash
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.withContext

class OverrideSettingsActivity : BaseActivity<OverrideSettingsDesign>() {
    override suspend fun main() {
        val configuration = withClash { queryOverride(Clash.OverrideSlot.Persist) }
        val service = ServiceStore(this)

        defer {
            withClash {
                patchOverride(Clash.OverrideSlot.Persist, configuration)
            }
        }

        val design = OverrideSettingsDesign(
            this,
            configuration
        )

        setContentDesign(design)

        while (isActive) {
            select<Unit> {
                events.onReceive {

                }
                design.requests.onReceive {
                    when (it) {
                        OverrideSettingsDesign.Request.ResetOverride -> {
                            if (design.requestResetConfirm()) {
                                defer {
                                    withClash {
                                        clearOverride(Clash.OverrideSlot.Persist)
                                    }

                                    service.sideloadGeoip = ""
                                }

                                finish()
                            }
                        }
                        OverrideSettingsDesign.Request.EditSideloadGeoip -> {
                            withContext(Dispatchers.IO) {
                                val list = querySideloadProviders()
                                val initial = service.sideloadGeoip
                                val exist = list.any { info -> info.packageName == initial }

                                service.sideloadGeoip =
                                    design.requestSelectSideload(if (exist) initial else "", list)
                            }
                        }
                    }
                }
            }
        }
    }

    private fun querySideloadProviders(): List<AppInfo> {
        val apps = packageManager.getInstalledPackages(PackageManager.GET_META_DATA)
            .filter {
                it.applicationInfo.metaData?.containsKey(Metadata.GEOIP_FILE_NAME)
                    ?: false
            }
            .map { it.toAppInfo(packageManager) }

        return listOf(
            AppInfo(
                packageName = "",
                label = getString(R.string.use_built_in),
                icon = getDrawableCompat(R.drawable.ic_baseline_work)!!,
                installTime = 0,
                updateDate = 0,
            )
        ) + apps
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/ProfilesActivity.kt
================================================
package yos.clash.material

import yos.clash.material.common.util.intent
import yos.clash.material.common.util.setUUID
import yos.clash.material.common.util.ticker
import yos.clash.material.design.ProfilesDesign
import yos.clash.material.service.model.Profile
import yos.clash.material.util.withProfile
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select
import java.util.concurrent.TimeUnit

class ProfilesActivity : BaseActivity<ProfilesDesign>() {
    override suspend fun main() {
        val design = ProfilesDesign(this)

        setContentDesign(design)

        val ticker = ticker(TimeUnit.MINUTES.toMillis(1))

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ActivityStart, Event.ProfileChanged -> {
                            design.fetch()
                        }
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        ProfilesDesign.Request.Create ->
                            startActivity(NewProfileActivity::class.intent)
                        ProfilesDesign.Request.UpdateAll ->
                            withProfile {
                                queryAll().forEach { p ->
                                    if (p.imported && p.type != Profile.Type.File)
                                        update(p.uuid)
                                }
                            }
                        is ProfilesDesign.Request.Update ->
                            withProfile { update(it.profile.uuid) }
                        is ProfilesDesign.Request.Delete ->
                            withProfile { delete(it.profile.uuid) }
                        is ProfilesDesign.Request.Edit ->
                            startActivity(PropertiesActivity::class.intent.setUUID(it.profile.uuid))
                        is ProfilesDesign.Request.Active -> {
                            withProfile {
                                if (it.profile.imported)
                                    setActive(it.profile)
                                else
                                    design.requestSave(it.profile)
                            }
                        }
                        is ProfilesDesign.Request.Duplicate -> {
                            val uuid = withProfile { clone(it.profile.uuid) }

                            startActivity(PropertiesActivity::class.intent.setUUID(uuid))
                        }
                    }
                }
                if (activityStarted) {
                    ticker.onReceive {
                        design.updateElapsed()
                    }
                }
            }
        }
    }

    private suspend fun ProfilesDesign.fetch() {
        withProfile {
            patchProfiles(queryAll())
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/PropertiesActivity.kt
================================================
package yos.clash.material

import yos.clash.material.R
import yos.clash.material.common.util.intent
import yos.clash.material.common.util.setUUID
import yos.clash.material.common.util.uuid
import yos.clash.material.design.PropertiesDesign
import yos.clash.material.design.ui.ToastDuration
import yos.clash.material.design.util.showExceptionToast
import yos.clash.material.service.model.Profile
import yos.clash.material.util.withProfile
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select

class PropertiesActivity : BaseActivity<PropertiesDesign>() {
    private var canceled: Boolean = false

    override suspend fun main() {
        setResult(RESULT_CANCELED)

        val uuid = intent.uuid ?: return finish()
        val design = PropertiesDesign(this)

        val original = withProfile { queryByUUID(uuid) } ?: return finish()

        design.profile = original

        setContentDesign(design)

        defer {
            canceled = true

            withProfile { release(uuid) }
        }

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ActivityStop -> {
                            val profile = design.profile

                            if (!canceled && profile != original) {
                                withProfile {
                                    patch(profile.uuid, profile.name, profile.source, profile.interval)
                                }
                            }
                        }
                        Event.ServiceRecreated -> {
                            finish()
                        }
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        PropertiesDesign.Request.BrowseFiles -> {
                            startActivity(FilesActivity::class.intent.setUUID(uuid))
                        }
                        PropertiesDesign.Request.Commit -> {
                            design.verifyAndCommit()
                        }
                    }
                }
            }
        }
    }

    override fun onBackPressed() {
        design?.apply {
            launch {
                if (!progressing) {
                    if (requestExitWithoutSaving())
                        finish()
                }
            }
        } ?: return super.onBackPressed()
    }

    private suspend fun PropertiesDesign.verifyAndCommit() {
        when {
            profile.name.isBlank() -> {
                showToast(R.string.empty_name, ToastDuration.Long)
            }
            profile.type != Profile.Type.File && profile.source.isBlank() -> {
                showToast(R.string.invalid_url, ToastDuration.Long)
            }
            else -> {
                try {
                    withProcessing { updateStatus ->
                        withProfile {
                            patch(profile.uuid, profile.name, profile.source, profile.interval)

                            coroutineScope {
                                commit(profile.uuid) {
                                    launch {
                                        updateStatus(it)
                                    }
                                }
                            }
                        }
                    }

                    setResult(RESULT_OK)

                    finish()
                } catch (e: Exception) {
                    showExceptionToast(e)
                }
            }
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/ProvidersActivity.kt
================================================
package yos.clash.material

import yos.clash.material.R
import yos.clash.material.common.util.intent
import yos.clash.material.common.util.ticker
import yos.clash.material.design.ProvidersDesign
import yos.clash.material.design.util.showExceptionToast
import yos.clash.material.util.withClash
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import java.util.concurrent.TimeUnit

class ProvidersActivity : BaseActivity<ProvidersDesign>() {
    override suspend fun main() {
        val providers = withClash { queryProviders().sorted() }
        val design = ProvidersDesign(this, providers)

        setContentDesign(design)

        val ticker = ticker(TimeUnit.MINUTES.toMillis(1))

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ProfileLoaded -> {
                            val newList = withClash { queryProviders().sorted() }

                            if (newList != providers) {
                                startActivity(ProvidersActivity::class.intent)

                                finish()
                            }
                        }
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        is ProvidersDesign.Request.Update -> {
                            launch {
                                try {
                                    withClash {
                                        updateProvider(it.provider.type, it.provider.name)
                                    }

                                    design.notifyChanged(it.index)
                                } catch (e: Exception) {
                                    design.showExceptionToast(
                                        getString(
                                            R.string.format_update_provider_failure,
                                            it.provider.name,
                                            e.message
                                        )
                                    )

                                    design.notifyUpdated(it.index)
                                }
                            }
                        }
                    }
                }
                if (activityStarted) {
                    ticker.onReceive {
                        design.updateElapsed()
                    }
                }
            }
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/ProxyActivity.kt
================================================
package yos.clash.material

import yos.clash.material.common.util.intent
import com.github.kr328.clash.core.Clash
import com.github.kr328.clash.core.model.Proxy
import yos.clash.material.design.ProxyDesign
import yos.clash.material.design.model.ProxyState
import yos.clash.material.store.TipsStore
import yos.clash.material.util.withClash
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.selects.select
import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.sync.withPermit
import java.util.concurrent.TimeUnit

class ProxyActivity : BaseActivity<ProxyDesign>() {
    override suspend fun main() {
        val mode = withClash { queryOverride(Clash.OverrideSlot.Session).mode }
        val names = withClash { queryProxyGroupNames(uiStore.proxyExcludeNotSelectable) }
        val states = List(names.size) { ProxyState("?") }
        val unorderedStates = names.indices.map { names[it] to states[it] }.toMap()
        val reloadLock = Semaphore(10)
        val tips = TipsStore(this)

        val design = ProxyDesign(
            this,
            mode,
            names,
            uiStore
        )

        setContentDesign(design)

        launch(Dispatchers.IO) {
            val pkg = packageManager.getPackageInfo(packageName, 0)
            val validate = System.currentTimeMillis() - pkg.firstInstallTime > TimeUnit.DAYS.toMillis(5)

            if (tips.requestDonate && validate) {
                tips.requestDonate = false

                design.requestDonate()
            }
        }

        design.requests.send(ProxyDesign.Request.ReloadAll)

        while (isActive) {
            select<Unit> {
                events.onReceive {
                    when (it) {
                        Event.ProfileLoaded -> {
                            val newNames = withClash {
                                queryProxyGroupNames(uiStore.proxyExcludeNotSelectable)
                            }

                            if (newNames != names) {
                                startActivity(ProxyActivity::class.intent)

                                finish()
                            }
                        }
                        else -> Unit
                    }
                }
                design.requests.onReceive {
                    when (it) {
                        ProxyDesign.Request.ReLaunch -> {
                            startActivity(ProxyActivity::class.intent)

                            finish()
                        }
                        ProxyDesign.Request.ReloadAll -> {
                            names.indices.forEach { idx ->
                                design.requests.trySend(ProxyDesign.Request.Reload(idx))
                            }
                        }
                        is ProxyDesign.Request.Reload -> {
                            launch {
                                val group = reloadLock.withPermit {
                                    withClash {
                                        queryProxyGroup(names[it.index], uiStore.proxySort)
                                    }
                                }
                                val state = states[it.index]

                                state.now = group.now

                                design.updateGroup(
                                    it.index,
                                    group.proxies,
                                    group.type == Proxy.Type.Selector,
                                    state,
                                    unorderedStates
                                )
                            }
                        }
                        is ProxyDesign.Request.Select -> {
                            withClash {
                                patchSelector(names[it.index], it.name)

                                states[it.index].now = it.name
                            }

                            design.requestRedrawVisible()
                        }
                        is ProxyDesign.Request.UrlTest -> {
                            launch {
                                withClash {
                                    healthCheck(names[it.index])
                                }

                                design.requests.send(ProxyDesign.Request.Reload(it.index))
                            }
                        }
                        is ProxyDesign.Request.PatchMode -> {
                            design.showModeSwitchTips()

                            withClash {
                                val o = queryOverride(Clash.OverrideSlot.Session)

                                o.mode = it.mode

                                patchOverride(Clash.OverrideSlot.Session, o)
                            }
                        }
                    }
                }
            }
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/RestartReceiver.kt
================================================
package yos.clash.material

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import yos.clash.material.service.StatusProvider
import yos.clash.material.util.startClashService

class RestartReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        when (intent.action) {
            Intent.ACTION_BOOT_COMPLETED, Intent.ACTION_MY_PACKAGE_REPLACED -> {
                if (StatusProvider.shouldStartClashOnBoot)
                    context.startClashService()
            }
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/SettingsActivity.kt
================================================
package yos.clash.material

import yos.clash.material.common.util.intent
import yos.clash.material.design.SettingsDesign
import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select

class SettingsActivity : BaseActivity<SettingsDesign>() {
    override suspend fun main() {
        val design = SettingsDesign(this)

        setContentDesign(design)

        while (isActive) {
            select<Unit> {
                events.onReceive {

                }
                design.requests.onReceive {
                    when (it) {
                        SettingsDesign.Request.StartApp ->
                            startActivity(AppSettingsActivity::class.intent)
                        SettingsDesign.Request.StartNetwork ->
                            startActivity(NetworkSettingsActivity::class.intent)
                        SettingsDesign.Request.StartOverride ->
                            startActivity(OverrideSettingsActivity::class.intent)
                    }
                }
            }
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/TileService.kt
================================================
package yos.clash.material

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 androidx.annotation.RequiresApi
import yos.clash.material.R
import yos.clash.material.common.constants.Intents
import yos.clash.material.common.constants.Permissions
import yos.clash.material.remote.StatusClient
import yos.clash.material.util.startClashService
import yos.clash.material.util.stopClashService

@RequiresApi(Build.VERSION_CODES.N)
class TileService : TileService() {
    private var currentProfile = ""
    private var clashRunning = false

    override fun onClick() {
        val tile = qsTile ?: return

        when (tile.state) {
            Tile.STATE_INACTIVE -> {
                startClashService()
            }
            Tile.STATE_ACTIVE -> {
                stopClashService()
            }
        }
    }

    override fun onStartListening() {
        super.onStartListening()

        registerReceiver(
            receiver,
            IntentFilter().apply {
                addAction(Intents.ACTION_CLASH_STARTED)
                addAction(Intents.ACTION_CLASH_STOPPED)
                addAction(Intents.ACTION_PROFILE_LOADED)
                addAction(Intents.ACTION_SERVICE_RECREATED)
            },
            Permissions.RECEIVE_SELF_BROADCASTS,
            null
        )

        val name = StatusClient(this).currentProfile()

        clashRunning = name != null
        currentProfile = name ?: ""

        updateTile()
    }

    override fun onStopListening() {
        super.onStopListening()

        unregisterReceiver(receiver)
    }

    private fun updateTile() {
        val tile = qsTile ?: return

        tile.state = if (clashRunning)
            Tile.STATE_ACTIVE
        else
            Tile.STATE_INACTIVE

        tile.label = if (currentProfile.isEmpty())
            getText(R.string.launch_name)
        else
            currentProfile

        tile.icon = Icon.createWithResource(this, R.drawable.ic_logo_service)

        tile.updateTile()
    }

    private val receiver = object : BroadcastReceiver() {
        override fun onReceive(context: Context?, intent: Intent?) {
            when (intent?.action) {
                Intents.ACTION_CLASH_STARTED -> {
                    clashRunning = true

                    currentProfile = ""
                }
                Intents.ACTION_CLASH_STOPPED, Intents.ACTION_SERVICE_RECREATED -> {
                    clashRunning = false

                    currentProfile = ""
                }
                Intents.ACTION_PROFILE_LOADED -> {
                    currentProfile = StatusClient(this@TileService).currentProfile() ?: ""
                }
            }

            updateTile()
        }
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/log/LogcatCache.kt
================================================
package yos.clash.material.log

import androidx.collection.CircularArray
import com.github.kr328.clash.core.model.LogMessage
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock

class LogcatCache {
    data class Snapshot(val messages: List<LogMessage>, val removed: Int, val appended: Int)

    private val array = CircularArray<LogMessage>(CAPACITY)
    private val lock = Mutex()

    private var removed: Int = 0
    private var appended: Int = 0

    suspend fun append(msg: LogMessage) {
        lock.withLock {
            if (array.size() >= CAPACITY) {
                array.removeFromStart(1)

                removed++
                appended--
            }

            array.addLast(msg)

            appended++
        }
    }

    suspend fun snapshot(full: Boolean): Snapshot? {
        return lock.withLock {
            if (!full && removed == 0 && appended == 0) {
                return@withLock null
            }

            Snapshot(
                List(array.size()) { array[it] },
                removed,
                if (full) array.size() + appended else appended
            ).also {
                removed = 0
                appended = 0
            }
        }
    }

    companion object {
        const val CAPACITY = 128
    }
}


================================================
FILE: app/src/main/java/yos/clash/material/log/LogcatFilter.kt
================================================
package yos.clash.material.log

import android.content.Context
import com.github.kr328.clash.core.model.LogMessage
import yos.clash.material.design.util.format
import java.io.BufferedWriter
import java.io.Writer
import java.util.*

class LogcatFilter(output: Writer, private val context: Context) : BufferedWriter(output) {
    fun writeHeader(time: Date) {
        appendLine("# Capture on ${time.format(context)}")
    }

    fun writeMessage(message: LogMessage) {
        val time = message.time.format(context, includeDate = false)
        val level = message.level.name

        appendLine(FORMAT.format(time, level, message.message))
    }

    companion object {
        private const val FORMAT = "%12s %7s: %s"
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/log/LogcatReader.kt
================================================
package yos.clash.material.log

import android.content.Context
import com.github.kr328.clash.core.model.LogMessage
import yos.clash.material.design.model.LogFile
import yos.clash.material.util.logsDir
import java.io.BufferedReader
import java.io.FileReader
import java.util.*

class LogcatReader(context: Context, file: LogFile) : AutoCloseable {
    private val reader = BufferedReader(FileReader(context.logsDir.resolve(file.fileName)))

    override fun close() {
        reader.close()
    }

    fun readAll(): List<LogMessage> {
        return reader.lineSequence()
            .map { it.trim() }
            .filter { !it.startsWith("#") }
            .map { it.split(":", limit = 3) }
            .map {
                LogMessage(
                    time = Date(it[0].toLong()),
                    level = LogMessage.Level.valueOf(it[1]),
                    message = it[2]
                )
            }
            .toList()
    }
}

================================================
FILE: app/src/main/java/yos/clash/material/log/LogcatWriter.kt
================================================
package yos.clash.material.log

import android.content.Context
import com.github.kr328.clash.core.model.LogMessage
import yos.clash.material.design.model.LogFile
import yos.clash.material.util.logsDir
import java.io.BufferedWriter
import java.io.FileWriter

class LogcatWriter(context: Context) : AutoCloseable {
    private val file = LogFile.generate()
    private val writer = BufferedWriter(FileWriter(context.logsDir.resolve(file.fileName)))

    override fun close() {
        writer.close()
    }

    fun appendMessage(message: LogMessage) {
        writer.appendLine(FORMAT.format(message.time.time, message.level.name, message.message))
    }

    companion object {
        private const val FORMAT = "%d:%s:%s"
    }
}

================================================
FILE: app/src/main/
Download .txt
gitextract_6w_2unif/

├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 01-bug-report-en.yml
│   │   ├── 02-feature-request-en.yml
│   │   ├── 03-bug-report-zh-cn.yml
│   │   ├── 04-feature-request-zh-cn.yml
│   │   └── config.yml
│   └── workflows/
│       └── build.yaml
├── .gitignore
├── .gitmodules
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── PRIVACY_POLICY.md
├── README.md
├── README_en.md
├── app/
│   ├── build.gradle.kts
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               ├── AccessControlActivity.kt
│           │               ├── ApkBrokenActivity.kt
│           │               ├── AppCrashedActivity.kt
│           │               ├── AppSettingsActivity.kt
│           │               ├── BaseActivity.kt
│           │               ├── ExternalImportActivity.kt
│           │               ├── FilesActivity.kt
│           │               ├── HelpActivity.kt
│           │               ├── LogcatActivity.kt
│           │               ├── LogcatService.kt
│           │               ├── LogsActivity.kt
│           │               ├── MainActivity.kt
│           │               ├── MainApplication.kt
│           │               ├── NetworkSettingsActivity.kt
│           │               ├── NewProfileActivity.kt
│           │               ├── OverrideSettingsActivity.kt
│           │               ├── ProfilesActivity.kt
│           │               ├── PropertiesActivity.kt
│           │               ├── ProvidersActivity.kt
│           │               ├── ProxyActivity.kt
│           │               ├── RestartReceiver.kt
│           │               ├── SettingsActivity.kt
│           │               ├── TileService.kt
│           │               ├── log/
│           │               │   ├── LogcatCache.kt
│           │               │   ├── LogcatFilter.kt
│           │               │   ├── LogcatReader.kt
│           │               │   ├── LogcatWriter.kt
│           │               │   └── SystemLogcat.kt
│           │               ├── remote/
│           │               │   ├── Broadcasts.kt
│           │               │   ├── FilesClient.kt
│           │               │   ├── Remote.kt
│           │               │   ├── Resource.kt
│           │               │   ├── Service.kt
│           │               │   └── StatusClient.kt
│           │               ├── store/
│           │               │   ├── AppStore.kt
│           │               │   └── TipsStore.kt
│           │               └── util/
│           │                   ├── Activity.kt
│           │                   ├── Application.kt
│           │                   ├── Clash.kt
│           │                   ├── Content.kt
│           │                   ├── Files.kt
│           │                   ├── Remote.kt
│           │                   ├── Service.kt
│           │                   └── Uri.kt
│           └── res/
│               ├── drawable/
│               │   └── ic_launcher_foreground.xml
│               ├── mipmap-anydpi-v26/
│               │   ├── ic_launcher.xml
│               │   └── ic_launcher_round.xml
│               ├── values/
│               │   ├── colors.xml
│               │   ├── ids.xml
│               │   └── themes.xml
│               ├── values-night/
│               │   └── themes.xml
│               └── xml/
│                   ├── full_backup_content.xml
│                   └── network_security_config.xml
├── build.gradle.kts
├── common/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               └── common/
│           │                   ├── Global.kt
│           │                   ├── compat/
│           │                   │   ├── App.kt
│           │                   │   ├── Context.kt
│           │                   │   ├── Html.kt
│           │                   │   ├── Intents.kt
│           │                   │   ├── Package.kt
│           │                   │   ├── Resource.kt
│           │                   │   ├── Services.kt
│           │                   │   ├── UI.kt
│           │                   │   └── View.kt
│           │                   ├── constants/
│           │                   │   ├── Authorities.kt
│           │                   │   ├── Components.kt
│           │                   │   ├── Intents.kt
│           │                   │   ├── Metadata.kt
│           │                   │   └── Permissions.kt
│           │                   ├── id/
│           │                   │   └── UndefinedIds.kt
│           │                   ├── log/
│           │                   │   └── Log.kt
│           │                   ├── store/
│           │                   │   ├── Providers.kt
│           │                   │   ├── Store.kt
│           │                   │   └── StoreProvider.kt
│           │                   └── util/
│           │                       ├── Components.kt
│           │                       ├── Global.kt
│           │                       ├── Intent.kt
│           │                       ├── Parcelable.kt
│           │                       ├── Patterns.kt
│           │                       └── Ticker.kt
│           └── res/
│               ├── values/
│               │   └── strings.xml
│               ├── values-zh/
│               │   └── strings.xml
│               └── values-zh-rTW/
│                   └── strings.xml
├── core/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       ├── foss/
│       │   └── golang/
│       │       ├── go.mod
│       │       ├── go.sum
│       │       └── main.go
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── cpp/
│       │   │   ├── CMakeLists.txt
│       │   │   ├── bridge_helper.c
│       │   │   ├── bridge_helper.h
│       │   │   ├── jni_helper.c
│       │   │   ├── jni_helper.h
│       │   │   └── main.c
│       │   ├── golang/
│       │   │   ├── go.mod
│       │   │   ├── go.sum
│       │   │   └── native/
│       │   │       ├── all/
│       │   │       │   └── imports.go
│       │   │       ├── app/
│       │   │       │   ├── app.go
│       │   │       │   ├── content.go
│       │   │       │   ├── dns.go
│       │   │       │   ├── tun.go
│       │   │       │   └── ui.go
│       │   │       ├── app.go
│       │   │       ├── bridge.c
│       │   │       ├── bridge.h
│       │   │       ├── common/
│       │   │       │   └── path.go
│       │   │       ├── config/
│       │   │       │   ├── defaults.go
│       │   │       │   ├── fetch.go
│       │   │       │   ├── load.go
│       │   │       │   ├── override.go
│       │   │       │   ├── process.go
│       │   │       │   ├── process_open.go
│       │   │       │   ├── process_premium.go
│       │   │       │   ├── provider_open.go
│       │   │       │   └── provider_premium.go
│       │   │       ├── config.go
│       │   │       ├── debug.go
│       │   │       ├── delegate/
│       │   │       │   └── init.go
│       │   │       ├── log_open.go
│       │   │       ├── log_premium.go
│       │   │       ├── main.go
│       │   │       ├── platform/
│       │   │       │   ├── limit.go
│       │   │       │   └── procfs.go
│       │   │       ├── proxy/
│       │   │       │   └── http.go
│       │   │       ├── proxy.go
│       │   │       ├── trace.c
│       │   │       ├── trace.h
│       │   │       ├── tun/
│       │   │       │   ├── dns.go
│       │   │       │   ├── metadata_open.go
│       │   │       │   ├── metadata_premium.go
│       │   │       │   ├── tun.go
│       │   │       │   └── udp.go
│       │   │       ├── tun.go
│       │   │       ├── tunnel/
│       │   │       │   ├── conn.go
│       │   │       │   ├── connectivity.go
│       │   │       │   ├── geoip.go
│       │   │       │   ├── init.go
│       │   │       │   ├── loopback_open.go
│       │   │       │   ├── loopback_premium.go
│       │   │       │   ├── providers_open.go
│       │   │       │   ├── providers_premium.go
│       │   │       │   ├── proxies.go
│       │   │       │   ├── state.go
│       │   │       │   ├── statistic.go
│       │   │       │   └── suspend.go
│       │   │       ├── tunnel.go
│       │   │       └── utils.go
│       │   └── java/
│       │       └── com/
│       │           └── github/
│       │               └── kr328/
│       │                   └── clash/
│       │                       └── core/
│       │                           ├── Clash.kt
│       │                           ├── bridge/
│       │                           │   ├── Bridge.kt
│       │                           │   ├── ClashException.kt
│       │                           │   ├── Content.kt
│       │                           │   ├── FetchCallback.kt
│       │                           │   ├── LogcatInterface.kt
│       │                           │   └── TunInterface.kt
│       │                           ├── model/
│       │                           │   ├── ConfigurationOverride.kt
│       │                           │   ├── FetchStatus.kt
│       │                           │   ├── LogMessage.kt
│       │                           │   ├── Provider.kt
│       │                           │   ├── ProviderList.kt
│       │                           │   ├── Proxy.kt
│       │                           │   ├── ProxyGroup.kt
│       │                           │   ├── ProxySort.kt
│       │                           │   ├── Traffic.kt
│       │                           │   ├── TunnelState.kt
│       │                           │   └── UiConfiguration.kt
│       │                           └── util/
│       │                               ├── Net.kt
│       │                               ├── Parcelizer.kt
│       │                               ├── Serializers.kt
│       │                               └── Traffic.kt
│       └── premium/
│           └── golang/
│               ├── go.mod
│               ├── go.sum
│               └── main.go
├── design/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               └── design/
│           │                   ├── AccessControlDesign.kt
│           │                   ├── ApkBrokenDesign.kt
│           │                   ├── AppCrashedDesign.kt
│           │                   ├── AppSettingsDesign.kt
│           │                   ├── Design.kt
│           │                   ├── FilesDesign.kt
│           │                   ├── HelpDesign.kt
│           │                   ├── LogcatDesign.kt
│           │                   ├── LogsDesign.kt
│           │                   ├── MainDesign.kt
│           │                   ├── NetworkSettingsDesign.kt
│           │                   ├── NewProfileDesign.kt
│           │                   ├── OverrideSettingsDesign.kt
│           │                   ├── ProfilesDesign.kt
│           │                   ├── PropertiesDesign.kt
│           │                   ├── ProvidersDesign.kt
│           │                   ├── ProxyDesign.kt
│           │                   ├── SettingsDesign.kt
│           │                   ├── YosConfigAchieve.kt
│           │                   ├── adapter/
│           │                   │   ├── AppAdapter.kt
│           │                   │   ├── EditableTextListAdapter.kt
│           │                   │   ├── EditableTextMapAdapter.kt
│           │                   │   ├── FileAdapter.kt
│           │                   │   ├── LogFileAdapter.kt
│           │                   │   ├── LogMessageAdapter.kt
│           │                   │   ├── PopupListAdapter.kt
│           │                   │   ├── ProfileAdapter.kt
│           │                   │   ├── ProfileProviderAdapter.kt
│           │                   │   ├── ProviderAdapter.kt
│           │                   │   ├── ProxyAdapter.kt
│           │                   │   ├── ProxyPageAdapter.kt
│           │                   │   └── SideloadProviderAdapter.kt
│           │                   ├── component/
│           │                   │   ├── AccessControlMenu.kt
│           │                   │   ├── ProxyMenu.kt
│           │                   │   ├── ProxyPageFactory.kt
│           │                   │   ├── ProxyView.kt
│           │                   │   ├── ProxyViewConfig.kt
│           │                   │   └── ProxyViewState.kt
│           │                   ├── dialog/
│           │                   │   ├── Dialogs.kt
│           │                   │   ├── Input.kt
│           │                   │   └── Progress.kt
│           │                   ├── model/
│           │                   │   ├── AppInfo.kt
│           │                   │   ├── AppInfoSort.kt
│           │                   │   ├── Behavior.kt
│           │                   │   ├── DarkMode.kt
│           │                   │   ├── File.kt
│           │                   │   ├── LogFile.kt
│           │                   │   ├── ProfileProvider.kt
│           │                   │   ├── ProviderState.kt
│           │                   │   ├── ProxyPageState.kt
│           │                   │   └── ProxyState.kt
│           │                   ├── preference/
│           │                   │   ├── Category.kt
│           │                   │   ├── Clickable.kt
│           │                   │   ├── EditableText.kt
│           │                   │   ├── EditableTextList.kt
│           │                   │   ├── EditableTextMap.kt
│           │                   │   ├── Overlay.kt
│           │                   │   ├── Preference.kt
│           │                   │   ├── Screen.kt
│           │                   │   ├── SelectableList.kt
│           │                   │   ├── Switch.kt
│           │                   │   ├── Tips.kt
│           │                   │   └── Value.kt
│           │                   ├── store/
│           │                   │   └── UiStore.kt
│           │                   ├── ui/
│           │                   │   ├── DayNight.kt
│           │                   │   ├── Insets.kt
│           │                   │   ├── ObservableCurrentTime.kt
│           │                   │   ├── Surface.kt
│           │                   │   └── ToastDuration.kt
│           │                   ├── util/
│           │                   │   ├── ActivityBar.kt
│           │                   │   ├── App.kt
│           │                   │   ├── Binding.kt
│           │                   │   ├── Context.kt
│           │                   │   ├── Diff.kt
│           │                   │   ├── Elevation.kt
│           │                   │   ├── I18n.kt
│           │                   │   ├── Inserts.kt
│           │                   │   ├── Interval.kt
│           │                   │   ├── Landscape.kt
│           │                   │   ├── ListView.kt
│           │                   │   ├── RecyclerView.kt
│           │                   │   ├── ScrollView.kt
│           │                   │   ├── Theme.kt
│           │                   │   ├── Toast.kt
│           │                   │   ├── Validator.kt
│           │                   │   └── View.kt
│           │                   └── view/
│           │                       ├── ActionLabel.kt
│           │                       ├── ActionTextField.kt
│           │                       ├── ActivityBarLayout.kt
│           │                       ├── AppRecyclerView.kt
│           │                       ├── LargeActionCard.kt
│           │                       ├── LargeActionLabel.kt
│           │                       ├── ObservableScrollView.kt
│           │                       └── VerticalScrollableHost.kt
│           └── res/
│               ├── drawable/
│               │   ├── bg_bottom_sheet.xml
│               │   ├── ic_baseline_adb.xml
│               │   ├── ic_baseline_add.xml
│               │   ├── ic_baseline_apps.xml
│               │   ├── ic_baseline_arrow_back.xml
│               │   ├── ic_baseline_assignment.xml
│               │   ├── ic_baseline_attach_file.xml
│               │   ├── ic_baseline_brightness_4.xml
│               │   ├── ic_baseline_clear_all.xml
│               │   ├── ic_baseline_close.xml
│               │   ├── ic_baseline_cloud_download.xml
│               │   ├── ic_baseline_content_copy.xml
│               │   ├── ic_baseline_delete.xml
│               │   ├── ic_baseline_dns.xml
│               │   ├── ic_baseline_domain.xml
│               │   ├── ic_baseline_edit.xml
│               │   ├── ic_baseline_extension.xml
│               │   ├── ic_baseline_flash_on.xml
│               │   ├── ic_baseline_get_app.xml
│               │   ├── ic_baseline_help_center.xml
│               │   ├── ic_baseline_info.xml
│               │   ├── ic_baseline_more_vert.xml
│               │   ├── ic_baseline_publish.xml
│               │   ├── ic_baseline_replay.xml
│               │   ├── ic_baseline_restore.xml
│               │   ├── ic_baseline_save.xml
│               │   ├── ic_baseline_search.xml
│               │   ├── ic_baseline_settings.xml
│               │   ├── ic_baseline_stop.xml
│               │   ├── ic_baseline_swap_vert.xml
│               │   ├── ic_baseline_swap_vertical_circle.xml
│               │   ├── ic_baseline_sync.xml
│               │   ├── ic_baseline_update.xml
│               │   ├── ic_baseline_view_list.xml
│               │   ├── ic_baseline_vpn_lock.xml
│               │   ├── ic_baseline_work.xml
│               │   ├── ic_clash.xml
│               │   ├── ic_outline_article.xml
│               │   ├── ic_outline_check_circle.xml
│               │   ├── ic_outline_delete.xml
│               │   ├── ic_outline_folder.xml
│               │   ├── ic_outline_inbox.xml
│               │   ├── ic_outline_info.xml
│               │   ├── ic_outline_label.xml
│               │   ├── ic_outline_not_interested.xml
│               │   ├── ic_outline_update.xml
│               │   ├── yos_shape.xml
│               │   └── yos_shape_color.xml
│               ├── layout/
│               │   ├── adapter_app.xml
│               │   ├── adapter_editable_text_list.xml
│               │   ├── adapter_editable_text_map.xml
│               │   ├── adapter_file.xml
│               │   ├── adapter_log_message.xml
│               │   ├── adapter_profile.xml
│               │   ├── adapter_profile_provider.xml
│               │   ├── adapter_provider.xml
│               │   ├── adapter_sideload_provider.xml
│               │   ├── common_activity_bar.xml
│               │   ├── common_recycler_list.xml
│               │   ├── component_action_label.xml
│               │   ├── component_action_text_field.xml
│               │   ├── component_large_action_label.xml
│               │   ├── design_about.xml
│               │   ├── design_access_control.xml
│               │   ├── design_app_crashed.xml
│               │   ├── design_files.xml
│               │   ├── design_logcat.xml
│               │   ├── design_logs.xml
│               │   ├── design_main.xml
│               │   ├── design_new_profile.xml
│               │   ├── design_profiles.xml
│               │   ├── design_properties.xml
│               │   ├── design_providers.xml
│               │   ├── design_proxy.xml
│               │   ├── design_settings.xml
│               │   ├── design_settings_common.xml
│               │   ├── design_settings_overide.xml
│               │   ├── dialog_editable_map_text_field.xml
│               │   ├── dialog_fetch_status.xml
│               │   ├── dialog_files_menu.xml
│               │   ├── dialog_preference_list.xml
│               │   ├── dialog_profiles_menu.xml
│               │   ├── dialog_search.xml
│               │   ├── dialog_text_field.xml
│               │   ├── preference_category.xml
│               │   ├── preference_clickable.xml
│               │   ├── preference_switch.xml
│               │   └── preference_tips.xml
│               ├── menu/
│               │   ├── menu_access_control.xml
│               │   └── menu_proxy.xml
│               ├── values/
│               │   ├── attrs.xml
│               │   ├── colors.xml
│               │   ├── dimens.xml
│               │   ├── ids.xml
│               │   ├── strings.xml
│               │   ├── styles.xml
│               │   └── themes.xml
│               ├── values-v23/
│               │   └── themes.xml
│               ├── values-v27/
│               │   └── themes.xml
│               ├── values-v29/
│               │   └── themes.xml
│               ├── values-v31/
│               │   └── colors.xml
│               ├── values-v34/
│               │   └── colors.xml
│               ├── values-zh/
│               │   └── strings.xml
│               ├── values-zh-rHK/
│               │   └── strings.xml
│               └── values-zh-rTW/
│                   └── strings.xml
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── hideapi/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── android/
│                   └── app/
│                       └── ActivityThread.java
├── service/
│   ├── build.gradle.kts
│   ├── consumer-rules.pro
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── yos/
│           │       └── clash/
│           │           └── material/
│           │               └── service/
│           │                   ├── BaseService.kt
│           │                   ├── ClashManager.kt
│           │                   ├── ClashService.kt
│           │                   ├── FilesProvider.kt
│           │                   ├── PreferenceProvider.kt
│           │                   ├── ProfileManager.kt
│           │                   ├── ProfileProcessor.kt
│           │                   ├── ProfileReceiver.kt
│           │                   ├── ProfileWorker.kt
│           │                   ├── RemoteService.kt
│           │                   ├── StatusProvider.kt
│           │                   ├── TunService.kt
│           │                   ├── clash/
│           │                   │   ├── ClashRuntime.kt
│           │                   │   └── module/
│           │                   │       ├── AppListCacheModule.kt
│           │                   │       ├── CloseModule.kt
│           │                   │       ├── ConfigurationModule.kt
│           │                   │       ├── DynamicNotificationModule.kt
│           │                   │       ├── Module.kt
│           │                   │       ├── NetworkObserveModule.kt
│           │                   │       ├── SideloadDatabaseModule.kt
│           │                   │       ├── StaticNotificationModule.kt
│           │                   │       ├── SuspendModule.kt
│           │                   │       ├── TimeZoneModule.kt
│           │                   │       └── TunModule.kt
│           │                   ├── data/
│           │                   │   ├── Converters.kt
│           │                   │   ├── Daos.kt
│           │                   │   ├── Database.kt
│           │                   │   ├── Imported.kt
│           │                   │   ├── ImportedDao.kt
│           │                   │   ├── Pending.kt
│           │                   │   ├── PendingDao.kt
│           │                   │   ├── ProviderMoreInfo.kt
│           │                   │   ├── ProviderMoreInfoDao.kt
│           │                   │   ├── Selection.kt
│           │                   │   ├── SelectionDao.kt
│           │                   │   └── migrations/
│           │                   │       ├── LegacyMigration.kt
│           │                   │       └── Migrations.kt
│           │                   ├── document/
│           │                   │   ├── Document.kt
│           │                   │   ├── FileDocument.kt
│           │                   │   ├── Flag.kt
│           │                   │   ├── Path.kt
│           │                   │   ├── Paths.kt
│           │                   │   ├── Picker.kt
│           │                   │   └── VirtualDocument.kt
│           │                   ├── model/
│           │                   │   ├── AccessControlMode.kt
│           │                   │   └── Profile.kt
│           │                   ├── remote/
│           │                   │   ├── IClashManager.kt
│           │                   │   ├── IFetchObserver.kt
│           │                   │   ├── ILogObserver.kt
│           │                   │   ├── IProfileManager.kt
│           │                   │   └── IRemoteService.kt
│           │                   ├── sideload/
│           │                   │   └── ExternalGeoip.kt
│           │                   ├── store/
│           │                   │   └── ServiceStore.kt
│           │                   └── util/
│           │                       ├── Address.kt
│           │                       ├── Broadcast.kt
│           │                       ├── Connectivity.kt
│           │                       ├── Coroutine.kt
│           │                       ├── Database.kt
│           │                       ├── Files.kt
│           │                       ├── Intent.kt
│           │                       ├── Net.kt
│           │                       └── Serializers.kt
│           └── res/
│               ├── drawable/
│               │   └── ic_logo_service.xml
│               ├── values/
│               │   ├── arrays.xml
│               │   ├── colors.xml
│               │   ├── ids.xml
│               │   └── strings.xml
│               ├── values-zh/
│               │   └── strings.xml
│               ├── values-zh-rHK/
│               │   └── strings.xml
│               └── values-zh-rTW/
│                   └── strings.xml
└── settings.gradle.kts
Download .txt
SYMBOL INDEX (214 symbols across 50 files)

FILE: core/src/main/cpp/bridge_helper.c
  function down_scale_traffic (line 3) | uint64_t down_scale_traffic(uint64_t value) {

FILE: core/src/main/cpp/jni_helper.c
  function initialize_jni (line 12) | void initialize_jni(JavaVM *vm, JNIEnv *env) {
  function JavaVM (line 20) | JavaVM *global_java_vm() {
  function jstring (line 37) | jstring jni_new_string(JNIEnv *env, const char *str) {
  function jni_catch_exception (line 46) | int jni_catch_exception(JNIEnv *env) {
  function jni_attach_thread (line 57) | void jni_attach_thread(struct _scoped_jni *jni) {
  function jni_detach_thread (line 72) | void jni_detach_thread(struct _scoped_jni *jni) {
  function release_string (line 80) | void release_string(char **str) {

FILE: core/src/main/cpp/jni_helper.h
  type _scoped_jni (line 9) | struct _scoped_jni {
  type _scoped_jni (line 18) | struct _scoped_jni
  type _scoped_jni (line 19) | struct _scoped_jni

FILE: core/src/main/cpp/main.c
  function JNICALL (line 11) | JNICALL
  function JNICALL (line 23) | JNICALL
  function JNICALL (line 30) | JNICALL
  function JNICALL (line 37) | JNICALL
  function JNICALL (line 46) | JNICALL
  function JNICALL (line 55) | JNICALL
  function JNICALL (line 66) | JNICALL
  function JNICALL (line 77) | JNICALL
  function JNICALL (line 87) | JNICALL
  function JNICALL (line 97) | JNICALL
  function JNICALL (line 108) | JNICALL
  function JNICALL (line 125) | JNICALL
  function JNICALL (line 132) | JNICALL
  function JNICALL (line 147) | JNICALL
  function JNICALL (line 154) | JNICALL
  function JNICALL (line 164) | JNICALL
  function JNICALL (line 180) | JNICALL
  function JNICALL (line 192) | JNICALL
  function JNICALL (line 199) | JNICALL
  function JNICALL (line 210) | JNICALL
  function JNICALL (line 221) | JNICALL
  function JNICALL (line 235) | JNICALL
  function JNICALL (line 244) | JNICALL
  function JNICALL (line 258) | JNICALL
  function JNICALL (line 268) | JNICALL
  function JNICALL (line 279) | JNICALL
  function JNICALL (line 287) | JNICALL
  function JNICALL (line 314) | JNICALL
  function JNICALL (line 323) | JNICALL
  function call_tun_interface_mark_socket_impl (line 347) | static void call_tun_interface_mark_socket_impl(void *tun_interface, int...
  function call_tun_interface_query_socket_uid_impl (line 357) | static int call_tun_interface_query_socket_uid_impl(void *tun_interface,...
  function call_completable_complete_impl (line 370) | static void call_completable_complete_impl(void *completable, const char...
  function call_fetch_callback_report_impl (line 395) | static void call_fetch_callback_report_impl(void *fetch_callback, const ...
  function call_fetch_callback_complete_impl (line 408) | static void call_fetch_callback_complete_impl(void *fetch_callback, cons...
  function call_logcat_interface_received_impl (line 424) | static int call_logcat_interface_received_impl(void *callback, const cha...
  function open_content_impl (line 441) | static int open_content_impl(const char *url, char *error, int error_len...
  function release_jni_object_impl (line 473) | static void release_jni_object_impl(void *obj) {
  function JNICALL (line 481) | JNICALL

FILE: core/src/main/golang/native/app.go
  function openRemoteContent (line 15) | func openRemoteContent(url string) (int, error) {
  function notifyDnsChanged (line 33) | func notifyDnsChanged(dnsList C.c_string) {
  function notifyInstalledAppsChanged (line 40) | func notifyInstalledAppsChanged(uids C.c_string) {
  function notifyTimeZoneChanged (line 47) | func notifyTimeZoneChanged(name C.c_string, offset C.int) {
  function queryConfiguration (line 53) | func queryConfiguration() *C.char {
  function init (line 59) | func init() {

FILE: core/src/main/golang/native/app/app.go
  function ApplyVersionName (line 13) | func ApplyVersionName(versionName string) {
  function ApplyPlatformVersion (line 17) | func ApplyPlatformVersion(version int) {
  function VersionName (line 21) | func VersionName() string {
  function PlatformVersion (line 25) | func PlatformVersion() int {
  function NotifyInstallAppsChanged (line 29) | func NotifyInstallAppsChanged(uidList string) {
  function QueryAppByUid (line 47) | func QueryAppByUid(uid int) string {
  function NotifyTimeZoneChanged (line 51) | func NotifyTimeZoneChanged(name string, offset int) {

FILE: core/src/main/golang/native/app/content.go
  function OpenContent (line 13) | func OpenContent(url string) (*os.File, error) {
  function ApplyContentContext (line 25) | func ApplyContentContext(openContent func(string) (int, error)) {

FILE: core/src/main/golang/native/app/dns.go
  function NotifyDnsChanged (line 9) | func NotifyDnsChanged(dnsList string) {

FILE: core/src/main/golang/native/app/tun.go
  function MarkSocket (line 13) | func MarkSocket(fd int) {
  function QuerySocketUid (line 17) | func QuerySocketUid(source, target net.Addr) int {
  function ApplyTunContext (line 36) | func ApplyTunContext(markSocket func(fd int), querySocketUid func(int, s...
  function init (line 49) | func init() {

FILE: core/src/main/golang/native/app/ui.go
  function ApplySubtitlePattern (line 11) | func ApplySubtitlePattern(pattern string) {
  function SubtitlePattern (line 32) | func SubtitlePattern() *regexp2.Regexp {

FILE: core/src/main/golang/native/bridge.c
  function mark_socket (line 20) | void mark_socket(void *interface, int fd) {
  function query_socket_uid (line 26) | int query_socket_uid(void *interface, int protocol, char *source, char *...
  function complete (line 37) | void complete(void *obj, char *error) {
  function fetch_complete (line 45) | void fetch_complete(void *fetch_callback, char *exception) {
  function fetch_report (line 53) | void fetch_report(void *fetch_callback, char *json_status) {
  function logcat_received (line 61) | int logcat_received(void *logcat_interface, char *payload) {
  function open_content (line 71) | int open_content(char *url, char *error, int error_length) {
  function release_object (line 81) | void release_object(void *obj) {
  function log_info (line 87) | void log_info(char *msg) {
  function log_error (line 93) | void log_error(char *msg) {
  function log_warn (line 99) | void log_warn(char *msg) {
  function log_debug (line 105) | void log_debug(char *msg) {
  function log_verbose (line 111) | void log_verbose(char *msg) {

FILE: core/src/main/golang/native/common/path.go
  function ResolveAsRoot (line 5) | func ResolveAsRoot(path string) string {

FILE: core/src/main/golang/native/config.go
  type remoteValidCallback (line 13) | type remoteValidCallback struct
    method reportStatus (line 17) | func (r *remoteValidCallback) reportStatus(json string) {
  function fetchAndValid (line 22) | func fetchAndValid(callback unsafe.Pointer, path, url C.c_string, force ...
  function load (line 37) | func load(completable unsafe.Pointer, path C.c_string) {
  function readOverride (line 48) | func readOverride(slot C.int) *C.char {
  function writeOverride (line 53) | func writeOverride(slot C.int, content C.c_string) {
  function clearOverride (line 60) | func clearOverride(slot C.int) {

FILE: core/src/main/golang/native/config/fetch.go
  type Status (line 18) | type Status struct
  function openUrl (line 35) | func openUrl(url string) (io.ReadCloser, error) {
  function openContent (line 52) | func openContent(url string) (io.ReadCloser, error) {
  function fetch (line 56) | func fetch(url *U.URL, file string) error {
  function FetchAndValid (line 92) | func FetchAndValid(

FILE: core/src/main/golang/native/config/load.go
  function logDns (line 18) | func logDns(cfg *config.RawConfig) {
  function UnmarshalAndPatch (line 33) | func UnmarshalAndPatch(profilePath string) (*config.RawConfig, error) {
  function Parse (line 53) | func Parse(rawConfig *config.RawConfig) (*config.Config, error) {
  function Load (line 62) | func Load(path string) error {
  function LoadDefault (line 88) | func LoadDefault() {

FILE: core/src/main/golang/native/config/override.go
  type OverrideSlot (line 10) | type OverrideSlot
  constant OverrideSlotPersist (line 13) | OverrideSlotPersist OverrideSlot = iota
  constant OverrideSlotSession (line 14) | OverrideSlotSession
  constant defaultPersistOverride (line 17) | defaultPersistOverride = `{"dns":{"enable": false}, "redir-port": 0, "tp...
  constant defaultSessionOverride (line 18) | defaultSessionOverride = `{}`
  function overridePersistPath (line 22) | func overridePersistPath() string {
  function ReadOverride (line 26) | func ReadOverride(slot OverrideSlot) string {
  function WriteOverride (line 47) | func WriteOverride(slot OverrideSlot, content string) {
  function ClearOverride (line 61) | func ClearOverride(slot OverrideSlot) {

FILE: core/src/main/golang/native/config/process.go
  type processor (line 29) | type processor
  function patchOverride (line 31) | func patchOverride(cfg *config.RawConfig, _ string) error {
  function patchGeneral (line 42) | func patchGeneral(cfg *config.RawConfig, _ string) error {
  function patchProfile (line 50) | func patchProfile(cfg *config.RawConfig, _ string) error {
  function patchDns (line 57) | func patchDns(cfg *config.RawConfig, _ string) error {
  function patchProviders (line 79) | func patchProviders(cfg *config.RawConfig, profileDir string) error {
  function validConfig (line 89) | func validConfig(cfg *config.RawConfig, _ string) error {
  function process (line 101) | func process(cfg *config.RawConfig, profileDir string) error {

FILE: core/src/main/golang/native/config/process_open.go
  function patchTun (line 7) | func patchTun(cfg *config.RawConfig, _ string) error {

FILE: core/src/main/golang/native/config/process_premium.go
  function patchTun (line 7) | func patchTun(cfg *config.RawConfig, _ string) error {

FILE: core/src/main/golang/native/config/provider_open.go
  function forEachProviders (line 11) | func forEachProviders(rawCfg *config.RawConfig, fun func(index int, tota...
  function destroyProviders (line 22) | func destroyProviders(cfg *config.Config) {

FILE: core/src/main/golang/native/config/provider_premium.go
  function forEachProviders (line 11) | func forEachProviders(rawCfg *config.RawConfig, fun func(index int, tota...
  function destroyProviders (line 28) | func destroyProviders(cfg *config.Config) {

FILE: core/src/main/golang/native/debug.go
  function init (line 12) | func init() {

FILE: core/src/main/golang/native/delegate/init.go
  function Init (line 22) | func Init(home, versionName string, platformVersion int) {

FILE: core/src/main/golang/native/log_open.go
  type message (line 16) | type message struct
  function init (line 22) | func init() {
  function subscribeLogcat (line 49) | func subscribeLogcat(remote unsafe.Pointer) {

FILE: core/src/main/golang/native/log_premium.go
  type message (line 16) | type message struct
  function init (line 22) | func init() {
  function subscribeLogcat (line 48) | func subscribeLogcat(remote unsafe.Pointer) {

FILE: core/src/main/golang/native/main.go
  function main (line 20) | func main() {
  function coreInit (line 25) | func coreInit(home, versionName C.c_string, sdkVersion C.int) {
  function reset (line 36) | func reset() {
  function forceGc (line 45) | func forceGc() {

FILE: core/src/main/golang/native/platform/limit.go
  function init (line 10) | func init() {
  function ShouldBlockConnection (line 29) | func ShouldBlockConnection() bool {

FILE: core/src/main/golang/native/platform/procfs.go
  function QuerySocketUidFromProcFs (line 22) | func QuerySocketUidFromProcFs(source, _ net.Addr) int {
  function doQuery (line 66) | func doQuery(path string, sIP net.IP, sPort int) int {
  function nativeEndianIP (line 105) | func nativeEndianIP(ip net.IP) []byte {
  function init (line 117) | func init() {
  function init (line 164) | func init() {

FILE: core/src/main/golang/native/proxy.go
  function startHttp (line 11) | func startHttp(listenAt C.c_string) *C.char {
  function stopHttp (line 23) | func stopHttp() {

FILE: core/src/main/golang/native/proxy/http.go
  function Start (line 13) | func Start(listen string) (listenAt string, err error) {
  function Stop (line 27) | func Stop() {
  function stopLocked (line 34) | func stopLocked() {

FILE: core/src/main/golang/native/trace.c
  function trace_method_exit (line 5) | void trace_method_exit(const char **name) {

FILE: core/src/main/golang/native/tun.go
  type remoteTun (line 21) | type remoteTun struct
    method markSocket (line 29) | func (t *remoteTun) markSocket(fd int) {
    method querySocketUid (line 40) | func (t *remoteTun) querySocketUid(protocol int, source, target string...
    method close (line 51) | func (t *remoteTun) close() {
  function startTun (line 67) | func startTun(fd C.int, gateway, portal, dns C.c_string, callback unsafe...
  function stopTun (line 100) | func stopTun() {

FILE: core/src/main/golang/native/tun/dns.go
  function shouldHijackDns (line 11) | func shouldHijackDns(dns net.IP, target net.IP, targetPort int) bool {
  function relayDns (line 19) | func relayDns(payload []byte) ([]byte, error) {

FILE: core/src/main/golang/native/tun/metadata_open.go
  function createMetadata (line 12) | func createMetadata(lAddr, rAddr *net.TCPAddr) *C.Metadata {

FILE: core/src/main/golang/native/tun/metadata_premium.go
  function createMetadata (line 13) | func createMetadata(lAddr, rAddr *net.TCPAddr) *C.Metadata {

FILE: core/src/main/golang/native/tun/tun.go
  function Start (line 23) | func Start(fd int, gateway, portal, dns string) (io.Closer, error) {

FILE: core/src/main/golang/native/tun/udp.go
  type packet (line 7) | type packet struct
    method Data (line 14) | func (pkt *packet) Data() []byte {
    method WriteBack (line 18) | func (pkt *packet) WriteBack(b []byte, addr net.Addr) (n int, err erro...
    method Drop (line 22) | func (pkt *packet) Drop() {
    method LocalAddr (line 26) | func (pkt *packet) LocalAddr() net.Addr {

FILE: core/src/main/golang/native/tunnel.go
  function queryTunnelState (line 14) | func queryTunnelState() *C.char {
  function queryNow (line 25) | func queryNow(upload, download *C.uint64_t) {
  function queryTotal (line 33) | func queryTotal(upload, download *C.uint64_t) {
  function queryGroupNames (line 41) | func queryGroupNames(excludeNotSelectable C.int) *C.char {
  function queryGroup (line 46) | func queryGroup(name C.c_string, sortMode C.c_string) *C.char {
  function healthCheck (line 69) | func healthCheck(completable unsafe.Pointer, name C.c_string) {
  function healthCheckAll (line 78) | func healthCheckAll() {
  function patchSelector (line 83) | func patchSelector(selector, name C.c_string) C.int {
  function queryProviders (line 95) | func queryProviders() *C.char {
  function updateProvider (line 100) | func updateProvider(completable unsafe.Pointer, pType C.c_string, name C...
  function suspend (line 109) | func suspend(suspended C.int) {
  function installSideloadGeoip (line 114) | func installSideloadGeoip(block unsafe.Pointer, blockSize C.int) *C.char {

FILE: core/src/main/golang/native/tunnel/conn.go
  function CloseAllConnections (line 8) | func CloseAllConnections() {
  function closeMatch (line 14) | func closeMatch(filter func(conn C.Conn) bool) {
  function closeConnByGroup (line 24) | func closeConnByGroup(name string) {

FILE: core/src/main/golang/native/tunnel/connectivity.go
  function HealthCheck (line 13) | func HealthCheck(name string) {
  function HealthCheckAll (line 44) | func HealthCheckAll() {

FILE: core/src/main/golang/native/tunnel/geoip.go
  function InstallSideloadGeoip (line 11) | func InstallSideloadGeoip(block []byte) error {

FILE: core/src/main/golang/native/tunnel/init.go
  function init (line 14) | func init() {

FILE: core/src/main/golang/native/tunnel/providers_open.go
  type Provider (line 14) | type Provider struct
  function QueryProviders (line 21) | func QueryProviders() []*Provider {
  function UpdateProvider (line 54) | func UpdateProvider(_ string, name string) error {

FILE: core/src/main/golang/native/tunnel/providers_premium.go
  type Provider (line 18) | type Provider struct
  function QueryProviders (line 25) | func QueryProviders() []*Provider {
  function UpdateProvider (line 67) | func UpdateProvider(t string, name string) error {

FILE: core/src/main/golang/native/tunnel/proxies.go
  type SortMode (line 18) | type SortMode
  constant Default (line 21) | Default SortMode = iota
  constant Title (line 22) | Title
  constant Delay (line 23) | Delay
  type Proxy (line 26) | type Proxy struct
  type ProxyGroup (line 34) | type ProxyGroup struct
  type sortableProxyList (line 40) | type sortableProxyList struct
    method Len (line 45) | func (s *sortableProxyList) Len() int {
    method Less (line 49) | func (s *sortableProxyList) Less(i, j int) bool {
    method Swap (line 53) | func (s *sortableProxyList) Swap(i, j int) {
  function QueryProxyGroupNames (line 57) | func QueryProxyGroupNames(excludeNotSelectable bool) []string {
  function QueryProxyGroup (line 83) | func QueryProxyGroup(name string, sortMode SortMode, uiSubtitlePattern *...
  function PatchSelector (line 131) | func PatchSelector(selector, name string) bool {
  function collectProviders (line 165) | func collectProviders(providers []provider.ProxyProvider, uiSubtitlePatt...

FILE: core/src/main/golang/native/tunnel/state.go
  function QueryMode (line 7) | func QueryMode() string {

FILE: core/src/main/golang/native/tunnel/statistic.go
  function ResetStatistic (line 7) | func ResetStatistic() {
  function Now (line 11) | func Now() (up int64, down int64) {
  function Total (line 15) | func Total() (up int64, down int64) {

FILE: core/src/main/golang/native/tunnel/suspend.go
  function Suspend (line 5) | func Suspend(s bool) {

FILE: core/src/main/golang/native/utils.go
  function marshalJson (line 10) | func marshalJson(obj any) *C.char {
  function marshalString (line 19) | func marshalString(obj any) *C.char {

FILE: hideapi/src/main/java/android/app/ActivityThread.java
  class ActivityThread (line 3) | public class ActivityThread {
    method currentProcessName (line 4) | public static String currentProcessName() {
Condensed preview — 484 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,063K chars).
[
  {
    "path": ".gitattributes",
    "chars": 53,
    "preview": "* text=auto eol=lf\n\n*.bat text eol=crlf\n*.jar binary\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/01-bug-report-en.yml",
    "chars": 2963,
    "preview": "name: \"[English] Bug Report\"\ndescription: \"Create a report to help us debug bugs\"\ntitle: \"[BUG] \"\nbody:\n  - type: markdo"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/02-feature-request-en.yml",
    "chars": 760,
    "preview": "name: \"[English] Feature Request\"\ndescription: \"Create a report to help us improve\"\ntitle: \"[Feature Request] \"\nbody:\n  "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/03-bug-report-zh-cn.yml",
    "chars": 2169,
    "preview": "name: \"[简体中文] 错误报告\"\ndescription: \"创建错误报告以帮助我们修正应用\"\ntitle: \"[BUG] \"\nbody:\n  - type: markdown\n    attributes:\n      value:"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/04-feature-request-zh-cn.yml",
    "chars": 525,
    "preview": "name: \"[简体中文] 功能请求\"\ndescription: \"您希望的能够在应用中增加功能\"\ntitle: \"[Feature Request] \"\nbody:\n  - type: markdown\n    attributes:\n "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 28,
    "preview": "blank_issues_enabled: false\n"
  },
  {
    "path": ".github/workflows/build.yaml",
    "chars": 6689,
    "preview": "name: Android CI\non:\n  push:\n    branches:\n      - main\n    paths-ignore:\n      # - '.github/**'\n      - '.idea/**'\n    "
  },
  {
    "path": ".gitignore",
    "chars": 770,
    "preview": ".gradle\nbuild/\n/app/foss/release\n/app/premium/release\n/captures\n\n# Ignore Gradle GUI config\ngradle-app.setting\n\n# Avoid "
  },
  {
    "path": ".gitmodules",
    "chars": 238,
    "preview": "[submodule \"clash-foss\"]\n\tpath = core/src/foss/golang/clash\n\turl = https://github.com/xuhaoyang/ClashForAndroid.git\n[sub"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 474,
    "preview": "## Contributing to Clash for Android\n\n#### Code Style\n\nPlease use `Android Studio` or `Intellij IDEA` to open the projec"
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "NOTICE",
    "chars": 45546,
    "preview": "3th-party software licenses\n\n * Clash\n==========================================================================\n       "
  },
  {
    "path": "PRIVACY_POLICY.md",
    "chars": 2535,
    "preview": "## Privacy Policy\n\nThe Clash for Android is built as an Open Source software. This app is provided by personal at no cos"
  },
  {
    "path": "README.md",
    "chars": 1371,
    "preview": "## Clash You\n\n📕 [English Version](./README_en.md)\n\n基于 [Clash for Android](),为安卓设备设计的 [Clash]() GUI,使用 Material You 设计语言。"
  },
  {
    "path": "README_en.md",
    "chars": 2080,
    "preview": "## Clash You\n\n**⚠ This page is translated by GPT 4.**\n\nBased on [Clash for Android](),\na [Clash]() GUI designed for Andr"
  },
  {
    "path": "app/build.gradle.kts",
    "chars": 1185,
    "preview": "plugins {\n    kotlin(\"android\")\n    kotlin(\"kapt\")\n    id(\"com.android.application\")\n}\n\ndependencies {\n    repositories "
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 2186,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 7843,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:to"
  },
  {
    "path": "app/src/main/java/yos/clash/material/AccessControlActivity.kt",
    "chars": 5031,
    "preview": "package yos.clash.material\n\nimport android.Manifest.permission.INTERNET\nimport android.content.ClipData\nimport android.c"
  },
  {
    "path": "app/src/main/java/yos/clash/material/ApkBrokenActivity.kt",
    "chars": 513,
    "preview": "package yos.clash.material\n\nimport android.content.Intent\nimport android.net.Uri\nimport yos.clash.material.design.ApkBro"
  },
  {
    "path": "app/src/main/java/yos/clash/material/AppCrashedActivity.kt",
    "chars": 954,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.common.compat.versionCodeCompat\nimport yos.clash.material.common.l"
  },
  {
    "path": "app/src/main/java/yos/clash/material/AppSettingsActivity.kt",
    "chars": 1934,
    "preview": "package yos.clash.material\n\nimport android.content.pm.PackageManager\nimport yos.clash.material.common.util.componentName"
  },
  {
    "path": "app/src/main/java/yos/clash/material/BaseActivity.kt",
    "chars": 7089,
    "preview": "package yos.clash.material\n\nimport android.content.res.Configuration\nimport android.os.Build\nimport android.os.Bundle\nim"
  },
  {
    "path": "app/src/main/java/yos/clash/material/ExternalImportActivity.kt",
    "chars": 1455,
    "preview": "package yos.clash.material\n\nimport android.app.Activity\nimport android.content.Intent\nimport android.os.Bundle\nimport yo"
  },
  {
    "path": "app/src/main/java/yos/clash/material/FilesActivity.kt",
    "chars": 10626,
    "preview": "@file:Suppress(\"BlockingMethodInNonBlockingContext\")\n\npackage yos.clash.material\n\nimport android.content.Intent\nimport a"
  },
  {
    "path": "app/src/main/java/yos/clash/material/HelpActivity.kt",
    "chars": 446,
    "preview": "package yos.clash.material\n\nimport android.content.Intent\nimport yos.clash.material.design.HelpDesign\nimport kotlinx.cor"
  },
  {
    "path": "app/src/main/java/yos/clash/material/LogcatActivity.kt",
    "chars": 5935,
    "preview": "package yos.clash.material\n\nimport android.content.ComponentName\nimport android.content.Context\nimport android.content.S"
  },
  {
    "path": "app/src/main/java/yos/clash/material/LogcatService.kt",
    "chars": 5760,
    "preview": "package yos.clash.material\n\nimport android.app.PendingIntent\nimport android.app.Service\nimport android.content.Component"
  },
  {
    "path": "app/src/main/java/yos/clash/material/LogsActivity.kt",
    "chars": 2348,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.common.util.intent\nimport yos.clash.material.common.util.setFileNa"
  },
  {
    "path": "app/src/main/java/yos/clash/material/MainActivity.kt",
    "chars": 5616,
    "preview": "package yos.clash.material\n\nimport android.content.Context\nimport androidx.activity.result.contract.ActivityResultContra"
  },
  {
    "path": "app/src/main/java/yos/clash/material/MainApplication.kt",
    "chars": 933,
    "preview": "package yos.clash.material\n\nimport android.app.Application\nimport android.content.Context\nimport androidx.core.splashscr"
  },
  {
    "path": "app/src/main/java/yos/clash/material/NetworkSettingsActivity.kt",
    "chars": 1180,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.common.util.intent\nimport yos.clash.material.design.NetworkSetting"
  },
  {
    "path": "app/src/main/java/yos/clash/material/NewProfileActivity.kt",
    "chars": 5075,
    "preview": "package yos.clash.material\n\nimport android.app.Activity\nimport android.content.ComponentName\nimport android.content.Inte"
  },
  {
    "path": "app/src/main/java/yos/clash/material/OverrideSettingsActivity.kt",
    "chars": 3152,
    "preview": "package yos.clash.material\n\nimport android.content.pm.PackageManager\nimport yos.clash.material.common.compat.getDrawable"
  },
  {
    "path": "app/src/main/java/yos/clash/material/ProfilesActivity.kt",
    "chars": 2970,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.common.util.intent\nimport yos.clash.material.common.util.setUUID\ni"
  },
  {
    "path": "app/src/main/java/yos/clash/material/PropertiesActivity.kt",
    "chars": 3722,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.R\nimport yos.clash.material.common.util.intent\nimport yos.clash.ma"
  },
  {
    "path": "app/src/main/java/yos/clash/material/ProvidersActivity.kt",
    "chars": 2614,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.R\nimport yos.clash.material.common.util.intent\nimport yos.clash.ma"
  },
  {
    "path": "app/src/main/java/yos/clash/material/ProxyActivity.kt",
    "chars": 4971,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.common.util.intent\nimport com.github.kr328.clash.core.Clash\nimport"
  },
  {
    "path": "app/src/main/java/yos/clash/material/RestartReceiver.kt",
    "chars": 588,
    "preview": "package yos.clash.material\n\nimport android.content.BroadcastReceiver\nimport android.content.Context\nimport android.conte"
  },
  {
    "path": "app/src/main/java/yos/clash/material/SettingsActivity.kt",
    "chars": 1048,
    "preview": "package yos.clash.material\n\nimport yos.clash.material.common.util.intent\nimport yos.clash.material.design.SettingsDesign"
  },
  {
    "path": "app/src/main/java/yos/clash/material/TileService.kt",
    "chars": 2953,
    "preview": "package yos.clash.material\n\nimport android.content.BroadcastReceiver\nimport android.content.Context\nimport android.conte"
  },
  {
    "path": "app/src/main/java/yos/clash/material/log/LogcatCache.kt",
    "chars": 1297,
    "preview": "package yos.clash.material.log\n\nimport androidx.collection.CircularArray\nimport com.github.kr328.clash.core.model.LogMes"
  },
  {
    "path": "app/src/main/java/yos/clash/material/log/LogcatFilter.kt",
    "chars": 728,
    "preview": "package yos.clash.material.log\n\nimport android.content.Context\nimport com.github.kr328.clash.core.model.LogMessage\nimpor"
  },
  {
    "path": "app/src/main/java/yos/clash/material/log/LogcatReader.kt",
    "chars": 947,
    "preview": "package yos.clash.material.log\n\nimport android.content.Context\nimport com.github.kr328.clash.core.model.LogMessage\nimpor"
  },
  {
    "path": "app/src/main/java/yos/clash/material/log/LogcatWriter.kt",
    "chars": 730,
    "preview": "package yos.clash.material.log\n\nimport android.content.Context\nimport com.github.kr328.clash.core.model.LogMessage\nimpor"
  },
  {
    "path": "app/src/main/java/yos/clash/material/log/SystemLogcat.kt",
    "chars": 697,
    "preview": "package yos.clash.material.log\n\nobject SystemLogcat {\n    private val command = arrayOf(\n        \"logcat\",\n        \"-d\","
  },
  {
    "path": "app/src/main/java/yos/clash/material/remote/Broadcasts.kt",
    "chars": 3064,
    "preview": "package yos.clash.material.remote\n\nimport android.app.Application\nimport android.content.BroadcastReceiver\nimport androi"
  },
  {
    "path": "app/src/main/java/yos/clash/material/remote/FilesClient.kt",
    "chars": 3282,
    "preview": "@file:Suppress(\"BlockingMethodInNonBlockingContext\")\n\npackage yos.clash.material.remote\n\nimport android.content.Context\n"
  },
  {
    "path": "app/src/main/java/yos/clash/material/remote/Remote.kt",
    "chars": 2172,
    "preview": "package yos.clash.material.remote\n\nimport android.content.Context\nimport android.content.Intent\nimport yos.clash.materia"
  },
  {
    "path": "app/src/main/java/yos/clash/material/remote/Resource.kt",
    "chars": 1500,
    "preview": "package yos.clash.material.remote\n\nimport kotlinx.coroutines.suspendCancellableCoroutine\nimport kotlin.coroutines.resume"
  },
  {
    "path": "app/src/main/java/yos/clash/material/remote/Service.kt",
    "chars": 1699,
    "preview": "package yos.clash.material.remote\n\nimport android.app.Application\nimport android.content.ComponentName\nimport android.co"
  },
  {
    "path": "app/src/main/java/yos/clash/material/remote/StatusClient.kt",
    "chars": 889,
    "preview": "package yos.clash.material.remote\n\nimport android.content.Context\nimport android.net.Uri\nimport yos.clash.material.commo"
  },
  {
    "path": "app/src/main/java/yos/clash/material/store/AppStore.kt",
    "chars": 528,
    "preview": "package yos.clash.material.store\n\nimport android.content.Context\nimport yos.clash.material.common.store.Store\nimport yos"
  },
  {
    "path": "app/src/main/java/yos/clash/material/store/TipsStore.kt",
    "chars": 702,
    "preview": "package yos.clash.material.store\n\nimport android.content.Context\nimport yos.clash.material.common.store.Store\nimport yos"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Activity.kt",
    "chars": 1271,
    "preview": "@file:Suppress(\"LeakingThis\")\n\npackage yos.clash.material.util\n\nimport androidx.lifecycle.Lifecycle\nimport androidx.life"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Application.kt",
    "chars": 2387,
    "preview": "package yos.clash.material.util\n\nimport android.app.Activity\nimport android.app.Application\nimport android.content.Conte"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Clash.kt",
    "chars": 972,
    "preview": "package yos.clash.material.util\n\nimport android.content.Context\nimport android.content.Intent\nimport android.net.VpnServ"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Content.kt",
    "chars": 726,
    "preview": "package yos.clash.material.util\n\nimport android.content.ContentResolver\nimport android.net.Uri\nimport kotlinx.coroutines"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Files.kt",
    "chars": 147,
    "preview": "package yos.clash.material.util\n\nimport android.content.Context\nimport java.io.File\n\nval Context.logsDir: File\n    get()"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Remote.kt",
    "chars": 1298,
    "preview": "package yos.clash.material.util\n\nimport android.os.DeadObjectException\nimport yos.clash.material.common.log.Log\nimport y"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Service.kt",
    "chars": 269,
    "preview": "package yos.clash.material.util\n\nimport android.content.Context\nimport android.content.ServiceConnection\n\nfun Context.un"
  },
  {
    "path": "app/src/main/java/yos/clash/material/util/Uri.kt",
    "chars": 137,
    "preview": "package yos.clash.material.util\n\nimport android.net.Uri\n\nval Uri.fileName: String?\n    get() = schemeSpecificPart.split("
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_foreground.xml",
    "chars": 1112,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n  "
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 343,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 343,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 123,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"color_launcher_background\">#FFFFFF</color>\n</resourc"
  },
  {
    "path": "app/src/main/res/values/ids.xml",
    "chars": 110,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <item name=\"nf_logcat_status\" type=\"id\" />\n</resources>"
  },
  {
    "path": "app/src/main/res/values/themes.xml",
    "chars": 358,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"BootstrapTheme\" parent=\"AppThemeLight\" />\n    <style"
  },
  {
    "path": "app/src/main/res/values-night/themes.xml",
    "chars": 355,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"BootstrapTheme\" parent=\"AppThemeDark\" />\n    <style "
  },
  {
    "path": "app/src/main/res/xml/full_backup_content.xml",
    "chars": 399,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<full-backup-content>\n    <include\n        domain=\"sharedpref\"\n        path=\".\" /"
  },
  {
    "path": "app/src/main/res/xml/network_security_config.xml",
    "chars": 349,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config xmlns:tools=\"http://schemas.android.com/tools\"\n    tools"
  },
  {
    "path": "build.gradle.kts",
    "chars": 4923,
    "preview": "@file:Suppress(\"UNUSED_VARIABLE\")\n\nimport com.android.build.gradle.AppExtension\nimport com.android.build.gradle.BaseExte"
  },
  {
    "path": "common/build.gradle.kts",
    "chars": 201,
    "preview": "plugins {\n    kotlin(\"android\")\n    id(\"com.android.library\")\n}\n\ndependencies {\n    compileOnly(project(\":hideapi\"))\n\n  "
  },
  {
    "path": "common/consumer-rules.pro",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "common/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "common/src/main/AndroidManifest.xml",
    "chars": 476,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"yos.clash.material.common\">\n\n    <perm"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/Global.kt",
    "chars": 493,
    "preview": "package yos.clash.material.common\n\nimport android.app.Application\nimport kotlinx.coroutines.CoroutineScope\nimport kotlin"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/App.kt",
    "chars": 843,
    "preview": "package yos.clash.material.common.compat\n\nimport android.app.ActivityThread\nimport android.app.Application\nimport androi"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/Context.kt",
    "chars": 478,
    "preview": "@file:Suppress(\"DEPRECATION\")\n\npackage yos.clash.material.common.compat\n\nimport android.content.Context\nimport android.g"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/Html.kt",
    "chars": 355,
    "preview": "@file:Suppress(\"DEPRECATION\")\n\npackage yos.clash.material.common.compat\n\nimport android.os.Build\nimport android.text.Htm"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/Intents.kt",
    "chars": 427,
    "preview": "package yos.clash.material.common.compat\n\nimport android.app.PendingIntent\nimport android.os.Build\n\nfun pendingIntentFla"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/Package.kt",
    "chars": 319,
    "preview": "@file:Suppress(\"DEPRECATION\")\n\npackage yos.clash.material.common.compat\n\nimport android.content.pm.PackageInfo\n\nval Pack"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/Resource.kt",
    "chars": 336,
    "preview": "@file:Suppress(\"DEPRECATION\")\n\npackage yos.clash.material.common.compat\n\nimport android.content.res.Configuration\nimport"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/Services.kt",
    "chars": 314,
    "preview": "package yos.clash.material.common.compat\n\nimport android.content.Context\nimport android.content.Intent\nimport android.os"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/UI.kt",
    "chars": 4394,
    "preview": "@file:Suppress(\"DEPRECATION\")\n\npackage yos.clash.material.common.compat\n\nimport android.annotation.TargetApi\nimport andr"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/compat/View.kt",
    "chars": 449,
    "preview": "@file:Suppress(\"DEPRECATION\")\n\npackage yos.clash.material.common.compat\n\nimport android.os.Build\nimport android.widget.T"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/constants/Authorities.kt",
    "chars": 264,
    "preview": "package yos.clash.material.common.constants\n\nimport yos.clash.material.common.util.packageName\n\nobject Authorities {\n   "
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/constants/Components.kt",
    "chars": 414,
    "preview": "package yos.clash.material.common.constants\n\nimport android.content.ComponentName\nimport yos.clash.material.common.util."
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/constants/Intents.kt",
    "chars": 1040,
    "preview": "package yos.clash.material.common.constants\n\nimport yos.clash.material.common.util.packageName\n\nobject Intents {\n    // "
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/constants/Metadata.kt",
    "chars": 172,
    "preview": "package yos.clash.material.common.constants\n\nimport yos.clash.material.common.util.packageName\n\nobject Metadata {\n    va"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/constants/Permissions.kt",
    "chars": 197,
    "preview": "package yos.clash.material.common.constants\n\nimport yos.clash.material.common.util.packageName\n\nobject Permissions {\n   "
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/id/UndefinedIds.kt",
    "chars": 302,
    "preview": "package yos.clash.material.common.id\n\nobject UndefinedIds {\n    private const val PREFIX = 0x14000000\n    private const "
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/log/Log.kt",
    "chars": 761,
    "preview": "package yos.clash.material.common.log\n\nobject Log {\n    private const val TAG = \"ClashForAndroid\"\n\n    fun i(message: St"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/store/Providers.kt",
    "chars": 1665,
    "preview": "package yos.clash.material.common.store\n\nimport android.content.SharedPreferences\nimport androidx.core.content.edit\n\ncla"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/store/Store.kt",
    "chars": 3530,
    "preview": "package yos.clash.material.common.store\n\nimport kotlin.reflect.KProperty\n\nclass Store(val provider: StoreProvider) {\n   "
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/store/StoreProvider.kt",
    "chars": 608,
    "preview": "package yos.clash.material.common.store\n\ninterface StoreProvider {\n    fun getInt(key: String, defaultValue: Int): Int\n "
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/util/Components.kt",
    "chars": 373,
    "preview": "package yos.clash.material.common.util\n\nimport android.content.ComponentName\nimport android.content.Intent\nimport yos.cl"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/util/Global.kt",
    "chars": 137,
    "preview": "package yos.clash.material.common.util\n\nimport yos.clash.material.common.Global\n\nval packageName: String = Global.applic"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/util/Intent.kt",
    "chars": 1007,
    "preview": "package yos.clash.material.common.util\n\nimport android.content.Intent\nimport android.net.Uri\nimport java.util.*\n\nfun Int"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/util/Parcelable.kt",
    "chars": 2154,
    "preview": "package yos.clash.material.common.util\n\nimport android.os.Binder\nimport android.os.Parcel\nimport android.os.Parcelable\n\n"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/util/Patterns.kt",
    "chars": 85,
    "preview": "package yos.clash.material.common.util\n\nval PatternFileName = Regex(\"[^*&%\\\\n\\\\r/]+\")"
  },
  {
    "path": "common/src/main/java/yos/clash/material/common/util/Ticker.kt",
    "chars": 572,
    "preview": "package yos.clash.material.common.util\n\nimport kotlinx.coroutines.CoroutineScope\nimport kotlinx.coroutines.channels.Chan"
  },
  {
    "path": "common/src/main/res/values/strings.xml",
    "chars": 243,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"receive_clash_broadcasts\">Receive Clash You Broadca"
  },
  {
    "path": "common/src/main/res/values-zh/strings.xml",
    "chars": 209,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"receive_clash_broadcasts\">接收 Clash You 广播</string>\n"
  },
  {
    "path": "common/src/main/res/values-zh-rTW/strings.xml",
    "chars": 210,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"receive_clash_broadcasts\">接收 Clash You 廣播</string>\n"
  },
  {
    "path": "core/build.gradle.kts",
    "chars": 2930,
    "preview": "import com.github.kr328.golang.GolangBuildTask\nimport com.github.kr328.golang.GolangPlugin\nimport java.io.FileOutputStre"
  },
  {
    "path": "core/consumer-rules.pro",
    "chars": 557,
    "preview": "-keep class kotlinx.coroutines.CompletableDeferred {\n    *;\n}\n\n-keep class kotlin.Unit {\n    *;\n}\n\n-keepattributes *Anno"
  },
  {
    "path": "core/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "core/src/foss/golang/go.mod",
    "chars": 1581,
    "preview": "module foss\n\ngo 1.18\n\nrequire cfa v0.0.0\n\nrequire (\n\tcfa/blob v0.0.0 // indirect\n\tgithub.com/Dreamacro/clash v1.7.1 // i"
  },
  {
    "path": "core/src/foss/golang/go.sum",
    "chars": 13307,
    "preview": "github.com/Kr328/tun2socket v0.0.0-20220414050025-d07c78d06d34 h1:USCTqih5d1bUXUxWNS9ZD5Tx/lb0jXHEtRIIx/F9dMc=\ngithub.co"
  },
  {
    "path": "core/src/foss/golang/main.go",
    "chars": 47,
    "preview": "package golang\n\nimport (\n\t_ \"cfa/native/all\"\n)\n"
  },
  {
    "path": "core/src/main/AndroidManifest.xml",
    "chars": 188,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"yos.clash.material.core\">\n\n    <uses-p"
  },
  {
    "path": "core/src/main/cpp/CMakeLists.txt",
    "chars": 867,
    "preview": "cmake_minimum_required(VERSION 3.0)\n\nproject(clash-bridge C)\n\nset(CMAKE_POSITION_INDEPENDENT_CODE on)\nset(CMAKE_C_FLAGS_"
  },
  {
    "path": "core/src/main/cpp/bridge_helper.c",
    "chars": 427,
    "preview": "#include \"bridge_helper.h\"\n\nuint64_t down_scale_traffic(uint64_t value) {\n    if (value > 1042 * 1024 * 1024)\n        re"
  },
  {
    "path": "core/src/main/cpp/bridge_helper.h",
    "chars": 79,
    "preview": "#pragma once\n\n#include <stdint.h>\n\nuint64_t down_scale_traffic(uint64_t value);"
  },
  {
    "path": "core/src/main/cpp/jni_helper.c",
    "chars": 1915,
    "preview": "#include \"jni_helper.h\"\n\n#include <malloc.h>\n#include <string.h>\n\nstatic JavaVM *global_vm;\n\nstatic jclass c_string;\nsta"
  },
  {
    "path": "core/src/main/cpp/jni_helper.h",
    "chars": 1192,
    "preview": "#pragma once\n\n#include <jni.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <malloc.h>\n#include <android/log.h>\n\nstr"
  },
  {
    "path": "core/src/main/cpp/main.c",
    "chars": 18027,
    "preview": "#include <jni.h>\n#include <stdint.h>\n#include <stddef.h>\n#include <string.h>\n\n#include \"bridge_helper.h\"\n#include \"libcl"
  },
  {
    "path": "core/src/main/golang/go.mod",
    "chars": 1018,
    "preview": "module cfa\n\ngo 1.18\n\nrequire (\n\tgithub.com/Dreamacro/clash v1.7.1\n\tgithub.com/Kr328/tun2socket v0.0.0-20220414050025-d07"
  },
  {
    "path": "core/src/main/golang/go.sum",
    "chars": 11113,
    "preview": "github.com/Dreamacro/clash v1.7.1 h1:8iYYiyVf7ZAztwoFeTFihs5rI9Jjic0ZKmf05vQxzFU=\ngithub.com/Dreamacro/clash v1.7.1/go.m"
  },
  {
    "path": "core/src/main/golang/native/all/imports.go",
    "chars": 276,
    "preview": "package all\n\nimport (\n\t_ \"cfa/native/app\"\n\t_ \"cfa/native/common\"\n\t_ \"cfa/native/config\"\n\t_ \"cfa/native/delegate\"\n\t_ \"cfa"
  },
  {
    "path": "core/src/main/golang/native/app/app.go",
    "chars": 882,
    "preview": "package app\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar appVersionName string\nvar platformVersion int\nvar installedAp"
  },
  {
    "path": "core/src/main/golang/native/app/content.go",
    "chars": 452,
    "preview": "package app\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"syscall\"\n)\n\nvar openContentImpl = func(url string) (int, error) {\n\treturn -1, er"
  },
  {
    "path": "core/src/main/golang/native/app/dns.go",
    "chars": 330,
    "preview": "package app\n\nimport (\n\t\"strings\"\n\n\t\"github.com/Dreamacro/clash/dns\"\n)\n\nfunc NotifyDnsChanged(dnsList string) {\n\tdL := st"
  },
  {
    "path": "core/src/main/golang/native/app/tun.go",
    "chars": 991,
    "preview": "package app\n\nimport (\n\t\"net\"\n\t\"syscall\"\n\n\t\"cfa/native/platform\"\n)\n\nvar markSocketImpl func(fd int)\nvar querySocketUidImp"
  },
  {
    "path": "core/src/main/golang/native/app/ui.go",
    "chars": 601,
    "preview": "package app\n\nimport (\n\t\"github.com/dlclark/regexp2\"\n\n\t\"github.com/Dreamacro/clash/log\"\n)\n\nvar uiSubtitlePattern *regexp2"
  },
  {
    "path": "core/src/main/golang/native/app.go",
    "chars": 1037,
    "preview": "package main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"errors\"\n\t\"unsafe\"\n\n\t\"cfa/native/app\"\n\n\t\"github.com/Dreamacro/"
  },
  {
    "path": "core/src/main/golang/native/bridge.c",
    "chars": 2348,
    "preview": "#include \"bridge.h\"\n#include \"trace.h\"\n\nvoid (*mark_socket_func)(void *tun_interface, int fd);\n\nint (*query_socket_uid_f"
  },
  {
    "path": "core/src/main/golang/native/bridge.h",
    "chars": 1459,
    "preview": "#pragma once\n\n#include <stddef.h>\n#include <stdint.h>\n#include <malloc.h>\n#include <android/log.h>\n\n#define TAG \"ClashFo"
  },
  {
    "path": "core/src/main/golang/native/common/path.go",
    "chars": 425,
    "preview": "package common\n\nimport \"strings\"\n\nfunc ResolveAsRoot(path string) string {\n\tdirectories := strings.Split(path, \"/\")\n\tres"
  },
  {
    "path": "core/src/main/golang/native/config/defaults.go",
    "chars": 667,
    "preview": "package config\n\nvar (\n\tdefaultNameServers = []string{\n\t\t\"223.5.5.5\",\n\t\t\"119.29.29.29\",\n\t\t\"8.8.4.4\",\n\t\t\"1.0.0.1\",\n\t}\n\tdef"
  },
  {
    "path": "core/src/main/golang/native/config/fetch.go",
    "chars": 3131,
    "preview": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\tU \"net/url\"\n\t\"os\"\n\tP \"path\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"cf"
  },
  {
    "path": "core/src/main/golang/native/config/load.go",
    "chars": 1622,
    "preview": "package config\n\nimport (\n\t\"io/ioutil\"\n\tP \"path\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"gopkg.in/yaml.v2\"\n\n\t\"cfa/native/app\"\n\t\"github.c"
  },
  {
    "path": "core/src/main/golang/native/config/override.go",
    "chars": 1360,
    "preview": "package config\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/Dreamacro/clash/constant\"\n)\n\ntype OverrideSlot int\n\nconst (\n\tO"
  },
  {
    "path": "core/src/main/golang/native/config/process.go",
    "chars": 2591,
    "preview": "package config\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/dlclark/regexp2\"\n\n\t\"cfa/native/commo"
  },
  {
    "path": "core/src/main/golang/native/config/process_open.go",
    "chars": 150,
    "preview": "//go:build !premium\n\npackage config\n\nimport \"github.com/Dreamacro/clash/config\"\n\nfunc patchTun(cfg *config.RawConfig, _ "
  },
  {
    "path": "core/src/main/golang/native/config/process_premium.go",
    "chars": 174,
    "preview": "//go:build premium\n\npackage config\n\nimport \"github.com/Dreamacro/clash/config\"\n\nfunc patchTun(cfg *config.RawConfig, _ s"
  },
  {
    "path": "core/src/main/golang/native/config/provider_open.go",
    "chars": 458,
    "preview": "//go:build !premium\n\npackage config\n\nimport (\n\t\"io\"\n\n\t\"github.com/Dreamacro/clash/config\"\n)\n\nfunc forEachProviders(rawCf"
  },
  {
    "path": "core/src/main/golang/native/config/provider_premium.go",
    "chars": 642,
    "preview": "//go:build premium\n\npackage config\n\nimport (\n\t\"io\"\n\n\t\"github.com/Dreamacro/clash/config\"\n)\n\nfunc forEachProviders(rawCfg"
  },
  {
    "path": "core/src/main/golang/native/config.go",
    "chars": 1323,
    "preview": "package main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"runtime\"\n\t\"unsafe\"\n\n\t\"cfa/native/config\"\n)\n\ntype remoteValidC"
  },
  {
    "path": "core/src/main/golang/native/debug.go",
    "chars": 247,
    "preview": "// +build debug\n\npackage main\n\nimport (\n\t\"net/http\"\n\t_ \"net/http/pprof\"\n\n\t\"github.com/Dreamacro/clash/log\"\n)\n\nfunc init("
  },
  {
    "path": "core/src/main/golang/native/delegate/init.go",
    "chars": 1252,
    "preview": "package delegate\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n\n\t\"cfa/blob\"\n\n\t\"github.com/Dreamacro/clash/component/process\"\n\t\"github.c"
  },
  {
    "path": "core/src/main/golang/native/log_open.go",
    "chars": 1413,
    "preview": "//go:build !premium\n\npackage main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"strings\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com"
  },
  {
    "path": "core/src/main/golang/native/log_premium.go",
    "chars": 1327,
    "preview": "//go:build premium\n\npackage main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"strings\"\n\t\"time\"\n\t\"unsafe\"\n\n\t\"github.com/"
  },
  {
    "path": "core/src/main/golang/native/main.go",
    "chars": 659,
    "preview": "package main\n\n/*\n#cgo LDFLAGS: -llog\n\n#include \"bridge.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"runtime\"\n\n\t\"cfa/native/config\"\n\t\"cfa"
  },
  {
    "path": "core/src/main/golang/native/platform/limit.go",
    "chars": 604,
    "preview": "// +build linux\n\npackage platform\n\nimport \"syscall\"\n\nvar nullFd int\nvar maxFdCount int\n\nfunc init() {\n\tfd, err := syscal"
  },
  {
    "path": "core/src/main/golang/native/platform/procfs.go",
    "chars": 2717,
    "preview": "// +build linux\n\npackage platform\n\nimport (\n\t\"bufio\"\n\t\"encoding/binary\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\t\"strconv\"\n\t"
  },
  {
    "path": "core/src/main/golang/native/proxy/http.go",
    "chars": 576,
    "preview": "package proxy\n\nimport (\n\t\"sync\"\n\n\t\"github.com/Dreamacro/clash/listener/http\"\n\t\"github.com/Dreamacro/clash/tunnel\"\n)\n\nvar"
  },
  {
    "path": "core/src/main/golang/native/proxy.go",
    "chars": 318,
    "preview": "package main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"cfa/native/proxy\"\n)\n\n//export startHttp\nfunc startHttp(listen"
  },
  {
    "path": "core/src/main/golang/native/trace.c",
    "chars": 165,
    "preview": "#include \"trace.h\"\n\n#if ENABLE_TRACE\n\nvoid trace_method_exit(const char **name) {\n    __android_log_print(ANDROID_LOG_VE"
  },
  {
    "path": "core/src/main/golang/native/trace.h",
    "chars": 378,
    "preview": "#pragma once\n\n#include \"bridge.h\"\n\n#include <android/log.h>\n\n#define ENABLE_TRACE 0\n\n#if ENABLE_TRACE\n\nextern void trace"
  },
  {
    "path": "core/src/main/golang/native/tun/dns.go",
    "chars": 526,
    "preview": "package tun\n\nimport (\n\t\"net\"\n\n\t\"github.com/Dreamacro/clash/dns\"\n\n\tD \"github.com/miekg/dns\"\n)\n\nfunc shouldHijackDns(dns n"
  },
  {
    "path": "core/src/main/golang/native/tun/metadata_open.go",
    "chars": 452,
    "preview": "//go:build !premium\n\npackage tun\n\nimport (\n\t\"net\"\n\t\"strconv\"\n\n\tC \"github.com/Dreamacro/clash/constant\"\n)\n\nfunc createMet"
  },
  {
    "path": "core/src/main/golang/native/tun/metadata_premium.go",
    "chars": 553,
    "preview": "//go:build premium\n\npackage tun\n\nimport (\n\t\"net\"\n\t\"net/netip\"\n\t\"strconv\"\n\n\tC \"github.com/Dreamacro/clash/constant\"\n)\n\nfu"
  },
  {
    "path": "core/src/main/golang/native/tun/tun.go",
    "chars": 3102,
    "preview": "package tun\n\nimport (\n\t\"encoding/binary\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/Kr328/tun2socket\"\n\n\t\"github.com/Dreama"
  },
  {
    "path": "core/src/main/golang/native/tun/udp.go",
    "chars": 439,
    "preview": "package tun\n\nimport (\n\t\"net\"\n)\n\ntype packet struct {\n\tlocal     *net.UDPAddr\n\tdata      []byte\n\twriteBack func(b []byte,"
  },
  {
    "path": "core/src/main/golang/native/tun.go",
    "chars": 1733,
    "preview": "package main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"sync\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sync/semapho"
  },
  {
    "path": "core/src/main/golang/native/tunnel/conn.go",
    "chars": 614,
    "preview": "package tunnel\n\nimport (\n\tC \"github.com/Dreamacro/clash/constant\"\n\t\"github.com/Dreamacro/clash/tunnel/statistic\"\n)\n\nfunc"
  },
  {
    "path": "core/src/main/golang/native/tunnel/connectivity.go",
    "chars": 900,
    "preview": "package tunnel\n\nimport (\n\t\"sync\"\n\n\t\"github.com/Dreamacro/clash/adapter\"\n\t\"github.com/Dreamacro/clash/adapter/outboundgro"
  },
  {
    "path": "core/src/main/golang/native/tunnel/geoip.go",
    "chars": 395,
    "preview": "package tunnel\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/oschwald/geoip2-golang\"\n\n\t\"github.com/Dreamacro/clash/component/mmdb\"\n)\n\nf"
  },
  {
    "path": "core/src/main/golang/native/tunnel/init.go",
    "chars": 928,
    "preview": "package tunnel\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"strings\"\n\n\t\"github.com/Dreamacro/clash/component/dialer\"\n\tC \"github.com/Dre"
  },
  {
    "path": "core/src/main/golang/native/tunnel/loopback_open.go",
    "chars": 91,
    "preview": "//go:build !premium\n\npackage tunnel\n\nimport \"net\"\n\nvar loopback = net.ParseIP(\"127.0.0.1\")\n"
  },
  {
    "path": "core/src/main/golang/native/tunnel/loopback_premium.go",
    "chars": 104,
    "preview": "//go:build premium\n\npackage tunnel\n\nimport \"net/netip\"\n\nvar loopback = netip.MustParseAddr(\"127.0.0.1\")\n"
  },
  {
    "path": "core/src/main/golang/native/tunnel/providers_open.go",
    "chars": 1192,
    "preview": "//go:build !premium\n\npackage tunnel\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\tP \"github.com/Dreamacro/clash/adapter/provider\"\n\t\"github."
  },
  {
    "path": "core/src/main/golang/native/tunnel/providers_premium.go",
    "chars": 1755,
    "preview": "//go:build premium\n\npackage tunnel\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\tP \"github.com/Dreamacro/clash/adapter/provider\"\n"
  },
  {
    "path": "core/src/main/golang/native/tunnel/proxies.go",
    "chars": 4235,
    "preview": "package tunnel\n\nimport (\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/dlclark/regexp2\"\n\n\t\"github.com/Dreamacro/clash/adapter\"\n\n\t\"git"
  },
  {
    "path": "core/src/main/golang/native/tunnel/state.go",
    "chars": 124,
    "preview": "package tunnel\n\nimport (\n\t\"github.com/Dreamacro/clash/tunnel\"\n)\n\nfunc QueryMode() string {\n\treturn tunnel.Mode().String("
  },
  {
    "path": "core/src/main/golang/native/tunnel/statistic.go",
    "chars": 304,
    "preview": "package tunnel\n\nimport (\n\t\"github.com/Dreamacro/clash/tunnel/statistic\"\n)\n\nfunc ResetStatistic() {\n\tstatistic.DefaultMan"
  },
  {
    "path": "core/src/main/golang/native/tunnel/suspend.go",
    "chars": 116,
    "preview": "package tunnel\n\nimport \"github.com/Dreamacro/clash/adapter/provider\"\n\nfunc Suspend(s bool) {\n\tprovider.Suspend(s)\n}\n"
  },
  {
    "path": "core/src/main/golang/native/tunnel.go",
    "chars": 2371,
    "preview": "package main\n\n//#include \"bridge.h\"\nimport \"C\"\n\nimport (\n\t\"unsafe\"\n\n\t\"cfa/native/app\"\n\t\"cfa/native/tunnel\"\n)\n\n//export q"
  },
  {
    "path": "core/src/main/golang/native/utils.go",
    "chars": 453,
    "preview": "package main\n\nimport \"C\"\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n)\n\nfunc marshalJson(obj any) *C.char {\n\tres, err := json."
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/Clash.kt",
    "chars": 7604,
    "preview": "package com.github.kr328.clash.core\n\nimport com.github.kr328.clash.core.bridge.Bridge\nimport com.github.kr328.clash.core"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/bridge/Bridge.kt",
    "chars": 2722,
    "preview": "package com.github.kr328.clash.core.bridge\n\nimport android.os.Build\nimport android.os.ParcelFileDescriptor\nimport androi"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/bridge/ClashException.kt",
    "chars": 148,
    "preview": "package com.github.kr328.clash.core.bridge\n\nimport androidx.annotation.Keep\n\n@Keep\nclass ClashException(msg: String) : I"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/bridge/Content.kt",
    "chars": 576,
    "preview": "package com.github.kr328.clash.core.bridge\n\nimport android.net.Uri\nimport androidx.annotation.Keep\nimport yos.clash.mate"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/bridge/FetchCallback.kt",
    "chars": 178,
    "preview": "package com.github.kr328.clash.core.bridge\n\nimport androidx.annotation.Keep\n\n@Keep\ninterface FetchCallback {\n    fun rep"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/bridge/LogcatInterface.kt",
    "chars": 150,
    "preview": "package com.github.kr328.clash.core.bridge\n\nimport androidx.annotation.Keep\n\n@Keep\ninterface LogcatInterface {\n    fun r"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/bridge/TunInterface.kt",
    "chars": 212,
    "preview": "package com.github.kr328.clash.core.bridge\n\nimport androidx.annotation.Keep\n\n@Keep\ninterface TunInterface {\n    fun mark"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/ConfigurationOverride.kt",
    "chars": 3610,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport com.github.kr328"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/FetchStatus.kt",
    "chars": 966,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport com.github.kr328"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/LogMessage.kt",
    "chars": 1437,
    "preview": "@file:UseSerializers(DateSerializer::class)\n\npackage com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport "
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/Provider.kt",
    "chars": 1137,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport com.github.kr328"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/ProviderList.kt",
    "chars": 881,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport yos.clash.materi"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/Proxy.kt",
    "chars": 1297,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport com.github.kr328"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/ProxyGroup.kt",
    "chars": 1832,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport yos.clash.materi"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/ProxySort.kt",
    "chars": 94,
    "preview": "package com.github.kr328.clash.core.model\n\nenum class ProxySort {\n    Default, Title, Delay\n}\n"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/Traffic.kt",
    "chars": 67,
    "preview": "package com.github.kr328.clash.core.model\n\ntypealias Traffic = Long"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/TunnelState.kt",
    "chars": 1066,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport com.github.kr328"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/model/UiConfiguration.kt",
    "chars": 785,
    "preview": "package com.github.kr328.clash.core.model\n\nimport android.os.Parcel\nimport android.os.Parcelable\nimport com.github.kr328"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/util/Net.kt",
    "chars": 302,
    "preview": "package com.github.kr328.clash.core.util\n\nimport java.net.InetAddress\nimport java.net.InetSocketAddress\nimport java.net."
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/util/Parcelizer.kt",
    "chars": 8520,
    "preview": "package com.github.kr328.clash.core.util\n\nimport android.os.Parcel\nimport kotlinx.serialization.DeserializationStrategy\n"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/util/Serializers.kt",
    "chars": 746,
    "preview": "package com.github.kr328.clash.core.util\n\nimport kotlinx.serialization.KSerializer\nimport kotlinx.serialization.descript"
  },
  {
    "path": "core/src/main/java/com/github/kr328/clash/core/util/Traffic.kt",
    "chars": 1413,
    "preview": "package com.github.kr328.clash.core.util\n\nimport com.github.kr328.clash.core.model.Traffic\n\nfun Traffic.trafficUpload():"
  },
  {
    "path": "core/src/premium/golang/go.mod",
    "chars": 2716,
    "preview": "module premium\n\ngo 1.18\n\nrequire cfa v0.0.0\n\nrequire (\n\tcfa/blob v0.0.0 // indirect\n\tgithub.com/Dreamacro/clash v1.7.1 /"
  },
  {
    "path": "core/src/premium/golang/go.sum",
    "chars": 31435,
    "preview": "cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=\ngithub.com/BurntSushi/toml v0.3.1/go."
  },
  {
    "path": "core/src/premium/golang/main.go",
    "chars": 40,
    "preview": "package main\n\nimport _ \"cfa/native/all\"\n"
  },
  {
    "path": "design/build.gradle.kts",
    "chars": 979,
    "preview": "plugins {\n    kotlin(\"android\")\n    kotlin(\"kapt\")\n    id(\"com.android.library\")\n}\n\ndependencies {\n    repositories {\n  "
  },
  {
    "path": "design/consumer-rules.pro",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "design/proguard-rules.pro",
    "chars": 751,
    "preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
  },
  {
    "path": "design/src/main/AndroidManifest.xml",
    "chars": 49,
    "preview": "<manifest package=\"yos.clash.material.design\" />\n"
  }
]

// ... and 284 more files (download for full content)

About this extraction

This page contains the full source code of the Yos-X/ClashYou GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 484 files (951.7 KB), approximately 250.7k tokens, and a symbol index with 214 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!