Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion 3 src/main/java/io/appium/java_client/MobileCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.openqa.selenium.remote.CommandInfo;
import org.openqa.selenium.remote.http.HttpMethod;

import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.AbstractMap;
import java.util.HashMap;
Expand Down Expand Up @@ -376,7 +377,7 @@ public static ImmutableMap<String, Object> prepareArguments(String[] params,
*/
public static Map.Entry<String, Map<String, ?>> pushFileCommand(String remotePath, byte[] base64Data) {
String[] parameters = new String[] {"path", "data"};
Object[] values = new Object[] {remotePath, base64Data};
Object[] values = new Object[]{remotePath, new String(base64Data, StandardCharsets.UTF_8)};
return new AbstractMap.SimpleEntry<>(PUSH_FILE, prepareArguments(parameters, values));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class AndroidDriverTest extends BaseAndroidTest {
.getBytes());
driver.pushFile("/data/local/tmp/remote.txt", data);
byte[] returnData = driver.pullFile("/data/local/tmp/remote.txt");
String returnDataDecoded = new String(Base64.decodeBase64(returnData));
String returnDataDecoded = new String(returnData);
assertEquals(
"The eventual code is no more than the deposit of your understanding. ~E. W. Dijkstra",
returnDataDecoded);
Expand All @@ -75,7 +75,7 @@ public class AndroidDriverTest extends BaseAndroidTest {
+ "more than the deposit of your understanding. ~E. W. Dijkstra", "UTF-8", true);
driver.pushFile("/data/local/tmp/remote2.txt", temp);
byte[] returnData = driver.pullFile("/data/local/tmp/remote2.txt");
String returnDataDecoded = new String(Base64.decodeBase64(returnData));
String returnDataDecoded = new String(returnData);
assertEquals(
"The eventual code is no more than the deposit of "
+ "your understanding. ~E. W. Dijkstra",
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.