Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. String color = this.hexFortmat.substring(0, 6);
  2. ImageView colorBand1 = ((ImageView) DecompiledFile.this.findViewById(R.id.image_view1));
  3. ImageView colorBand2 = ((ImageView) DecompiledFile.this.findViewById(R.id.image_view2));
  4. ImageView colorBand3 = ((ImageView) DecompiledFile.this.findViewById(R.id.image_view3));
  5. String hexFortmat = DecompiledFile.bin2hex(this.mdbytes);
  6. byte[] mdbytes = DecompiledFile.generateHmacSHA256Signature(DecompiledFile.this.getSalt(), DecompiledFile.this.getColorBand());
  7. boolean performAllTimerFunctions = true;
  8. TextView specialInstruction = ((TextView) DecompiledFile.this.findViewById(R.id.textView9));
  9. boolean visibleColorBand = false;
  10. boolean visibleSpecialInstruction = false;
  11.  
  12. public static byte[] generateHmacSHA256Signature(String data, String key) throws GeneralSecurityException, IOException {
  13. try {
  14. SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(StringEncodings.UTF8), HMAC_SHA_256);
  15. Mac mac = Mac.getInstance(HMAC_SHA_256);
  16. mac.init(secretKey);
  17. return mac.doFinal(data.getBytes(StringEncodings.UTF8));
  18. } catch (UnsupportedEncodingException e) {
  19. throw new GeneralSecurityException(e);
  20. }
  21. }
  22.  
  23. static String bin2hex(byte[] data) {
  24. return String.format("%0" + (data.length * 2) + "X", new Object[]{new BigInteger(1, data)});
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement