Kate Mobile v109.1版本的 MD5 值为:fcd76ded5f363ecbfac46035a4ed2a23
以下内容为反编译后的 Auth.java 源代码,内容仅作参考
package com.perm.kate.api;
import android.util.Log;
import com.perm.utils.ErrorReporter;
import com.perm.utils.TokenHider;
import com.perm.utils.Utils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public abstract class Auth {
public static String getSettings() {
return "notify,friends,photos,audio,video,docs,status,notes,pages,wall,groups,messages,offline,notifications,stories";
}
public static String getUrl(String str, String str2) {
try {
return "https://oauth.vk.com/authorize?client_id=" + str + "&display=mobile&scope=" + str2 + "&redirect_uri=" + URLEncoder.encode("https://oauth.vk.com/blank.html", "utf-8") + "&response_type=token&v=" + URLEncoder.encode("5.139", "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
ErrorReporter.report(e);
return "";
}
}
public static String parseGroupRedirectUrl(String str, long j) {
String extractPattern = Utils.extractPattern(str, "access_token_" + j + "=(.*?)(&|$)");
if (Api.is_dev) {
Log.i("Kate.Auth", "access_token=" + extractPattern);
}
if (extractPattern == null || extractPattern.length() == 0) {
throw new Exception("Failed to parse redirect url " + TokenHider.hideAccessToken(str));
}
return extractPattern;
}
public static String[] parseRedirectUrl(String str) {
String extractPattern = Utils.extractPattern(str, "access_token=(.*?)&");
if (Api.is_dev) {
Log.i("Kate.Auth", "access_token=" + extractPattern);
}
String extractPattern2 = Utils.extractPattern(str, "user_id=(\\d*)");
Log.i("Kate.Auth", "user_id=" + extractPattern2);
if (extractPattern2 == null || extractPattern2.length() == 0 || extractPattern == null || extractPattern.length() == 0) {
throw new Exception("Failed to parse redirect url " + TokenHider.hideAccessToken(str));
}
return new String[]{extractPattern, extractPattern2};
}
}