Skip to content

Commit d2eacd2

Browse files
authored
Merge pull request #218 from solrudev/develop
0.25.3
2 parents 0d9d879 + a686cf8 commit d2eacd2

41 files changed

Lines changed: 1658 additions & 32 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Key features of Ackpine:
2222
- **Deferred**: Ackpine allows to defer user's intervention via customizable high-priority notification.
2323
- **Progress and state updates**: it's easy to observe every session's state and progress updates.
2424
- **Advanced features**: Ackpine allows to benefit from advanced features without juggling complex OS APIs (such as install pre-approval) introduced in later Android versions.
25-
- **Elevated permissions**: Shizuku and root shell are supported as installer backends with advanced install flags.
25+
- **Elevated permissions**: Shizuku, root shell and Dhizuku are supported as installer backends with advanced install flags.
2626
- **100% Java and Kotlin-friendly**: while maintaining full Java compatibility, Ackpine was developed as a Kotlin-first library.
2727
- **Compatibility**: Ackpine supports Android versions starting from API level 16.
2828

@@ -69,6 +69,12 @@ ackpine-libsu = { module = "ru.solrudev.ackpine:ackpine-libsu", version.ref = "a
6969
# optional - Kotlin extensions for libsu plugin
7070
ackpine-libsu-ktx = { module = "ru.solrudev.ackpine:ackpine-libsu-ktx", version.ref = "ackpine" }
7171

72+
# optional - plugin enabling installs/uninstalls through Dhizuku
73+
ackpine-dhizuku = { module = "ru.solrudev.ackpine:ackpine-dhizuku", version.ref = "ackpine" }
74+
75+
# optional - Kotlin extensions for Dhizuku plugin
76+
ackpine-dhizuku-ktx = { module = "ru.solrudev.ackpine:ackpine-dhizuku-ktx", version.ref = "ackpine" }
77+
7278
# optional - testing utilities
7379
ackpine-test = { module = "ru.solrudev.ackpine:ackpine-test", version.ref = "ackpine" }
7480

@@ -82,7 +88,9 @@ ackpine = [
8288
"ackpine-shizuku",
8389
"ackpine-shizuku-ktx",
8490
"ackpine-libsu",
85-
"ackpine-libsu-ktx"
91+
"ackpine-libsu-ktx",
92+
"ackpine-dhizuku",
93+
"ackpine-dhizuku-ktx"
8694
]
8795
```
8896
</details>
@@ -119,6 +127,12 @@ dependencies {
119127
// optional - Kotlin extensions for libsu plugin
120128
implementation("ru.solrudev.ackpine:ackpine-libsu-ktx:$ackpineVersion")
121129

130+
// optional - plugin enabling installs/uninstalls through Dhizuku
131+
implementation("ru.solrudev.ackpine:ackpine-dhizuku:$ackpineVersion")
132+
133+
// optional - Kotlin extensions for Dhizuku plugin
134+
implementation("ru.solrudev.ackpine:ackpine-dhizuku-ktx:$ackpineVersion")
135+
122136
// optional - testing utilities
123137
testImplementation("ru.solrudev.ackpine:ackpine-test:$ackpineVersion")
124138
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
public abstract interface class ru/solrudev/ackpine/dhizuku/DhizukuInstallParametersDsl {
2+
public abstract fun getRequestDowngrade ()Z
3+
public abstract fun setRequestDowngrade (Z)V
4+
}
5+
6+
public final class ru/solrudev/ackpine/dhizuku/DhizukuInstallParametersDslBuilder : ru/solrudev/ackpine/dhizuku/DhizukuInstallParametersDsl {
7+
public fun <init> ()V
8+
public final fun build ()Lru/solrudev/ackpine/dhizuku/DhizukuPlugin$InstallParameters;
9+
public fun getRequestDowngrade ()Z
10+
public fun setRequestDowngrade (Z)V
11+
}
12+
13+
public final class ru/solrudev/ackpine/dhizuku/DhizukuInstallParametersKt {
14+
public static final fun DhizukuInstallParameters (Lkotlin/jvm/functions/Function1;)Lru/solrudev/ackpine/dhizuku/DhizukuPlugin$InstallParameters;
15+
public static synthetic fun DhizukuInstallParameters$default (Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lru/solrudev/ackpine/dhizuku/DhizukuPlugin$InstallParameters;
16+
}
17+
18+
public abstract interface class ru/solrudev/ackpine/dhizuku/DhizukuUninstallParametersDsl {
19+
public abstract fun getAllUsers ()Z
20+
public abstract fun getKeepData ()Z
21+
public abstract fun getSystemApp ()Z
22+
public abstract fun setAllUsers (Z)V
23+
public abstract fun setKeepData (Z)V
24+
public abstract fun setSystemApp (Z)V
25+
}
26+
27+
public final class ru/solrudev/ackpine/dhizuku/DhizukuUninstallParametersDslBuilder : ru/solrudev/ackpine/dhizuku/DhizukuUninstallParametersDsl {
28+
public fun <init> ()V
29+
public final fun build ()Lru/solrudev/ackpine/dhizuku/DhizukuPlugin$UninstallParameters;
30+
public fun getAllUsers ()Z
31+
public fun getKeepData ()Z
32+
public fun getSystemApp ()Z
33+
public fun setAllUsers (Z)V
34+
public fun setKeepData (Z)V
35+
public fun setSystemApp (Z)V
36+
}
37+
38+
public final class ru/solrudev/ackpine/dhizuku/DhizukuUninstallParametersKt {
39+
public static final fun DhizukuUninstallParameters (Lkotlin/jvm/functions/Function1;)Lru/solrudev/ackpine/dhizuku/DhizukuPlugin$UninstallParameters;
40+
public static synthetic fun DhizukuUninstallParameters$default (Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lru/solrudev/ackpine/dhizuku/DhizukuPlugin$UninstallParameters;
41+
}
42+
43+
public final class ru/solrudev/ackpine/dhizuku/InstallParametersDslKt {
44+
public static final fun dhizuku (Lru/solrudev/ackpine/installer/parameters/InstallParametersDsl;Lkotlin/jvm/functions/Function1;)V
45+
public static synthetic fun dhizuku$default (Lru/solrudev/ackpine/installer/parameters/InstallParametersDsl;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
46+
}
47+
48+
public final class ru/solrudev/ackpine/dhizuku/UninstallParametersDslKt {
49+
public static final fun dhizuku (Lru/solrudev/ackpine/uninstaller/parameters/UninstallParametersDsl;Lkotlin/jvm/functions/Function1;)V
50+
public static synthetic fun dhizuku$default (Lru/solrudev/ackpine/uninstaller/parameters/UninstallParametersDsl;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
51+
}
52+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
description = "Kotlin extensions for Ackpine Dhizuku plugin"
18+
19+
plugins {
20+
id("ru.solrudev.ackpine.library")
21+
id("ru.solrudev.ackpine.library-publish")
22+
id("ru.solrudev.ackpine.dokka")
23+
}
24+
25+
ackpine {
26+
id = "dhizuku-ktx"
27+
minSdk = 26
28+
artifact {
29+
name = "Ackpine Dhizuku Plugin KTX"
30+
inceptionYear = "2026"
31+
}
32+
}
33+
34+
dependencies {
35+
api(projects.ackpineKtx)
36+
api(projects.ackpinePlugins.dhizuku)
37+
}

ackpine-plugins/dhizuku-ktx/consumer-rules.pro

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package ru.solrudev.ackpine.dhizuku
18+
19+
/**
20+
* Constructs a new instance of [DhizukuPlugin.InstallParameters].
21+
*/
22+
@Suppress("FunctionName")
23+
public inline fun DhizukuInstallParameters(
24+
configure: DhizukuInstallParametersDsl.() -> Unit = {}
25+
): DhizukuPlugin.InstallParameters {
26+
return DhizukuInstallParametersDslBuilder().apply(configure).build()
27+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package ru.solrudev.ackpine.dhizuku
18+
19+
import ru.solrudev.ackpine.DelicateAckpineApi
20+
import ru.solrudev.ackpine.session.parameters.SessionParametersDsl
21+
22+
/**
23+
* DSL allowing to configure [install parameters for DhizukuPlugin][DhizukuPlugin.InstallParameters].
24+
*/
25+
@SessionParametersDsl
26+
public interface DhizukuInstallParametersDsl {
27+
28+
/**
29+
* Whether an upgrade to a lower version of a package than currently installed is requested.
30+
*
31+
* Ackpine sets downgrade-request flag which is honored for debuggable installed apps or debuggable OS builds, but
32+
* does not add the unrestricted downgrade permission flag used by root, shell, or system identities.
33+
* The device owner must still be authorized by Android to perform the downgrade, so setting this option does
34+
* not guarantee that a downgrade will succeed.
35+
*
36+
* This is a **delicate** API. The outcome of using this flag depends on the app being installed, on a
37+
* specific OS build, and on the permissions that the used device owner identity has.
38+
*/
39+
@set:DelicateAckpineApi
40+
public var requestDowngrade: Boolean
41+
}
42+
43+
@PublishedApi
44+
internal class DhizukuInstallParametersDslBuilder : DhizukuInstallParametersDsl {
45+
46+
private val delegate = DhizukuPlugin.InstallParameters.Builder()
47+
48+
@set:DelicateAckpineApi
49+
override var requestDowngrade: Boolean
50+
get() = delegate.requestDowngrade
51+
set(value) {
52+
delegate.setRequestDowngrade(value)
53+
}
54+
55+
fun build(): DhizukuPlugin.InstallParameters = delegate.build()
56+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package ru.solrudev.ackpine.dhizuku
18+
19+
/**
20+
* Constructs a new instance of [DhizukuPlugin.UninstallParameters].
21+
*/
22+
@Suppress("FunctionName")
23+
public inline fun DhizukuUninstallParameters(
24+
configure: DhizukuUninstallParametersDsl.() -> Unit = {}
25+
): DhizukuPlugin.UninstallParameters {
26+
return DhizukuUninstallParametersDslBuilder().apply(configure).build()
27+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package ru.solrudev.ackpine.dhizuku
18+
19+
import ru.solrudev.ackpine.session.parameters.SessionParametersDsl
20+
21+
/**
22+
* DSL allowing to configure [uninstall parameters for DhizukuPlugin][DhizukuPlugin.UninstallParameters].
23+
*/
24+
@SessionParametersDsl
25+
public interface DhizukuUninstallParametersDsl {
26+
27+
/**
28+
* Whether to retain the package's data directory.
29+
*/
30+
public var keepData: Boolean
31+
32+
/**
33+
* Whether to delete the package for all users.
34+
*/
35+
public var allUsers: Boolean
36+
37+
/**
38+
* Whether a system app should be marked as uninstalled for the current user.
39+
*/
40+
public var systemApp: Boolean
41+
}
42+
43+
@PublishedApi
44+
internal class DhizukuUninstallParametersDslBuilder : DhizukuUninstallParametersDsl {
45+
46+
private val delegate = DhizukuPlugin.UninstallParameters.Builder()
47+
48+
override var keepData: Boolean
49+
get() = delegate.keepData
50+
set(value) {
51+
delegate.setKeepData(value)
52+
}
53+
54+
override var allUsers: Boolean
55+
get() = delegate.allUsers
56+
set(value) {
57+
delegate.setAllUsers(value)
58+
}
59+
60+
override var systemApp: Boolean
61+
get() = delegate.systemApp
62+
set(value) {
63+
delegate.setSystemApp(value)
64+
}
65+
66+
fun build(): DhizukuPlugin.UninstallParameters = delegate.build()
67+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package ru.solrudev.ackpine.dhizuku
18+
19+
import ru.solrudev.ackpine.installer.parameters.InstallParametersDsl
20+
21+
/**
22+
* Registers [DhizukuPlugin] for the session.
23+
*/
24+
public inline fun InstallParametersDsl.dhizuku(
25+
configure: DhizukuInstallParametersDsl.() -> Unit = {}
26+
) {
27+
plugin(DhizukuPlugin::class, DhizukuInstallParameters(configure))
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (C) 2026 Ilya Fomichev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package ru.solrudev.ackpine.dhizuku
18+
19+
import ru.solrudev.ackpine.uninstaller.parameters.UninstallParametersDsl
20+
21+
/**
22+
* Registers [DhizukuPlugin] for the session.
23+
*/
24+
public inline fun UninstallParametersDsl.dhizuku(
25+
configure: DhizukuUninstallParametersDsl.() -> Unit = {}
26+
) {
27+
plugin(DhizukuPlugin::class, DhizukuUninstallParameters(configure))
28+
}

0 commit comments

Comments
 (0)