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

hejiwang 2013-11-28 03:12:49
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
...全文
161 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
纳兰弦歌 2013-11-28
回复
时光清浅 2013-11-28
这代码写的
回复
hejiwang 2013-11-28
这是我整理后的,运行时报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; } 谢谢各位帮助
回复
艾德 2013-11-28
这已经很清楚了啊,把goto到的代码段诺个位置,用{}括起来基本就差不多了
回复
发帖
Java EE
创建于2007-09-28

6.6w+

社区成员

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
申请成为版主
帖子事件
创建了帖子
2013-11-28 03:12
社区公告
暂无公告