RootInstaller: Ensure sessionId is non-null
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -102,8 +102,8 @@ class RootInstaller(context: Context) : InstallerBase(context) {
|
|||||||
val found = sessionIdMatcher.find()
|
val found = sessionIdMatcher.find()
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
val sessionId = sessionIdMatcher.group(1).toInt()
|
val sessionId = sessionIdMatcher.group(1)?.toInt()
|
||||||
if (Shell.getShell().isRoot) {
|
if (Shell.getShell().isRoot && sessionId != null) {
|
||||||
for (file in files) {
|
for (file in files) {
|
||||||
Shell.su("cat \"${file.absoluteFile}\" | pm install-write -S ${file.length()} $sessionId \"${file.name}\"")
|
Shell.su("cat \"${file.absoluteFile}\" | pm install-write -S ${file.length()} $sessionId \"${file.name}\"")
|
||||||
.exec()
|
.exec()
|
||||||
|
|||||||
Reference in New Issue
Block a user