gnirehtet: 2.2.1 -> 2.3

This commit is contained in:
Vladyslav Mykhailichenko 2018-09-16 14:08:42 +03:00
parent 69b6230cee
commit 9501915218
2 changed files with 23 additions and 10 deletions

View file

@ -1,11 +1,11 @@
{stdenv, rustPlatform, fetchFromGitHub, fetchzip, androidenv, substituteAll}:
let
version = "2.2.1";
version = "2.3";
apk = stdenv.mkDerivation {
name = "gnirehtet.apk-${version}";
src = fetchzip {
url = "https://github.com/Genymobile/gnirehtet/releases/download/v${version}/gnirehtet-rust-linux64-v${version}.zip";
sha256 = "1rz2wdjc1y7n8fhskmki1nj0ak80ylxspcsrcdnjkk9r7jbq0kan";
sha256 = "08pgmpbz82cd8ndr2syiv25l5xk1gvh9gzji4pgva5gw269bjmpz";
};
installPhase = ''
mkdir $out
@ -20,10 +20,10 @@ rustPlatform.buildRustPackage rec {
owner = "Genymobile";
repo = "gnirehtet";
rev = "v${version}";
sha256 = "1mv8nq4422k2d766qjqqnqp47qzzbbvlwhdni0k6w4nmd3m5cnd9";
sha256 = "118ig42qzr2xyra7r8zfxq38xidaxfc98ja9836jwnn9fgbigczr";
};
sourceRoot = "source/relay-rust";
cargoSha256 = "11qf9n6h6akvb0rbmsgdlfmypkbnas8ss1cs7i8w19mh7524n0v5";
cargoSha256 = "0370jbllahcdhs132szbxb2yr675s5smm74sx58qi8jhykbb5qs7";
patchFlags = [ "-p2" ];
patches = [

View file

@ -1,7 +1,7 @@
diff --git a/relay-rust/src/main.rs b/relay-rust/src/main.rs
index 4f1be53..96d2e78 100644
--- a/relay-rust/src/main.rs
+++ b/relay-rust/src/main.rs
Index: gnirehtet/relay-rust/src/main.rs
===================================================================
--- gnirehtet.orig/relay-rust/src/main.rs
+++ gnirehtet/relay-rust/src/main.rs
@@ -299,7 +299,7 @@ impl Command for RelayCommand {
fn cmd_install(serial: Option<&String>) -> Result<(), CommandExecutionError> {
@ -11,7 +11,7 @@ index 4f1be53..96d2e78 100644
}
fn cmd_uninstall(serial: Option<&String>) -> Result<(), CommandExecutionError> {
@@ -467,8 +467,8 @@ fn exec_adb<S: Into<String>>(
@@ -464,8 +464,8 @@ fn exec_adb<S: Into<String>>(
args: Vec<S>,
) -> Result<(), CommandExecutionError> {
let adb_args = create_adb_args(serial, args);
@ -22,7 +22,7 @@ index 4f1be53..96d2e78 100644
Ok(exit_status) => {
if exit_status.success() {
Ok(())
@@ -490,8 +490,8 @@ fn must_install_client(serial: Option<&String>) -> Result<bool, CommandExecution
@@ -487,8 +487,8 @@ fn must_install_client(serial: Option<&S
serial,
vec!["shell", "dumpsys", "package", "com.genymobile.gnirehtet"],
);
@ -33,3 +33,16 @@ index 4f1be53..96d2e78 100644
Ok(output) => {
if output.status.success() {
// the "regex" crate makes the binary far bigger, so just parse the versionCode
Index: gnirehtet/relay-rust/src/adb_monitor.rs
===================================================================
--- gnirehtet.orig/relay-rust/src/adb_monitor.rs
+++ gnirehtet/relay-rust/src/adb_monitor.rs
@@ -206,7 +206,7 @@ impl AdbMonitor {
fn start_adb_daemon() -> bool {
info!(target: TAG, "Restarting adb daemon");
- match process::Command::new("adb")
+ match process::Command::new("@adb@")
.args(&["start-server"])
.status() {
Ok(exit_status) => {