Skip to content

Commit 917c2ea

Browse files
committed
Upload file
1 parent b7a39df commit 917c2ea

3 files changed

Lines changed: 7 additions & 19 deletions

File tree

560 Bytes
Binary file not shown.

pio/src/main/java/com/tool/tree/SplashActivity.kt

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,29 +122,16 @@ private fun applyTheme() {
122122
}
123123

124124
// =================== PERMISSION ===================
125-
private fun hasReadPermission(): Boolean {
126-
return ContextCompat.checkSelfPermission(
127-
this,
128-
android.Manifest.permission.READ_EXTERNAL_STORAGE
129-
) == PackageManager.PERMISSION_GRANTED
130-
}
125+
private fun hasReadPermission() = ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
131126

132-
private fun requestReadPermission() {
133-
ActivityCompat.requestPermissions(
134-
this,
135-
arrayOf(android.Manifest.permission.READ_EXTERNAL_STORAGE),
136-
REQUEST_CODE_PERMISSIONS
137-
)
138-
}
127+
private fun requestReadPermission() = ActivityCompat.requestPermissions(this, arrayOf(android.Manifest.permission.READ_EXTERNAL_STORAGE), REQUEST_CODE_PERMISSIONS)
139128

140129
private fun requestAppPermissions() {
141130
saveAgreement()
142-
if (!hasReadPermission()) {
143-
requestReadPermission()
144-
} else {
131+
if (hasReadPermission()) {
145132
started = true
146133
checkRootAndStart()
147-
}
134+
} else requestReadPermission()
148135
}
149136

150137
override fun onResume() {

website/Instruct.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ file.add
1515
├── icon.png (256×256) # is the icon of the add-on
1616
├── menu.sh|menu.xml # 3-dot menu button
1717
├── index.sh|index.xml # After entering the page, all content will be displayed.
18+
├── firstly_start.sh # This command only runs during data installation and application updates.
1819
├── early_start.sh # The first time the application starts, it will run the shell.
1920
├── install.sh # When the add-on is unzipped, it will run the shell.
2021
├── uninstall.sh # remove add-on it will run shell
@@ -36,12 +37,12 @@ version=1.0
3637
versionCode=100
3738
3839
# if set to "true" root is required for add-on to work
39-
root=false
40+
root=false
4041
```
4142

4243
**Add-on icon**
4344

44-
- The icon.png file is an image file that can be 100x100 ~ 500x500 in size
45+
- The icon.png file is an image file that can be 100x100 ~ 256x256 in size
4546

4647
- Can also rename icon_true.png, icon_false.png, true is dark mode, false is light mode.
4748

0 commit comments

Comments
 (0)