Can anyone explain how the "sk" variable is generated?

Discuss other programming languages besides AutoHotkey
afe
Posts: 574
Joined: 06 Dec 2018, 04:36

Can anyone explain how the "sk" variable is generated?

15 Oct 2019, 14:06

Hello,

Can anyone explain how the "sk" variable is generated in the Java code below?
The variable "sk" s generated by a function named URLHandler.getSK(), but I am trapped here.
The code is transferred from the APK. It can be seen that it uses code obfuscation, so it increases the difficulty of reading.

Code: Select all

    String str1 = URLHandler.getSK();
    byte[] arrayOfByte = __.decode(str1);
    str1 = new String();
    arrayOfByte = a.__(arrayOfByte, paramString);
    this(arrayOfByte);
    String str2 = stringBuilder1.append("sk:").append(str1).toString();
    return str1;
  }

// URLHandler.getSK()
public class URLHandler implements NoProguard {
  static  {
    getSK();
  }

  public static String getSK() {
    ______ ______ = ______.IL();
    String str1 = ______.getString("net_param_sk");
    boolean bool = TextUtils.isEmpty(str1);
    if (bool) {
      b b = b.IN();
      str1 = b.getString("net_param_sk");
    } 
    return str1;
  }
}

// ______.IL()
public class ______ extends _ {
  public static ______ IL() {
    ______ ______1 = aCH;
    if (______1 == null)
      synchronized (______.class) {
        ______1 = aCH;
        if (______1 == null) {
          ______1 = new ______();
          this();
          aCH = ______1;
        } 
        return aCH;
      }  
    return aCH;
  }

// b.IN()
public class b {
  private IAccountChecker aCA;
  private Context mContext;
  private boolean mInited;
  private String mName;
  private SharedPreferences mSharedPreferences;

  public static b IN() {
    b b1 = aCK;
    if (b1 == null)
      synchronized (b.class) {
        b1 = aCK;
        if (b1 == null) {
          b1 = new b();
          this();
          aCK = b1;
        } 
        return aCK;
      }  
    return aCK;
  }
}

// getString("net_param_sk")
  public String getString(String paramString) { return getString(paramString, ""); }

  public String getString(String paramString1, String paramString2) {
    ____ ____1 = this.aCz;
    if (____1 != null) {
      ____1 = this.aCz;
      paramString2 = ____1.get(paramString1, paramString2);
    } 
    return paramString2;
  }

This is the complete jar:

http://s000.tinyupload.com/?file_id=01039354714521268657
http://s000.tinyupload.com/?file_id=75877549987323050614
Last edited by afe on 21 Oct 2019, 12:55, edited 7 times in total.
User avatar
TheDewd
Posts: 1347
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Can anyone explain this piece of Java code?

15 Oct 2019, 14:31

I also cannot understand Java, but I found references from Google searches that refer to the getSK() value as "SelectionKey".

https://docs.oracle.com/javase/7/docs/api/java/nio/channels/SelectionKey.html
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
afe
Posts: 574
Joined: 06 Dec 2018, 04:36

Re: Can anyone explain this piece of Java code?

16 Oct 2019, 07:04

Thanks, I found the definition of getSK() , but the problem is a bit complicated. Because it seems that various dependencies are intertwined, it is difficult to figure out the clues.
afe
Posts: 574
Joined: 06 Dec 2018, 04:36

Re: Can anyone explain this Java function?

20 Oct 2019, 09:38

I updated the code, this time it's concise, but I don't understand.

Return to “Other Programming Languages”

Who is online

Users browsing this forum: No registered users and 11 guests