Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
boomshakalaka (plane) writeup
package com.example.plane;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
public class a
{
private SharedPreferences editor = null;
public a(Context paramContext, String paramString)
{
this.editor = paramContext.getSharedPreferences(paramString, 0);
}
public void b()
{
this.editor.edit().putString("DATA", "").commit();
}
public String c()
{
return this.editor.getString("DATA", "");
}
public void d(String paramString)
{
this.editor.edit().putString("DATA", String.valueOf(c()) + paramString).commit();
}
}
.class public Lcom/example/plane/a;
.super Ljava/lang/Object;
.source "a.java"
# instance fields
.field private editor:Landroid/content/SharedPreferences;
# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
.locals 1
.param p1, "arg1" # Landroid/content/Context;
.param p2, "arg2" # Ljava/lang/String;
.prologue
.line 9
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 7
const/4 v0, 0x0
iput-object v0, p0, Lcom/example/plane/a;->editor:Landroid/content/SharedPreferences;
.line 10
const/4 v0, 0x0
invoke-virtual {p1, p2, v0}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
iput-object v0, p0, Lcom/example/plane/a;->editor:Landroid/content/SharedPreferences;
.line 11
return-void
.end method
# virtual methods
.method public b()V
.locals 3
.prologue
.line 14
iget-object v0, p0, Lcom/example/plane/a;->editor:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "DATA"
const-string v2, ""
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 15
return-void
.end method
.method public c()Ljava/lang/String;
.locals 3
.prologue
.line 18
iget-object v0, p0, Lcom/example/plane/a;->editor:Landroid/content/SharedPreferences;
const-string v1, "DATA"
const-string v2, ""
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public d(Ljava/lang/String;)V
.locals 4
.param p1, "arg1" # Ljava/lang/String;
.prologue
.line 22
iget-object v0, p0, Lcom/example/plane/a;->editor:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "DATA"
new-instance v2, Ljava/lang/StringBuilder;
invoke-virtual {p0}, Lcom/example/plane/a;->c()Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v3
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 23
return-void
.end method
package com.example.plane;
import android.os.Bundle;
import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
public class FirstTest extends Cocos2dxActivity
{
static
{
System.loadLibrary("cocos2dcpp");
}
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
new a(this, "flag").d("YmF6aW5nYWFhYQ==");
new a(this, "Cocos2dxPrefsFile").d("N0");
}
public Cocos2dxGLSurfaceView onCreateView()
{
Cocos2dxGLSurfaceView localCocos2dxGLSurfaceView = new Cocos2dxGLSurfaceView(this);
new a(this, "Cocos2dxPrefsFile").d("MG");
localCocos2dxGLSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
return localCocos2dxGLSurfaceView;
}
}
.class public Lcom/example/plane/FirstTest;
.super Lorg/cocos2dx/lib/Cocos2dxActivity;
.source "FirstTest.java"
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 54
const-string v0, "cocos2dcpp"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
.line 55
return-void
.end method
.method public constructor <init>()V
.locals 0
.prologue
.line 31
invoke-direct {p0}, Lorg/cocos2dx/lib/Cocos2dxActivity;-><init>()V
return-void
.end method
# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
.locals 4
.param p1, "savedInstanceState" # Landroid/os/Bundle;
.prologue
.line 34
invoke-super {p0, p1}, Lorg/cocos2dx/lib/Cocos2dxActivity;->onCreate(Landroid/os/Bundle;)V
.line 35
const-string v0, "YmF6aW5nYWFhYQ=="
.line 36
.local v0, "flag":Ljava/lang/String;
new-instance v1, Lcom/example/plane/a;
const-string v3, "flag"
invoke-direct {v1, p0, v3}, Lcom/example/plane/a;-><init>(Landroid/content/Context;Ljava/lang/String;)V
.line 37
.local v1, "haha":Lcom/example/plane/a;
invoke-virtual {v1, v0}, Lcom/example/plane/a;->d(Ljava/lang/String;)V
.line 38
new-instance v2, Lcom/example/plane/a;
const-string v3, "Cocos2dxPrefsFile"
invoke-direct {v2, p0, v3}, Lcom/example/plane/a;-><init>(Landroid/content/Context;Ljava/lang/String;)V
.line 39
.local v2, "hehe":Lcom/example/plane/a;
const-string v3, "N0"
invoke-virtual {v2, v3}, Lcom/example/plane/a;->d(Ljava/lang/String;)V
.line 40
return-void
.end method
.method public onCreateView()Lorg/cocos2dx/lib/Cocos2dxGLSurfaceView;
.locals 8
.prologue
const/4 v1, 0x5
.line 43
new-instance v0, Lorg/cocos2dx/lib/Cocos2dxGLSurfaceView;
invoke-direct {v0, p0}, Lorg/cocos2dx/lib/Cocos2dxGLSurfaceView;-><init>(Landroid/content/Context;)V
.line 46
.local v0, "glSurfaceView":Lorg/cocos2dx/lib/Cocos2dxGLSurfaceView;
new-instance v7, Lcom/example/plane/a;
const-string v2, "Cocos2dxPrefsFile"
invoke-direct {v7, p0, v2}, Lcom/example/plane/a;-><init>(Landroid/content/Context;Ljava/lang/String;)V
.line 47
.local v7, "hehe":Lcom/example/plane/a;
const-string v2, "MG"
invoke-virtual {v7, v2}, Lcom/example/plane/a;->d(Ljava/lang/String;)V
.line 48
const/4 v2, 0x6
const/4 v4, 0x0
const/16 v5, 0x10
const/16 v6, 0x8
move v3, v1
invoke-virtual/range {v0 .. v6}, Lorg/cocos2dx/lib/Cocos2dxGLSurfaceView;->setEGLConfigChooser(IIIIII)V
.line 50
return-object v0
.end method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment