当前位置:编程学习 > JAVA >>

求反编译后的一段代码解析

DJ Java Decompiler反编译代码为:
 public Engine onLoadEngine()
    {
        Resources resources = getResources();
        Constants.CAMERA_HEIGHT = resources.getDisplayMetrics().heightPixels;
        Constants.CAMERA_WIDTH = resources.getDisplayMetrics().widthPixels;
        Constants.defaultContext = this;
        Constants.defaultResources = resources;
        Saver.setSharedPreferences(getSharedPreferences(Saver.PREF_NAME, 0));
        Saver.loadLastLevel();
        Constants.STAGE_SCALE_Y = Constants.CAMERA_HEIGHT / Constants.STAGE_HEIGHT;
        Constants.STAGE_SCALE_X = Constants.CAMERA_WIDTH / Constants.STAGE_WIDTH;
_L6:
        if(Constants.tasks.size() != 0) goto _L2; else goto _L1
_L1:
        String as[];
        as = getImage();
        ShuffleArray.shuffleString(as);
        int i = 0;
_L4:
        if(i >= as.length)
            continue; /* Loop/switch isn't completed */
        String s = as[i].substring(0, as[i].indexOf(".jpg")).toLowerCase();
        if(Constants.completedTasks.contains(s))
        {
            Constants.tasks.add(0, s);
            break MISSING_BLOCK_LABEL_330;
        }
        try
        {
            Constants.tasks.add(Constants.tasks.size(), s);
            break MISSING_BLOCK_LABEL_330;
        }
        catch(Exception exception) { }
_L2:
        Log.i(TAG, (new StringBuilder()).append("DATA: tasks len = ").append(Constants.tasks.size()).toString());
        mCamera = new Camera(0.0F, 0.0F, Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT);
        RatioResolutionPolicy ratioresolutionpolicy = new RatioResolutionPolicy(Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT);
        EngineOptions engineoptions = (new EngineOptions(true, org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation.PORTRAIT, ratioresolutionpolicy, mCamera)).setNeedsMusic(true).setNeedsSound(true);
        engineoptions.getTouchOptions().setRunOnUpdateThread(true);
        engineoptions.getRenderOptions().disableExtensionVertexBufferObjects();
        SceneManager.init(this);
        sceneManager = SceneManager.getManager();
        Constants.audioManager = (AudioManager)getSystemService("audio");
        Engine engine = new Engine(engineoptions);
        Constants.textureManager = engine.getTextureManager();
        Constants.defaultEngine = engine;
        return engine;
        i++;
        if(true) goto _L4; else goto _L3
_L3:
        if(true) goto _L6; else goto _L5
_L5:
    }

jd-gui反编译代码为:
public Engine onLoadEngine()
  {
    Resources localResources = getResources();
    Constants.CAMERA_HEIGHT = localResources.getDisplayMetrics().heightPixels;
    Constants.CAMERA_WIDTH = localResources.getDisplayMetrics().widthPixels;
    Constants.defaultContext = this;
    Constants.defaultResources = localResources;
    Saver.setSharedPreferences(getSharedPreferences(Saver.PREF_NAME, 0));
    Saver.loadLastLevel();
    Constants.STAGE_SCALE_Y = Constants.CAMERA_HEIGHT / Constants.STAGE_HEIGHT;
    Constants.STAGE_SCALE_X = Constants.CAMERA_WIDTH / Constants.STAGE_WIDTH;
    for (;;)
    {
      int i;
      try
      {
        if (Constants.tasks.size() == 0)
        {
          String[] arrayOfString = getImage();
          ShuffleArray.shuffleString(arrayOfString);
          i = 0;
          if (i >= arrayOfString.length) {
            continue;
          }
          String str = arrayOfString[i].substring(0, arrayOfString[i].indexOf(".jpg")).toLowerCase();
          if (Constants.completedTasks.contains(str)) {
            Constants.tasks.add(0, str);
          } else {
            Constants.tasks.add(Constants.tasks.size(), str);
          }
        }
      }
      catch (Exception localException)
      {
        Log.i(this.TAG, "DATA: tasks len = " + Constants.tasks.size());
        this.mCamera = new Camera(0.0F, 0.0F, Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT);
        RatioResolutionPolicy localRatioResolutionPolicy = new RatioResolutionPolicy(Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT);
        EngineOptions localEngineOptions = new EngineOptions(true, EngineOptions.ScreenOrientation.PORTRAIT, localRatioResolutionPolicy, this.mCamera).setNeedsMusic(true).setNeedsSound(true);
        localEngineOptions.getTouchOptions().setRunOnUpdateThread(true);
        localEngineOptions.getRenderOptions().disableExtensionVertexBufferObjects();
        SceneManager.init(this);
        this.sceneManager = SceneManager.getManager();
        Constants.audioManager = (AudioManager)getSystemService("audio");
        Engine localEngine = new Engine(localEngineOptions);
        Constants.textureManager = localEngine.getTextureManager();
        Constants.defaultEngine = localEngine;
        return localEngine;
      }
      i++;
    }
  }

