Aykhan Amiraslanli
Aykhan Amiraslanli

Reputation: 643

what this android function returns

I am trying to decode an APK file. I need to get what m21862a function returns.

Simply I need HASH value. Hash is requested to https://api.SOMESITE.net/external/auth. How it is generated?

Here is my part code:

a = HttpTools.m22199a("https://api.somesite.net/external/hello", false);
String str = BuildConfig.FLAVOR;
str = BuildConfig.FLAVOR;
str = BuildConfig.FLAVOR;
try {
        str = ((String) new JSONObject(a).get("token")) + ZaycevApp.f15130a.m21564W();
        Logger.m22256a("ZAuth", "token - " + str);
        str = m21862a(str);
        a = new JSONObject(HttpTools.m22199a(String.format("https://api.SOMESITE.net/external/auth?code=%s&hash=%s", new Object[]{a, str}), false)).getString("token");
        if (!ae.m21746b((CharSequence) a)) {
            ZaycevApp.f15130a.m21595f(a);
        }
}

I need to know what is m21862a function. Is there PHP replacement for m21862a? Here is m21862a function:

private String m21862a(String str) {
    try {
        MessageDigest instance = MessageDigest.getInstance("MD5");
        instance.update(str.getBytes());
        byte[] digest = instance.digest();
        StringBuffer stringBuffer = new StringBuffer();
        for (byte b : digest) {
            String toHexString = Integer.toHexString(b & RadialCountdown.PROGRESS_ALPHA);
            while (toHexString.length() < 2) {
                toHexString = "0" + toHexString;
            }
            stringBuffer.append(toHexString);
        }
        return stringBuffer.toString();
    } catch (Exception e) {
        Logger.m22252a((Object) this, e);
        return BuildConfig.FLAVOR;
    }
}

Upvotes: 0

Views: 79

Answers (1)

user180100
user180100

Reputation:

The function computes the MD5 digest of the input, takes each byte of the computed MD5, "ANDize" with RadialCountdown.PROGRESS_ALPHA, translates to hex (pad with 0 to have 2 char) and appends that to the ouput.

There is probably a way to do the same thing in php (using md5()?).

Upvotes: 1

Related Questions