Anonymous 发表于 2014-10-16 02:02:30

求完整分析该段源码的意思,并且求出隐藏的key。

package com.deepnoite.toosimple;

import android.app.Activity;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.Bundle;
import android.os.Process;
import android.text.Editable;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import java.io.File;

public class MainActivity extends Activity
implements View.OnClickListener
{
private static String[] known_pipes;
private Button check;
private EditText strKey;

static
{
    System.loadLibrary("getKey");
    known_pipes = new String[] { "/dev/socket/qemud", "/dev/qemu_pipe" };
}

private native String getKey();

public boolean checkPipes()
{
    for (int i = 0; ; ++i)
    {
      if (i >= known_pipes.length)
      return false;
      if (new File(known_pipes).exists())
      return true;
    }
}

public int getSignature(String paramString)
{
    PackageManager localPackageManager = getPackageManager();
    try
    {
      int i = localPackageManager.getPackageInfo(paramString, 64).signatures.hashCode();
      return i;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return 0;
}

public void init()
{
    ApplicationInfo localApplicationInfo = getApplicationInfo();
    int i = 0x2 & localApplicationInfo.flags;
    localApplicationInfo.flags = i;
    if (i != 0)
      Process.killProcess(Process.myPid());
    if (checkPipes())
      Process.killProcess(Process.myPid());
    if (getSignature("com.deepnoite.toosimple") == -2057288379)
      return;
    Process.killProcess(Process.myPid());
}

public void onClick(View paramView)
{
    if (paramView == this.check)
    {
      if (!(this.strKey.getText().toString().equals(getKey())))
      break label41;
      Toast.makeText(this, "成功", 0).show();
    }
    return;
    label41: Toast.makeText(this, "失败", 0).show();
}

protected void onCreate(Bundle paramBundle)
{
    super.onCreate(paramBundle);
    setContentView(2130903040);
    init();
    this.strKey = ((EditText)findViewById(2131230721));
    this.check = ((Button)findViewById(2131230720));
    this.check.setOnClickListener(this);
}

public boolean onCreateOptionsMenu(Menu paramMenu)
{
    getMenuInflater().inflate(2131165184, paramMenu);
    return true;
}
}

向往青莲 发表于 2014-10-16 02:02:31

System.loadLibrary("getKey");
getKey库里面有getKey()函数。。getKey()函数的返回值就是key
你可以修改代码,实习调用getKey()函数并打印返回值(具体操作谷歌)\

勿扰

流行语 发表于 2014-10-16 12:13:13

看不懂啊!:cry

百日维新 发表于 2014-10-16 21:41:45

对安卓不怎么研究啊,那去eclipse跑一下不就行了吗
页: [1]
查看完整版本: 求完整分析该段源码的意思,并且求出隐藏的key。