麻烦写出正确的代码,谢谢!

如果你对反编译精通,请联系我,可以付费求破解。QQ:1807306
JAVA Java反编译 --------------------编程问答-------------------- 这已经很清楚了啊,把goto到的代码段诺个位置,用{}括起来基本就差不多了 --------------------编程问答-------------------- 这是我整理后的,运行时报NULL指针,逻辑错误。
public Engine onLoadEngine() {
       
        Resources resources = getResources();
        Constants.CAMERA_HEIGHT = resources.getDisplayMetrics().heightPixels;
        Constants.CAMERA_WIDTH = resources.getDisplayMetrics().widthPixels;
        Constants.defaultContext = this;
        Constants.defaultResources = resources;
        Saver.setSharedPreferences(getSharedPreferences(Saver.PREF_NAME, 0));
        Saver.loadLastLevel();
        Constants.STAGE_SCALE_Y = Constants.CAMERA_HEIGHT / Constants.STAGE_HEIGHT;
        Constants.STAGE_SCALE_X = Constants.CAMERA_WIDTH / Constants.STAGE_WIDTH;
        if(Constants.tasks.size() != 0)
        {
          Log.i(TAG, (new StringBuilder()).append("DATA: tasks len = ").append(Constants.tasks.size()).toString());
          mCamera = new Camera(0.0F, 0.0F, Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT);
          RatioResolutionPolicy ratioresolutionpolicy = new RatioResolutionPolicy(Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT);
          EngineOptions engineoptions = (new EngineOptions(true, org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation.PORTRAIT, ratioresolutionpolicy, mCamera)).setNeedsMusic(true).setNeedsSound(true);
          engineoptions.getTouchOptions().setRunOnUpdateThread(true);
          engineoptions.getRenderOptions().disableExtensionVertexBufferObjects();
          SceneManager.init(this);
          sceneManager = SceneManager.getManager();
          Constants.audioManager = (AudioManager)getSystemService("audio");
          Engine engine = new Engine(engineoptions);
          Constants.textureManager = engine.getTextureManager();
          Constants.defaultEngine = engine;
          return engine;
        }
        else
        {
         String as[];
         try
         {
          as = getImage();
          ShuffleArray.shuffleString(as);
          for(int i=0;i<as.length;i++)
          {
           String s = as[i].substring(0, as[i].indexOf(".jpg")).toLowerCase();
          if(Constants.completedTasks.contains(s))
              Constants.tasks.add(0, s);
          else
           Constants.tasks.add(Constants.tasks.size(), s);
          }
        }
         catch(Exception exception)
         {}
        }
return mEngine;
}
谢谢各位帮助 --------------------编程问答-------------------- 这代码写的 --------------------编程问答--------------------
补充:Java ,  Java EE
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,