Created
July 22, 2013 06:53
-
-
Save kmod-midori/6051777 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. | |
| // Jad home page: http://www.kpdus.com/jad.html | |
| // Decompiler options: packimports(3) | |
| import android.content.ContentResolver; | |
| import android.util.Base64; | |
| import android.util.Log; | |
| import java.io.UnsupportedEncodingException; | |
| import java.math.BigInteger; | |
| import java.security.*; | |
| import java.security.spec.InvalidKeySpecException; | |
| import java.security.spec.RSAPublicKeySpec; | |
| import javax.crypto.*; | |
| final class rd | |
| { | |
| private static int a(byte abyte0[], int i) | |
| { | |
| return 0 | (0xff & abyte0[i]) << 24 | (0xff & abyte0[i + 1]) << 16 | (0xff & abyte0[i + 2]) << 8 | 0xff & abyte0[i + 3]; | |
| } | |
| public static String a(ContentResolver contentresolver, String s, String s1) | |
| { | |
| return a((new StringBuilder()).append(s).append("\0").append(s1).toString(), contentresolver, null); | |
| } | |
| private static String a(String s) | |
| { | |
| MessageDigest messagedigest; | |
| int i; | |
| messagedigest = null; | |
| i = 0; | |
| _L2: | |
| if(i >= 2) | |
| break; /* Loop/switch isn't completed */ | |
| MessageDigest messagedigest1 = MessageDigest.getInstance("SHA-1"); | |
| messagedigest = messagedigest1; | |
| _L3: | |
| i++; | |
| if(true) goto _L2; else goto _L1 | |
| NoSuchAlgorithmException nosuchalgorithmexception; | |
| nosuchalgorithmexception; | |
| if(i > 0) | |
| throw new RuntimeException(nosuchalgorithmexception); | |
| goto _L3 | |
| _L1: | |
| byte abyte0[]; | |
| StringBuffer stringbuffer; | |
| int j; | |
| String s1; | |
| try | |
| { | |
| abyte0 = messagedigest.digest(s.getBytes("UTF-8")); | |
| stringbuffer = new StringBuffer(); | |
| } | |
| catch(UnsupportedEncodingException unsupportedencodingexception) | |
| { | |
| throw new RuntimeException(unsupportedencodingexception); | |
| } | |
| j = 0; | |
| if(j >= abyte0.length) | |
| break; /* Loop/switch isn't completed */ | |
| stringbuffer.append(a[(0xff & abyte0[j]) >>> 4]); | |
| stringbuffer.append(a[0xf & (0xff & abyte0[j])]); | |
| j++; | |
| if(true) goto _L5; else goto _L4 | |
| _L5: | |
| break MISSING_BLOCK_LABEL_65; | |
| _L4: | |
| s1 = stringbuffer.toString(); | |
| return s1; | |
| } | |
| private static String a(String s, ContentResolver contentresolver, String s1) | |
| { | |
| byte abyte0[]; | |
| PublicKey publickey; | |
| int i; | |
| String s2; | |
| if(s1 != null) | |
| s2 = s1; | |
| else | |
| s2 = cxc.a(contentresolver, "google_login_public_key"); | |
| if(s2 == null) | |
| { | |
| Log.i("GoogleLoginService.Pass", "no public key available, using default"); | |
| s2 = "AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwgi3iJIZdodyhKZQrNWp5nKJ3srRXcUW+F1BD3baEVGcmEgqaLZUNBjm057pKRI16kB0YppeGx5qIQ5QjKzsR8ETQbKLNWgRY0QRNVz34kMJR3P/LgHax/6rmf5AAAAAwEAAQ=="; | |
| } | |
| abyte0 = new byte[5]; | |
| publickey = a(s2, abyte0); | |
| if(publickey == null) | |
| return null; | |
| i = 0; | |
| _L5: | |
| if(i >= 2) goto _L2; else goto _L1 | |
| _L1: | |
| int i1; | |
| Cipher cipher; | |
| byte abyte1[]; | |
| int j; | |
| byte abyte2[]; | |
| int k; | |
| int l; | |
| byte abyte3[]; | |
| String s3; | |
| try | |
| { | |
| cipher = Cipher.getInstance("RSA/ECB/OAEPWITHSHA1ANDMGF1PADDING"); | |
| abyte1 = s.getBytes("UTF-8"); | |
| j = 1 + (-1 + abyte1.length) / 86; | |
| abyte2 = new byte[j * 133]; | |
| } | |
| catch(NoSuchAlgorithmException nosuchalgorithmexception) | |
| { | |
| if(i > 0) | |
| throw new RuntimeException(nosuchalgorithmexception); | |
| break MISSING_BLOCK_LABEL_292; | |
| } | |
| catch(NoSuchPaddingException nosuchpaddingexception) | |
| { | |
| throw new RuntimeException(nosuchpaddingexception); | |
| } | |
| catch(BadPaddingException badpaddingexception) | |
| { | |
| throw new RuntimeException(badpaddingexception); | |
| } | |
| catch(UnsupportedEncodingException unsupportedencodingexception) | |
| { | |
| throw new RuntimeException(unsupportedencodingexception); | |
| } | |
| catch(IllegalBlockSizeException illegalblocksizeexception) | |
| { | |
| Log.e("GoogleLoginService.Pass", "error encrypting password: ", illegalblocksizeexception); | |
| return null; | |
| } | |
| catch(InvalidKeyException invalidkeyexception) | |
| { | |
| Log.e("GoogleLoginService.Pass", "received bad google_login_public_key: ", invalidkeyexception); | |
| return null; | |
| } | |
| k = 0; | |
| if(k >= j) goto _L4; else goto _L3 | |
| _L3: | |
| cipher.init(1, publickey); | |
| l = k * 86; | |
| if(k != j - 1) | |
| break MISSING_BLOCK_LABEL_308; | |
| i1 = abyte1.length - k * 86; | |
| _L6: | |
| abyte3 = cipher.doFinal(abyte1, l, i1); | |
| System.arraycopy(abyte0, 0, abyte2, k * 133, abyte0.length); | |
| System.arraycopy(abyte3, 0, abyte2, k * 133 + abyte0.length, abyte3.length); | |
| k++; | |
| break MISSING_BLOCK_LABEL_100; | |
| _L4: | |
| s3 = Base64.encodeToString(abyte2, 10); | |
| return s3; | |
| i++; | |
| goto _L5 | |
| _L2: | |
| throw new RuntimeException("Execution should never reach here."); | |
| i1 = 86; | |
| goto _L6 | |
| } | |
| public static String a(String s, String s1) | |
| { | |
| if(s == null) | |
| Log.e("GoogleLoginService.Pass", "attempt to hash null username"); | |
| if(s.equals("null")) | |
| Log.e("GoogleLoginService.Pass", "attempt to hash \"null\" username"); | |
| if(s1 == null) | |
| Log.e("GoogleLoginService.Pass", "attempt to hash null password"); | |
| if(s1.equals("null")) | |
| Log.e("GoogleLoginService.Pass", "attempt to hash \"null\" password"); | |
| String s2 = (new StringBuilder()).append(s).append("\0").append(s1).append("\0").append(s).toString(); | |
| String s3 = a(s2); | |
| String s4 = a(s2, ((ContentResolver) (null)), "AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwgi3iJIZdodyhKZQrNWp5nKJ3srRXcUW+F1BD3baEVGcmEgqaLZUNBjm057pKRI16kB0YppeGx5qIQ5QjKzsR8ETQbKLNWgRY0QRNVz34kMJR3P/LgHax/6rmf5AAAAAwEAAQ=="); | |
| if(s4 == null) | |
| return s3; | |
| else | |
| return (new StringBuilder()).append(s3).append(";").append(s4).toString(); | |
| } | |
| private static PublicKey a(String s, byte abyte0[]) | |
| { | |
| byte abyte1[] = Base64.decode(s, 0); | |
| int i = a(abyte1, 0); | |
| byte abyte2[] = new byte[i]; | |
| System.arraycopy(abyte1, 4, abyte2, 0, i); | |
| BigInteger biginteger = new BigInteger(1, abyte2); | |
| int j = a(abyte1, i + 4); | |
| byte abyte3[] = new byte[j]; | |
| System.arraycopy(abyte1, i + 8, abyte3, 0, j); | |
| BigInteger biginteger1 = new BigInteger(1, abyte3); | |
| int k = 0; | |
| label0: | |
| do | |
| { | |
| label1: | |
| { | |
| if(k >= 2) | |
| break label0; | |
| PublicKey publickey; | |
| try | |
| { | |
| byte abyte4[] = MessageDigest.getInstance("SHA-1").digest(abyte1); | |
| abyte0[0] = 0; | |
| System.arraycopy(abyte4, 0, abyte0, 1, 4); | |
| publickey = KeyFactory.getInstance("RSA").generatePublic(new RSAPublicKeySpec(biginteger, biginteger1)); | |
| } | |
| catch(NoSuchAlgorithmException nosuchalgorithmexception) | |
| { | |
| if(k > 0) | |
| throw new RuntimeException(nosuchalgorithmexception); | |
| break label1; | |
| } | |
| catch(InvalidKeySpecException invalidkeyspecexception) | |
| { | |
| Log.e("GoogleLoginService.Pass", "received bad google_login_public_key: ", invalidkeyspecexception); | |
| return null; | |
| } | |
| return publickey; | |
| } | |
| k++; | |
| } while(true); | |
| throw new RuntimeException("Execution should never reach here."); | |
| } | |
| private static char a[] = { | |
| '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', | |
| 'a', 'b', 'c', 'd', 'e', 'f' | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment