AuthorizationRequestFactory.java
1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.bitstrips.imoji.monouser.oauth2;
import android.support.annotation.NonNull;
import android.util.Base64;
import com.bitstrips.imoji.monouser.models.AuthorizationRequest;
import com.bitstrips.imoji.monouser.models.OAuth2Constants;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class AuthorizationRequestFactory
{
private static String a = "AuthRequestFactory";
private static int b = 32;
private static int c = 32;
private static String a(int paramInt)
{
byte[] arrayOfByte = new byte[paramInt];
new SecureRandom().nextBytes(arrayOfByte);
return Base64.encodeToString(arrayOfByte, 11);
}
private static String a(@NonNull String paramString)
{
try
{
Object localObject = MessageDigest.getInstance("SHA-256");
((MessageDigest)localObject).update(paramString.getBytes("US-ASCII"));
localObject = Base64.encodeToString(((MessageDigest)localObject).digest(), 11);
return (String)localObject;
}
catch (Exception localException) {}
return paramString;
}
public static AuthorizationRequest generateRequest(boolean paramBoolean)
{
String str1 = a(c);
String str2 = a(str1);
String str3 = a(b);
return new AuthorizationRequest().withResponseType(OAuth2Constants.OAUTH2_RESPONSE_TYPE).withClientId(OAuth2Constants.getClientId(paramBoolean)).withScope(OAuth2Constants.OAUTH2_SCOPE).withRedirectUri(OAuth2Constants.OAUTH2_REDIRECT_URI).withCodeChallengeMethod(OAuth2Constants.OAUTH2_CODE_CHALLENGE_METHOD).withCodeVerifier(str1).withCodeChallenge(str2).withState(str3);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/monouser/oauth2/AuthorizationRequestFactory.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/