{{ data.heroText || $title || 'Hello' }}
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
{{ feature.title }}
{{ feature.details }}
Repository: RikkaApps/websites
Branch: master
Commit: 66a2bc3549a5
Files: 177
Total size: 361.6 KB
Directory structure:
gitextract_c9c7yzyg/
├── .gitattributes
├── .github/
│ └── dependabot.yml
├── .gitignore
├── appops/
│ ├── .gitignore
│ ├── .vuepress/
│ │ ├── config.js
│ │ ├── public/
│ │ │ └── icon/
│ │ │ ├── browserconfig.xml
│ │ │ └── manifest.json
│ │ └── theme/
│ │ ├── components/
│ │ │ ├── Home.vue
│ │ │ └── SidebarLink.vue
│ │ ├── index.js
│ │ ├── layouts/
│ │ │ └── Layout.vue
│ │ └── styles/
│ │ ├── index.styl
│ │ └── palette.styl
│ ├── README.md
│ ├── changelog.md
│ ├── download.md
│ ├── guide/
│ │ ├── README.md
│ │ ├── faq/
│ │ │ ├── how_to_reset.md
│ │ │ └── purchase.md
│ │ ├── technical/
│ │ │ ├── run_in_background.md
│ │ │ └── system_behaviors.md
│ │ └── working_mode/
│ │ ├── dpm.md
│ │ └── shizuku.md
│ ├── zh-hans/
│ │ ├── README.md
│ │ ├── changelog.md
│ │ ├── download.md
│ │ └── guide/
│ │ ├── README.md
│ │ ├── faq/
│ │ │ ├── how_to_reset.md
│ │ │ └── purchase.md
│ │ ├── technical/
│ │ │ ├── run_in_background.md
│ │ │ └── system_behaviors.md
│ │ └── working_mode/
│ │ ├── dpm.md
│ │ └── shizuku.md
│ └── zh-hant/
│ ├── README.md
│ ├── changelog.md
│ ├── download.md
│ └── guide/
│ ├── README.md
│ ├── faq/
│ │ ├── how_to_reset.md
│ │ └── purchase.md
│ ├── technical/
│ │ ├── run_in_background.md
│ │ └── system_behaviors.md
│ └── working_mode/
│ ├── dpm.md
│ └── shizuku.md
├── assets/
│ └── SourceCodePro-BDC.css
├── package.json
├── shizuku/
│ ├── .gitignore
│ ├── .vuepress/
│ │ ├── config.js
│ │ ├── public/
│ │ │ └── icon/
│ │ │ ├── browserconfig.xml
│ │ │ └── manifest.json
│ │ └── theme/
│ │ ├── index.js
│ │ ├── layouts/
│ │ │ └── Layout.vue
│ │ └── styles/
│ │ ├── index.styl
│ │ └── palette.styl
│ ├── README.md
│ ├── download.md
│ ├── guide/
│ │ └── setup.md
│ ├── introduction.md
│ ├── zh-hans/
│ │ ├── README.md
│ │ ├── download.md
│ │ ├── guide/
│ │ │ └── setup.md
│ │ └── introduction.md
│ └── zh-hant/
│ ├── README.md
│ ├── download.md
│ ├── guide/
│ │ └── setup.md
│ └── introduction.md
├── storage_redirect/
│ ├── .gitignore
│ ├── .vuepress/
│ │ ├── config.js
│ │ ├── public/
│ │ │ └── icon/
│ │ │ ├── browserconfig.xml
│ │ │ └── manifest.json
│ │ └── theme/
│ │ ├── LICENSE
│ │ ├── components/
│ │ │ ├── AlgoliaSearchBox.vue
│ │ │ ├── Download.vue
│ │ │ ├── DropdownLink.vue
│ │ │ ├── DropdownTransition.vue
│ │ │ ├── Home.vue
│ │ │ ├── NavLink.vue
│ │ │ ├── NavLinks.vue
│ │ │ ├── Navbar.vue
│ │ │ ├── Page.vue
│ │ │ ├── PageEdit.vue
│ │ │ ├── PageNav.vue
│ │ │ ├── Sidebar.vue
│ │ │ ├── SidebarButton.vue
│ │ │ ├── SidebarGroup.vue
│ │ │ ├── SidebarLink.vue
│ │ │ └── SidebarLinks.vue
│ │ ├── global-components/
│ │ │ └── Badge.vue
│ │ ├── index.js
│ │ ├── layouts/
│ │ │ ├── 404.vue
│ │ │ └── Layout.vue
│ │ ├── noopModule.js
│ │ ├── styles/
│ │ │ ├── arrow.styl
│ │ │ ├── code.styl
│ │ │ ├── config.styl
│ │ │ ├── custom-blocks.styl
│ │ │ ├── index.styl
│ │ │ ├── mobile.styl
│ │ │ ├── palette.styl
│ │ │ ├── toc.styl
│ │ │ └── wrapper.styl
│ │ └── util/
│ │ └── index.js
│ ├── README.md
│ ├── changelog.md
│ ├── download.md
│ ├── guide/
│ │ ├── README.md
│ │ ├── advanced/
│ │ │ ├── shared_user_id.md
│ │ │ └── technical_details_export_isolated_files.md
│ │ ├── compatibility/
│ │ │ ├── README.md
│ │ │ ├── meizu.md
│ │ │ ├── miui.md
│ │ │ └── samsung.md
│ │ ├── contribute.md
│ │ ├── enhanced_mode/
│ │ │ ├── README.md
│ │ │ └── install.md
│ │ ├── faq/
│ │ │ ├── cant_find_app.md
│ │ │ ├── how_to_document.md
│ │ │ └── how_to_report_problems.md
│ │ └── tutorial.md
│ ├── zh-hans/
│ │ ├── README.md
│ │ ├── changelog.md
│ │ ├── download.md
│ │ └── guide/
│ │ ├── README.md
│ │ ├── advanced/
│ │ │ ├── shared_user_id.md
│ │ │ └── technical_details_export_isolated_files.md
│ │ ├── compatibility/
│ │ │ ├── README.md
│ │ │ ├── meizu.md
│ │ │ ├── miui.md
│ │ │ └── samsung.md
│ │ ├── contribute.md
│ │ ├── enhanced_mode/
│ │ │ ├── README.md
│ │ │ └── install.md
│ │ ├── faq/
│ │ │ ├── cant_find_app.md
│ │ │ ├── how_to_document.md
│ │ │ └── how_to_report_problems.md
│ │ └── tutorial.md
│ └── zh-hant/
│ ├── README.md
│ ├── changelog.md
│ ├── download.md
│ └── guide/
│ ├── README.md
│ ├── advanced/
│ │ ├── shared_user_id.md
│ │ └── technical_details_export_isolated_files.md
│ ├── compatibility/
│ │ ├── README.md
│ │ ├── meizu.md
│ │ ├── miui.md
│ │ └── samsung.md
│ ├── contribute.md
│ ├── enhanced_mode/
│ │ ├── README.md
│ │ └── install.md
│ ├── faq/
│ │ ├── cant_find_app.md
│ │ ├── how_to_document.md
│ │ └── how_to_report_problems.md
│ └── tutorial.md
├── webhooks/
│ ├── .gitignore
│ ├── index.js
│ └── package.json
└── www/
├── .gitignore
├── .vuepress/
│ ├── config.js
│ ├── public/
│ │ └── robots.txt
│ └── theme/
│ ├── components/
│ │ ├── Home.vue
│ │ └── SidebarLink.vue
│ ├── index.js
│ ├── layouts/
│ │ └── Layout.vue
│ └── styles/
│ ├── index.styl
│ └── palette.styl
├── README.md
├── contribute_translation.md
├── knowledge/
│ ├── exit_on_start.md
│ └── google_play_purchase.md
├── privacy_policy.md
├── zh-hans/
│ ├── README.md
│ ├── contribute_translation.md
│ └── knowledge/
│ ├── exit_on_start.md
│ └── google_play_purchase.md
└── zh-hant/
├── README.md
├── contribute_translation.md
└── knowledge/
├── exit_on_start.md
└── google_play_purchase.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
* text=auto
*.sh text eol=lf
hooks/* text eol=lf
*.png binary
*.ico binary
*.woff binary
*.woff2 binary
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
================================================
FILE: .gitignore
================================================
/.vscode
/node_modules
/yarn.lock
================================================
FILE: appops/.gitignore
================================================
/.vuepress/dist
================================================
FILE: appops/.vuepress/config.js
================================================
const moment = require('moment')
const langMap = {
"zh-Hans": "zh-cn",
"zh-Hant": "zh-tw"
}
var timestampCache = {}
module.exports = {
base: '/',
title: 'App Ops',
head: [
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/Roboto-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/NotoSansCJK-SC-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/NotoSansCJK-TC-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', { rel: 'apple-touch-icon', size: '57x57', href: '/icon/apple-icon-57x57.png' }],
['link', { rel: 'apple-touch-icon', size: '60x60', href: '/icon/apple-icon-60x60.png' }],
['link', { rel: 'apple-touch-icon', size: '72x72', href: '/icon/apple-icon-72x72.png' }],
['link', { rel: 'apple-touch-icon', size: '76x76', href: '/icon/apple-icon-76x76.png' }],
['link', { rel: 'apple-touch-icon', size: '114x114', href: '/icon/apple-icon-114x114.png' }],
['link', { rel: 'apple-touch-icon', size: '120x120', href: '/icon/apple-icon-120x120.png' }],
['link', { rel: 'apple-touch-icon', size: '144x144', href: '/icon/apple-icon-144x144.png' }],
['link', { rel: 'apple-touch-icon', size: '152x152', href: '/icon/apple-icon-152x152.png' }],
['link', { rel: 'apple-touch-icon', size: '180x180', href: '/icon/apple-icon-180x180.png' }],
['link', { rel: 'icon', type: 'image/png', size: '192x192', href: '/icon/android-icon-192x192.png' }],
['link', { rel: 'icon', type: 'image/png', size: '32x32', href: '/icon/favicon-32x32.png' }],
['link', { rel: 'icon', type: 'image/png', size: '96x96', href: '/icon/favicon-96x96.png' }],
['link', { rel: 'icon', type: 'image/png', size: '16x16', href: '/icon/favicon-16x16.png' }]
],
locales: {
'/': {
lang: 'en',
description: 'Control the hidden appops conveniently'
},
'/zh-hans/': {
lang: 'zh-Hans',
description: '方便地控制隐藏的 appops'
},
'/zh-hant/': {
lang: 'zh-Hant',
description: '方便地控制隱藏的 appops'
}
},
themeConfig: {
locales: {
'/': {
selectText: 'Languages',
label: 'English',
serviceWorker: {
updatePopup: {
message: "New content is available.",
buttonText: "Refresh"
}
},
sidebar: getSidebar("/guide/", "Basic", "Working modes", "FAQ", "Technical details"),
nav: getNavbar('/', 'Guide', 'Download', 'Changelog', 'Rikka Apps'),
lastUpdated: 'Last Updated'
},
'/zh-hans/': {
selectText: '语言',
label: '简体中文',
editLinkText: '在 GitHub 上编辑此页',
serviceWorker: {
updatePopup: {
message: "发现新内容可用.",
buttonText: "刷新"
}
},
sidebar: getSidebar("/zh-hans/guide/", "基础", "工作模式", "FAQ", "技术细节"),
nav: getNavbar('/zh-hans/', '指南', '下载', 'Changelog', 'Rikka Apps'),
lastUpdated: '最后更新'
},
'/zh-hant/': {
selectText: '語言',
label: '繁體中文',
editLinkText: '在 GitHub 上編輯此頁',
serviceWorker: {
updatePopup: {
message: "發現新內容可用.",
buttonText: "重新整理"
}
},
sidebar: getSidebar("/zh-hant/guide/", "基礎", "工作模式", "FAQ", "技術細節"),
nav: getNavbar('/zh-hant/', '指南', '下載', 'Changelog', 'Rikka Apps'),
lastUpdated: '最後更新'
}
},
displayAllHeaders: true,
sidebarDepth: 2,
serviceWorker: {
updatePopup: true
},
docsRepo: 'https://github.com/RikkaApps/websites',
docsDir: 'appops',
editLinks: true
},
plugins: [
[
'sitemap',
{
hostname: 'https://appops.rikka.app',
exclude: ['/404.html'],
dateFormatter: (time) => {
timestampCache[time]
}
}
],
/*[
'redirect',
{
locales: true,
}
],*/
[
'clean-urls',
{
normalSuffix: '/',
indexSuffix: '/',
notFoundPath: '/404.html'
}
],
[
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
var original = timestamp
moment.locale(langMap[lang])
var localized = moment(original).format('lll')
moment.locale('en')
var iso = moment(original).toISOString()
timestampCache[localized] = iso
return localized
}
}
]
]
}
function getSidebar(prefix, basicTitle, workingModeTitle, faqTitle, technicalDetailsTitle) {
var res = {}
res[prefix] = [
{
title: basicTitle,
collapsable: false,
sidebarDepth: 1,
children: [
''
]
},
{
title: workingModeTitle,
collapsable: false,
sidebarDepth: 1,
children: [
'working_mode/shizuku',
'working_mode/dpm',
]
},
{
title: faqTitle,
collapsable: false,
sidebarDepth: 0,
children: [
'faq/how_to_reset',
'faq/purchase',
]
},
{
title: technicalDetailsTitle,
collapsable: false,
sidebarDepth: 0,
children: [
'technical/system_behaviors',
'technical/run_in_background',
]
}
]
return res
}
function getNavbar(prefix, guide, download, changelog, allRikkaApps) {
return [
{ text: guide, link: `${prefix}guide/` },
{ text: download, link: `${prefix}download/` },
{ text: changelog, link: `${prefix}changelog/` },
{ text: allRikkaApps, link: `https://rikka.app${prefix}` },
]
}
================================================
FILE: appops/.vuepress/public/icon/browserconfig.xml
================================================
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
{{ feature.details }}
{{ data.heroText || $title || 'Hello' }}
{{ feature.title }}
〔2〕Previously, the name of "the permission" is used in priority. But as Android changes some permission name across versions, the name is more and more inaccurate.
〔3〕Due to user reports, some old Samsung devices "appear to have this feature", but change to "ask" will cause the system unable to boot.
## 3.1.1 (2019-08-03)
- Fix can't modify template
## 3.1.0 (2019-08-02)
- Provide more obvious warnings when doing operations on system apps
- Provide edit & add for apply template dialog
- Fix the problem that it will always determine that you are using Island once you have used Island in Delegated Device admin mode
## 3.0.3 (2019-07-29)
- Minor bug fix
- Provide new website with document:
**\[2\]** The actual behavior depends on the system, and the app can also check if "appops" is denied
## What is App Ops app?
The core function of App Ops app is to modify the system "appops" settings to implement permission management in a sense. App Ops app also makes a lot of effort to simplify many technical details and make it easier to use.
## Term
### "Permissions"
App Ops actually modifies "application operation" rather than "permission", but we call it "permissions" to reduce the difficulty. App Ops app **can't control "permissions" directly**, please don't misunderstand.
::: tip
We still call it "permission" in the rest of the help
:::
## Limitations of App Ops
### Permissions can be modified are depend on your system
The permissions that App Ops can modify **depend only on your system**, so stop asking "why there is no XXX permission".
In general, the higher the system version, the more permission you can modify (manufacturers or custom ROMs may add their own permission). All permissions supported by your system can be found in Settings - Behavior - All Permissions.
### Apps can still check if they have no permission
Apps can check if the returned data is blank or directly check if "appops" is allowed. But there are very few apps do this.
================================================
FILE: appops/guide/faq/how_to_reset.md
================================================
# How to reset all settings?
1. Switch to app list mode
2. Long press or tap the app icon on the left to enter multi-select mode
3. Three-dot menu - Select all
4. Select "Reset"
================================================
FILE: appops/guide/faq/purchase.md
================================================
# Purchase or restore problems
## Google Play restore
In most cases, follow the prompts that appear after clicking the purchase. If you still can't solve the problem, please send us an email.
================================================
FILE: appops/guide/technical/run_in_background.md
================================================
# `RUN_IN_BACKGROUND`/`RUN_ANY_IN_BACKGROUND` (Run in background)
"Run in background" seen in the App Ops app actually refers to the two ops `RUN_IN_BACKGROUND` (added from Android 7) and `RUN_ANY_IN_BACKGROUND` (added from Android 9). Changing these ops will behave differently on different system versions.
This article will explain the effect of modifying `RUN_IN_BACKGROUND` and `RUN_ANY_IN_BACKGROUND` on app behavior on Android 9.
## Special handling by the app App Ops
In response to the new addition of `RUN_ANY_IN_BACKGROUND` for Android 9, App Ops v2.6.0 used a strategy like this: directly treat `RUN_IN_BACKGROUND` and `RUN_ANY_IN_BACKGROUND` as the same one, ie only see a "Run in background" option, modify it will modify both two ops at the same time. However, in some special cases, setting two at the same time will cause the restriction to be too strict, so you can choose which one to limit from v2.6.0.
## `RUN_IN_BACKGROUND`
> The article has not been completed, more information will be added later
All apps targeting API 26 and above will always subject to this restriction.
Refer to the following article:
Https://developer.android.com/about/versions/oreo/background
## `RUN_ANY_IN_BACKGROUND`
> The article has not been completed, more information will be added later
Refer to the following article:
Https://developer.android.com/about/versions/pie/power#battery-saver
Https://developer.android.com/topic/performance/power/power-details
Some of the commits involved:
Https://github.com/aosp-mirror/platform_frameworks_base/commit/3ac1daac4044c70ad4ee673214074306de499a18
Https://github.com/aosp-mirror/platform_frameworks_base/commit/db6bf66ee3b82edf25874d5dea4e02b0a146fb16
================================================
FILE: appops/guide/technical/system_behaviors.md
================================================
# Difference under different Android versions
Each op has two modes, `package mode` and `uid mode`. `uid mode` has higher priority, that is, `package mode` is used only when `uid mode` is the default value.
The following forms shows how the `uid mode` will be set when the permission settings are modified from the system.
::: details Forms
The asterisk (*) indicates changes from the previous system.
#### Android 6 - Android 9
| System setting page | uid mode |
|---------------------|-----------------------------------------|
| Allow | allow |
| Deny | ignore
星号(*)表示相对之前的系统放生变化。
#### Android 6 - Android 9
| 系统设定页面 | uid mode |
|--------------|-----------------------------------------|
| 允许 | allow |
| 拒绝 | ignore(只对 target 23 以下的应用设定) |
| (尚未设定) | (allow) |
#### Android 10
| 系统设定页面 | uid mode |
|--------------------|------------|
| 仅在使用期间允许 * | foreground |
| 允许 | allow |
| 拒绝 * | ignore |
| (尚未设定) | (allow) |
#### Android 11
| 系统设定页面 | uid mode |
|--------------------|------------|
| 每次都询问 * | ignore |
| 仅在使用期间允许 * | foreground |
| 允许 | allow |
| 拒绝 | ignore |
| (尚未设定)* | ignore |
#### Android 11 中的其他行为
* 设置 `package mode` 无效
* 设置 `uid mode` 时,若设定值不符合运行时权限状态则无效
* 在特定的情况下(比如安装应用后),系统将重设**全部应用**的 appops 设定到与运行时权限符合的状态
:::
### 旧版本 App Ops 没做对
旧版本的 App Ops(v5.0.0 以前)只会读取和修改 `package mode`,这显然是不对的。
在 Android 9 及之前,对 target 23 以下的应用在 App Ops 中设定“允许”是无效的;在 Android 10,一旦用户在系统中设置“拒绝”或“仅在使用时允许”,则在 App Ops 中的设置永远无法生效(因为此时系统设置的 `uid mode` 被优先使用)。
由于从低版本升级时系统的权限设定是被保留的,这个巨大的问题在 Android 10 发布的一年后才慢慢地暴露出来。
### 新版本(v5.0.0)App Ops 所做出的变化
除了完全跟随系统行为以外别无选择。
另外,因为 Android 11 会重置 appops 设定(所有“运行时权限允许,ops 忽略”会被重设为“运行时权限拒绝”),所以除了在系统之后再次重设以外别无选择。
### 新版本(v5.0.0)App Ops 需要更多能力
想要正确跟随系统行为,App Ops 必须具备取得和设置 `runtime permission`,`permission flags`,`appops` 的能力。但是,并不是所有工作模式都能做到。
| | Shizuku 模式 | 托管设备管理员模式 | root 模式(已被移除) |
|--------------------|--------------|------------------------------|-----------------------|
| appops | ✔️ | ✔️ | ✔️ |
| runtime permission | ✔️ | 仅可设置**〔1〕** | ❌ |
| permission flags | ✔️ | ❌ | ❌ |
〔1〕需要 Island v5.0+ 或其他具有 [Delegated Scopes Manager](https://github.com/heruoxin/Delegated-Scopes-Manager) v3 支持的管理员应用
#### “托管设备管理员模式”的缺陷
* “无法确认”
* 无法备份全部设置
* 在 Android 11,无法设定新增的“每次都询问”(需要“设置 permission flags”)
::: details 技术信息
被设为 `profile owner` 或 `device owner` 的管理员应用享有一些特权,但是只有它们自身可以使用。因此,不同的管理员应用提供了不同的 API,使其他应用得以“借用”其特权。
* [Delegated Scopes Manager API](https://github.com/heruoxin/Delegated-Scopes-Manager)
* [Delegation API](https://island.oasisfeng.com/api)
只有提供 Delegation API 的 Island v5.0+ 支持“设置 runtime permission”。
对于“无法确认”,举个例子,在 Android 10 中:
| | appops | runtime permission | permission flags |
|--------------|------------|--------------------|------------------|
| 忽略 | ignore | true | |
| 拒绝 | (任何值) | false | 任意 "FIXED" |
| (尚未设置) | (任何值) | false | 无 "FIXED" |
只看 appops 设置显然不够。
:::
#### 为什么必须移除“root 模式”
纯 root(执行指令)的能力十分有限,没有可以修改 permission flags 的指令。想要正确修改 runtime permission 必须保证 permission flags 也被正确地修改(设备管理员所使用的更高层级的 Java API 不需要考虑这个问题)。
因此,root 模式已被移除。
::: details 技术信息
很多人会认为 root 无所不能,但实际上 root 只提供了一个 `uid 0` 的 shell。想要进入 Android 世界(直接使用 Java API),通过 `app_process` 运行 dex 几乎是唯一选择。
“root 模式”的替代——“Shizuku 模式”使用 Shizuku([GitHub](https://github.com/RikkaApps/Shizuku))做这一部分的工作。如果不使用 Shizuku,则仍然需要运行类似 Shizuku 的东西,这样做是没有意义的,并且也将带来无意义的资源使用。
:::
================================================
FILE: appops/zh-hans/guide/working_mode/dpm.md
================================================
# 托管设备管理员模式
::: warning 警告
从 6.0.0 起,此工作模式不再支持。若要继续使用此工作模式,请[下载 5.5.6 版本](https://github.com/RikkaApps/App-Ops-issue-tracker/releases/download/files/appops-v5.5.6.r1453.f44c5855.apk)。
:::
## 需求及特性
* 需要 Android 9+
* 需要安装其他应用,并使用 adb 将其设为 Device owner
* 是否支持多用户取决于 Device owner 应用
## 背景
托管设备管理员模式是 App Ops 从 v2.9.0 开始加入的新的工作模式。从 Android 9 开始,设备管理员开始可以修改 appops 设定,但系统限制一台设备上仅能设置一个应用为设备管理员。因此 App Ops 使用由其他设备管理员应用提供的 API。
从 v2.9.0 起支持使用 [Delegated Scopes Manager](https://github.com/heruoxin/Delegated-Scopes-Manager) 的设备管理员应用。
从 v2.9.8 起支持另一种[由 Island 提供的 API](https://island.oasisfeng.com/api)。
## 免责声明
你需要安装的设备管理员应用都不是由我们开发。
::: warning
设备管理员在三星设备及很多来自中国大陆地区厂商的设备上或多或少存在一些问题,请务必仔细阅读来自设备管理员应用提供的帮助,如果你无法接受可能的问题,请不要使用。
:::
::: danger
三星设备在使用设备管理员后可能造成无法挽回的结果(参阅 [来自 冰箱 IceBox 的文档](https://iceboxdoc.catchingnow.com/Device%20Owner%20%E4%B8%89%E6%98%9F%E7%89%B9%E5%88%AB%E8%AF%B4%E6%98%8E)),请务必谨慎。
:::
## 如何使用
设置过程需要连接电脑使用 adb,但只需要进行一次设置。
### 1. 安装及设置设备管理员应用
#### 冰箱 IceBox
1. 下载 [Google Play](https://play.google.com/store/apps/details?id=com.catchingnow.icebox) 或 [Coolapk](https://www.coolapk.com/apk/com.catchingnow.icebox)
2. 参阅 [帮助](https://iceboxdoc.catchingnow.com/Device%20Owner%20%EF%BC%88%E5%85%8D%20root%EF%BC%89%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE) 为其设置设备管理员模式
#### 小黑屋
1. 下载 [Google Play](https://play.google.com/store/apps/details?id=web1n.stopapp) 或 [Coolapk](https://www.coolapk.com/apk/web1n.stopapp)
2. 参阅 [帮助](https://github.com/web1n/Stopapp-Docs/blob/master/Device%20Owner%20%EF%BC%88%E5%85%8D%20root%EF%BC%89%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE.md)(仅提供简体中文) 为其设置设备管理员模式
#### Island
1. 下载 [Google Play](https://play.google.com/store/apps/details?id=com.oasisfeng.island) 或 [Coolapk](https://www.coolapk.com/apk/com.oasisfeng.island)
2. 参阅 [帮助](https://island.oasisfeng.com/setup.html) 为其设置设备管理员模式(Island 称其为“上帝模式”)
### 2. 授予权限
在 App Ops “设置”-“工作模式”中选择“托管设备管理员模式”后返回应用列表应该会弹出来自设备管理员应用的授权对话框,请在勾选“修改 app ops”后确认。
接着,你还需要使用使用 adb 授予 App Ops “获取 app ops” 权限。使用以下的指令:
```
adb shell pm grant --user 0 rikka.appops android.permission.GET_APP_OPS_STATS
```
注意,如果你将 App Ops 应用安装到其他用户,需要将其中 `--user 0` 的 `0` 替换为其他用户的 id(使用 `adb shell pm list users` 获得的 `UserInfo{0:Owner:13} running` 的结果中的 `0` 即为用户 id)。
### 3. 授予多用户权限
对于多用户支持,你还需要运行下面的指令来让 App Ops 可以部分访问其他用户:
```
adb shell pm grant --user 0 rikka.appops android.permission.INTERACT_ACROSS_USERS
```
::: tip
目前只有 Island 3.8+ 支持多用户
:::
### 4. 遇到问题?
* 使用 Island 时出现 `Cannot request permission without a restrictions provider registered`
清除 Island 的缓存(应用信息 -> 存储 -> 清除缓存),后重新启动 Island。
================================================
FILE: appops/zh-hans/guide/working_mode/shizuku.md
================================================
# Shizuku 模式
## 需求及特性
* 需要安装 Shizuku 应用并通过 adb 或 root 启动 Shizuku 服务
* 支持多用户
::: tip
如果使用 adb,每次开机都需要使用 adb 进行启动 Shizuku 的步骤(**但 appops 设置总是生效**)
:::
## 背景
Shizuku 是一个免费且[开源](https://github.com/RikkaApps/Shizuku)的类似于框架的应用。它旨在服务多个需要 root 或 adb 的应用。Shizuku 在对性能的影响最小的情况下,极大地提高了使用 Shizuku 的应用的性能和可靠性。 此外,Shizuku 还为开发者提供了极大的便利。
> 有关 Shizuku 的信息,以及为什么要独立出一个应用,请查看 [shizuku.rikka.app](https://shizuku.rikka.app/zh-hans)。
================================================
FILE: appops/zh-hant/README.md
================================================
---
home: true
heroImage: /logo.png
actionText: 立即下載
actionLink: /zh-hant/download.html
secondaryActionText: 瞭解更多
secondaryActionLink: /zh-hant/guide/
features:
- title: 訪問隱藏的權限機制
details: 藉助 App Ops 修改隱藏的 appops 設定來(部分)控制權限。
- title: 優秀的使用者經驗
details: 提供美觀、友好的使用者介面。App Ops 在很多不為人知的地方做出許多努力以降低使用難度。
- title: 無需 root 也可使用
details: 提供多種只需 adb 的工作模式。
- title: 跟隨最新的 Android 系統
details: 支援新版本 Android 的特性,即使是測試版系統也會在幾天內得到支援。
- title: 詳細的幫助
details: 提供詳細的幫助文件。
- title: 提供高階功能
details: 藉助模板、備份恢復等功能來方便操作。
footer: Copyright © 2019 RikkaApps
---
================================================
FILE: appops/zh-hant/changelog.md
================================================
# 變更日誌
## 9.0.6 (2023-08-03)
- 升級 Shizuku 到 13.5.0 以上可能可以解決自動化功能不工作的問題
- 修復在部分 realme 裝置上「無法啟動服務」的問題
- 修復在 Android 7.1 及之前版本崩潰
## 9.0.0 (2023-04-08)
- 為 Android 10 及以上版本新增「感測器」權限,可控制應用程式是否可以使用加速度計、重力感測器等無需權限即可使用的感測器
- 支援 Android 14(但是,根據經驗,應用程式很可能會因為之後的改動再次無法工作)
- 在 Android 11 以上針對目標 API 為 30 及以上的應用程式隱藏 `OP_TOAST_WINDOW`,因為其不再有效
- 在 Android 10 以上針對儲存權限新增說明,因為系統允許特定的應用程式寫入標準資料夾,即使其沒有儲存權限(特定的應用程式是指目標 API 是 30 或以上,或者目標 API 是 29 且適配了 Scoped Storage 的應用程式)
- 增加允許備份系統元件的選項
- 針對中日韓語言使用者,如果系統沒有提供 Medium(500)字重的字型,則會使用模擬實現
- 針對在三星裝置上出現的 `com.android.externalstorage`、`com.android.providers.downloads`、`com.samsung.android.providers.media` 無權限問題增加提示資訊
## 8.0.1 (2022-11-22)
- 未解鎖完整版時允許備份(恢復備份仍需要完整版)
- 修復切換使用者隨機失效
## 8.0.0 (2022-09-02)
- 針對 Android 12 及以上的實驗性功能:使用情況歷史
- 適配 Android 12 關於位置權限的變化
- Material Design 3
- 裝置管理員模式因為 Google Play 政策變化而被移除
## 5.5.6 (2022-06-10)
- 在 Android 13 Beta 3 上工作
- 修復使用法語時崩潰的問題
- 裝置管理員模式將要因為 Google Play 政策變化而被移除
## 5.5.2 (2022-03-10)
- 更換應用程式圖示,因為舊圖示「違反 Google Play 政策」
## 5.5.0 (2022-03-03)
- 在 Android 13 DP1 上工作(但是,根據經驗,DP1 是非常早期的版本,應用程序很可能會因為 DP2 的改動再次無法工作)
## 5.4.3 (2021-06-13)
- 修復「自動恢復」可能造成所有同組權限都被重設爲「忽略」的問題
## 5.4.2 (2021-06-01)
- 修復從 5.4.0 起備份不工作
- 修復低版本系統上的一些視覺問題
## 5.4.0 (2021-05-27)
- 修復在 Android 12 Beta 1 上剪貼簿監視器不工作的問題
- 修復在 Android 11 及以上版本,無法為安裝在工作資料的應用程式設定「忽略」的問題(此修復只在 Shizuku 模式下可能)
- 隱藏 `OP_QUERY_ALL_PACKAGES` 因為完全沒有用
- 隱藏 `OP_NO_ISOLATED_STORAGE` 因為它只用作除錯
## 5.3.3 (2021-05-04)
- 適應另一個 Android 12 的改變
- 阻止 💩 MIUI 的「強制深色模式」弄壞自己的深色主題**〔1〕**
〔1〕MIUI 有自己的「強制深色模式」,但是似乎即使應用程式正確地提供了深色主題,它也會繼續起作用,從而把顏色改亂。
## 5.3.1 (2021-04-03)
- 修了一個可能導致崩潰的問題
- 適應一些 Android 12 的改變
## 5.3.0 (2021-01-28)
- 初步地加入正確處理 Shared user ID
## 5.2.0 (2021-01-16)
- 支援 Sui(https://github.com/RikkaApps/Sui)
## 5.1.3 (2020-11-29)
- 適應了「儲存空間隔離」v5 的變化
- 修瞭如果系統返回了「錯誤」的資料備份會壞掉的問題(但是已經壞了的備份檔案不可能修好)
## 5.1.2 (2020-10-07)
- 修復一個涉及建立備份的問題
- 修復一個涉及「剪貼簿監視器」的問題
- 修復「自動恢復」的記錄有時可能無法正確地被更新的問題
- 匯入來自使用者的翻譯
## 5.1.0 (2020-09-24)
- 「應用詳情」及「權限檢視」的的批量操作現在可以使用所有的選項(注意,選中多個項目時,顯示的選項為所有可用選項的交集)
- 「權限檢視」可以搜尋
## 5.0.6 (2020-09-06)
- 修復一個有關建立備份的問題
- 修復一個有關批量操作(包括使用模板、備份等)的問題
- 匯入來自使用者的翻譯
- 其他小改變
## 5.0.4 (2020-08-30)
- 修復了實際上未還原任何內容時「正在還原備份」也可能會顯示的問題
- 匯入來自使用者的翻譯
- 其他小改變
## 5.0.3 (2020-08-27)
- 修復 v5.0.2 (1236) 引入的問題
## 5.0.2 (2020-08-26)
- 為所有 Android 10 強制使用「自動恢復」選項,因為已確認 Android 10 也會進行重置(只是相較 Android 11 情況更少)
- 修復了在「託管裝置管理員模式」下錯誤地要求所有版本的 Island 請求了只有 Island 5.0+ 提供的功能的問題
- 修復了「自動恢復」的忽略選項實際上不起作用的問題
- 修復了模板中的 `RUN_IN_BACKGROUND` 在編輯後沒有正確顯示的問題
## 5.0.1 (2020-08-24)
- 修了上個版本將使用 DSM API v3 的管理員程式錯誤地標明為「缺少支援」的問題
- 修了上個版本的模板並沒有正確顯示所有選項
- 修了上個版本針對(以「隱藏」為原理的)凍結類應用的自動恢復備份功能壞掉的問題
- 在必要時重設 package mode(針對使用舊版 App Ops 或其他尚未正確適應系統變化的 appops 工具留下的「錯誤」設定)
- 匯入新增的使用者翻譯
## 5.0.0 (2020-08-22)
此更新解決了一個隱蔽但長期存在的問題。因為 Android 10 以下只在極少情況才出現,且升級到 Android 10 以後已有的設定不會被影響,這個問題在最近才浮出水面。一個典型的例子是,在 Android 10 中,一旦您從系統更改了位置權限,對舊版 App Ops 的更改將永遠無法生效(即使看起來成功地更改了)。
這背後包含很多工作,請閱讀[技術細節](./guide/technical/system_behaviors/)。
**您應該知道的內容:**
- 您在 App Ops 中看到或更改的內容現在反映最終狀態
- 舊版本中的「拒絕」被重新命名為「忽略」
- 不再支援舊備份,因為它們缺少必要的資訊(甚至可能包含錯誤的資訊)
- 對於「託管裝置管理員模式」,當前只有 Island v5.0+ 支援新的必要的 API
- 對於「託管裝置管理員模式」,備份的一部分來源於歷史使用者操作,這是因為管理員程式沒有足夠的權限來獲取準確的狀態(這是系統限制)
其他變化:
- 模板:不止「忽略」(「拒絕」),現在可以在模板中使用任何選項
- 備份:還原時更加靈活
- 使用情況監控器:嘗試減少「錯誤」報告(有時系統始終報告應用程式正在使用位置,即使該應用程式已經不再執行也是如此)
- 使用情況監控器 & 剪貼簿監視器:加入「排除系統應用程式」選項
## 4.2.3 (2020-07-18)
- Add Turkish translation
- "Usage monitor" fix
## 4.2.2 (2020-07-16)
- 解決了從 v4.0.0 起出現的小概率隨機停止執行問題
- 「使用情況監視器」改進
- 重新整理字串,任何人都可以參與翻譯
## 4.2.0 (2020-07-12)
- 增加「使用情況監視器」(需要 Android 9 以上和通過 root 啟動的 Shizuku)
當應用程式使用位置、相機或麥克風時收到提示
## 4.1.1 (2020-07-10)
- 剪貼簿監視:可設定「臨時訪問時限」
- 剪貼簿監視:修復一個有關「排除的程式」的 UI 問題
- 修復在 Android 10 以上,從 v4.0.0 起建立的備份可能損壞的問題
- 正確地回報來自託管裝置管理員模式的錯誤
- 暫時不使用 AAPT2 的資源優化功能,這可能可以解決部分使用者出現的隨機的設定介面崩潰問題
## 4.1.0 (2020-07-09)
- 剪貼簿監視:增加「視窗位置」和「排除的程式」選項
- 修復一旦主要程式死掉,「新程式行為」功能就會停止工作
- 修復權限檢視 UI 重新整理問題
## 4.0.1 (2020-07-05)
- 修復在某些情況下監視服務非正常地啟動
## 4.0.0 (2020-07-04)
用最新技術(部分)重寫。具有更多改進和新功能的全面重寫將在不久的將來出現。
- 新功能:剪貼簿監視(需要 Android 10 以上和通過 root 啟動的 Shizuku)**〔1〕**
- 在 Android 10 及 11 上工作
- 使用者介面翻新
- 修復一個有關恢復備份的問題
- 永遠使用內建的名稱**〔2〕**
- 對於免費版本,移除 Google Ads(轉而推薦我們的其他應用程式)
- 對於崩潰報告,使用 AppCenter 替代 Firebase Crashlytics(此外,崩潰報告可關閉)
- 目標 API 30
- 不再支援 system plugin 模式
- 不再支援 Android 6.0
- 不再支援古老的以 LineageOS 為基礎的 ROM 中的詢問模式**〔3〕**
〔1〕從監視中排除應用程式的功能將在下個版本中加入
星號(*)表示相對之前的系統放生變化。
#### Android 6 - Android 9
| 系統設定頁面 | uid mode |
|--------------|-----------------------------------------|
| 允許 | allow |
| 拒絕 | ignore(只對 target 23 以下的應用程式設定) |
| (尚未設定) | (allow) |
#### Android 10
| 系統設定頁面 | uid mode |
|--------------------|------------|
| 僅在使用期間允許 * | foreground |
| 允許 | allow |
| 拒絕 * | ignore |
| (尚未設定) | (allow) |
#### Android 11
| 系統設定頁面 | uid mode |
|--------------------|------------|
| 每次都詢問 * | ignore |
| 僅在使用期間允許 * | foreground |
| 允許 | allow |
| 拒絕 | ignore |
| (尚未設定)* | ignore |
#### Android 11 中的其他行為
* 設定 `package mode` 無效
* 設定 `uid mode` 時,若設定值不符合執行時權限狀態則無效
* 在特定的情況下(比如安裝應用程式後),系統將重設**全部應用程式**的 appops 設定到與執行時權限符合的狀態
:::
### 舊版本 App Ops 沒做對
舊版本的 App Ops(v5.0.0 以前)只會讀取和修改 `package mode`,這顯然是不對的。
在 Android 9 及之前,對 target 23 以下的應用程式在 App Ops 中設定「允許」是無效的;在 Android 10,一旦使用者在系統中設定「拒絕」或「僅在使用時允許」,則在 App Ops 中的設定永遠無法生效(因為此時系統設定的 `uid mode` 被優先使用)。
由於從低版本升級時系統的權限設定是被保留的,這個巨大的問題在 Android 10 釋出的一年後才慢慢地暴露出來。
### 新版本(v5.0.0)App Ops 所做出的變化
除了完全跟隨系統行為以外別無選擇。
另外,因為 Android 11 會重置 appops 設定(所有「執行時權限允許,ops 忽略」會被重設為「執行時權限拒絕」),所以除了在系統之後再次重設以外別無選擇。
### 新版本(v5.0.0)App Ops 需要更多能力
想要正確跟隨系統行為,App Ops 必須具備取得和設定 `runtime permission`,`permission flags`,`appops` 的能力。但是,並不是所有工作模式都能做到。
| | Shizuku 模式 | 託管裝置管理員模式 | root 模式(已被移除) |
|--------------------|--------------|------------------------------|-----------------------|
| appops | ✔️ | ✔️ | ✔️ |
| runtime permission | ✔️ | 僅可設定**〔1〕** | ❌ |
| permission flags | ✔️ | ❌ | ❌ |
〔1〕需要 Island v5.0+ 或其他具有 [Delegated Scopes Manager](https://github.com/heruoxin/Delegated-Scopes-Manager) v3 支援的管理員程式
#### 「託管裝置管理員模式」的缺陷
* 「無法確認」
* 無法備份全部設定
* 在 Android 11,無法設定新增的「每次都詢問」(需要「設定 permission flags」)
::: details 技術資訊
被設為 `profile owner` 或 `device owner` 的管理員程式享有一些特權,但是隻有它們自身可以使用。因此,不同的管理員程式提供了不同的 API,使其他應用程式得以「借用」其特權。
* [Delegated Scopes Manager API](https://github.com/heruoxin/Delegated-Scopes-Manager)
* [Delegation API](https://island.oasisfeng.com/api)
只有提供 Delegation API 的 Island v5.0+ 支援「設定 runtime permission」。
對於「無法確認」,舉個例子,在 Android 10 中:
| | appops | runtime permission | permission flags |
|--------------|------------|--------------------|------------------|
| 忽略 | ignore | true | |
| 拒絕 | (任何值) | false | 任意 "FIXED" |
| (尚未設定) | (任何值) | false | 無 "FIXED" |
只看 appops 設定顯然不夠。
:::
#### 為什麼必須移除「root 模式」
純 root(執行指令)的能力十分有限,沒有可以修改 permission flags 的指令。想要正確修改 runtime permission 必須保證 permission flags 也被正確地修改(裝置管理員所使用的更高層級的 Java API 不需要考慮這個問題)。
因此,root 模式已被移除。
::: details 技術資訊
很多人會認為 root 無所不能,但實際上 root 只提供了一個 `uid 0` 的 shell。想要進入 Android 世界(直接使用 Java API),通過 `app_process` 執行 dex 幾乎是唯一選擇。
「root 模式」的替代——「Shizuku 模式」使用 Shizuku([GitHub](https://github.com/RikkaApps/Shizuku))做這一部分的工作。如果不使用 Shizuku,則仍然需要執行類似 Shizuku 的東西,這樣做是沒有意義的,並且也將帶來無意義的資源使用。
:::
================================================
FILE: appops/zh-hant/guide/working_mode/dpm.md
================================================
# 託管裝置管理員模式
::: warning 警告
從 6.0.0 起,此工作模式不再支援。若要繼續使用此工作模式,請[下載 5.5.6 版本](https://github.com/RikkaApps/App-Ops-issue-tracker/releases/download/files/appops-v5.5.6.r1453.f44c5855.apk)。
:::
## 需求及特性
* 需要 Android 9+
* 需要安裝其他應用程式,並使用 adb 將其設為 Device owner
* 是否支援多使用者取決於 Device owner 應用程式
## 背景
託管裝置管理員模式是 App Ops 從 v2.9.0 開始加入的新的工作模式。從 Android 9 開始,裝置管理員開始可以修改 appops 設定,但系統限制一臺裝置上僅能設定一個程式為裝置管理員。因此 App Ops 使用由其他裝置管理員程式提供的 API。
從 v2.9.0 起支援使用 [Delegated Scopes Manager](https://github.com/heruoxin/Delegated-Scopes-Manager) 的裝置管理員程式。
從 v2.9.8 起支援另一種[由 Island 提供的 API](https://island.oasisfeng.com/api)。
## 免責聲明
你需要安裝的裝置管理員程式都不是由我們開發。
::: warning
裝置管理員在 Samsung 裝置及很多來自中國大陸地區廠商的裝置上或多或少存在一些問題,請務必仔細閱讀來自裝置管理員程式提供的幫助,如果你無法接受可能的問題,請不要使用。
:::
::: danger
Samsung 裝置在使用裝置管理員後可能造成無法挽回的結果(參閱 [來自 冰箱 IceBox 的文件](https://iceboxdoc.catchingnow.com/Device%20Owner%20%E4%B8%89%E6%98%9F%E7%89%B9%E5%88%AB%E8%AF%B4%E6%98%8E)),請務必謹慎。
:::
## 如何使用
設定過程需要連線電腦使用 adb,但只需要進行一次設定。
### 1. 安裝及設定裝置管理員程式
#### 冰箱 IceBox
1. 下載 [Google Play](https://play.google.com/store/apps/details?id=com.catchingnow.icebox) 或 [Coolapk](https://www.coolapk.com/apk/com.catchingnow.icebox)
2. 參閱 [幫助](https://iceboxdoc.catchingnow.com/Device%20Owner%20%EF%BC%88%E5%85%8D%20root%EF%BC%89%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE) 為其設定裝置管理員模式
#### 小黑屋
1. 下載 [Google Play](https://play.google.com/store/apps/details?id=web1n.stopapp) 或 [Coolapk](https://www.coolapk.com/apk/web1n.stopapp)
2. 參閱 [幫助](https://github.com/web1n/Stopapp-Docs/blob/master/Device%20Owner%20%EF%BC%88%E5%85%8D%20root%EF%BC%89%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE.md)(僅提供簡體中文) 為其設定裝置管理員模式
#### Island
1. 下載 [Google Play](https://play.google.com/store/apps/details?id=com.oasisfeng.island) 或 [Coolapk](https://www.coolapk.com/apk/com.oasisfeng.island)
2. 參閱 [幫助](https://island.oasisfeng.com/setup.html) 為其設定裝置管理員模式(Island 稱其為「上帝模式」)
### 2. 授予權限
在 App Ops「設定」-「工作模式」中選擇「託管裝置管理員模式」後返回程式列表應該會彈出來自裝置管理員程式的授權對話方塊,請在勾選「修改 app ops」後確認。
接著,你還需要使用使用 adb 授予 App Ops 「獲取 app ops」 權限。使用以下的指令:
```
adb shell pm grant --user 0 rikka.appops android.permission.GET_APP_OPS_STATS
```
注意,如果你將 App Ops 程式安裝到其他使用者,需要將其中 `--user 0` 的 `0` 替換為其他使用者的 id(使用 `adb shell pm list users` 獲得的 `UserInfo{0:Owner:13} running` 的結果中的 `0` 即為使用者 id)。
### 3. 授予多使用者許可權
對於多使用者支援,你還需要執行下面的指令來讓 App Ops 可以部分訪問其他使用者:
```
adb shell pm grant --user 0 rikka.appops android.permission.INTERACT_ACROSS_USERS
```
::: tip
目前只有 Island 3.8+ 支援多使用者
:::
### 4. 遇到問題?
* 使用 Island 時出現 `Cannot request permission without a restrictions provider registered`
清除 Island 的快取(應用資訊 -> 儲存 -> 清除快取),後重新啟動 Island。
================================================
FILE: appops/zh-hant/guide/working_mode/shizuku.md
================================================
# Shizuku 模式
## 需求及特性
* 需要安裝 Shizuku 應用程式並通過 adb 或 root 啟動 Shizuku 服務
* 支援多使用者
::: tip
如果使用 adb,每次開機都需要使用 adb 進行啟動 Shizuku 的步驟(**但 appops 設定總是生效**)
:::
## 背景
Shizuku 是一個免費且[開源](https://github.com/RikkaApps/Shizuku)的類似於框架的應用程式。它旨在服務多個需要 root 或 adb 的應用程式。Shizuku 在對效能的影響最小的情況下,極大地提高了使用 Shizuku 的應用程式的效能和可靠性。 此外,Shizuku 還為開發人員提供了極大的便利。
> 有關 Shizuku 的資訊,以及為什麼要獨立出一個應用程式,請檢視 [shizuku.rikka.app](https://shizuku.rikka.app/zh-hant)。
================================================
FILE: assets/SourceCodePro-BDC.css
================================================
@font-face {
font-family: 'Source Code Pro BDC';
src: local('Source Code Pro'), local('SourceCodePro-Regular.ttf'), url('../fonts/SourceCodePro-BDC-Regular.woff2') format('woff2');
font-weight: 400;
font-display: swap;
font-style: normal;
unicode-range: U+2500-259F;
}
================================================
FILE: package.json
================================================
{
"dependencies": {
"moment": "^2.29.1",
"vuepress": "^1.8.2",
"vuepress-plugin-clean-urls": "^1.1.2",
"vuepress-plugin-sitemap": "^2.3.1"
},
"scripts": {
"appops:dev": "vuepress dev appops",
"appops:build": "vuepress build appops",
"shizuku:dev": "vuepress dev shizuku",
"shizuku:build": "vuepress build shizuku",
"sr:dev": "vuepress dev storage_redirect",
"sr:build": "vuepress build storage_redirect",
"www:dev": "vuepress dev www",
"www:build": "vuepress build www"
}
}
================================================
FILE: shizuku/.gitignore
================================================
/.vuepress/dist
================================================
FILE: shizuku/.vuepress/config.js
================================================
const moment = require('moment')
const langMap = {
"zh-Hans": "zh-cn",
"zh-Hant": "zh-tw"
}
var timestampCache = {}
module.exports = {
base: '/',
title: 'Shizuku',
head: [
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/Roboto-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/NotoSansCJK-SC-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/NotoSansCJK-TC-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', { rel: 'apple-touch-icon', size: '57x57', href: '/icon/apple-icon-57x57.png' }],
['link', { rel: 'apple-touch-icon', size: '60x60', href: '/icon/apple-icon-60x60.png' }],
['link', { rel: 'apple-touch-icon', size: '72x72', href: '/icon/apple-icon-72x72.png' }],
['link', { rel: 'apple-touch-icon', size: '76x76', href: '/icon/apple-icon-76x76.png' }],
['link', { rel: 'apple-touch-icon', size: '114x114', href: '/icon/apple-icon-114x114.png' }],
['link', { rel: 'apple-touch-icon', size: '120x120', href: '/icon/apple-icon-120x120.png' }],
['link', { rel: 'apple-touch-icon', size: '144x144', href: '/icon/apple-icon-144x144.png' }],
['link', { rel: 'apple-touch-icon', size: '152x152', href: '/icon/apple-icon-152x152.png' }],
['link', { rel: 'apple-touch-icon', size: '180x180', href: '/icon/apple-icon-180x180.png' }],
['link', { rel: 'icon', type: 'image/png', size: '192x192', href: '/icon/android-icon-192x192.png' }],
['link', { rel: 'icon', type: 'image/png', size: '32x32', href: '/icon/favicon-32x32.png' }],
['link', { rel: 'icon', type: 'image/png', size: '96x96', href: '/icon/favicon-96x96.png' }],
['link', { rel: 'icon', type: 'image/png', size: '16x16', href: '/icon/favicon-16x16.png' }]
],
locales: {
'/': {
lang: 'en',
description: 'Let your app use system APIs directly'
},
'/zh-hans/': {
lang: 'zh-Hans',
description: '让你的应用直接使用系统 API'
},
'/zh-hant/': {
lang: 'zh-Hant',
description: '讓你的應用程式直接使用系統 API'
}
},
themeConfig: {
locales: {
'/': {
selectText: 'Languages',
label: 'English',
serviceWorker: {
updatePopup: {
message: "New content is available.",
buttonText: "Refresh"
}
},
sidebar: {
},
nav: getNavbar('/', 'Introduction', 'User manual', 'Download', 'Developer guide'),
lastUpdated: 'Last Updated'
}
,
'/zh-hans/': {
selectText: '语言',
label: '简体中文',
editLinkText: '在 GitHub 上编辑此页',
serviceWorker: {
updatePopup: {
message: "发现新内容可用.",
buttonText: "刷新"
}
},
sidebar: {
},
nav: getNavbar('/zh-hans/', '简介', '用户手册', '下载', '开发者指南'),
lastUpdated: '最后更新'
},
'/zh-hant/': {
selectText: '語言',
label: '繁體中文',
editLinkText: '在 GitHub 上編輯此頁',
serviceWorker: {
updatePopup: {
message: "發現新內容可用.",
buttonText: "重新整理"
}
},
sidebar: {
},
nav: getNavbar('/zh-hant/', '簡介', '使用者手冊', '下載', '開發者指南'),
lastUpdated: '最後更新'
}
},
displayAllHeaders: true,
sidebarDepth: 2,
serviceWorker: {
updatePopup: true
},
repo: 'https://github.com/RikkaApps/Shizuku',
docsRepo: 'https://github.com/RikkaApps/websites',
docsDir: 'shizuku',
editLinks: true
},
plugins: [
[
'sitemap',
{
hostname: 'https://shizuku.rikka.app',
exclude: ['/404.html'],
dateFormatter: (time) => {
timestampCache[time]
}
}
],
[
'clean-urls',
{
normalSuffix: '/',
indexSuffix: '/',
notFoundPath: '/404.html'
}
],
[
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
var original = timestamp
moment.locale(langMap[lang])
var localized = moment(original).format('lll')
moment.locale('en')
var iso = moment(original).toISOString()
timestampCache[localized] = iso
return localized
}
}
]
]
}
function getNavbar(prefix, introduction, guide, download, dev) {
return [
{ text: introduction, link: `${prefix}introduction` },
{ text: guide, link: `${prefix}guide/setup.html` },
{ text: dev, link: `https://github.com/RikkaApps/Shizuku/blob/master/README.md` },
{ text: download, link: `${prefix}download.html` },
]
}
================================================
FILE: shizuku/.vuepress/public/icon/browserconfig.xml
================================================
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
{{ feature.details }}
←
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
(only for apps target pre-23) |
| (Not yet set) | (allow) |
#### Android 10
| System setting page | uid mode |
|--------------------------|------------|
| Allow only while using * | foreground |
| Allow | allow |
| Deny * | ignore |
| (Not yet set) | (allow) |
#### Android 11
| System setting page | uid mode |
|--------------------------|------------|
| Ask every time * | ignore |
| Allow only while using * | foreground |
| Allow | allow |
| Deny | ignore |
| (Not yet set) * | ignore |
#### Other behaviors on Android 11
* Setting `package mode` is invalid
* When setting `uid mode`, it is invalid if the set value does not match to the runtime permission status
* Under certain circumstances (for example, install an app), the system will reset the appops of **all apps** to states that match runtime permissions
:::
### The old version of App Ops didn't do it right
The old versions of App Ops (before v5.0.0) will only read and modify `package mode`, which is obviously wrong.
In Android 9 and before, it is invalid to set "Allow" in App Ops for apps target below 23. In Android 10, once the user sets "Deny" or "Allow only while using" in the system, the settings in App Ops will never take effect (because `uid mode` set by the system is used first).
Since the system's permission settings were retained when upgrading from a lower version, this huge problem was slowly exposed one year after Android 10 was released.
### Changes made in the new version (v5.0.0) of App Ops
There is no choice but to follow the behavior of the system completely.
In addition, since Android 11 will reset appops settings (all "runtime permission allowed, ops ignored" will be reset to "runtime permission denied"), so there is no choice but to reset later after the system.
### The new version (v5.0.0) App Ops needs more capabilities
To follow the system behavior correctly, App Ops must have the ability to read and set `runtime permission`, `permission flags`, and `appops`. However, not all working modes can do it.
| | Shizuku mode | Delegated Device Admin mode | root mode (removed) |
|--------------------|--------------|--------------------------------|---------------------|
| appops | ✔️ | ✔️ | ✔️ |
| runtime permission | ✔️ | "Set" only**〔1〕** | ❌ |
| permission flags | ✔️ | ❌ | ❌ |
〔1〕Requires Island v5.0+ or any other admin apps with [Delegated Scopes Manager](https://github.com/heruoxin/Delegated-Scopes-Manager) v3 support
#### Defects of "Delegated Device Admin mode"
* "Unable to confirm"
* Cannot backup all settings
* In Android 11, the new "Ask every time" cannot be set (requires "set permission flags")
::: details Technical information
Administrator apps set as `profile owner` or `device owner` have some privileges, but only they can use them. Therefore, different admin apps provide different APIs, allowing other apps to "borrow" their privileges.
* [Delegated Scopes Manager API](https://github.com/heruoxin/Delegated-Scopes-Manager)
* [Delegation API](https://island.oasisfeng.com/api)
Only Island v5.0+ that provides Delegation API supports "set runtime permission".
For "unable to confirm", for example, in Android 10:
| | appops | runtime permission | permission flags |
|---------------|--------|--------------------|------------------|
| Ignore | ignore | true | |
| Deny | (any) | false | any "FIXED" flag |
| (Not yet set) | (any) | false | no "FIXED" flag |
Just looking at the appops setting is obviously not enough.
:::
#### Why "root mode" has to be removed?
The ability of pure root (execution command) is very limited, there is no command that can modify `permission flags`. If you want to modify the `runtime permission` correctly, you must ensure that the `permission flags` are also modified correctly (the higher-level Java API used by device admins does not need to consider this issue).
Therefore, the root mode has been removed.
::: details Technical information
Many people think that root is omnipotent, but in fact root basically only provides a shell with `uid 0`. If you want to enter the Android world (use Java API directly), running dex through `app_process` is almost the only option.
The alternative of "root mode", "Shizuku mode", uses Shizuku ([GitHub](https://github.com/RikkaApps/Shizuku)) to do this part of the work. If not Shizuku, something like Shizuku still need to be run, doing this is meaningless and will also bring meaningless resource usage.
:::
================================================
FILE: appops/guide/working_mode/dpm.md
================================================
# Delegated Device Admin mode
::: warning Warning
As of 6.0.0, this working mode is no longer supported. To continue using this working mode, please [download version 5.5.6](https://github.com/RikkaApps/App-Ops-issue-tracker/releases/download/files/appops-v5.5.6.r1453.f44c5855.apk).
:::
## Requirements and Features
* Requires Android 9+
* Need to install other apps and use adb to set it as Device owner
* Multi-user support depends on the Device owner app
## Background
Delegated Device Admin mode is a new working mode that App Ops has added since v2.9.0. Starting with Android 9, Device admin apps can modify appops settings, but the system limits the ability to set only one app as a Device admin on a device. Therefore, the App Ops app chooses to use APIs provided by other Device admin apps.
From v2.9.0, App Ops supports Device admin apps using [Delegated Scopes Manager](https://github.com/heruoxin/Delegated-Scopes-Manager).
From v2.9.8, App Ops supports [another API provided by Island app](https://island.oasisfeng.com/api).
## Disclaimer
The Device admin app you need to install is not developed by us.
::: warning
Device admin have somewhat problems with Samsung devices and many devices from mainland China. Please be sure to read the help provided by the Device admin app. If you can't accept possible problems, please don't use them.
:::
::: danger
Samsung devices may cause irreparable results after using the Device admin (see [Document from IceBox](https://iceboxdoc.catchingnow.com/Device%20Owner%20%E4%B8%89%E6%98%9F%E7%89%B9%E5%88%AB%E8%AF%B4%E6%98%8E)), **please be cautious**.
:::
## How to use
The setup process requires a computer to be use adb, but only needs to be set once.
### 1. Install and set up the Device admin app
#### IceBox
1. Download from [Google Play](https://play.google.com/store/apps/details?id=com.catchingnow.icebox) or [Coolapk](https://www.coolapk.com/apk/com.catchingnow.icebox)
2. See [Help](https://iceboxdoc.catchingnow.com/Device%20Owner%20(Non%20Root)%20Setup) to set up Device admin mode for it
#### 小黑屋 (Simplified Chinese only)
1. Download from [Google Play](https://play.google.com/store/apps/details?id=web1n.stopapp) or [Coolapk](https://www.coolapk.com/apk/web1n.stopapp )
2. See [Help](https://github.com/web1n/Stopapp-Docs/blob/master/Device%20Owner%20%EF%BC%88%E5%85%8D%20root%EF%BC%89%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE.md) (Simplified Chinese only) to set up Device admin mode for it
#### Island
1. Download from [Google Play](https://play.google.com/store/apps/details?id=com.oasisfeng.island) or [Coolapk](https://www.coolapk.com/apk/com.oasisfeng.island)
2. See [Help](https://island.oasisfeng.com/setup.html) to set up Device admin mode for it (Island call it "God mode")
### 2. Granting permissions
In the "Settings" - "Working Mode" of App Ops, select "Delegated Device Admin mode" and return to the app list. The authorization dialog from the Device admin app should pop up. Please check "change app ops" and confirm.
Next, you'll also need to grant App Ops the "get app ops" permission using adb. Use the following command:
```
adb shell pm grant --user 0 rikka.appops android.permission.GET_APP_OPS_STATS
```
Note that if you install the App Ops app in other users, you need to replace the `0` of `--user 0` with the id of the other user (use `adb shell pm list users` you will see results like `UserInfo{0:Owner:13} running`, `0` from it is the user id).
### 3. Granting multi-user permissions
For multi-user support, you also need to execute the following command to allow App Ops to partially access other users:
```
adb shell pm grant --user 0 rikka.appops android.permission.INTERACT_ACROSS_USERS
```
::: tip
Currently only Island 3.8+ supports multiple users
:::
### 4. Have trouble?
* `Cannot request permission without a restrictions provider registered` when using Island
Clear cache of Island (App info -> Storage -> Clear cache) and restart Island.
================================================
FILE: appops/guide/working_mode/shizuku.md
================================================
# Shizuku mode
## Requirements and Features
* Need to install Shizuku app and start Shizuku service via adb or root
* Support multi-user
::: tip
If you use adb, you need to use adb to start Shizuku every time your device boot (**but the appops settings always take effect**)
:::
## Background
Shizuku is a free and [open-sourced](https://github.com/RikkaApps/Shizuku) framework-like app. It's designed to serve multiple apps which requires root or adb. With minimal performance impact, Shizuku significantly improve the performance and reliability of apps using Shizuku. Also, Shizuku provides great convenience for developers.
> For information about Shizuku and the reason of making an application separately, please check [shizuku.rikka.app](https://shizuku.rikka.app/).
================================================
FILE: appops/zh-hans/README.md
================================================
---
home: true
heroImage: /logo.png
actionText: 立即下载
actionLink: /zh-hans/download.html
secondaryActionText: 了解更多
secondaryActionLink: /zh-hans/guide/
features:
- title: 访问隐藏的权限机制
details: 借助 App Ops 修改隐藏的 appops 设置来(部分)控制权限。
- title: 优秀的用户体验
details: 提供美观、友好的用户界面。App Ops 在很多不为人知的地方做出许多努力以降低使用难度。
- title: 无需 root 也可使用
details: 提供多种只需 adb 的工作模式。
- title: 跟随最新的 Android 系统
details: 支持新版本 Android 的特性,即使是测试版系统也会在几天内得到支持。
- title: 详细的帮助
details: 提供详细的帮助文档。
- title: 提供高级功能
details: 借助模板、备份恢复等功能来方便操作。
footer: Copyright © 2019 RikkaApps
---
================================================
FILE: appops/zh-hans/changelog.md
================================================
# 变更日志
## 9.0.6 (2023-08-03)
- 升级 Shizuku 到 13.5.0 以上可能可以解决自动化功能不工作的问题
- 修复在部分 realme 设备上“无法启动服务”的问题
- 修复在 Android 7.1 及之前版本崩溃
## 9.0.0 (2023-04-08)
- 为 Android 10 及以上版本添加“传感器”权限,可控制应用是否可以使用加速度计、重力传感器等无需权限即可使用的传感器
- 支持 Android 14(但是,根据经验,应用程序很可能会因为之后的改动再次无法工作)
- 在 Android 11 以上针对目标 API 为 30 及以上的应用隐藏 `OP_TOAST_WINDOW`,因为其不再有效
- 在 Android 10 以上针对存储权限添加说明,因为系统允许特定的应用写入标准文件夹,即使其没有存储权限(特定的应用是指目标 API 是 30 或以上,或者目标 API 是 29 且适配了分区存储的应用)
- 增加允许备份系统组件的选项
- 针对中日韩语言用户,如果系统没有提供 Medium(500)字重的字体,则会使用模拟实现
- 针对在三星设备上出现的 `com.android.externalstorage`、`com.android.providers.downloads`、`com.samsung.android.providers.media` 无权限问题增加提示信息
## 8.0.1 (2022-11-22)
- 未解锁完整版时允许备份(恢复备份仍需要完整版)
- 修复切换用户随机失效
## 8.0.0 (2022-09-02)
- 针对 Android 12 及以上的实验性功能:使用情况历史
- 适配 Android 12 关于位置权限的变化
- Material Design 3
- 设备管理员模式因为 Google Play 政策变化而被移除
## 5.5.6 (2022-06-10)
- 在 Android 13 Beta 3 上工作
- 修复使用法语时崩溃的问题
- 设备管理员模式将要因为 Google Play 政策变化而被移除
## 5.5.2 (2022-03-10)
- 更换应用图标,因为旧图标“违反 Google Play 政策”
## 5.5.0 (2022-03-03)
- 在 Android 13 DP1 上工作(但是,根据经验,DP1 是非常早期的版本,应用程序很可能会因为 DP2 的改动再次无法工作)
## 5.4.3 (2021-06-13)
- 修复“自动恢复”可能造成所有同组权限都被重设为“忽略”的问题
## 5.4.2 (2021-06-01)
- 修复从 5.4.0 起备份坏掉
- 修复低版本系统上的一些视觉问题
## 5.4.0 (2021-05-27)
- 修复在 Android 12 Beta 1 上剪贴板监视器不工作的问题
- 修复在 Android 11 及以上版本,无法为安装在工作资料的应用设置“忽略”的问题(此修复只在 Shizuku 模式下可能)
- 隐藏 `OP_QUERY_ALL_PACKAGES` 因为完全没有用
- 隐藏 `OP_NO_ISOLATED_STORAGE` 因为它只用作调试
## 5.3.3 (2021-05-04)
- 适应另一个 Android 12 的改变
- 阻止 💩 MIUI 的“强制深色模式”弄坏自己的深色主题**〔1〕**
〔1〕MIUI 有自己的“强制深色主题”,但是似乎即使应用正确地提供了深色主题,它也会继续起作用,从而把颜色改乱。
## 5.3.1 (2021-04-03)
- 修了一个可能导致崩溃的问题
- 适应一些 Android 12 的改变
## 5.3.0 (2021-01-28)
- 初步地加入正确处理 Shared user ID
## 5.2.0 (2021-01-16)
- 支持 Sui(https://github.com/RikkaApps/Sui)
## 5.1.3 (2020-11-29)
- 适应了“存储空间隔离” v5 的变化
- 修了如果系统返回了“错误”的数据备份会坏掉的问题(但是已经坏了的备份文件不可能修好)
## 5.1.2 (2020-10-07)
- 修复一个涉及创建备份的问题
- 修复一个涉及“剪贴板监视器”的问题
- 修复“自动恢复”的记录有时可能无法正确地被更新的问题
- 导入来自用户的翻译
## 5.1.0 (2020-09-24)
- “应用详情”及“权限视图”的批量操作现在可以使用所有的选项(注意,选中多个项目时,显示的选项为所有可用选项的交集)
- “权限视图”可以搜索
## 5.0.6 (2020-09-06)
- 修复一个有关创建备份的问题
- 修复一个有关批量操作(包括使用模板、备份等)的问题
- 导入来自用户的翻译
- 其他小改变
## 5.0.4 (2020-08-30)
- 修复了实际上未还原任何内容时“正在还原备份”也可能会显示的问题
- 导入来自用户的翻译
- 其他小改变
## 5.0.3 (2020-08-27)
- 修复 v5.0.2 (1236) 引入的问题
## 5.0.2 (2020-08-26)
- 为所有 Android 10 强制使用“自动恢复”选项,因为已确认 Android 10 也会进行重置(只是相较 Android 11 情况更少)
- 修复了在“托管设备管理员模式”下错误地要求所有版本的 Island 请求了只有 Island 5.0+ 提供的功能的问题
- 修复了“自动恢复”的忽略选项实际上不起作用的问题
- 修复了模板中的 `RUN_IN_BACKGROUND` 在编辑后没有正确显示的问题
## 5.0.1 (2020-08-24)
- 修了上个版本将使用 DSM API v3 的管理员应用错误地标明为“缺少支持”的问题
- 修了上个版本的模板并没有正确显示所有选项
- 修了上个版本针对(以“隐藏”为原理的)冻结类应用的自动恢复备份功能坏掉的问题
- 在必要时重设 package mode(针对使用旧版 App Ops 或其他尚未正确适应系统变化的 appops 工具留下的“错误”设置)
- 导入新增的用户翻译
## 5.0.0 (2020-08-22)
此更新解决了一个隐蔽但长期存在的问题。因为 Android 10 以下只在极少情况才出现,且升级到 Android 10 以后已有的设定不会被影响,这个问题在最近才浮出水面。一个典型的例子是,在 Android 10 中,一旦您从系统更改了位置权限,对旧版 App Ops 的更改将永远无法生效(即使看起来成功地更改了)。
这背后包含很多工作,请阅读[技术细节](./guide/technical/system_behaviors/)。
**您应该知道的内容:**
- 您在 App Ops 中看到或更改的内容现在反映最终状态
- 旧版本中的“拒绝”被重命名为“忽略”
- 不再支持旧备份,因为它们缺少必要的信息(甚至可能包含错误的信息)
- 对于“托管设备管理员模式”,当前只有 Island v5.0+ 支持新的必要的 API
- 对于“托管设备管理员模式”,备份的一部分来源于历史用户操作,这是因为管理员应用没有足够的权限来获取准确的状态(这是系统限制)
其他变化:
- 添加自动恢复功能:针对 Android 11 和部分高度修改的系统(MIUI,Oxygen 等)会自动复原设置的系统
- 模板:不止“忽略”(“拒绝”),现在可以在模板中使用任何选项
- 备份:还原时更加灵活
- 使用情况监控器:尝试减少“错误”报告(有时系统始终报告应用正在使用“位置”,即使该应用已经不再运行也是如此)
- 使用情况监控器 & 剪贴板监视器:加入“排除系统应用”选项
## 4.2.3 (2020-07-18)
- Add Turkish translation
- "Usage monitor" fix
## 4.2.2 (2020-07-16)
- 解决了从 v4.0.0 起出现的小概率随机停止运行问题
- “使用情况监视器”改进
- 重新整理字符串,任何人都可以参与翻译
## 4.2.0 (2020-07-12)
- 增加“使用情况监视器”(需要 Android 9 以上和通过 root 启动的 Shizuku)
当应用使用位置、相机或麦克风时收到提示
## 4.1.1 (2020-07-10)
- 剪贴板监视:可设定“临时访问时限”
- 剪贴板监视:修复一个有关“排除的应用”的 UI 问题
- 修复在 Android 10 以上,从 v4.0.0 起建立的备份可能损坏的问题
- 正确地回报来自托管设备管理员模式的错误
- 暂时不使用 AAPT2 的资源优化功能,这可能可以解决部分用户出现的随机的设置界面崩溃问题
## 4.1.0 (2020-07-09)
- 剪贴板监视:增加“窗口位置”和“排除的应用”选项
- 修复一旦主要进程死掉,“新应用行为”功能就会停止工作
- 修复权限视图 UI 刷新问题
## 4.0.1 (2020-07-05)
- 修复在某些情况下监视服务非正常地启动
## 4.0.0 (2020-07-04)
用最新技术(部分)重写。具有更多改进和新功能的全面重写将在不久的将来出现。
- 新功能:剪贴板监视(需要 Android 10 以上和通过 root 启动的 Shizuku)**〔1〕**
- 在 Android 10 及 11 上工作
- 用户界面翻新
- 修复一个有关恢复备份的问题
- 永远使用内置的名称**〔2〕**
- 对于免费版本,移除 Google Ads(转而推荐我们的其他应用)
- 对于崩溃报告,使用 AppCenter 替代 Firebase Crashlytics(此外,崩溃报告可关闭)
- 目标 API 30
- 不再支持系统插件模式
- 不再支持 Android 6.0
- 不再支持古老的以 LineageOS 为基础的 ROM 中的询问模式**〔3〕**
〔1〕从监视中排除应用的功能将在下个版本中加入
〔2〕之前,“权限”的名称被优先使用。但是随着 Android 在每个版本间不断改变权限名称,权限名称越来越不准确。
〔3〕根据用户报告,一些老旧的三星设备表现得有这个功能,但是改为“询问”将会导致系统无法启动。
## 3.1.1 (2019-08-03)
- 修复无法编辑模板
## 3.1.0 (2019-08-02)
- 操作系统应用时提供更加明显的警告
- 为套用模板对话框提供编辑与添加功能
- 修复使用托管设备管理员模式时,如果先使用 Island 之后更换为其他也会被判定为正在使用 Island
## 3.0.3 (2019-07-29)
- 小 bug 修复
- 提供新的包含文档的网站:
**〔2〕** 实际行为取决于系统,应用也可检查 "appops" 是否被拒绝
## 什么是 App Ops 应用
App Ops 应用的核心功能是修改系统 "appops" 设置,可以在某种意义上实现权限管理。App Ops 应用还做出很多努力简化许多技术细节,让使用更加简单。
## 用语声明
### “权限”
App Ops 实际修改的是“应用操作”而非“权限”,但为了降低难度将其称为“权限”。App Ops 应用**不可以直接操作“权限”**,请不要误解。
::: tip
帮助中的其他地方仍称其为“权限”。
:::
## App Ops 的限制
### 可以修改的权限取决于系统
App Ops 所能修改的权限**只取决于你的系统**,所以别再问“为什么没有 XXX 权限”了。
通常,系统版本越高,能修改的内容越多(厂商或自定义 ROM 可能会添加自己的权限)。所有你的系统支持的权限可以在 设置 - 行为 - 全部权限 中看到。
### 应用仍可以获知没有权限
应用可以检查返回数据是否为空白,或是直接检查 "appops" 是否被允许。只是很少有应用这么做。
================================================
FILE: appops/zh-hans/guide/faq/how_to_reset.md
================================================
### 如何重置全部设置?
1. 切换到应用列表模式
2. 长按或点击左侧应用图标进入多选模式
3. 右上方三点菜单 - 全选
4. 选择“重置”
================================================
FILE: appops/zh-hans/guide/faq/purchase.md
================================================
# 购买或恢复问题
## Google Play 恢复问题
大部分情况下,按照点击购买后出现的提示文字处理即可,如果仍不能解决问题,请发送邮件给我们。
================================================
FILE: appops/zh-hans/guide/technical/run_in_background.md
================================================
# `RUN_IN_BACKGROUND`/`RUN_ANY_IN_BACKGROUND`(在后台运行)
在 App Ops 应用中看到的“在后台运行”实际是指 `RUN_IN_BACKGROUND`(Android 7 起增加)和 `RUN_ANY_IN_BACKGROUND`(Android 9 起增加)这两个 op。在不同的系统版本上,改变这些 op 会有不同的行为。
这篇文章将会说明在 Android 9 上修改 `RUN_IN_BACKGROUND` 和 `RUN_ANY_IN_BACKGROUND` 对应用行为的影响。
## App Ops 应用所做的特殊处理
为了应对 Android 9 新增加的 `RUN_ANY_IN_BACKGROUND`,App Ops v2.6.0 以前采取这样的策略:直接将 `RUN_IN_BACKGROUND` 和 `RUN_ANY_IN_BACKGROUND` 视为同一个,即只会看到一个“在后台运行”选项,修改时会同时修改这两个。但部分特殊情况下,同时设置两个会造成限制过于严格的问题,因此从 v2.6.0 起可以自行选择限制哪一个。
## `RUN_IN_BACKGROUND`
> 文章尚未完成,更多信息将在以后补充
所有 target API 在 26 及以上的应用会受到此限制。
参考以下文章:
https://developer.android.com/about/versions/oreo/background
## `RUN_ANY_IN_BACKGROUND`
> 文章尚未完成,更多信息将在以后补充
参考以下文章:
https://developer.android.com/about/versions/pie/power#battery-saver
https://developer.android.com/topic/performance/power/power-details
部分涉及的 commit:
https://github.com/aosp-mirror/platform_frameworks_base/commit/3ac1daac4044c70ad4ee673214074306de499a18
https://github.com/aosp-mirror/platform_frameworks_base/commit/db6bf66ee3b82edf25874d5dea4e02b0a146fb16
================================================
FILE: appops/zh-hans/guide/technical/system_behaviors.md
================================================
# 不同 Android 版本下的不同
每个 op 都有两种 mode,分别为 `package mode` 和 `uid mode`。`uid mode` **有更高优先级**,即只有当 `uid mode` 为默认值时才会使用 `package mode`。
以下表格展示了从系统修改权限设定时,`uid mode` 会被如何设定。
::: details 表格
〔2〕之前,權限的名稱被優先使用。但是隨著 Android 在每個版本間不斷改變權限名稱,權限名稱越來越不準確。
〔3〕根據使用者報告,一些老舊的三星裝置表現得有這個功能,但是改為「詢問」將會導致系統無法啟動。
## 3.1.1 (2019-08-03)
- 修復無法編輯模板
## 3.1.0 (2019-08-02)
- 操作系統程式時提供更加明顯的警告
- 為套用模板對話方塊提供編輯與新增功能
- 修復使用託管裝置管理員模式時,如果先使用 Island 之後更換為其他也會被判定為正在使用 Island
## 3.0.3 (2019-07-29)
- 小 bug 修复
- 提供新的包含文档的网站:
**〔2〕** 實際行為取決於系統,程式也可檢查 "appops" 是否被拒絕
## 什麼是 App Ops 程式
App Ops 程式的核心功能是修改系統 "appops" 設定,可以在某種意義上實現權限管理。App Ops 程式還做出很多努力簡化許多技術細節,讓使用更加簡單。
## 用語宣告
### 「權限」
App Ops 實際修改的是「程式操作」而非「權限」,但為了降低難度將其稱為「權限」。App Ops 程式**不可以直接操作「權限」**,請不要誤解。
::: tip
幫助中的其他地方仍稱其為「權限」。
:::
## App Ops 的限制
### 可以修改的權限取決於系統
App Ops 所能修改的權限**只取決於你的系統**,所以别再問「為什麼沒有 XXX 權限」了。
通常,系統版本越高,能修改的內容越多(廠商或自定義 ROM 可能會新增自己的權限)。所有你的系統支援的權限可以在 設定 - 行為 - 全部權限 中看到。
### 程式仍可以獲知沒有權限
程式可以檢查返回資料是否為空白,或是直接檢查 "appops" 是否被允許。只是很少有程式這麼做。
================================================
FILE: appops/zh-hant/guide/faq/how_to_reset.md
================================================
# 如何重置全部設定?
1. 切換到應用列表模式
2. 長按或點選左側應用圖示進入多選模式
3. 右上方三點選單 - 全選
4. 選擇「重置」
================================================
FILE: appops/zh-hant/guide/faq/purchase.md
================================================
# 購買或恢復問題
## Google Play 恢復問題
大部分情況下,按照點擊購買後出現的提示文字處理即可,如果仍不能解決問題,請發送郵件給我們。
================================================
FILE: appops/zh-hant/guide/technical/run_in_background.md
================================================
# `RUN_IN_BACKGROUND`/`RUN_ANY_IN_BACKGROUND`(在後臺執行)
在 App Ops 應用中看到的「在後臺執行」實際是指 `RUN_IN_BACKGROUND`(Android 7 起增加)和 `RUN_ANY_IN_BACKGROUND`(Android 9 起增加)這兩個 op。在不同的系統版本上,改變這些 op 會有不同的行為。
這篇文章將會說明在 Android 9 上修改 `RUN_IN_BACKGROUND` 和 `RUN_ANY_IN_BACKGROUND` 對應用行為的影響。
## App Ops 應用所做的特殊處理
為了應對 Android 9 新增加的 `RUN_ANY_IN_BACKGROUND`,App Ops v2.6.0 以前採取這樣的策略:直接將 `RUN_IN_BACKGROUND` 和 `RUN_ANY_IN_BACKGROUND` 視為同一個,即只會看到一個「在後臺執行」選項,修改時會同時修改這兩個。但部分特殊情況下,同時設定兩個會造成限制過於嚴格的問題,因此從 v2.6.0 起可以自行選擇限制哪一個。
## `RUN_IN_BACKGROUND`
> 文章尚未完成,更多資訊將在以後補充
所有 target API 在 26 及以上的應用會受到此限制。
參考以下文章:
https://developer.android.com/about/versions/oreo/background
## `RUN_ANY_IN_BACKGROUND`
> 文章尚未完成,更多資訊將在以後補充
參考以下文章:
https://developer.android.com/about/versions/pie/power#battery-saver
https://developer.android.com/topic/performance/power/power-details
部分涉及的 commit:
https://github.com/aosp-mirror/platform_frameworks_base/commit/3ac1daac4044c70ad4ee673214074306de499a18
https://github.com/aosp-mirror/platform_frameworks_base/commit/db6bf66ee3b82edf25874d5dea4e02b0a146fb16
================================================
FILE: appops/zh-hant/guide/technical/system_behaviors.md
================================================
# 不同 Android 版本下的不同
每個 op 都有兩種 mode,分別為 `package mode` 和 `uid mode`。`uid mode` **有更高優先順序**,即只有當 `uid mode` 為預設值時才會使用 `package mode`。
以下表格展示了從系統修改權限設定時,`uid mode` 會被如何設定。
::: details 表格
3. Enter "Wireless debugging"
4. Enable "Wireless debugging"
#### Pairing (only needs once)
1. Start pairing in Shizuku
2. [Enable Wireless debugging](#enable-wireless-debugging)
3. Tap "Pair device with pairing code" in "Wireless debugging"
4. Enter pairing code in Shizuku's notificaiton
#### Start Shizuku
If it does not start, try disabling and enabling wireless debugging.
### Start by connecting to a computer
This boot method works on unrooted devices running Android 10 and below. Unfortunately, this startup method requires a computer. Due to system limitations, the boot steps need to be performed again after each reboot.
#### What is `adb`?
Android Debug Bridge (`adb`) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you Can use to run a variety of commands on a device.
See [Android Developer](https://developer.android.com/studio/command-line/adb) for more information.
#### Install `adb`
1. Download "SDK Platform Tools" provided by Google and extract it to any folder
* [Windows](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)
* [Linux](https://dl.google.com/android/repository/platform-tools-latest-linux.zip)
* [Mac](https://dl.google.com/android/repository/platform-tools-latest-darwin.zip)
2. Open the folder, right click to select
* Windows 10: Open PowerShell windows here (**hold down Shift to show this option**)
* Windows 7: Open command window here (**hold down Shift to show this option**)
* Mac or Linux: Open Terminal
3. Enter `adb`, if success, you can see a long list of content instead of the prompt not finding adb.
::: tip
1. Please do not close this window. The "terminal" mentioned later refers to this window (if you closed the window, please go back to step 2)
2. If you use PowerShell or Linux/Mac, all `adb` should be replaced with `./adb`
:::
#### Setting `adb`
To use `adb` you first need to turn on USB debugging on your device, usually by following these steps:
1. Open system Settings and go to About.
2. Click "Build number" quickly for several times, you can see a message similar to "You are a developer".
3. At this point, you should able to find "Developer Options" in Settings, enable "USB Debugging".
4. Connect the device to the computer and type `adb devices` in the terminal.
5. At this time, the dialog "Allow debugging" will appear on the device, check "Always allow" and confirm.
6. Enter `adb devices` again in the terminal. If there is no problem, you will see something like the following.
```
List of devices attached
XXX device
```
::: tip
The steps for enabling Developer Options on different devices may vary, please search for yourself.
:::
#### Start Shizuku
Copy the command and paste into the terminal. If there is no problem, you will see that Shizuku has started successfully in Shizuku app.
::: details Command for Shizuku v11.2.0+
```
adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh
```
:::
## FAQ
Many manufacturers have made modifications to the Android system that prevent Shizuku from working properly.
### Start via wireless debugging: keeps showing "Searching for pairing service"
Please allow Shizuku to run in the background.
Searching for pairing service requires access to the local network, and many manufacturers disable network access for apps as soon as they become invisible. You can search the web for how to allow apps to run in the background on your device.
### Start via wireless debugging: immediately fail after tapping "Enter pairing code"
#### MIUI (Xiaomi, POCO)
Switch notification style to "Android" from "Notification" - "Notification shade" in system settings.
### Start via wireless debugging/Start by connecting to a computer: the permission of adb is limited
#### MIUI (Xiaomi, POCO)
Enable "USB debugging (Security options)" in "Developer options". **Note that this is a separate option from "USB debugging".**
#### ColorOS (OPPO & OnePlus)
Disable "Permission monitoring" in "Developer options".
#### Flyme (Meizu)
Disable "Flyme payment protection" in "Developer options".
### Start via wireless debugging/Start by connecting to a computer: Shizuku randomly stops
#### All devices
- Make sure Shizuku can run in the background.
- Do not disable "USB debugging" and "Developer options".
- Change the USB usage mode to "Charge only" in the "Developer options".
On Android 8, the option is "Select USB configuration" - "Charge only".
On Android 9+, the option is "Default USB configuration" - "No data transfer".
- (Android 11+) Enable "Disable adb authorization timeout" option
#### EMUI (Huawei)
Enable "Allow ADB debugging options in 'Charge only' mode" in "Developer options".
#### MIUI (Xiaomi, POCO)
Do not use the scan feature in MIUI's "Security" app, since it will disable "Developer options".
#### Sony
Don't click the dialog shows after connecting the USB, because it will change USB usage mode.
### Start via root: cannot start on boot
Please allow Shizuku to run in the background.
================================================
FILE: shizuku/introduction.md
================================================
# Introduction
Shizuku can help normal apps uses system APIs directly with adb/root privileges with a Java process started with app_process.
The name Shizuku comes from [a character](https://danbooru.donmai.us/posts/3553474).
## Why was Shizuku born?
The birth of Shizuku has two main purposes.
1. Provide a convenient way to use system APIs
2. Convenient for the development of some apps that only requires adb permissions
## Shizuku vs. "Old school" method
### "Old school" method
For example, to enable/disable components, some apps that require root privileges execute `pm disable` directly in `su`.
1. Execute `su`
2. Execute `pm disable`
3. (pre-Pie) Start the Java process with app_process ([see here](https://android.googlesource.com/platform/frameworks/base/+/oreo-release/cmds/pm/pm))
4. (Pie+) Execute the native program `cmd` ([see here](https://android.googlesource.com/platform/frameworks/native/+/pie-release/cmds/cmd/))
5. Process the parameters, interact with the system server through the binder, and process the result to output the text result.
Each of the "Execute" means a new process creation, su internally uses sockets to interact with the su daemon, and a lot of time and performance are consumed in such process. (Some poorly designed app will even execute `su` **every time** for each command)
The disadvantages of this type of method are:
1. **Extremely slow**
2. Need to process the text to get the result
3. Features are subject to available commands
4. Even if adb has sufficient permissions, the app requires root privileges to run
### Shizuku method
The Shizuku app will direct the user to run a process (Shizuku service process) using root or adb.
1. When the app process starts, the Shizuku service process sends the binder to the app process.
2. The app interacts with the Shizuku service through the binder, and the Shizuku service process interacts with the system server through the binder.
The advantages of Shizuku are:
1. Minimal extra time and performance consumption
2. It is almost identical to the direct invocation API experience (app developers only need to add a small amount of code)
================================================
FILE: shizuku/zh-hans/README.md
================================================
---
home: true
heroImage: /logo.png
actionText: 了解更多
actionLink: /zh-hans/introduction.html
features:
- title: 优雅地使用系统 API
details: 忘掉 root shell 吧,你可以「直接使用」需要高权限的 API。此外,Shizuku 比 shell 要快得多。
- title: 支持 adb 使用
details: 如果你的「需要 root 的应用」只需要 adb 权限,则可以使用 Shizuku 轻松地扩大用户群体。
- title: 节省时间
details: Shizuku 有详细的文档引导用户,你只需要让用户安装 Shizuku。
footer: Copyright © 2019 RikkaApps
---
### 就像是系统应用一样简单
```java
private static final IPackageManager PACKAGE_MANAGER = IPackageManager.Stub.asInterface(
new ShizukuBinderWrapper(SystemServiceHelper.getSystemService("package")));
public static void grantRuntimePermission(String packageName, String permissionName, int userId) {
try {
PACKAGE_MANAGER.grantRuntimePermission(packageName, permissionName, userId);
} catch (RemoteException tr) {
throw new RuntimeException(tr.getMessage(), tr);
}
}
```
::: tip
还有一些步骤要做,比如检查权限或 Shizuku 是否正在运行。
:::
================================================
FILE: shizuku/zh-hans/download.md
================================================
# 下载
[Google Play](https://play.google.com/store/apps/details?id=moe.shizuku.privileged.api)
[GitHub Release](https://github.com/RikkaApps/Shizuku/releases)
[Coolapk](https://www.coolapk.com/apk/moe.shizuku.privileged.api)
[IzzyOnDroid F-Droid Repository](https://apt.izzysoft.de/fdroid/index/apk/moe.shizuku.privileged.api)
================================================
FILE: shizuku/zh-hans/guide/setup.md
================================================
# 用户手册
[[toc]]
## 启动 Shizuku
Shizuku 支持通过以下三种方式启动。
::: tip 如果您正在使用 GrapheneOS
您可能需要关闭 系统设置 - “安全” - “Secure app spawning”。
[来源](https://github.com/RikkaApps/websites/pull/79#issue-1751837442)
:::
### 通过 root 启动
如果您的设备已经 root,直接启动即可。
### 通过无线调试启动
通过无线调试启动适用于 Android 11 或以上版本。这种启动方式无需连接电脑。由于系统限制,每次重新启动后都需要再次进行启动步骤。
#### 启用无线调试
1. 在网络上搜索如何为您的机型启用“开发者选项”
2. 启用“开发者选项”和“USB 调试”
3. 进入“无线调试”
4. 启用“无线调试”
#### 配对(仅需一次)
1. 在 Shizuku 内开始配对
2. [启用无线调试](#启用无线调试)
3. 点按“无线调试”中的“使用配对码配对设备”
4. 在 Shizuku 的通知中填入配对码
#### 启动 Shizuku
如果无法启动,尝试禁用并启用无线调试。
### 通过连接电脑启动
该启动方式适用于未 root 且运行 Android 10 及以下版本的设备。很不幸,该启动方式需要连接电脑。由于系统限制,每次重新启动后都需要再次进行启动步骤。
#### 什么是 `adb`?
Android 调试桥 (`adb`) 是一个通用命令行工具,其允许您与模拟器实例或连接的 Android 设备进行通信。它可为各种设备操作提供便利,如安装和调试应用,并提供对 Unix shell(可用来在模拟器或连接的设备上运行各种命令)的访问。
更多信息请查看 [Android Developer](https://developer.android.google.cn/studio/command-line/adb)。
#### 安装 `adb`
1. 下载由 Google 提供的“SDK 平台工具”并解压至任意文件夹
* [Windows](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)
* [Linux](https://dl.google.com/android/repository/platform-tools-latest-linux.zip)
* [Mac](https://dl.google.com/android/repository/platform-tools-latest-darwin.zip)
2. 打开文件夹,右键选择
* Windows 10:在此处打开 PowerShell 窗口(**需要按住 Shift 才会显示该选项**)
* Windows 7:在此处打开命令行窗口(**需要按住 Shift 才会显示该选项**)
* Mac 或 Linux:打开 Terminal(终端)
3. 输入 `adb` 如果可以看到一长串内容而不是提示找不到 adb 则表示成功
::: tip 提示
1. 请不要关闭该窗口,后面提到的“终端”都是指此窗口(如果关闭请重新进行第 2 步)。
2. 如果使用 PowerShell 或是 Linux 及 Mac,所有 `adb` 都要替换成 `./adb`。
:::
#### 设置 `adb`
要使用 `adb` 你首先需要在设备上打开 USB 调试功能,通常需要经过以下步骤:
1. 打开系统设置,进入关于
2. 连续数次点击 "Build number" 后看到类似 "You are a developer" 的提示
3. 此时你应该可以在设置中找到“开发者选项”,进入后开启“USB 调试”
4. 连接设备到电脑,在终端中输入 `adb devices`
5. 此时设备上会出现“是否允许调试”的对话框,勾选“总是允许”后确认
6. 再次在终端中输入 `adb devices`,如无问题将会看到类似如下内容
```
List of devices attached
XXX device
```
::: tip
不同设备开启“开发者选项”的步骤可能有所不同,请自己搜索。
:::
#### 启动 Shizuku
复制指令并粘贴到终端中,如无问题你将会在 Shizuku 中看到已启动成功。
::: details 适用于 Shizuku v11.2.0+ 的指令
```
adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh
```
:::
## 常见问题
许多厂商对 Android 系统进行了修改,这会造成 Shizuku 无法正常工作。
### 通过无线调试启动:一直显示“正在搜索配对服务”
请允许 Shizuku 在后台运行。
搜索配对服务需要访问本地网络,许多厂商在应用不可见后立刻禁止应用访问网络。您可以在网络上搜索如何在您的设备上允许应用在后台运行。
### 通过无线调试启动:点击“输入配对码”后立刻提示失败
#### MIUI(小米、POCO)
在系统设置的“通知管理”-“通知显示设置”将通知样式切换为“原生样式”。
### 通过无线调试启动/通过连接电脑启动:adb 权限受限
#### MIUI(小米、POCO)
在“开发者选项”中开启“USB 调试(安全设置)”。**注意,这和“USB 调试”是两个分开的选项。**
#### ColorOS(OPPO & OnePlus)
在“开发者选项”中关闭“权限监控”。
#### Flyme(魅族)
在“开发者选项”中关闭“Flyme 支付保护”。
### 通过无线调试启动/通过连接电脑启动:Shizuku 随机停止
#### 所有设备
- 保证 Shizuku 可以在后台运行。
- 不要关闭“USB 调试”及“开发者选项”。
- 在“开发者选项”中将 USB 使用模式改为“仅充电”。
在 Android 8 上的选项是“选择 USB 配置”-“仅充电”。
在 Android 9 及以上版本上选项是“默认 USB 配置”-“不进行数据传输”。
- (Android 11+)启用“停用 adb 授权超时功能”选项
#### EMUI (华为)
在“开发者选项”中开启「“仅充电”模式下允许 ADB 调试选项」。
#### MIUI(小米、POCO)
不要使用“手机管家”的扫描功能,因为它会禁用开发者选项。
#### Sony
不要点击连接 USB 后弹出的对话框,因为这会导致 USB 使用模式发生变化。
### 通过 root 启动:无法开机启动
请允许 Shizuku 在后台运行。
================================================
FILE: shizuku/zh-hans/introduction.md
================================================
# 简介
Shizuku 可以帮助普通应用借助一个由 app_process 启动的 Java 进程直接以 adb 或 root 特权使用系统 API。
> Shizuku 这个名字来自[这里](https://www.pixiv.net/artworks/75508584)。
## Shizuku 为何而生?
Shizuku 的诞生主要有两大目的:
1. 提供一个方便地使用系统 API 的方式
2. 为部分只需要 adb 权限的应用开发提供便利
## Shizuku 与“传统”做法对比
### “传统”做法
以启用/禁用组件为例,一些需要 root 权限的应用直接在 `su` 中执行 `pm disable`。
1. 执行 `su`
2. 执行 `pm disable`
3. (pre-Pie) 使用 app_process 启动 Java 进程([参见此处](https://android.googlesource.com/platform/frameworks/base/+/oreo-release/cmds/pm/pm))
4. (Pie+) 执行原生程序 `cmd`([参见此处](https://android.googlesource.com/platform/frameworks/native/+/pie-release/cmds/cmd/))
5. 处理参数,通过 binder 与 system server 交互,处理结果输出文字结果
其中每个“执行”都意味着新进程建立,su 内部使用 socket 与 su daemon 交互,大量的时间和性能被消耗在这样的过程中。(部分设计不佳的应用甚至会每次执行指令都执行一次 `su`)
此类做法的缺点在于:
1. **极慢**
2. 需要处理文本来获取结果
3. 功能受制于可用的指令
4. 即使 adb 有足够权限,应用也需要 root 权限才可使用
### Shizuku 做法
Shizuku app 会引导用户使用 root 或是 adb 方式运行一个进程(Shizuku 服务进程)。
1. 应用进程启动时 Shizuku 服务进程发送 binder 至应用进程
2. 应用通过该 binder 与 Shizuku 服务进程交互,Shizuku 服务进程通过 binder 与 system server 交互
Shizuku 的优点在于:
1. 极小额外时间及性能消耗
2. 与直接调用 API 体验几乎一致(应用开发者只需添加少量代码)
================================================
FILE: shizuku/zh-hant/README.md
================================================
---
home: true
heroImage: /logo.png
actionText: 瞭解更多
actionLink: /zh-hant/introduction.html
features:
- title: 優雅地使用系統 API
details: 忘掉 root shell 吧,你可以「直接使用」需要高權限的 API。此外,Shizuku 比 shell 要快得多。
- title: 支援 adb 使用
details: 如果你的「需要 root 的程式」只需要 adb 權限,則可以使用 Shizuku 輕鬆地擴大用戶羣體。
- title: 節省時間
details: Shizuku 有詳細的文檔引導使用者,你只需要讓使用者安裝 Shizuku。
footer: Copyright © 2019 RikkaApps
---
### 就像是系統程序一樣簡單
```java
private static final IPackageManager PACKAGE_MANAGER = IPackageManager.Stub.asInterface(
new ShizukuBinderWrapper(SystemServiceHelper.getSystemService("package")));
public static void grantRuntimePermission(String packageName, String permissionName, int userId) {
try {
PACKAGE_MANAGER.grantRuntimePermission(packageName, permissionName, userId);
} catch (RemoteException tr) {
throw new RuntimeException(tr.getMessage(), tr);
}
}
```
::: tip
還有一些步驟要做,比如檢查權限或 Shizuku 是否正在執行。
:::
================================================
FILE: shizuku/zh-hant/download.md
================================================
# 下載
[Google Play](https://play.google.com/store/apps/details?id=moe.shizuku.privileged.api)
[GitHub Release](https://github.com/RikkaApps/Shizuku/releases)
[Coolapk](https://www.coolapk.com/apk/moe.shizuku.privileged.api)
[IzzyOnDroid F-Droid Repository](https://apt.izzysoft.de/fdroid/index/apk/moe.shizuku.privileged.api)
================================================
FILE: shizuku/zh-hant/guide/setup.md
================================================
# 使用者手冊
[[toc]]
## 啟動 Shizuku
Shizuku 支援透過以下三種方式啟動。
::: tip 如果您正在使用 GrapheneOS
您可能需要關閉 系統設定 - 「安全」 - 「Secure app spawning」。
[來源](https://github.com/RikkaApps/websites/pull/79#issue-1751837442)
:::
### 透過 root 啟動
對於已 root 裝置,直接啟動即可。
### 透過無線偵錯啟動
透過無線除錯啟動適用於 Android 11 或以上版本。這種啟動方式無需連線電腦。由於系統限制,每次重新啟動後都需要再次進行啟動步驟。
#### 啟用無線偵錯
1. 在網路上搜索如何為您的機型啟用「開發人員選項」
2. 啟用「開發人員選項」和「USB 偵錯」
3. 進入「無線偵錯」
4. 啟用「無線偵錯」
#### 配對(僅需一次)
1. 在 Shizuku 內開始配對
2. [啟用無線偵錯](#啟用無線偵錯)
3. 點按「無線偵錯」中的「使用配對碼配對裝置」
4. 在 Shizuku 的通知中填入配對碼
#### 啟動 Shizuku
如果無法啟動,嘗試禁用並啟用無線偵錯。
### 透過連線電腦啟動
該啟動方式適用於未 root 且執行 Android 10 及以下版本的裝置。很不幸,該啟動方式需要連線電腦。由於系統限制,每次重新啟動後都需要再次進行啟動步驟。
#### 什麼是 `adb`?
Android 除錯橋 (`adb`) 是一個通用命令列工具,其允許您與模擬器例項或連線的 Android 裝置進行通訊。它可為各種裝置操作提供便利,如安裝和除錯程式,並提供對 Unix shell(可用來在模擬器或連線的裝置上執行各種命令)的存取。
更多資訊請檢視 [Android Developer](https://developer.android.com/studio/command-line/adb)。
#### 安裝 `adb`
1. 下載由 Google 提供的「SDK Platform Tools」並解壓至任意資料夾
* [Windows](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)
* [Linux](https://dl.google.com/android/repository/platform-tools-latest-linux.zip)
* [Mac](https://dl.google.com/android/repository/platform-tools-latest-darwin.zip)
2. 開啟資料夾,右鍵選擇
* Windows 10:在此處開啟 PowerShell 視窗(**需要按住 Shift 才會顯示該選項**)
* Windows 7:在此處開啟命令視窗(**需要按住 Shift 才會顯示該選項**)
* Mac 或 Linux:打开 Terminal(終端)
3. 輸入 `adb` 如果可以看到一長串內容而不是提示找不到 adb 則表示成功
::: tip 提示
1. 請不要關閉該視窗,後面提到的「終端」都是指此視窗(如果關閉請重新進行第 2 步)。
2. 如果使用 PowerShell 或是 Linux 及 Mac,所有 `adb` 都要替換成 `./adb`。
:::
#### 設定 `adb`
要使用 `adb` 你首先需要在裝置上開啟 USB 偵錯功能,通常需要經過以下步驟:
1. 開啟系統設定,進入關於
2. 連續數次點選 "Build number" 後看到類似 "You are a developer" 的提示
3. 此時你應該可以在設定中找到「開發人員選項」,進入後開啟「USB 偵錯」
4. 連線裝置到電腦,在終端中輸入 `adb devices`
5. 此時裝置上會出現「是否允許偵錯」的對話方塊,勾選「總是允許」後確認
6. 再次在終端中輸入 `adb devices`,如無問題將會看到類似如下內容
```
List of devices attached
XXX device
```
::: tip
不同裝置開啟「開發人員選項」的步驟可能有所不同,請自己搜尋。
:::
#### 啟動 Shizuku
複製指令並貼上到終端中,如無問題你將會在 Shizuku 中看到已啟動成功。
::: details 適用於 Shizuku v11.2.0+ 的指令
```
adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh
```
:::
## 常見問題
許多廠商對 Android 系統進行了修改,這會造成 Shizuku 無法正常工作。
### 透過無線除錯啟動:一直顯示「正在搜尋配對服務」
請允許 Shizuku 在背景執行。
搜尋配對服務需要訪問本地網路,許多廠商在應用程式不可見後立刻禁止應用程式訪問網路。您可以在網路上搜索如何在您的裝置上允許應用程式在背景執行。
### 透過無線除錯啟動:點選「輸入配對碼」後立刻提示失敗
#### MIUI(Xiaomi、POCO)
在系統設定的「通知管理」-「通知顯示設定」將通知樣式切換為「Android」。
### 透過無線除錯啟動/透過連線電腦啟動:adb 權限受限
#### MIUI(Xiaomi、POCO)
在「開發人員選項」中開啟「USB 偵錯(安全設定)」。**注意,這和「USB 偵錯」是兩個分開的選項。**
#### ColorOS(OPPO & OnePlus)
你需要在「開發人員選項」中關閉「權限監控」。
#### Flyme(魅族)
你需要在「開發人員選項」中關閉「Flyme 支付保護」。
### 透過無線除錯啟動/透過連線電腦啟動:Shizuku 隨機停止
#### 所有裝置
- 保證 Shizuku 可以在背景執行。
- 不要關閉「USB 偵錯」及「開發人員選項」。
- 在「開發人員選項」中將 USB 使用模式改為「僅充電」。
在 Android 8 上的選項是「選擇 USB 配置」-「僅充電」。
在 Android 9 及以上版本上選項是「預設 USB 配置」-「不進行資料傳輸」。
- (Android 11+)啟用「停用 ADB 授權逾時」選項。
#### EMUI (Huawei)
你需要在「開發人員選項」中開啟「僅充電模式下允許 ADB 偵錯選項」。
#### MIUI(Xiaomi、POCO)
不要使用 MIUI 的「手機管家」的掃描功能,因為它會禁用「開發人員選項」。
#### Sony
不要點選連線 USB 後彈出的對話方塊,因為這會導致 USB 使用模式發生變化。
### 透過 root 啟動:無法開機啟動
請允許 Shizuku 在背景執行。
================================================
FILE: shizuku/zh-hant/introduction.md
================================================
# 簡介
Shizuku 可以幫助普通程式藉助一個由 app_process 啟動的 Java 程序直接以 adb 或 root 特權使用系統 API。
Shizuku 這個名字來自[這裡](https://www.pixiv.net/artworks/75508584)。
## Shizuku 為何而生?
Shizuku 的誕生主要有兩大目的:
1. 提供一個方便地使用系統 API 的方式
2. 為部分只需要 adb 許可權的程式開發提供便利
## Shizuku 與「傳統」做法對比
### 「傳統」做法
以啟用/停用元件為例,一些需要 root 許可權的程式直接在 `su` 中執行 `pm disable`。
1. 執行 `su`
2. 執行 `pm disable`
3. (pre-Pie) 使用 app_process 啟動 Java 程序([參見此處](https://android.googlesource.com/platform/frameworks/base/+/oreo-release/cmds/pm/pm))
4. (Pie+) 執行原生程式 `cmd`([參見此處](https://android.googlesource.com/platform/frameworks/native/+/pie-release/cmds/cmd/))
5. 處理引數,通過 binder 與 system server 互動,處理結果輸出文字結果
其中每個「執行」都意味著新程序建立,su 內部使用 socket 與 su daemon 互動,這樣的過程中消耗大量的時間和效能。(部分設計不佳的程式甚至會每次執行指令都執行一次 `su`)
此類做法的缺點在於:
1. **極慢**
2. 需要處理文字來獲取結果
3. 功能受制於可用的指令
4. 即使 adb 有足夠許可權,程式也需要 root 許可權才可使用
### Shizuku 做法
Shizuku app 會引導使用者使用 root 或是 adb 方式執行一個程序(Shizuku 服務程序)。
1. 應用程序啟動時 Shizuku 服務程序傳送 binder 至應用程序
2. 應用通過該 binder 與 Shizuku 服務程序互動,Shizuku 服務程序通過 binder 與 system server 互動
Shizuku 的優點在於:
1. 極小額外時間及效能消耗
2. 與直接呼叫 API 體驗幾乎一致(程式開發者只需新增少量程式碼)
================================================
FILE: storage_redirect/.gitignore
================================================
/.vuepress/dist
================================================
FILE: storage_redirect/.vuepress/config.js
================================================
const moment = require('moment')
const langMap = {
"zh-Hans": "zh-cn",
"zh-Hant": "zh-tw"
}
var timestampCache = {}
module.exports = {
base: '/',
title: 'Storage Isolation',
head: [
['link', {
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://raw.rikka.app/css/SourceCodePro-BDC.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/Roboto-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/NotoSansCJK-SC-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/RikkaW/webfonts@4/css/NotoSansCJK-TC-VF.css',
media: 'print',
onload: "this.media='all'"
}],
['link', { rel: 'apple-touch-icon', size: '57x57', href: '/icon/apple-icon-57x57.png' }],
['link', { rel: 'apple-touch-icon', size: '60x60', href: '/icon/apple-icon-60x60.png' }],
['link', { rel: 'apple-touch-icon', size: '72x72', href: '/icon/apple-icon-72x72.png' }],
['link', { rel: 'apple-touch-icon', size: '76x76', href: '/icon/apple-icon-76x76.png' }],
['link', { rel: 'apple-touch-icon', size: '114x114', href: '/icon/apple-icon-114x114.png' }],
['link', { rel: 'apple-touch-icon', size: '120x120', href: '/icon/apple-icon-120x120.png' }],
['link', { rel: 'apple-touch-icon', size: '144x144', href: '/icon/apple-icon-144x144.png' }],
['link', { rel: 'apple-touch-icon', size: '152x152', href: '/icon/apple-icon-152x152.png' }],
['link', { rel: 'apple-touch-icon', size: '180x180', href: '/icon/apple-icon-180x180.png' }],
['link', { rel: 'icon', type: 'image/png', size: '192x192', href: '/icon/android-icon-192x192.png' }],
['link', { rel: 'icon', type: 'image/png', size: '32x32', href: '/icon/favicon-32x32.png' }],
['link', { rel: 'icon', type: 'image/png', size: '96x96', href: '/icon/favicon-96x96.png' }],
['link', { rel: 'icon', type: 'image/png', size: '16x16', href: '/icon/favicon-16x16.png' }]
],
locales: {
'/': {
lang: 'en',
description: 'Elegantly solve the problem of bad apps abusing storage permissions'
},
'/zh-hans/': {
lang: 'zh-Hans',
title: '存储空间隔离',
description: '优雅地解决“坏应用”滥用存储权限的问题'
},
'/zh-hant/': {
lang: 'zh-Hant',
title: '儲存空間隔離',
description: '優雅地解決「壞應用程式」濫用儲存權限的問題'
}
},
themeConfig: {
locales: {
'/': {
selectText: 'Languages',
label: 'English',
serviceWorker: {
updatePopup: {
message: "New content is available.",
buttonText: "Refresh"
}
},
sidebar: getSidebar('/guide/', 'Guide', 'Advanced', 'Enhanced mode', 'Issues caused by OEMs', 'FAQ'),
nav: getNavbar('/', 'Guide', 'Download', 'Changelog', 'Rikka Apps'),
lastUpdated: 'Last Updated'
},
'/zh-hans/': {
selectText: '语言',
label: '简体中文',
editLinkText: '在 GitHub 上编辑此页',
serviceWorker: {
updatePopup: {
message: "发现新内容可用.",
buttonText: "刷新"
}
},
sidebar: getSidebar('/zh-hans/guide/', '指南', '高级', '增强模式', '厂商造成的问题', 'FAQ'),
nav: getNavbar('/zh-hans/', '指南', '下载', 'Changelog', 'Rikka Apps'),
lastUpdated: '最后更新'
},
'/zh-hant/': {
selectText: '語言',
label: '繁體中文',
editLinkText: '在 GitHub 上編輯此頁',
serviceWorker: {
updatePopup: {
message: "發現新內容可用.",
buttonText: "重新整理"
}
},
sidebar: getSidebar('/zh-hant/guide/', '指南', '高級', '增強模式', '廠商造成的問題', 'FAQ'),
nav: getNavbar('/zh-hant/', '指南', '下載', 'Changelog', 'Rikka Apps'),
lastUpdated: '最後更新'
}
},
displayAllHeaders: true,
sidebarDepth: 2,
serviceWorker: {
updatePopup: true
},
docsRepo: 'https://github.com/RikkaApps/websites',
docsDir: 'storage_redirect',
editLinks: true
},
plugins: [
[
'sitemap',
{
hostname: 'https://sr.rikka.app',
exclude: ['/404.html'],
dateFormatter: (time) => {
timestampCache[time]
}
}
],
[
'clean-urls',
{
normalSuffix: '/',
indexSuffix: '/',
notFoundPath: '/404.html'
}
],
[
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
var original = timestamp
moment.locale(langMap[lang])
var localized = moment(original).format('lll')
moment.locale('en')
var iso = moment(original).toISOString()
timestampCache[localized] = iso
return localized
}
}
]
]
}
function getSidebar(prefix, basicTitle, advancedTitle, enhancedModeTitle, compatibilityTitle, faqTitle) {
var res = {}
res[prefix] = [
{
title: basicTitle,
collapsable: true,
sidebarDepth: 0,
children: [
'',
'tutorial',
'contribute',
]
},
{
title: advancedTitle,
collapsable: true,
sidebarDepth: 0,
children: [
'advanced/shared_user_id',
'advanced/technical_details_export_isolated_files',
]
},
{
title: enhancedModeTitle,
collapsable: true,
sidebarDepth: 0,
children: [
`enhanced_mode/`,
`enhanced_mode/install`,
]
},
{
title: compatibilityTitle,
collapsable: true,
sidebarDepth: 0,
children: [
`compatibility/`,
`compatibility/samsung`,
`compatibility/meizu`,
`compatibility/miui`,
]
},
{
title: faqTitle,
collapsable: true,
sidebarDepth: 0,
children: [
`faq/cant_find_app`,
`faq/how_to_report_problems`,
`faq/how_to_document`,
]
}]
return res
}
function getNavbar(prefix, guide, download, changelog, allRikkaApps) {
return [
{ text: guide, link: `${prefix}guide/` },
{ text: download, link: `${prefix}download.html` },
{ text: changelog, link: `${prefix}changelog.html` },
{ text: allRikkaApps, link: `https://rikka.app${prefix}` },
]
}
================================================
FILE: storage_redirect/.vuepress/public/icon/browserconfig.xml
================================================
{{ data.heroText || $title || 'Hello' }}
{{ feature.title }}
{{ $siteTitle }}
${info}
` : ''}\n`,
after: () => '404
{{ getMsg() }}
〔2〕On Android 10+, exposing `file` uri will cause crash, garbage apps should have changed. We no longer need to "help" them.
〔3〕According to the ancient guideline, "Back" navigates to the previous screen but "Up" navigates to the logical up level. For example, enter a deep page of A from B, "Back" backs to B while "Up" goes to the upper page of A. (This also requires B doing right)
〔4〕On Android R Developer Preview, Google breaks this "nobody use thing", so "up" works as "back" until Google fix it.
## 4.3.1 (2020-04-05)
- Add a simpler way to submit rules
- Fix the problem that unable to add "Accessible folder" - "Folders from other apps" rule for apps installed in non-primary users
- Fix some UI bugs
## 4.2.3 (2020-03-24)
- Solve problems when using with "Freezer" apps based on `setApplicationHiddenSettingAsUser`
## 4.2.2 (2020-03-22)
- Fix the problem that, in the app settings, online rule loads before accessible folder causing bad experience under bad network
## 4.2.1 (2020-03-21)
- Change the implementation of "New app notification" and notifications of "Export isolated files" rules. This can workaround 💩 MIUI's system bug**〔1〕** and a minor historical issue**〔2〕**
- The version of Enhancement module is now fetched online
- The app list of "Accessible folders template" now support multi-user correctly
- Add more foolproof design
**〔1〕** In uncertain situations, MIUI will deserialize (`unparcel`) the `Bundle` in the `Intent` passed by `startActivity` in `system_server`. If the `Bundle` contains a non-system `Parcelable`, deserialization fails and the `Bundle` is broken forever, the app will only receive a blank `Bundle`.
**〔2〕** If the data structure changes and the core service has not been updated after installing a new version of the app, the app will crash when showing notification.
## 4.2.0 (2020-03-14)
- Enabling isolation for system apps which starts early will no longer cause problems (but, just in case, you still need to [be prepared](./guide/enhanced_mode/install.html#unable-to-enter-the-system-usually-due-to-isolation-of-system-components))
- Completely fix problems related to restoring backups
- Fix app not responding (white screen) under specific situations
## 4.1.7 (2020-03-10)
- "Export isolated files" rule now participates in the calculation of "Fix app interaction" feature (Affected apps need to be restarted for changes to take effect)
- Fixed an issue that modifying "Accessible folder template" would not take effect immediately
- Fixed multi-user support broken due to system update
- Add foolproof design to the process of isolating critical system apps and app groups
## 4.1.6 (2020-03-06)
- Ability to use built-in logcat to get boot log (no longer clear logs on start & fix UI not responding)
- "Export isolated files" rules for uninstalled apps are not used in conflict checking now
- Fix "File monitor" is not refreshing once the user has entered other pages
- Fix very few records are randomly not showing in "File monitor"
- Fix isolated apps rarely not starting
## 4.1.5 (2020-03-04)
- Completely solve the problem solved in the previous version
## 4.1.4 (2020-03-03)
- Fix the problem that "Block system remount" feature not working**〔1〕**
**〔1〕** This feature should be necessary only on MIUI 11 (maybe China version only?)
## 4.1.3 (2020-03-01)
- Adjust the timing of starting part of the core service again (on MIUI and maybe other weird systems, too early or too late will cause problems, it's too difficult
- Fix an issue about restoring backups
## 4.1.2 (2020-02-29)
- Fix random purchase information lost happened on some users introduced in v4.0.0
- Add "Disable notifications from Export isolated files rules" option, because notifications don’t make sense after using "Fix app interaction" in enhanced mode (this option is only enabled by default for new users)
- Fixed an issue with the "Export isolation file" feature when adding / updating / removing rules for an App group
- Fixed the problem that some apps cannot be restored when restoring a backup
- Fix a few issues related to "Fix app interaction"
## 4.1.0 (2020-2-28)
- To avoid problem, isolation for all non-regular app (uid < 10000) will be disabled on this upgrade (it's reported that isolate uid 1000 may cause problems on heavily modified system such as MIUI, OnePlus Oxygen OS, etc.)
- Fix File monitor is breaking on last version
- Fix possible configuration lose on last version
## 4.0.0 (2020-2-28)
- Change app name to "Storage Isolation" since "redirect" is very easy to make people think that it is "redirect to SD card" in the old days
- Correctly support the `SharedUserId` mechanism of the Android system (almost all parts need to be changed, and most of the time has been spent here since the last update)
- Core services continue to function after an "abnormal restart"
- Fixed an issue where storage permission was displayed as allowed but denied in fact on Android 10
- AOSP apps is no longer considered as verified in online rule
- If someone rename "Android" folder to "android", "Export isolated files" continue to function (Why there is people do this)
- Enhanced mode v22: Start some of the core services earlier, this resolves the issue where enabling isolation for apps start very early may cause the system to fail to boot (yeah, another 💩 MIUI only problem)
- The version of Enhanced mode and Riru will never show "unknown"
- If you reinstall the app that has enabled isolation, the original settings will be restored correctly (the isolation still needs to be manually turned on)
## 3.2.2 (2019-12-22)
- Fix a problem related to restoring the backup
## 3.2.0 (2019-12-18)
- Fix a problem related to isolation for the app which starts very early (yeah, another problem caused by "changes for 💩 MIUI")
- UI improve for almost every part
## 3.1.5 (2019-12-06)
- Revert some changes in 3.1.4 since it seems to cause problems on some other devices :(
## 3.1.4 (2019-12-05)
- Fix a problem of startup progress
## 3.1.3 (2019-11-24)
- Try to avoid the problem of "Block system remount" may cause "reboot" on some devices (Note, new changes requires reboot to take effect)
- Export isolated files (Synced folder) function now delete file with same name in target folder first, this is to avoid the problem of multiply rename/move may cause "wrong" file be exported
- Add preset strings of local rules for the situations of online rules is disabled or network is unavailable
## 3.1.0 (2019-11-23)
- Enhanced mode: "Fix app interaction" can handle requests of "Download Manager"
- Fix the problem that storage permission may not granted correctly on Android 10
- Other minor bug fix and UI improve
## 3.0.0 (2019-11-21)
- Redesign multiple UI parts to reduce the difficulty of understanding
- Refactor multiple UI related parts to make it more stable and smooth
- Enhanced mode v21: Add "Block system remount" feature to avoid system triggered remount makes the isolation invalid (available on Android 9+)**〔1〕**
- Enhanced mode: Bring back the feature of modifying file path in "Fix app interaction", but only `ACTION_VIEW` is handled**〔2〕** and it no longer use Storage Redirect app as proxy**〔3〕**
- Redesigned online rule, making it more flexible
**〔1〕** This feature should be necessary only on MIUI 11
**〔2〕** Trigger deserialization of `extras` is dangerous
**〔3〕** Even if we don’t do anything, the original behavior has already caused crash on Android 10, we don’t have to "fix problem" for "bad apps"
## 2.1.5 (2019-10-30)
- Fix some UI bugs
## 2.1.4 (2019-10-29)
- Improve the implementation of core
- Fix some UI bugs
## 2.1.3 (2019-10-23)
- Bypassing the problem that using auto dark theme causing crash on OnePlus Android 10 (this problem is caused by OnePlus)
## 2.1.1 (2019-10-23)
- Fix the problem that enabled app can't start if core process starts later than it
## 2.1.0 (2019-10-22)
- Simplify the process of allowing access for files belonging to other apps, now all files created by other apps can be chosen from "Folders belonging to other apps"
- Check and grant permissions every time when app starts, the could solve the problem caused by MIUI 11 random tampering permissions
- Bypassing the problem of core processes being killed when using built-in su on Meizu devices
- Temporarily remove "modify file path" feature in "Fix app interaction" because this feature can cause problems in app that use plug-in or hot fix technology (common in apps from mainland China), and currently mainstream apps should have switched to Content Provider to sharing files, removing this feature should have little effect
- Other bug fixes and lots of UI improvements
## 2.0.1 (2019-09-27)
- Fix "Shared folder" rules not work
## 2.0.0 (2019-09-27)
- Check the "Shared folder" and "Sync folder" rules (the problematic rules will be deleted or disabled), and the next version will provide more detailed tips and tutorials for this issue
- Fixed several issues with the "Sync folder" rule
- Fixed separate "Fix app interaction" switch broken
- Enhanced mode v20.1: Fixed an issue with the "Fix app interaction" feature on OnePlus Android 10 (and possibly others)
- Lots of UI improvements
## 1.9.1 (2019-09-09)
- Fix the problem that "Fix app interaction" may not work
- Add an option to use status bar & navigation bar
- Fix several UI bugs
## 1.9.0 (2019-09-08)
- Enhanced mode v20.0: Fix the problem that redirection not work for apps installed in external storage card when using [Adoptable Storage](https://source.android.com/devices/storage/adoptable)
- Enhanced mode v20.0: Change the implementation of "Fix app interaction", no longer be break by "Xposed Taichi", it may also solve some other problems
- Enhanced mode v20.0: "Fix app interaction" can be switched individually for each app
- Fix the problem that some configs can't be restored by backup feature
- Allow `OP_REQUEST_INSTALL_PACKAGES` automatically on Android Q (since the change of it will trigger remount by the system)
## 1.8.3 (2019-08-30)
- Fix some UI bugs
- Fix a critical problem under "Basic mode"
## 1.8.2 (2019-08-27)
- Handle special system apps (appId < 10000 or appId > 19999, appId = uid % 100000)
- Don't fix permission for special system apps
- Other bug fixes and UI improvements
## 1.8.1 (2019-08-26)
- Improve the process of selecting "Accessible folders"
- Directly choose apps of "Accessible folders template"
- Fix the problem that running apps with storage isolation enabled will be invalid when service start on Android Q
- Fix high CPU usage if stay in the app for long
- Fix other apps using API (not published yet) will crash
- Other bug fixes and UI improvements
## 1.8.0 (2019-08-17)
- When choosing "Accessible folders", multiply templates and custom can be chosen at the same time
- Add "Folders analysis", learn the size of folders in isolated storage
- Automatically create folders in "Accessible folders" if not exists
- Some UI improvements and bug fix
## 1.7.5 (2019-08-06)
- Fix "Synced folder" feature is broken
## 1.7.4 (2019-08-05)
- Use `FLAG_PERMISSION_SYSTEM_FIXED` to fix permission on Android Q
- Provide a solution for Huawei devices, [see here](./guide/compatibility/huawei.html)
- Fix "Synced folder" feature not trying to handle "move files from target folder" event
- Improve English translation
- Other minor changes
## 1.7.2
- Fix "Code 5"
- Other bug fix
## 1.7.0
* Basic mode now works on Android Q beta 4
* Correctly handle hide/unhide (commonly used by "Freeze" apps)
* Change target SDK version to 29 (Android Q)
## 1.6.12
* Fix app list not refreshed after restoring backup
* Use a more reliable method to monitor app install/uninstall
* Notify user if no browser app available when opening help documents
* Fix a bug related "Fix app interaction issues"
* Other bug fix
* UI improve
## 1.6.9
* Fix Enhanced mode not work for apps starts early than core service
## 1.6.8
* Fix apps not starting on new users
* Support Android Q beta 3 (including Enhanced mode)
* Remove the ability to choose "Android/sandbox" as isolated storage path since from Q beta 3 the system sandbox is only used for apps which declared support the sandbox
## 1.6.7
* Clear config (app info - storage - clear/manage data) feature dose clear all configs now
* Filter duplicates or incorrect mounts in the final stage to avoid problems from user misuse
* Fix "Fix app interaction issues" may incorrectly handle files in `Android/data(media, obb)/package`
## 1.6.6
* Fix app interaction issues (Enhanced mode): Grant content uri permission
* UI improve
## 1.6.4
* Fix app interaction issues (Enhanced mode): Always convert file uri to content uri on Android Q
* Enhanced mode: remove disable file uri expose check since it is meaningless
* Allow choosing "Android/sandbox" as isolated storage path on Android Q
* Other bug fix
## 1.6.3
* Enhanced mode works on Android Q
* Enhanced mode: force disable file uri expose check for Android Q system ui
* Improve App settings UI
* Try fix config lost (should be extremely rare), add "Debug info" for users to investigate this problem
* Fix storage permission can't be revoked if redirect is already disabled
## 1.6.2
* Add "View gallery as this app", you can learn which photos the app can access
* Bug fix & UI improve
## 1.6.0
* Works on Android Q DP2 (enhanced mode not supported yet)
* Change behavior, mount Android/media/xxx & Android/obb/xxx by default
* Huge UI improve
* Fix "Fix app interaction issues" never worked on some devices
## 1.5.7
* Continue fixing bugs caused by "Fix app interaction issues"
* Continue renaming options
## 1.5.6
* Fix new storage permission method breaks on MIUI
* Fix "Fix app interaction issues" feature causes app breaks on some situations (if extra contains Parcelables from non-BootClassloader)
## 1.5.5
* (Android 6.0-7.1) Fix "Fix app interaction issues" feature cause app crash or all media not shown
* Continue renaming options, app name would even change in the future
* Reduce extra app launching time
On my OnePlus 3T, average extra time reduced from 0.3s to 0.16s
* Enforce storage permission with API (do not need check everytime), save average 0.04s
* (only on 7.0+) Limit "File monitor" hook target, save average 0.1s
## 1.5.3
* Enhancement module v19, please upgrade as soon as possible
* "Fix app interaction issues": try bypassing the problem that apps use "Tencent app protect" (腾讯乐固) will crash (v19)
* "Fix app interaction issues": fix some media are filtered incorrectly (app 1.5.1, v19)
* "Fix app interaction issues": fix app may crash when "Access files from other redirected app" rules enabled (v18.1)
## 1.5.0
* New Enhancement module v18
Rewrite "Fix file uri" feature, upgrade to "Fix app interaction issues" feature
* UI change
* Rename some options, reduce the understanding difficulty
## 1.4.9
* Fix "Synced folders" feature is broken in 1.4.8
## 1.4.8
* Fix regex check of "Synced folders" rules is not proceed when enabling the rule
* Revoke app storage permission automatically when disabling redirect
* Other bug fix
## 1.4.7
* Fix Enhancement module installation error reporting
* Fix Google purchase issue reporting
* Bad connection with Google Play will not freeze the whole app forever (but 5s)
* Fix "Fix file uri" feature in Enhancement module may sometimes crash redirected app
* Correctly report some type of error on start
* Other bug fix
## 1.4.6
* Improve Enhancement module installation detection and provide solution
* Improve "Invalid license" page
* Bug fix
## 1.4.4
* Bug fix
## 1.4.2
* Report Enhancement module not correctly installed
* Improve home
## 1.4.1
* Fix license check
## 1.4.0
* New home page
* Rename/re-layout options, reduce the understanding difficulty
* "Non-redirect folders" -> "Read/writable folders in real storage"
* "Link" -> "Synced folders"
* New Enhancement module v17, not more "I can't open redirected apps"
* Fix tons of bugs
## 1.3.3
* Fix bug of Enhance module v16
## 1.3.2
* Enhance module v16, fix a problem related to passing file uri
(Example: can't open a received file in WeChat)
* New native starter (for some strange devices without executables like `chmod`, `rm`)
* Fix bugs related to link feature
* Other minor bug fix
## 1.2.2
* Fix mask template for link rule editor
* Add "Link function only" filter in "Logcat"
* Minor bug fix
## 1.2.1
* Add "Kill Media Storage on start" option
(on some devices, Media Storage can use all CPU on boot, kill it can solve the problem
(it can be started by other apps later))
* Add mask template for link rule editor
* Try to detect no log
* Minor bug fix
## 1.2.0
* Add "Shared folder" to solve the problem that files created by
a redirected app can't be used by another redirected app
* Refreshed detail UI
* Enhanced "Redirect storage viewer"
* Enhanced filter for "File monitor"
* Enhance module v15, fix the problem that redirect apps can't move files between specific folders
(Example: bilibili can't save gif)
* Minor bug fix
## 1.1.4
* Enhanced "Non-redirect folders" template mechanism
* Show conflicting rule info
## 1.1.2
* Simplified detail UI
* Try to support other su, confirmed support MagiskSU, SuperSU, LineageOS addonsu now
* Fix the problem that server may send wrong progress to client
when change "Default redirect target"
* Delete redirected app config after that app uninstall
* Improve app list performance
* Improve chooser dialogs
* Improve File monitor
* Add non standard behavior check (use file monitor data)
## 1.0.2
* Fix UI not refreshed when add link rules online
* Fix the problem that "You have already own this item" happens on some Google Play users
## 1.0.0
* Add "Non-redirect folders" template, you can create different templates
for different situations and apply them quickly
* Enhance module v14, changes behavior, may avoid some special problems on
some devices
* Bug fix
## 1.0.0-rc9
* New logcat UI
* Fix unpaid state check
* Migrate to AndroidX library
## 1.0.0-rc8
* Improve user experience
* Minor bug fix
## 1.0.0-rc7
* Fix "Launch" button not work
## 1.0.0-rc6
* Improve user experience
* Bug fix
## 1.0.0-rc5
* Add White / Light blue theme
* Try to hide overlay packages
* Fix can't open installer in file browser
* Fix some link rules can't be added
* Bug fix
## 1.0.0-rc4
* Add manually set /data/media path for some special devices
* Bug fix
## 1.0.0-rc3
* Fix Android/data can be chosen as a "Non-redirect folder"
* Bug fix
## 1.0.0-rc1
* New theme
* New detail UI
* Add local link rule
* Multi-user support
* Fix backup bug, but backup files created before 1.0.0-rc1 is unavailable
* Try to detect real internal storage path
## 0.18.2-beta
* Fix bug
## 0.18.0-beta
* "Non-redirect folder" (old "Standard folder") is now customizable like "Redirect target folder"
* Add Backup & restore
* Works with LineageOS's addonsu, but some non-core feature may break, still recommended to use Magisk
* Fix crash when change filter in the main list
* Fix redirected files may not be moved when change redirect target folder in some cases
## 0.17.4-beta
* Fix link feature not on some (old? special?) devices
* Try to fix owner of linked files' is 0 on older Android system (chown ourselves)
## 0.17.3-beta
* Fix a critical bug that if an app's redirect target is set different
from the default, it will not able to access files in public folders
* Fix others bugs in 0.17.x
## 0.17.1-beta
* Add set redirect target folder (globally and pre-app)
* Add app installed notification
* Also kill by uid when force stop package (for OnePlus stock ROM)
* Improved "Share helper"
* Bug fix
## 0.16.4-beta
* Add file stat for Redirect storage viewer
* Fix the problem that anyone is displayed as purchased
* Auto clean old server files
* Try to "fix" IAP problem "You have already own this item"
* Link files from target to source when enabling link rules
## 0.16.2-beta
* Enhanced File monitor: load more & filter by path / app
* Force grant storage permission for redirected apps
* Try to fix bug of link function (when create and delete files in a very short time)
* Create ".nomedia" file in Android/data/xxx automatically
* Add shortcut for File monitor (Android 7.1+)
* Fix crash when open help if no browser app installed
* Add more tips
* Fix bugs in 0.16.1 / 0.16.2
## 0.15.8-beta
* Files downloaded by redirected apps can be managed in Android's Files (DocumentUI) app
* Fix log parse (only some special ROM)
* Add "Show disabled apps" filter
* New app list style
* In-app logcat now catches logs from more sources
## 0.15.4-beta
* Fix reboot when new file created in folders monitored by link function (only on 8.0)
* Fix a bug of file monitoring function of the link function
## 0.15.2-beta
* Try to fix crash on boot (only some users)
* Fix log parse (only some special ROM)
* Auto shrink file monitor database file
## 0.15.1-beta
* Enhance module v12.1
Fix problem that all apps unable to access the storage (only appears on some devices), but it brings some minor problems (only happens on limited situation), check Help for detail.
* Other minor changes
## 0.15.0-beta
* New Enhance module (check Settings and Help)
* File monitor: monitor file access in public storage (requires "Enhance module")
* Try to fix bugs in 0.14.3
## 0.14.3-beta
* Try to fix bugs in 0.14.1 / 0.14.2
* Magisk module v10 (check Help & support)
## 0.14.1-beta
* Provide new Magisk module to solve the problem that redirected apps still create files sometimes, check Help & support for detail
* New native daemon
* Adapt Magisk v16.4
* Improve UI
* App list will be loaded correctly now even if instant app is installed (Android 8.0's bug)
## 0.12.13-beta
* Link rule: fix the problem that some files are skipped
## 0.12.12-beta
* Fix the problem that some processes are ignored on **some special ROMs**
* Link rule: ignore file which extension ends with _tmp_ or _temp_ by default
## 0.12.11-beta
* Some bug fix
## 0.12.7-beta
* Fix the problem that some process is not redirected (from 0.12.6)
* Link rule: handle file downloaded notification by our app
## 0.12.6-beta
* Should work on Android P DP1
* Link rules ignore .tmp / .temp by default
* Some minor changes
## 0.12.5-beta
* Update Magisk module (download from Help & support)
* Some minor changes
## 0.12.4-beta
* New link rules UI
* Mark outdated (not exists in online configuration) link rules
* Try to avoid some magic
* Add "Share helper"
## 0.12.3-beta
* Add more log for starter
* More core files to /data/adb
* Try to avoid strange behavior on some devices when using Magisk module
## 0.12.1-beta
* **The core feature should works perfectly on all devices**
* Provide Magisk module for starting before all apps (see Help & support)
## 0.12.0-beta
* Fix major issue on some devices
* Add tip when log may be disabled
* Linked files will only be deleted when redirected app is running in the foreground
## 0.11.2-beta
> Version 0.11.2 changed some implementation details, to avoid some magic problems on users who have problems using version 0.11.0
* Should work on more devices now, to the user who still have problem, the problem should not break all things
* Storage permission (both runtime permission and appops) will be automatically grant to redirected apps (to avoid magic problem)
## 0.11.0-beta
> In 0.11.0 and later version, we use a completely different method of implementation. The problem that hard-coded `/sdcard` cannot be redirected is solved.
> If you have problem using the new version, please contact us for help.
* A completely different implementation, guarantee that all files will be redirected (**Read help in "Help & support" for more detail**)
* Server can be restarted without rebooting (**Reboot is required if upgrade from 0.9.x**)
* Add redirected file browser
* Add logcat
* Add detailed help
* Add "verified app" mark which means the app will never write files in non-standard dictionaries
* Remove "Block writing file" feature since it is unnecessary now
* Fix bug about link
================================================
FILE: storage_redirect/download.md
================================================
# Download
**Requirement:** rooted Android 6.0+ device
[Google Play](https://play.google.com/store/apps/details?id=moe.shizuku.redirectstorage) (automatically select architecture)
[Coolapk](https://www.coolapk.com/apk/moe.shizuku.redirectstorage) (arm64 version)
[GitHub](https://github.com/RikkaApps/StorageRedirect-assets/releases) (all architectures, **Samsung users please download arm version from here**)
::: warning
**Samsung users**
Due to some unknown reasons of the Samsung device kernel, **Samsung devices can only use arm version**.
:::
================================================
FILE: storage_redirect/guide/README.md
================================================
# Introduction
As of the time of this writing (2023-03-06), the abuse of public storage by applications in Android is still an unresolved issue.
Storage Isolation is dedicated to solving this problem with as little or no impact on application functionality as possible.
To illustrate this clearly, we have to introduce some technical concepts first.
### Android's design for storage space
Android provides two categories with a total of three locations to store their files, which are:
#### data area
Corresponding folders:
- `/data/user/
:::
#### Scoped storage added by Android 11
Many people think that Scoped storage can this problem, but this is not the case.
The behavior of applications subject to Scoped storage when using the public storage changes as follows.
- Only files of the corresponding type can be written in the public folder (but the system will only check if the file name matches the rules)
- Write files in public folders without any permissions (this is more lenient than before!)
In addition, Scoped storage only affects apps that target Android 11 or above (i.e. Target API ≥ 31). Apps that are not on Google Play or older apps that have stopped being updated are not restricted.
### Solving the problem
To solve this problem above, we have created this application - Storage Isolation.
The user can enable isolation for a specific app. The "internal storage" used by the app will actually become a folder in `/storage/emulated/
〔2〕在 Android 10+,暴露 `file` uri 会导致崩溃,垃圾应用应该已经做出改变。我们不再需要去“帮助”它们。
〔3〕根据上古规范,“返回”应导航至前一屏幕但“向上”应导航至逻辑上的上一级。例如,从 B 进入 A 的一个深层页面,“返回”返回到 B 但是“向上”去往 A 的上一层。(这也需要 B 做对)
〔4〕在 Android R 开发者预览版本中,Google 弄坏了这个“没人用的东西”,因此“向上”仍然像“返回”一样运作。
## 4.3.1 (2020-04-05)
- 添加一个简单一些的提交规则方式
- 修了不能为非主用户的应用添加“可访问文件夹”-“其他应用的文件夹”规则的问题
- 修了一些 UI bug
## 4.2.3 (2020-03-24)
- 解决与以 `setApplicationHiddenSettingAsUser` 为原理的冻结类应用一起使用时出现的问题
## 4.2.2 (2020-03-22)
- 修复应用设置中在线规则早于可访问文件夹加载导致网络较差时体验糟糕的问题
## 4.2.1 (2020-03-21)
- 改变“新应用通知”及“导出被隔离的文件”规则的通知的实现,这可以绕过 💩 MIUI 的系统 bug **〔1〕**以及另一个祖传小问题 **〔2〕**
- 增强模块版本现在在线获取
- “可访问文件夹模板”的应用列表现在正确支持多用户
- 更多防呆设计
**〔1〕** 在不明确的情况下,MIUI 会在 system_server 中对 startActivity 传入的 Intent 中的 Bundle 进行反序列化。如果 Bundle 中包含非系统的 Parcelable,则反序列化会失败且无法复原,应用只会收到空白的 Bundle。
**〔2〕** 如果数据结构发生变化,且安装新版本应用后尚未更新核心服务,则出现通知时应用会崩溃。
## 4.2.0 (2020-03-14)
- 为启动较早的系统应用启用隔离不再会有问题(但是,以防万一,你仍需要[做好准备](./guide/enhanced_mode/install.html#无法进入系统(通常是由于隔离了系统组件)))
- 完全修好恢复备份
- 修复特定的情况下应用失去响应(白屏)
## 4.1.7 (2020-03-10)
- “导出被隔离的文件”规则现在参与“修复应用间交互”功能的计算(需要重新启动受影响的应用才可以让改动生效)
- 修复修改可访问文件夹模板不会立刻生效的问题
- 修复由于系统更新导致的多用户支持坏掉
- 为隔离重要系统应用及程序组的流程加入防呆设计
## 4.1.6 (2020-03-06)
- 可以使用内置 logcat 来取得开机 log(不再于启动时清除 log & 修复 UI 不响应)
- 已卸载应用的“导出被隔离的文件”规则不再参与冲突检查
- 修复一旦用户进入其他页面,“文件监视”就不再刷新的问题
- 修复极少数的“文件监视”记录不显示的问题
- 修复罕见的被隔离的应用不启动问题
## 4.1.5 (2020-03-04)
- 完全解决上个版本所解决的问题
## 4.1.4 (2020-03-03)
- 修复“禁止系统重新挂载”功能失效**〔1〕**
**〔1〕** 此功能应该只有 MIUI 11(或许只有中国大陆版本?)需要
## 4.1.3 (2020-03-01)
- 再次调整启动核心服务的一部分的时机(在 MIUI 或许还有其他的奇奇怪怪的系统上,启动太早或太晚都会有问题,太难了(
- 修复一个有关恢复备份的问题
## 4.1.2 (2020-02-29)
- 修复由 4.0.0 引入的部分人会出现购买信息丢失的问题
- 添加“禁用导出被隔离的文件的通知”选项,因为在使用增强模式的“修复应用间交互”后通知没有意义(该选项仅对新用户默认启用)
- 修复来自程序组的“导出被隔离的文件”规则在添加/更新/删除时可能出现问题
- 修复恢复备份时部分应用无法被恢复的问题
- 修复数个有关“修复应用间交互”的问题
## 4.1.0 (2020-02-28)
- 为避免问题,所有非普通应用(uid < 10000)将在本次升级时停用隔离(根据回报,隔离 uid 1000 的应用可能会在 MIUI, OnePlus Oxygen OS 等重度修改系统上产生问题)
- 修复上个版本文件监视不工作
- 修复上个版本可能的配置丢失
## 4.0.0 (2020-02-28)
- 修改应用名称为“存储空间隔离”,因为“重定向”十分容易让人误以为是旧时代的“重定向到 SD 卡”
- 正确支持 Android 系统的 `sharedUserId` 机制(几乎所有部分都需要改动,上次更新到现在大部分时间都花费于此)
- 核心服务在「非正常重新启动」后仍可正常运作
- 修复在 Android 10 上关闭隔离后存储权限显示为允许但实际为不允许且无法改为允许的问题
- 不再将 AOSP 应用视为已认证
- 现在如果有人没事把 "Android" 文件夹重命名为 "android" 甚至改来改去,“导出被隔离的文件”功能也能正常运行(到底是什么人才会这么无聊)
- 增强模式 v22:更早启动核心服务中的一部分,这可以解决为非常早启动的应用启用隔离可能会导致无法开机的问题(对,这又是仅限 💩 MIUI 的问题)
- 增强模式及 Riru 版本号永远不再显示为未知
- 若重新安装曾经启用隔离的应用,原先的设置会被正确地恢复(是否启用隔离的开关仍需要手动打开)
## 3.2.2 (2019-12-22)
- 修复一个有关恢复备份的问题
## 3.2.0 (2019-12-18)
- 修复使用了增强模式时为非常早启动的应用启用隔离可能产生问题(对,这又是「为了绕过 💩 MIUI 的问题做出的改动」产生的问题)
- 几乎改了每一处的 UI 改进
## 3.1.5 (2019-12-06)
- 退回 3.1.4 中的一些改动,因为在另外一部分人上又有问题(
## 3.1.4 (2019-12-05)
- 修复一个启动过程的问题
## 3.1.3 (2019-11-24)
- 尝试规避“禁止系统重新挂载”功能可能造成“重启”的问题(注意,新的改变需要重新启动后才会生效)
- 导出被隔离的文件(同步文件夹)功能会先删除目标文件夹中同名的文件,这是为了尝试避免一些应用进行数个重命名/移动等操作后“错误的”文件被导出的问题
- 增加本地规则预置字串以供关闭在线规则或网络不可用时使用
## 3.1.0 (2019-11-23)
- 增强模式:“修复应用间交互”现在可以处理对“下载管理器”的请求
- 修复在 Android 10 上存储权限可能没有正确授予的问题
- 其他小 BUG 修复与 UI 改进
## 3.0.0 (2019-11-21)
- 重新设计多处 UI,降低理解难度
- 重构多处 UI 相关部分,增加稳定性与流畅性
- 增强模式 v21:增加“禁止系统重新挂载”功能以避免系统触发的重新挂载导致隔离失效(在 Android 9 以上可用)**〔1〕**
- 增强模式:加回“修复应用间交互”中的修改传递的文件路径功能,但暂时只处理 `ACTION_VIEW`**〔2〕**,且不再经由存储重定向中转**〔3〕**
- 重新设计在线规则,更加灵活
**〔1〕** 此功能应该只有 MIUI 11 需要
**〔2〕** 触发反序列化 `extras` 很危险
**〔3〕** 即使我们什么也不做,原始行为在 Android 10 上已经会造成崩溃,我们没有必要越庖代俎为劣质应用「修复问题」
## 2.1.5 (2019-10-30)
- 修复一些 UI BUG
## 2.1.4 (2019-10-29)
- 改进一些核心部分的实现
- 修复一些 UI BUG
## 2.1.3 (2019-10-23)
- 绕过在 OnePlus 的 Android 10 上使用自动暗色主题会崩溃的问题(这个问题由 OnePlus 的引起)
## 2.1.1 (2019-10-23)
- 修復如果核心进程启动晚于启用的应用则该应用可能无法启动的问题
## 2.1.0 (2019-10-22)
- 简化允许访问来自其他应用的文件流程,现在只要是由其他应用创建的文件都可以在“属于其他应用的文件夹”中选择
- 在每次应用启动时检查并授予权限,这可能解决由 MIUI 11 随机篡改权限造成的问题
- 绕过在 Meizu 设备上使用内置 su 时核心工作进程会被杀死的问题
- 临时移除“修复应用间交互”中的修改传递的文件路径功能,因为这个功能在使用插件化或热修复技术(常见于来自中国大陆地区的应用)的应用中会产生问题,且目前主流应用应该都已使用 Content Provider 与其他应用共享文件,移除此功能应该影响不大
- 其他 BUG 修复与大量 UI 改进
## 2.0.1 (2019-09-27)
- 修复“共享文件夹”规则实际没有生效
## 2.0.0 (2019-09-27)
- 对“共享文件夹”及“同步文件夹”规则进行问题检查(有问题的规则会被删除有问题的部分或禁用),在下个版本会针对这个这个问题提供更加详细的提示及教程
- 修复数个有关“同步文件夹”规则的问题
- 修复独立“修复应用间交互”开关坏掉
- 增强模式 v20.1:修复“修复应用间交互”功能在 OnePlus Android 10(可能还有其他)上的问题
- 大量 UI 改进
## 1.9.1 (2019-09-09)
- 修复“修复应用间交互”可能没有工作的问题
- 增加半透明状态栏及导航栏选项
- 修复数个 UI bug
## 1.9.0 (2019-09-08)
- 增强模式 v20.0:修复使用 [Adoptable Storage](https://source.android.com/devices/storage/adoptable) 时安装在外置存储卡的应用无效的问题
- 增强模式 v20.0:更改“修复应用间交互”功能的实现方法,不再会被“Xposed Taichi”破坏,同时也可能会解决一些其他的问题
- 增强模式 v20.0:“修复应用间交互”可单独为每个应用开关
- 修复备份功能不能还原部分配置的问题
- 在 Android Q 上自动允许 `OP_REQUEST_INSTALL_PACKAGES`(因为其发生变化时会触发系统重新挂载)
## 1.8.3 (2019-08-30)
- 修复一些 UI bug
- 修复“基础模式”下的一个重大问题
## 1.8.2 (2019-08-27)
- 处理特殊系统应用(appId < 10000 或 appId > 19999, appId = uid % 100000)
- 不为特殊系统应用锁定权限
- 其他 bug 修复和 UI 改进
## 1.8.1 (2019-08-26)
- 改进选择“可访问文件夹”流程
- 可直接为“可访问文件夹模板”选择使用的应用
- 修复在 Android Q 上启动服务时对已启动的应用的重定向会失效问题
- 修复长时间停留在主界面 CPU 占用会越来越高问题
- 修复使用 API(暂未公开)的应用崩溃的问题
- 其他 bug 修复和 UI 改进
## 1.8.0 (2019-08-17)
- 选择“可访问文件夹”时可同时选择多个模板及自定义
- 增加“文件夹分析”功能,获知隔离存储空间中文件夹大小
- 可访问文件夹中选择的文件夹不存在时会自动建立
- 一些些 UI 改进和 bug 修复
## 1.7.5 (2019-08-06)
- 修复“同步文件夹”功能坏掉
## 1.7.4 (2019-08-05)
- 在 Android Q 上使用 `FLAG_PERMISSION_SYSTEM_FIXED` 来固定权限
- 为华为设备提供解决方法,[详见此处](./guide/compatibility/huawei.html)
- 修复“同步文件夹”功能没有尝试处理“从目标文件夹移走文件”事件
- 改进英语翻译
- 其他小改动
## 1.7.2
- Fix "Code 5"
- Other bug fix
## 1.7.0
* Basic mode now works on Android Q beta 4
* Correctly handle hide/unhide (commonly used by "Freeze" apps)
* Change target SDK version to 29 (Android Q)
## 1.6.12
* Fix app list not refreshed after restoring backup
* Use a more reliable method to monitor app install/uninstall
* Notify user if no browser app available when opening help documents
* Fix a bug related "Fix app interaction issues"
* Other bug fix
* UI improve
## 1.6.9
* Fix Enhanced mode not work for apps starts early than core service
## 1.6.8
* Fix apps not starting on new users
* Support Android Q beta 3 (including Enhanced mode)
* Remove the ability to choose "Android/sandbox" as isolated storage path since from Q beta 3 the system sandbox is only used for apps which declared support the sandbox
## 1.6.7
* Clear config (app info - storage - clear/manage data) feature dose clear all configs now
* Filter duplicates or incorrect mounts in the final stage to avoid problems from user misuse
* Fix "Fix app interaction issues" may incorrectly handle files in `Android/data(media, obb)/package`
## 1.6.6
* Fix app interaction issues (Enhanced mode): Grant content uri permission
* UI improve
## 1.6.4
* Fix app interaction issues (Enhanced mode): Always convert file uri to content uri on Android Q
* Enhanced mode: remove disable file uri expose check since it is meaningless
* Allow choosing "Android/sandbox" as isolated storage path on Android Q
* Other bug fix
## 1.6.3
* Enhanced mode works on Android Q
* Enhanced mode: force disable file uri expose check for Android Q system ui
* Improve App settings UI
* Try fix config lost (should be extremely rare), add "Debug info" for users to investigate this problem
* Fix storage permission can't be revoked if redirect is already disabled
## 1.6.2
* Add "View gallery as this app", you can learn which photos the app can access
* Bug fix & UI improve
## 1.6.0
* Works on Android Q DP2 (enhanced mode not supported yet)
* Change behavior, mount Android/media/xxx & Android/obb/xxx by default
* Huge UI improve
* Fix "Fix app interaction issues" never worked on some devices
## 1.5.7
* Continue fixing bugs caused by "Fix app interaction issues"
* Continue renaming options
## 1.5.6
* Fix new storage permission method breaks on MIUI
* Fix "Fix app interaction issues" feature causes app breaks on some situations (if extra contains Parcelables from non-BootClassloader)
## 1.5.5
* (Android 6.0-7.1) Fix "Fix app interaction issues" feature cause app crash or all media not shown
* Continue renaming options, app name would even change in the future
* Reduce extra app launching time
On my OnePlus 3T, average extra time reduced from 0.3s to 0.16s
* Enforce storage permission with API (do not need check everytime), save average 0.04s
* (only on 7.0+) Limit "File monitor" hook target, save average 0.1s
## 1.5.3
* Enhancement module v19, please upgrade as soon as possible
* "Fix app interaction issues": try bypassing the problem that apps use "Tencent app protect" (腾讯乐固) will crash (v19)
* "Fix app interaction issues": fix some media are filtered incorrectly (app 1.5.1, v19)
* "Fix app interaction issues": fix app may crash when "Access files from other redirected app" rules enabled (v18.1)
## 1.5.0
* New Enhancement module v18
Rewrite "Fix file uri" feature, upgrade to "Fix app interaction issues" feature
* UI change
* Rename some options, reduce the understanding difficulty
## 1.4.9
* Fix "Synced folders" feature is broken in 1.4.8
## 1.4.8
* Fix regex check of "Synced folders" rules is not proceed when enabling the rule
* Revoke app storage permission automatically when disabling redirect
* Other bug fix
## 1.4.7
* Fix Enhancement module installation error reporting
* Fix Google purchase issue reporting
* Bad connection with Google Play will not freeze the whole app forever (but 5s)
* Fix "Fix file uri" feature in Enhancement module may sometimes crash redirected app
* Correctly report some type of error on start
* Other bug fix
## 1.4.6
* Improve Enhancement module installation detection and provide solution
* Improve "Invalid license" page
* Bug fix
## 1.4.4
* Bug fix
## 1.4.2
* Report Enhancement module not correctly installed
* Improve home
## 1.4.1
* Fix license check
## 1.4.0
* New home page
* Rename/re-layout options, reduce the understanding difficulty
* "Non-redirect folders" -> "Read/writable folders in real storage"
* "Link" -> "Synced folders"
* New Enhancement module v17, not more "I can't open redirected apps"
* Fix tons of bugs
## 1.3.3
* Fix bug of Enhance module v16
## 1.3.2
* Enhance module v16, fix a problem related to passing file uri
(Example: can't open a received file in WeChat)
* New native starter (for some strange devices without executables like `chmod`, `rm`)
* Fix bugs related to link feature
* Other minor bug fix
## 1.2.2
* Fix mask template for link rule editor
* Add "Link function only" filter in "Logcat"
* Minor bug fix
## 1.2.1
* Add "Kill Media Storage on start" option
(on some devices, Media Storage can use all CPU on boot, kill it can solve the problem
(it can be started by other apps later))
* Add mask template for link rule editor
* Try to detect no log
* Minor bug fix
## 1.2.0
* Add "Shared folder" to solve the problem that files created by
a redirected app can't be used by another redirected app
* Refreshed detail UI
* Enhanced "Redirect storage viewer"
* Enhanced filter for "File monitor"
* Enhance module v15, fix the problem that redirect apps can't move files between specific folders
(Example: bilibili can't save gif)
* Minor bug fix
## 1.1.4
* Enhanced "Non-redirect folders" template mechanism
* Show conflicting rule info
## 1.1.2
* Simplified detail UI
* Try to support other su, confirmed support MagiskSU, SuperSU, LineageOS addonsu now
* Fix the problem that server may send wrong progress to client
when change "Default redirect target"
* Delete redirected app config after that app uninstall
* Improve app list performance
* Improve chooser dialogs
* Improve File monitor
* Add non standard behavior check (use file monitor data)
## 1.0.2
* Fix UI not refreshed when add link rules online
* Fix the problem that "You have already own this item" happens on some Google Play users
## 1.0.0
* Add "Non-redirect folders" template, you can create different templates
for different situations and apply them quickly
* Enhance module v14, changes behavior, may avoid some special problems on
some devices
* Bug fix
## 1.0.0-rc9
* New logcat UI
* Fix unpaid state check
* Migrate to AndroidX library
## 1.0.0-rc8
* Improve user experience
* Minor bug fix
## 1.0.0-rc7
* Fix "Launch" button not work
## 1.0.0-rc6
* Improve user experience
* Bug fix
## 1.0.0-rc5
* Add White / Light blue theme
* Try to hide overlay packages
* Fix can't open installer in file browser
* Fix some link rules can't be added
* Bug fix
## 1.0.0-rc4
* Add manually set /data/media path for some special devices
* Bug fix
## 1.0.0-rc3
* Fix Android/data can be chosen as a "Non-redirect folder"
* Bug fix
## 1.0.0-rc1
* New theme
* New detail UI
* Add local link rule
* Multi-user support
* Fix backup bug, but backup files created before 1.0.0-rc1 is unavailable
* Try to detect real internal storage path
## 0.18.2-beta
* Fix bug
## 0.18.0-beta
* "Non-redirect folder" (old "Standard folder") is now customizable like "Redirect target folder"
* Add Backup & restore
* Works with LineageOS's addonsu, but some non-core feature may break, still recommended to use Magisk
* Fix crash when change filter in the main list
* Fix redirected files may not be moved when change redirect target folder in some cases
## 0.17.4-beta
* Fix link feature not on some (old? special?) devices
* Try to fix owner of linked files' is 0 on older Android system (chown ourselves)
## 0.17.3-beta
* Fix a critical bug that if an app's redirect target is set different
from the default, it will not able to access files in public folders
* Fix others bugs in 0.17.x
## 0.17.1-beta
* Add set redirect target folder (globally and pre-app)
* Add app installed notification
* Also kill by uid when force stop package (for OnePlus stock ROM)
* Improved "Share helper"
* Bug fix
## 0.16.4-beta
* Add file stat for Redirect storage viewer
* Fix the problem that anyone is displayed as purchased
* Auto clean old server files
* Try to "fix" IAP problem "You have already own this item"
* Link files from target to source when enabling link rules
## 0.16.2-beta
* Enhanced File monitor: load more & filter by path / app
* Force grant storage permission for redirected apps
* Try to fix bug of link function (when create and delete files in a very short time)
* Create ".nomedia" file in Android/data/xxx automatically
* Add shortcut for File monitor (Android 7.1+)
* Fix crash when open help if no browser app installed
* Add more tips
* Fix bugs in 0.16.1 / 0.16.2
## 0.15.8-beta
* Files downloaded by redirected apps can be managed in Android's Files (DocumentUI) app
* Fix log parse (only some special ROM)
* Add "Show disabled apps" filter
* New app list style
* In-app logcat now catches logs from more sources
## 0.15.4-beta
* Fix reboot when new file created in folders monitored by link function (only on 8.0)
* Fix a bug of file monitoring function of the link function
## 0.15.2-beta
* Try to fix crash on boot (only some users)
* Fix log parse (only some special ROM)
* Auto shrink file monitor database file
## 0.15.1-beta
* Enhance module v12.1
Fix problem that all apps unable to access the storage (only appears on some devices), but it brings some minor problems (only happens on limited situation), check Help for detail.
* Other minor changes
## 0.15.0-beta
* New Enhance module (check Settings and Help)
* File monitor: monitor file access in public storage (requires "Enhance module")
* Try to fix bugs in 0.14.3
## 0.14.3-beta
* Try to fix bugs in 0.14.1 / 0.14.2
* Magisk module v10 (check Help & support)
## 0.14.1-beta
* Provide new Magisk module to solve the problem that redirected apps still create files sometimes, check Help & support for detail
* New native daemon
* Adapt Magisk v16.4
* Improve UI
* App list will be loaded correctly now even if instant app is installed (Android 8.0's bug)
## 0.12.13-beta
* Link rule: fix the problem that some files are skipped
## 0.12.12-beta
* Fix the problem that some processes are ignored on **some special ROMs**
* Link rule: ignore file which extension ends with _tmp_ or _temp_ by default
## 0.12.11-beta
* Some bug fix
## 0.12.7-beta
* Fix the problem that some process is not redirected (from 0.12.6)
* Link rule: handle file downloaded notification by our app
## 0.12.6-beta
* Should work on Android P DP1
* Link rules ignore .tmp / .temp by default
* Some minor changes
## 0.12.5-beta
* Update Magisk module (download from Help & support)
* Some minor changes
## 0.12.4-beta
* New link rules UI
* Mark outdated (not exists in online configuration) link rules
* Try to avoid some magic
* Add "Share helper"
## 0.12.3-beta
* Add more log for starter
* More core files to /data/adb
* Try to avoid strange behavior on some devices when using Magisk module
## 0.12.1-beta
* **The core feature should works perfectly on all devices**
* Provide Magisk module for starting before all apps (see Help & support)
## 0.12.0-beta
* Fix major issue on some devices
* Add tip when log may be disabled
* Linked files will only be deleted when redirected app is running in the foreground
## 0.11.2-beta
> Version 0.11.2 changed some implementation details, to avoid some magic problems on users who have problems using version 0.11.0
* Should work on more devices now, to the user who still have problem, the problem should not break all things
* Storage permission (both runtime permission and appops) will be automatically grant to redirected apps (to avoid magic problem)
## 0.11.0-beta
> In 0.11.0 and later version, we use a completely different method of implementation. The problem that hard-coded `/sdcard` cannot be redirected is solved.
> If you have problem using the new version, please contact us for help.
* A completely different implementation, guarantee that all files will be redirected (**Read help in "Help & support" for more detail**)
* Server can be restarted without rebooting (**Reboot is required if upgrade from 0.9.x**)
* Add redirected file browser
* Add logcat
* Add detailed help
* Add "verified app" mark which means the app will never write files in non-standard dictionaries
* Remove "Block writing file" feature since it is unnecessary now
* Fix bug about link
================================================
FILE: storage_redirect/zh-hans/download.md
================================================
# 下载
**需求:** 已 root 的 Android 6.0 以上设备
[Google Play](https://play.google.com/store/apps/details?id=moe.shizuku.redirectstorage)(自动选择架构)
[Coolapk](https://www.coolapk.com/apk/moe.shizuku.redirectstorage)(arm64 版本)
[GitHub](https://github.com/RikkaApps/StorageRedirect-assets/releases)(全部架构,**三星用户请在这里下载 arm 版本**)
::: warning
**三星用户**
由于三星设备内核的一些不明原因,**三星设备只能使用 arm 版本**。
:::
================================================
FILE: storage_redirect/zh-hans/guide/README.md
================================================
# 介绍
截至本文编写的时间(2023-03-06),在 Android 系统中应用对公共存储空间的滥用仍然是一个没有解决的问题。
存储空间隔离致力于在尽可能小或不影响应用功能的前提下,解决这一问题。
要清楚地说明这个问题,我们不得不先引入一些技术性的概念。
### Android 系统对于存储空间的设计
Android 系统为应用提供了两大类共三处存储其文件的位置,它们分别为:
#### data 区域
对应的文件夹:
- `/data/user/
:::
#### Android 11 添加的分区存储(Scoped storage)
许多人认为分区存储能够解决这个问题,但是事实并非如此。
受分区存储限制的应用在使用公共存储空间时的行为会发生如下的变化:
- 仅可在公共文件夹中写入对应类型的文件(但是系统只会检查文件名称是否符合规则)
- 不需要任何权限即可在公共文件夹中写入文件(这比以前更加宽松!)
显然我们可以发现,仍然可以写入任意文件,唯一的区别仅仅是需要调整保存文件的位置到某个公共文件中,调整文件名来欺骗系统。
此外,分区存储仅作用于以 Android 11 或以上版本为目标平台的应用(即 Target API ≥ 31)。不在 Google Play 上架的应用或停止更新的老应用不会受到限制。
### 解决这个问题
为了解决上面这个问题,我们创造了这个应用——存储空间隔离。
用户可以为特定的应用启用隔离。应用所使用的“内部存储空间”实际将变为 `/storage/emulated/
〔2〕在 Android 10+,暴露 `file` uri 會導致崩潰,垃圾程式應該已經做出改變。我們不再需要去「幫助」它們。
〔3〕根據上古規範,「返回」應導航至前一螢幕但「向上」應導航至邏輯上的上一級。例如,從 B 進入 A 的一個深層頁面,「返回」返回到 B 但是「向上」去往 A 的上一層。(這也需要 B 做對)
〔4〕在 Android R 開發者預覽版本中,Google 弄壞了這個「沒人用的東西」,因此「向上」仍然像「返回」一樣運作。
## 4.3.1 (2020-04-05)
- 新增一個簡單一些的提交規則方式
- 修了不能為非主使用者的應用程式新增「可訪問資料夾」-「其他應用程式的資料夾」規則的問題
- 修了一些 UI bug
## 4.2.3 (2020-03-24)
- 解決與以 `setApplicationHiddenSettingAsUser` 為原理的凍結類應用程式一起使用時出現的問題
## 4.2.2 (2020-03-22)
- 修復程式設定中線上規則早於可訪問資料夾載入導致網路較差時體驗糟糕的問題
## 4.2.1 (2020-03-21)
- 改變「新程式通知」及「匯出被隔離的檔案」規則的通知的實現,這可以繞過 💩 MIUI 的系統 bug **〔1〕**以及另一個祖傳小問題 **〔2〕**
- 增強模組版本現在線上獲取
- 「可訪問資料夾模板」的應用程式列表現在正確支援多使用者
- 更多防呆設計
**〔1〕** 在不明確的情況下,MIUI 會在 system_server 中對 startActivity 傳入的 Intent 中的 Bundle 進行反序列化。如果 Bundle 中包含非系統的 Parcelable,則反序列化會失敗且無法復原,應用程式只會收到空白的 Bundle。
**〔2〕** 如果資料結構發生變化,且安裝新版本應用程式後尚未更新核心服務,則出現通知時應用程式會崩潰。
## 4.2.0 (2020-03-14)
- 為啟動較早的系統程式啟用隔離不再會有問題(但是,以防萬一,你仍需要[做好準備](./guide/enhanced_mode/install.html#無法進入系統(通常是由於隔離了系統元件)))
- 完全修好恢復備份
- 修復特定的情況下程式失去響應(白屏)
## 4.1.7 (2020-03-10)
- 「匯出被隔離的檔案」規則現在參與「修復程式間互動」功能的計算(需要重新啟動受影響的應用程式才可以讓改動生效)
- 修復修改可訪問資料夾模板不會立刻生效的問題
- 修復由於系統更新導致的多使用者支援壞掉
- 為隔離重要系統程式及程式組的流程加入防呆設計
## 4.1.6 (2020-03-06)
- 可以使用內建 logcat 來取得開機 log(不再於啟動時清除 log & 修復 UI 不響應)
- 已解除安裝應用程式的「匯出被隔離的檔案」規則不再參與衝突檢查
- 修復一旦使用者進入其他頁面,「檔案監視」就不再重新整理的問題
- 修復極少數的「檔案監視」記錄不顯示的問題
- 修復罕見的被隔離的應用程式不啟動問題
## 4.1.5 (2020-03-04)
- 完全解決上個版本所解決的問題
## 4.1.4 (2020-03-03)
- 修复「禁止系統重新掛載」功能失效**〔1〕**
**〔1〕** 此功能應該只有 MIUI 11(或許只有中國大陸版本?)需要
## 4.1.3 (2020-03-01)
- 再次調整啟動核心服務的一部分的時機(在 MIUI 或許還有其他的奇奇怪怪的系統上,啟動太早或太晚都會有問題,太難了(
- 修復一個有關恢復備份的問題
## 4.1.2 (2020-02-29)
- 修復由 4.0.0 引入的部分人會出現購買資訊丟失的問題
- 新增「禁用匯出被隔離的檔案的通知」選項,因為在使用增強模式的「修復應用程式間互動」後通知沒有意義(該選項僅對新使用者預設啟用)
- 修復來自程式組的「匯出被隔離的檔案」規則在新增/更新/刪除時可能出現問題
- 修復恢復備份時部分應用程式無法被恢復的問題
- 修復數個有關「修復程式間互動」的問題
## 4.1.0 (2020-2-28)
- 為避免問題,所有非普通應用程式(uid < 10000)將在本次升級時停用隔離(根據回報,隔離 uid 1000 的應用程式可能會在 MIUI, OnePlus Oxygen OS 等重度修改系統上產生問題)
- 修復上個版本檔案監視不工作
- 修復上個版本可能的配置丟失
## 4.0.0 (2020-2-28)
- 修改程式名稱為「儲存空間隔離」,因為「重新導向」十分容易讓人誤以為是舊時代的「重新導向到 SD 卡」
- 正確支援 Android 系統的 `sharedUserId` 機制(幾乎所有部分都需要改動,上次更新到現在大部分時間都花費於此)
- 核心服務在「非正常重新啟動」後仍可正常運作
- 修復在 Android 10 上關閉隔離後儲存權限顯示為允許但實際為不允許且無法改為允許的問題
- 不再將 AOSP 程式視為已認證
- 現在如果有人沒事把 "Android" 資料夾重新命名為 "android" 甚至改來改去,「匯出被隔離的檔案」功能也能正常執行(到底是什麼人才會這麼無聊)
- 增強模式 v22:更早啟動核心服務中的一部分,這可以解決為非常早啟動的程式啟用隔離可能會導致無法開機的問題(對,這又是僅限 💩 MIUI 的問題)
- 增強模式及 Riru 版本號永遠不再顯示為未知
- 若重新安裝曾經啟用隔離的程式,原先的設定會被正確地恢復(是否啟用隔離的開關仍需要手動開啟)
## 3.2.2 (2019-12-22)
- 修復一個有關恢復備份的問題
## 3.2.0 (2019-12-18)
- 修復使用了增強模式時為非常早啟動的應用程式啟用隔離可能產生問題(對,這又是「為了繞過 💩 MIUI 的問題做出的改動」產生的問題)
- 幾乎改了每一處的 UI 改進
## 3.1.5 (2019-12-06)
- 退回 3.1.4 中的一些改動,因為在另外一部分人上又有問題(
## 3.1.4 (2019-12-05)
- 修復一個啟動過程的問題
## 3.1.3 (2019-11-24)
- 嘗試規避「禁止系統重新掛載」功能可能造成「重新啟動」的問題(注意,新的改變需要重新啟動後才會生效)
- 匯出被隔離的檔案(同步資料夾)功能會先刪除目標資料夾中同名的檔案,這是為了嘗試避免一些應用程式進行數個重新命名/移動等操作後「錯誤的」檔案被匯出的問題
- 增加本地規則預置字串以供關閉線上規則或網路不可用時使用
## 3.1.0 (2019-11-23)
- 增強模式:「修復程式間互動」現在可以處理對「下載管理器」的請求
- 修復在 Android 10 上儲存權限可能沒有正確授予的問題
- 其他小 BUG 修復與 UI 改進
## 3.0.0 (2019-11-21)
- 重新設計多處 UI,降低理解難度
- 重構多處 UI 相關部分,增加穩定性與流暢性
- 增強模式 v21:增加「禁止系統重新掛載」功能以避免系統觸發的重新掛載導致隔離失效(在 Android 9 以上可用)**〔1〕**
- 增強模式:加回「修復程序間交互」中的修改傳遞的文件路徑功能,但暫時只處理 `ACTION_VIEW`**〔2〕**,且不再經由儲存重新導向中轉**〔3〕**
- 重新設計在線規則,更加靈活
**〔1〕** 此功能應該只有 MIUI 11 需要
**〔2〕** 觸發反序列化 `extras` 很危險
**〔3〕** 即使我們什麼也不做,原始行爲在 Android 10 上已經會造成崩潰,我們沒有必要越庖代俎爲劣質應用「修復問題」
## 2.1.5 (2019-10-30)
- 修復一些 UI BUG
## 2.1.4 (2019-10-29)
- 改進一些核心部分的實現
- 修復一些 UI BUG
## 2.1.3 (2019-10-23)
- 繞過在 OnePlus 的 Android 10 上使用自動暗色主題會崩潰的問題(這個問題由 OnePlus 的引起)
## 2.1.1 (2019-10-23)
- 修復如果核心程序啟動晚於啟用的應用程式則該應用程式可能無法啟動的問題
## 2.1.0 (2019-10-22)
- 簡化允許訪問來自其他程式的檔案流程,現在只要是由其他程式建立的檔案都可以在「屬於其他程式的資料夾」中選擇
- 在每次程式啟動時檢查並授予權限,這可能解決由 MIUI 11 隨機篡改權限造成的問題
- 繞過在 Meizu 裝置上使用內建 su 時核心工作程序會被殺死的問題
- 臨時移除「修復程式間互動」中的修改傳遞的檔案路徑功能,因為這個功能在使用 plug-in 或 hot fix 技術的程式(常見於來自中國大陸地區的程式)中會產生問題,且目前主流程式應該都已使用 Content Provider 與其他程式共享檔案,移除此功能應該影響不大
- 其他 BUG 修復與大量 UI 改進
## 2.0.1 (2019-09-27)
- 修復「共享資料夾」規則實際沒有生效
## 2.0.0 (2019-09-27)
- 對「共享資料夾」及「同步資料夾」規則進行問題檢查(有問題的規則會被刪除有問題的部分或禁用),在下個版本會針對這個這個問題提供更加詳細的提示及教程
- 修復數個有關「同步資料夾」規則的問題
- 修復獨立「修復程式間互動」開關壞掉
- 增強模式 v20.1:修復「修復程式間互動」功能在 OnePlus Android 10(可能還有其他)上的問題
- 大量 UI 改進
## 1.9.1 (2019-09-09)
- 修復「修復程式間互動」可能沒有工作的問題
- 增加半透明狀態列及導航欄選項
- 修復數個 UI bug
## 1.9.0 (2019-09-08)
- 增強模式 v20.0:修復使用 [Adoptable Storage](https://source.android.com/devices/storage/adoptable) 時安裝在外接儲存卡的應用無效的問題
- 增強模式 v20.0:更改「修復程式間互動」功能的實現方法,不再會被「Xposed Taichi」破壞,同時也可能會解決一些其他的問題
- 增強模式 v20.0:「修復程式間互動」可單獨為每個程式開關
- 修復備份功能不能還原部分配置的問題
- 在 Android Q 上自動允許 `OP_REQUEST_INSTALL_PACKAGES`(因為其發生變化時會觸發系統重新掛載)
## 1.8.3 (2019-08-30)
- 修復一些 UI bug
- 修復「基礎模式」下的一個重大問題
## 1.8.2 (2019-08-27)
- 處理特殊系統程式(appId < 10000 或 appId > 19999, appId = uid % 100000)
- 不為特殊系統程式鎖定權限
- 其他 bug 修復和 UI 改進
## 1.8.1 (2019-08-26)
- 改進選擇「可訪問資料夾」流程
- 可直接為「可訪問資料夾模板」選擇使用的應用
- 修復在 Android Q 上啟動服務時對已啟動的應用程式的重新導向會失效問題
- 修復長時間停留在主介面 CPU 佔用會越來越高問題
- 修復使用 API(暫未公開)的應用程式崩潰的問題
- 其他 bug 修復和 UI 改進
## 1.8.0 (2019-08-17)
- 選擇「可訪問資料夾」時可同時選擇多個模板及自訂
- 增加「資料夾分析」功能,獲知隔離儲存空間中資料夾大小
- 可訪問資料夾中選擇的資料夾不存在時會自動建立
- 一些些 UI 改進和 bug 修正
## 1.7.5 (2019-08-06)
- 修復「同步資料夾」功能壞掉
## 1.7.4 (2019-08-05)
- 在 Android Q 上使用 `FLAG_PERMISSION_SYSTEM_FIXED` 來固定權限
- 為 Huawei 裝置提供解決方法,[詳見此處](./guide/compatibility/huawei.html)
- 修復「同步資料夾」功能沒有嘗試處理「從目標資料夾移走檔案」事件
- 改進英語翻譯
- 其他小改動
## 1.7.2
- Fix "Code 5"
- Other bug fix
## 1.7.0
* Basic mode now works on Android Q beta 4
* Correctly handle hide/unhide (commonly used by "Freeze" apps)
* Change target SDK version to 29 (Android Q)
## 1.6.12
* Fix app list not refreshed after restoring backup
* Use a more reliable method to monitor app install/uninstall
* Notify user if no browser app available when opening help documents
* Fix a bug related "Fix app interaction issues"
* Other bug fix
* UI improve
## 1.6.9
* Fix Enhanced mode not work for apps starts early than core service
## 1.6.8
* Fix apps not starting on new users
* Support Android Q beta 3 (including Enhanced mode)
* Remove the ability to choose "Android/sandbox" as isolated storage path since from Q beta 3 the system sandbox is only used for apps which declared support the sandbox
## 1.6.7
* Clear config (app info - storage - clear/manage data) feature dose clear all configs now
* Filter duplicates or incorrect mounts in the final stage to avoid problems from user misuse
* Fix "Fix app interaction issues" may incorrectly handle files in `Android/data(media, obb)/package`
## 1.6.6
* Fix app interaction issues (Enhanced mode): Grant content uri permission
* UI improve
## 1.6.4
* Fix app interaction issues (Enhanced mode): Always convert file uri to content uri on Android Q
* Enhanced mode: remove disable file uri expose check since it is meaningless
* Allow choosing "Android/sandbox" as isolated storage path on Android Q
* Other bug fix
## 1.6.3
* Enhanced mode works on Android Q
* Enhanced mode: force disable file uri expose check for Android Q system ui
* Improve App settings UI
* Try fix config lost (should be extremely rare), add "Debug info" for users to investigate this problem
* Fix storage permission can't be revoked if redirect is already disabled
## 1.6.2
* Add "View gallery as this app", you can learn which photos the app can access
* Bug fix & UI improve
## 1.6.0
* Works on Android Q DP2 (enhanced mode not supported yet)
* Change behavior, mount Android/media/xxx & Android/obb/xxx by default
* Huge UI improve
* Fix "Fix app interaction issues" never worked on some devices
## 1.5.7
* Continue fixing bugs caused by "Fix app interaction issues"
* Continue renaming options
## 1.5.6
* Fix new storage permission method breaks on MIUI
* Fix "Fix app interaction issues" feature causes app breaks on some situations (if extra contains Parcelables from non-BootClassloader)
## 1.5.5
* (Android 6.0-7.1) Fix "Fix app interaction issues" feature cause app crash or all media not shown
* Continue renaming options, app name would even change in the future
* Reduce extra app launching time
On my OnePlus 3T, average extra time reduced from 0.3s to 0.16s
* Enforce storage permission with API (do not need check everytime), save average 0.04s
* (only on 7.0+) Limit "File monitor" hook target, save average 0.1s
## 1.5.3
* Enhancement module v19, please upgrade as soon as possible
* "Fix app interaction issues": try bypassing the problem that apps use "Tencent app protect" (腾讯乐固) will crash (v19)
* "Fix app interaction issues": fix some media are filtered incorrectly (app 1.5.1, v19)
* "Fix app interaction issues": fix app may crash when "Access files from other redirected app" rules enabled (v18.1)
## 1.5.0
* New Enhancement module v18
Rewrite "Fix file uri" feature, upgrade to "Fix app interaction issues" feature
* UI change
* Rename some options, reduce the understanding difficulty
## 1.4.9
* Fix "Synced folders" feature is broken in 1.4.8
## 1.4.8
* Fix regex check of "Synced folders" rules is not proceed when enabling the rule
* Revoke app storage permission automatically when disabling redirect
* Other bug fix
## 1.4.7
* Fix Enhancement module installation error reporting
* Fix Google purchase issue reporting
* Bad connection with Google Play will not freeze the whole app forever (but 5s)
* Fix "Fix file uri" feature in Enhancement module may sometimes crash redirected app
* Correctly report some type of error on start
* Other bug fix
## 1.4.6
* Improve Enhancement module installation detection and provide solution
* Improve "Invalid license" page
* Bug fix
## 1.4.4
* Bug fix
## 1.4.2
* Report Enhancement module not correctly installed
* Improve home
## 1.4.1
* Fix license check
## 1.4.0
* New home page
* Rename/re-layout options, reduce the understanding difficulty
* "Non-redirect folders" -> "Read/writable folders in real storage"
* "Link" -> "Synced folders"
* New Enhancement module v17, not more "I can't open redirected apps"
* Fix tons of bugs
## 1.3.3
* Fix bug of Enhance module v16
## 1.3.2
* Enhance module v16, fix a problem related to passing file uri
(Example: can't open a received file in WeChat)
* New native starter (for some strange devices without executables like `chmod`, `rm`)
* Fix bugs related to link feature
* Other minor bug fix
## 1.2.2
* Fix mask template for link rule editor
* Add "Link function only" filter in "Logcat"
* Minor bug fix
## 1.2.1
* Add "Kill Media Storage on start" option
(on some devices, Media Storage can use all CPU on boot, kill it can solve the problem
(it can be started by other apps later))
* Add mask template for link rule editor
* Try to detect no log
* Minor bug fix
## 1.2.0
* Add "Shared folder" to solve the problem that files created by
a redirected app can't be used by another redirected app
* Refreshed detail UI
* Enhanced "Redirect storage viewer"
* Enhanced filter for "File monitor"
* Enhance module v15, fix the problem that redirect apps can't move files between specific folders
(Example: bilibili can't save gif)
* Minor bug fix
## 1.1.4
* Enhanced "Non-redirect folders" template mechanism
* Show conflicting rule info
## 1.1.2
* Simplified detail UI
* Try to support other su, confirmed support MagiskSU, SuperSU, LineageOS addonsu now
* Fix the problem that server may send wrong progress to client
when change "Default redirect target"
* Delete redirected app config after that app uninstall
* Improve app list performance
* Improve chooser dialogs
* Improve File monitor
* Add non standard behavior check (use file monitor data)
## 1.0.2
* Fix UI not refreshed when add link rules online
* Fix the problem that "You have already own this item" happens on some Google Play users
## 1.0.0
* Add "Non-redirect folders" template, you can create different templates
for different situations and apply them quickly
* Enhance module v14, changes behavior, may avoid some special problems on
some devices
* Bug fix
## 1.0.0-rc9
* New logcat UI
* Fix unpaid state check
* Migrate to AndroidX library
## 1.0.0-rc8
* Improve user experience
* Minor bug fix
## 1.0.0-rc7
* Fix "Launch" button not work
## 1.0.0-rc6
* Improve user experience
* Bug fix
## 1.0.0-rc5
* Add White / Light blue theme
* Try to hide overlay packages
* Fix can't open installer in file browser
* Fix some link rules can't be added
* Bug fix
## 1.0.0-rc4
* Add manually set /data/media path for some special devices
* Bug fix
## 1.0.0-rc3
* Fix Android/data can be chosen as a "Non-redirect folder"
* Bug fix
## 1.0.0-rc1
* New theme
* New detail UI
* Add local link rule
* Multi-user support
* Fix backup bug, but backup files created before 1.0.0-rc1 is unavailable
* Try to detect real internal storage path
## 0.18.2-beta
* Fix bug
## 0.18.0-beta
* "Non-redirect folder" (old "Standard folder") is now customizable like "Redirect target folder"
* Add Backup & restore
* Works with LineageOS's addonsu, but some non-core feature may break, still recommended to use Magisk
* Fix crash when change filter in the main list
* Fix redirected files may not be moved when change redirect target folder in some cases
## 0.17.4-beta
* Fix link feature not on some (old? special?) devices
* Try to fix owner of linked files' is 0 on older Android system (chown ourselves)
## 0.17.3-beta
* Fix a critical bug that if an app's redirect target is set different
from the default, it will not able to access files in public folders
* Fix others bugs in 0.17.x
## 0.17.1-beta
* Add set redirect target folder (globally and pre-app)
* Add app installed notification
* Also kill by uid when force stop package (for OnePlus stock ROM)
* Improved "Share helper"
* Bug fix
## 0.16.4-beta
* Add file stat for Redirect storage viewer
* Fix the problem that anyone is displayed as purchased
* Auto clean old server files
* Try to "fix" IAP problem "You have already own this item"
* Link files from target to source when enabling link rules
## 0.16.2-beta
* Enhanced File monitor: load more & filter by path / app
* Force grant storage permission for redirected apps
* Try to fix bug of link function (when create and delete files in a very short time)
* Create ".nomedia" file in Android/data/xxx automatically
* Add shortcut for File monitor (Android 7.1+)
* Fix crash when open help if no browser app installed
* Add more tips
* Fix bugs in 0.16.1 / 0.16.2
## 0.15.8-beta
* Files downloaded by redirected apps can be managed in Android's Files (DocumentUI) app
* Fix log parse (only some special ROM)
* Add "Show disabled apps" filter
* New app list style
* In-app logcat now catches logs from more sources
## 0.15.4-beta
* Fix reboot when new file created in folders monitored by link function (only on 8.0)
* Fix a bug of file monitoring function of the link function
## 0.15.2-beta
* Try to fix crash on boot (only some users)
* Fix log parse (only some special ROM)
* Auto shrink file monitor database file
## 0.15.1-beta
* Enhance module v12.1
Fix problem that all apps unable to access the storage (only appears on some devices), but it brings some minor problems (only happens on limited situation), check Help for detail.
* Other minor changes
## 0.15.0-beta
* New Enhance module (check Settings and Help)
* File monitor: monitor file access in public storage (requires "Enhance module")
* Try to fix bugs in 0.14.3
## 0.14.3-beta
* Try to fix bugs in 0.14.1 / 0.14.2
* Magisk module v10 (check Help & support)
## 0.14.1-beta
* Provide new Magisk module to solve the problem that redirected apps still create files sometimes, check Help & support for detail
* New native daemon
* Adapt Magisk v16.4
* Improve UI
* App list will be loaded correctly now even if instant app is installed (Android 8.0's bug)
## 0.12.13-beta
* Link rule: fix the problem that some files are skipped
## 0.12.12-beta
* Fix the problem that some processes are ignored on **some special ROMs**
* Link rule: ignore file which extension ends with _tmp_ or _temp_ by default
## 0.12.11-beta
* Some bug fix
## 0.12.7-beta
* Fix the problem that some process is not redirected (from 0.12.6)
* Link rule: handle file downloaded notification by our app
## 0.12.6-beta
* Should work on Android P DP1
* Link rules ignore .tmp / .temp by default
* Some minor changes
## 0.12.5-beta
* Update Magisk module (download from Help & support)
* Some minor changes
## 0.12.4-beta
* New link rules UI
* Mark outdated (not exists in online configuration) link rules
* Try to avoid some magic
* Add "Share helper"
## 0.12.3-beta
* Add more log for starter
* More core files to /data/adb
* Try to avoid strange behavior on some devices when using Magisk module
## 0.12.1-beta
* **The core feature should works perfectly on all devices**
* Provide Magisk module for starting before all apps (see Help & support)
## 0.12.0-beta
* Fix major issue on some devices
* Add tip when log may be disabled
* Linked files will only be deleted when redirected app is running in the foreground
## 0.11.2-beta
> Version 0.11.2 changed some implementation details, to avoid some magic problems on users who have problems using version 0.11.0
* Should work on more devices now, to the user who still have problem, the problem should not break all things
* Storage permission (both runtime permission and appops) will be automatically grant to redirected apps (to avoid magic problem)
## 0.11.0-beta
> In 0.11.0 and later version, we use a completely different method of implementation. The problem that hard-coded `/sdcard` cannot be redirected is solved.
> If you have problem using the new version, please contact us for help.
* A completely different implementation, guarantee that all files will be redirected (**Read help in "Help & support" for more detail**)
* Server can be restarted without rebooting (**Reboot is required if upgrade from 0.9.x**)
* Add redirected file browser
* Add logcat
* Add detailed help
* Add "verified app" mark which means the app will never write files in non-standard dictionaries
* Remove "Block writing file" feature since it is unnecessary now
* Fix bug about link
================================================
FILE: storage_redirect/zh-hant/download.md
================================================
# 下載
**需求:** 已 root 的 Android 6.0 以上裝置
[Google Play](https://play.google.com/store/apps/details?id=moe.shizuku.redirectstorage)(自動選擇架構)
[Coolapk](https://www.coolapk.com/apk/moe.shizuku.redirectstorage)(arm64 版本)
[GitHub](https://github.com/RikkaApps/StorageRedirect-assets/releases)(全部架構,**Samsung 用戶請在這裏下載 arm 版本**)
::: warning
**Samsung 用戶**
由於 Samsung 裝置內核的一些不明原因,**Samsung 裝置只能使用 arm 版本**。
:::
================================================
FILE: storage_redirect/zh-hant/guide/README.md
================================================
# 介紹
截至本文編寫的時間(2023-03-06),在 Android 系統中應用程式對公共儲存空間的濫用仍然是一個沒有解決的問題。
儲存空間隔離致力於在儘可能小或不影響應用程式功能的前提下,解決這一問題。
要清楚地說明這個問題,我們不得不先引入一些技術性的概念。
### Android 系統對於儲存空間的設計
Android 系統為應用程式提供了兩大類共三處儲存其檔案的位置,它們分別為:
#### data 區域
對應的資料夾:
- `/data/user/
:::
#### Android 11 新增的 Scoped storage
許多人認為「Scoped storage」能夠解決這個問題,但是事實並非如此。
受「Scoped storage」限制的應用程式在使用公共儲存空間時的行為會發生如下的變化:
- 僅可在公共資料夾中寫入對應型別的檔案(但是系統只會檢查檔名稱是否符合規則)
- 不需要任何權限即可在公共資料夾中寫入檔案(這比以前更加寬鬆!)
顯然我們可以發現,仍然可以寫入任意檔案,唯一的區別僅僅是需要調整儲存檔案的位置到某個公共檔案中,調整檔名來欺騙系統。
此外,「Scoped storage」僅作用於以 Android 11 或以上版本為目標平臺的應用程式(即 Target API ≥ 31)。不在 Google Play 上架的應用程式或停止更新的老應用程式不會受到限制。
### 解決這個問題
為了解決上面這個問題,我們創造了這個應用程式——儲存空間隔離。
使用者可以為特定的應用程式啟用隔離。應用程式所使用的「內部儲存空間」實際將變為 `/storage/emulated/
{{ data.heroText || $title || 'Hello' }}
{{ app.title }}
* Requires root
icon: https://sr.rikka.app/logo.png
secondaryAction:
link: https://sr.rikka.app
text: Learn more
primaryAction:
link: https://sr.rikka.app/download.html
text: Download
- title: App Ops
details: Control the hidden appops conveniently with App Ops app. Works without root.
* Requires adb if not rooted
icon: https://appops.rikka.app/logo.png
secondaryAction:
link: https://appops.rikka.app
text: Learn more
primaryAction:
link: https://appops.rikka.app/download.html
text: Download
- title: Shizuku
details: Help others apps to use system APIs conveniently with adb or root privilege.
* Requires adb or root
icon: https://shizuku.rikka.app/logo.png
secondaryAction:
link: https://shizuku.rikka.app
text: Learn more
primaryAction:
link: https://shizuku.rikka.app/download.html
text: Download
- title: NoPopping
details: Disable pop notification automatically by current app.
icon: /logo_nopooping.png
primaryAction:
link: https://play.google.com/store/apps/details?id=rikka.nopeeking
text: Download
- title: WADB
details: Toggle "adb over network" from Quick Settings.
* Requires root
icon: /logo_wadb.png
secondaryAction:
link: https://github.com/RikkaApps/WADB
text: Learn more
primaryAction:
link: https://play.google.com/store/apps/details?id=moe.haruue.wadb
text: Download
---
================================================
FILE: www/contribute_translation.md
================================================
# Contribute translation
RikkaApps uses self-hosted Weblate as a translation platform. Currently, we are moving the translation to this platform.
1. Go to
* 需要 root
icon: https://sr.rikka.app/logo.png
secondaryAction:
link: https://sr.rikka.app/zh-hans
text: 了解更多
primaryAction:
link: https://sr.rikka.app/zh-hans/download.html
text: 下载
- title: App Ops
details: 使用 App Ops 应用舒适地控制隐藏的 appops。无需 root 也可使用。
* 如果没有 root 则需要 adb
icon: https://appops.rikka.app/logo.png
secondaryAction:
link: https://appops.rikka.app/zh-hans
text: 了解更多
primaryAction:
link: https://appops.rikka.app/zh-hans/download.html
text: 下载
- title: Shizuku
details: 帮助其他应用舒适地以 adb 或 root 特权使用系统 API。
* 需要 adb 或 root
icon: https://shizuku.rikka.app/logo.png
secondaryAction:
link: https://shizuku.rikka.app/zh-hans
text: 了解更多
primaryAction:
link: https://shizuku.rikka.app/zh-hans/download.html
text: 下载
- title: NoPopping
details: 根据当前应用自动关闭弹出通知。
icon: /logo_nopooping.png
primaryAction:
link: https://play.google.com/store/apps/details?id=rikka.nopeeking
text: 下载
- title: WADB
details: 从快速设置开关“网络 adb”。
* 需要 root
icon: /logo_wadb.png
secondaryAction:
link: https://github.com/RikkaApps/WADB
text: 了解更多
primaryAction:
link: https://play.google.com/store/apps/details?id=moe.haruue.wadb
text: 下载
---
================================================
FILE: www/zh-hans/contribute_translation.md
================================================
# 参与翻译
RikkaApps 使用自行托管的 Weblate 作为翻译平台。目前,我们正在将翻译移动至该平台。
1. 进入
* 需要 root
icon: https://sr.rikka.app/logo.png
secondaryAction:
link: https://sr.rikka.app/zh-hant
text: 瞭解更多
primaryAction:
link: https://sr.rikka.app/zh-hant/download.html
text: 下載
- title: App Ops
details: 使用 App Ops 程式舒適地控制隱藏的 appops。無需 root 也可使用。
* 如果沒有 root 則需要 adb
icon: https://appops.rikka.app/logo.png
secondaryAction:
link: https://appops.rikka.app/zh-hant
text: 瞭解更多
primaryAction:
link: https://appops.rikka.app/zh-hant/download.html
text: 下載
- title: Shizuku
details: 幫助其他應用程式舒適地以 adb 或 root 特權使用系統 API。
* 需要 adb 或 root
icon: https://shizuku.rikka.app/logo.png
secondaryAction:
link: https://shizuku.rikka.app/zh-hant
text: 瞭解更多
primaryAction:
link: https://shizuku.rikka.app/zh-hant/download.html
text: 下載
- title: NoPopping
details: 根據當前應用程式自動關閉彈出通知。
icon: /logo_nopooping.png
primaryAction:
link: https://play.google.com/store/apps/details?id=rikka.nopeeking
text: 下載
- title: WADB
details: 從快速設定開關「網路 adb」。
* 需要 root
icon: /logo_wadb.png
secondaryAction:
link: https://github.com/RikkaApps/WADB
text: 瞭解更多
primaryAction:
link: https://play.google.com/store/apps/details?id=moe.haruue.wadb
text: 下載
---
================================================
FILE: www/zh-hant/contribute_translation.md
================================================
# 參與翻譯
RikkaApps 使用自行架設的 Weblate 作為翻譯平臺。目前,我們正在將翻譯移動至該平臺。
1. 進入