Android Studio debugger copies array value

I have a Base64 encoded key as an input String, from which I want to create a new byte array using the decoding method. I want to copy the received bytes to my notepad. I set a breakpoint, and I execute the code in the debugger, and everything works as it should. The size of the array is 392. I want to copy the value of the inputbytes array to the clipboard, so I right-click on the byte array, select "Copy value", and then paste it into the notebook, but nothing is inserted. It seems that the value of the array cannot be copied. What am I doing wrong? How to copy an array value?

String input ="Ajw9DS8nJCMtFRI0GhkGCEwDfyQMNCgpMzgKMTM+dzQ5Bi8PJgokMTgUNzMWJz46DTEZEhUMNlY3CkYqGDQeJjYVaSwPE8jIwA9BhYGBhI5ND84Q0wTJxUWNyI/NTMUCBktHAAxGQAYJBADKQNiHyEdNisMPB8dKBM1BgoCVx4ZNiATk34aIgIWfwpiNgAKPBgsPQY2GCMAfDZ8VCAnCx4AFwE4JB0mCxUoMyssMFIJCBkrLhYgOSwnAVQAIU8sOiYjAgxFI1A3FUIqASgOWUIuCBoifCcMAAA5Rk01J0INFw8sdlMsAFtWCjx2PztAeidBHz85LB4EOBcUARc6BwY2IjUOLhg1GhJwHiFeYEwlDk07MwooHRYWXSEFGBMQLScLH15dGygXMyEKeS9NFykgh5RE0sMSApFhEgfzUgDgQeJUgWQQc4ewAiJAU4UgYtIxF1GyEieUM2Lh81CSYOPAMPCDQCfTIRASUCAQUtITgdAB4MFTlDBB91KVwjXQ4MNjF+Djc=";
byte[] inputbytes = Base64.decode(input, Base64.DEFAULT);  

enter image description here

Android Studio 2.3.3

+4
source share
1 answer

It seems you cannot just copy arrays. Only single values.

At the breakpoint, click Alt+ F8. This opens a popup Evaluate expression. Enter the following code:

Arrays.toString(inputBytes)

This will produce the output of a string formatted as follows:

[97, 115, 100]

enter image description here

From there, you can manipulate using .replace*class methods Stringto remove commas and parentheses. Or just use a text editor.

Good luck :)

+2
source

Source: https://habr.com/ru/post/1684556/


All Articles