1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
| .method private createBadgeCode()Ljava/lang/String; // Date now = New Date(); new-instance v2,java/util/Date invoke-direct {v2},java/util/Date/ ; ()V
// SimpleDateFormat dateFormat = new SimpleDateFormat(“yyMMddhhmm”); new-instance v5,java/text/SimpleDateFormat const-string v7,”yyMMddhhmm” invoke-direct {v5,v7},java/text/SimpleDateFormat/ ; (Ljava/lang/String;)V
// StringBuilder raw = new StringBuilder(); new-instance v7,java/lang/StringBuilder invoke-direct {v7},java/lang/StringBuilder/ ; ()V
// raw.append(dateFormat.format(now)); invoke-virtual {v5,v2},java/text/SimpleDateFormat/format ; format(Ljava/util/Date;)Ljava/lang/String; move-result-object v8 invoke-virtual {v7,v8},java/lang/StringBuilder/append ; append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7
// raw.append(difficulty); iget v8,v12,tx/games/atd_world.difficulty I invoke-virtual {v7,v8},java/lang/StringBuilder/append ; append(I)Ljava/lang/StringBuilder; move-result-object v7
// raw.append(“tensaix2j”); const-string v8,”tensaix2j” invoke-virtual {v7,v8},java/lang/StringBuilder/append ; append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7
// Bytes[] rawbytes = raw.toString.getBytes; invoke-virtual {v7},java/lang/StringBuilder/toString ; toString()Ljava/lang/String; move-result-object v4 invoke-virtual {v4},java/lang/String/getBytes ; getBytes()[B move-result-object v0
/* Below code refined; int sum = 0;
for(int i = 0; i < rawbytes.length(); i++) sum += rawbytes[i]; */ const/4 v6,0 const/4 v3,0 l3c1e: // length = rawbytes.length(); array-length v7
// if( v3 > v7 ) goto: l3c30 if-ge v3,v7,l3c30
// v7 = rawbytes(v0); aget-byte v7,v0,v3
// v6 += v7; add-int/2addr v6,v7
// v3 ++; add-int/lit8 v3,v3,1 goto l3c1e
l3c30:
// StringBuilder badge = new StringBuilder(); new-instance v7,java/lang/StringBuilder invoke-direct {v7},java/lang/StringBuilder/ ; ()V
// v8 = Math.random(); invoke-static {},java/lang/Math/random ; random()D nop move-result-wide v8
// v10 = 4652007308841189376; const-wide v10,4652007308841189376 ; 0x408f400000000000
// v8 = Math.round(v8*v10); mul-double/2addr v8,v10
// I thought it only took one variable?? invoke-static {v8,v9},java/lang/Math/round ; round(D)J move-result-wide v8
// v10 = 1000 const-wide/16 v10,1000
// v8 += v10; add-long/2addr v8,v10
// badge.append(v8); invoke-virtual {v7,v8,v9},java/lang/StringBuilder/append ; append(J)Ljava/lang/StringBuilder; move-result-object v7
// badge.append(dateFormat.format(now)); invoke-virtual {v5,v2},java/text/SimpleDateFormat/format ; format(Ljava/util/Date;)Ljava/lang/String; move-result-object v8 invoke-virtual {v7,v8},java/lang/StringBuilder/append ; append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7
// badge.append(difficulty); iget v8,v12,tx/games/atd_world.difficulty I invoke-virtual {v7,v8},java/lang/StringBuilder/append ; append(I)Ljava/lang/StringBuilder; move-result-object v7
// badge.append(sum); invoke-virtual {v7,v6},java/lang/StringBuilder/append ; append(I)Ljava/lang/StringBuilder; move-result-object v7
// return badge.toString(); invoke-virtual {v7},java/lang/StringBuilder/toString ; toString()Ljava/lang/String; move-result-object v1 return-object v1 .end method
|