@@ -16,7 +16,6 @@ import android.os.UserHandle
16
16
import android.util.Log
17
17
import dev.zwander.installwithoptions.BuildConfig
18
18
import dev.zwander.installwithoptions.IOptionsApplier
19
- import rikka.shizuku.ShizukuSystemProperties
20
19
import rikka.shizuku.SystemServiceHelper
21
20
import java.io.OutputStream
22
21
import kotlin.random.Random
@@ -91,7 +90,7 @@ class InternalInstaller(private val context: Context) {
91
90
myUserId(),
92
91
) as Int
93
92
}
94
- val session = packageInstaller::class .java.getMethod(" openSession" )
93
+ val session = packageInstaller::class .java.getMethod(" openSession" , Int :: class .java )
95
94
.invoke(packageInstaller, sessionId) as Any
96
95
97
96
try {
@@ -115,7 +114,10 @@ class InternalInstaller(private val context: Context) {
115
114
0 ,
116
115
fd.length,
117
116
) as ParcelFileDescriptor ? )?.run {
118
- if (ShizukuSystemProperties .getBoolean(" fw.revocable_fd" , false )) {
117
+ if (Class .forName(" android.os.SystemProperties" )
118
+ .getMethod(" getBoolean" , String ::class .java, Boolean ::class .java)
119
+ .invoke(null , " fw.revocable_fd" , false ) as Boolean
120
+ ) {
119
121
ParcelFileDescriptor .AutoCloseOutputStream (this )
120
122
} else {
121
123
Class .forName(" android.os.FileBridge\$ FileBridgeOutputStream" )
@@ -131,8 +133,11 @@ class InternalInstaller(private val context: Context) {
131
133
}
132
134
}
133
135
134
- session::class .java.getMethod(" commit" , IntentSender ::class .java, Boolean ::class .java)
135
- .invoke(session, statusIntent.intentSender, false )
136
+ session::class .java.getMethod(
137
+ " commit" ,
138
+ IntentSender ::class .java,
139
+ Boolean ::class .java
140
+ ).invoke(session, statusIntent.intentSender, false )
136
141
} catch (e: Throwable ) {
137
142
Log .e(" InstallWithOptions" , " error" , e)
138
143
session::class .java.getMethod(" abandon" ).invoke(session)
0 commit comments