Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>app.revanced</groupId>
<artifactId>jadb</artifactId>
<version>1.2.1</version>
<version>1.2.1.1</version>
<url>https://github.com/vidstige/jadb</url>

<licenses>
Expand Down
12 changes: 12 additions & 0 deletions src/se/vidstige/jadb/JadbDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import se.vidstige.jadb.managers.Bash;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -80,6 +81,17 @@ public State getState() throws IOException, JadbException {
return convertState(transport.readString());
}
}

public Integer getSdkVersion() {
try (BufferedReader input = new BufferedReader(
new InputStreamReader(executeShell("getprop", "ro.build.version.sdk"), StandardCharsets.UTF_8))) {

String line = input.readLine();
return line != null ? Integer.valueOf(line.trim()) : null;
} catch (Exception e) {
return null;
}
}

/** <p>Execute a shell command.</p>
*
Expand Down
4 changes: 4 additions & 0 deletions src/se/vidstige/jadb/managers/PackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,9 @@ public static InstallOption ON_INTERNAL_SYSTEM_MEMORY(String name) {
*/
public static final InstallOption GRANT_ALL_PERMISSIONS = new InstallOption("-g");

/**
* This option is supported only from Android 14.X+
*/
public static final InstallOption UPDATE_OWNERSHIP = new InstallOption("--update-ownership");
//</editor-fold>
}