鱼C论坛

 找回密码
 立即注册
查看: 4264|回复: 3

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

[复制链接]
匿名鱼油
匿名鱼油  发表于 2014-10-16 02:02:30 |阅读模式
30鱼币
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[i]).exists())
        return true;
    }
  }

  public int getSignature(String paramString)
  {
    PackageManager localPackageManager = getPackageManager();
    try
    {
      int i = localPackageManager.getPackageInfo(paramString, 64).signatures[0].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;
  }
}

最佳答案

查看完整内容

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

使用道具 举报

发表于 2014-10-16 02:02:31 | 显示全部楼层
System.loadLibrary("getKey");
getKey库里面有getKey()函数。。getKey()函数的返回值就是key
你可以修改代码,实习调用getKey()函数并打印返回值(具体操作谷歌)\

勿扰
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2014-10-16 12:13:13 | 显示全部楼层
看不懂啊!:cry
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2014-10-16 21:41:45 From FishC Mobile | 显示全部楼层
对安卓不怎么研究啊,那去eclipse跑一下不就行了吗
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-20 00:22

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表