-
-
[求助]该怎样改呢?
-
发表于: 2013-3-26 02:04 4580
-
.method private initEModeBitmap()V
.locals 19
.prologue
.line 1140
move-object/from16 v0, p0
iget-object v2, v0, Lcom/amigo/compass_pro/Pra1;->eModeBitmaps:[Landroid/graphics/Bitmap;
if-eqz v2, :cond_1
.line 1203
:cond_0
return-void
.line 1143
:cond_1
const/16 v2, 0x8
new-array v2, v2, [Landroid/graphics/Bitmap;
move-object/from16 v0, p0
iput-object v2, v0, Lcom/amigo/compass_pro/Pra1;->eModeBitmaps:[Landroid/graphics/Bitmap;
.line 1145
const/4 v11, 0x0
.local v11, i:I
:goto_0
const/16 v2, 0x8
if-ge v11, v2, :cond_0
.line 1147
const/4 v13, 0x0
.line 1148
.local v13, r:I
if-nez v11, :cond_7
.line 1149
const v13, 0x7f020009
.line 1165
:cond_2
:goto_1
move-object/from16 v0, p0
iget-object v2, v0, Lcom/amigo/compass_pro/Pra1;->mContext: Landroid/app/Activity;
invoke-virtual {v2}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;
move-result-object v2
invoke-static {v2, v13}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
move-result-object v1
.line 1166
.local v1, image: Landroid/graphics/Bitmap;
const-string v2, "window"
move-object/from16 v0, p0
invoke-virtual {v0, v2}, Lcom/amigo/compass_pro/Pra1;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/view/WindowManager;
invoke-interface {v2}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v8
.line 1168
.local v8, display: Landroid/view/Display;
invoke-virtual {v8}, Landroid/view/Display;->getWidth()I
move-result v16
.line 1169
.local v16, w:I
invoke-virtual {v8}, Landroid/view/Display;->getHeight()I
move-result v9
.line 1170
.local v9, h:I
move/from16 v12, v16
.line 1171
.local v12, m:I
move/from16 v0, v16
if-ge v9, v0, :cond_3
.line 1172
move v12, v9
.line 1173
:cond_3
const/16 v2, 0xf0
if-gt v12, v2, :cond_4
.line 1175
const/16 v2, 0x190
if-ge v9, v2, :cond_4
.line 1177
const/16 v12, 0xb4
.line 1182
:cond_4
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v2
int-to-float v0, v2
move/from16 v17, v0
.line 1183
.local v17, width:F
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v2
int-to-float v10, v2
.line 1184
.local v10, height:F
int-to-float v2, v12
cmpl-float v2, v17, v2
if-lez v2, :cond_5
.line 1186
int-to-float v2, v12
div-float v2, v2, v17
mul-float/2addr v10, v2
.line 1187
int-to-float v0, v12
move/from16 v17, v0
.line 1189
:cond_5
int-to-float v2, v12
cmpl-float v2, v10, v2
if-lez v2, :cond_6
.line 1191
int-to-float v2, v12
div-float/2addr v2, v10
mul-float v17, v17, v2
.line 1192
int-to-float v10, v12
.line 1194
:cond_6
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v2
int-to-float v2, v2
div-float v15, v17, v2
.line 1195
.local v15, scaleWidth:F
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v2
int-to-float v2, v2
div-float v14, v10, v2
.line 1197
.local v14, scaleHeight:F
new-instance v6, Landroid/graphics/Matrix;
invoke-direct {v6}, Landroid/graphics/Matrix;-><init>()V
.line 1198
.local v6, matrix: Landroid/graphics/Matrix;
invoke-virtual {v6, v15, v14}, Landroid/graphics/Matrix;->postScale(FF)Z
.line 1200
move-object/from16 v0, p0
iget-object v0, v0, Lcom/amigo/compass_pro/Pra1;->eModeBitmaps:[Landroid/graphics/Bitmap;
move-object/from16 v18, v0
const/4 v2, 0x0
const/4 v3, 0x0
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v4
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v5
const/4 v7, 0x1
invoke-static/range {v1 .. v7}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;
move-result-object v2
aput-object v2, v18, v11
.line 1145
add-int/lit8 v11, v11, 0x1
goto/16 :goto_0
.line 1150
.end local v1 #image: Landroid/graphics/Bitmap;
.end local v6 #matrix: Landroid/graphics/Matrix;
.end local v8 #display: Landroid/view/Display;
.end local v9 #h:I
.end local v10 #height:F
.end local v12 #m:I
.end local v14 #scaleHeight:F
.end local v15 #scaleWidth:F
.end local v16 #w:I
.end local v17 #width:F
:cond_7
const/4 v2, 0x1
if-ne v11, v2, :cond_8
.line 1151
const v13, 0x7f02000a
goto/16 :goto_1
.line 1152
:cond_8
const/4 v2, 0x2
if-ne v11, v2, :cond_9
.line 1153
const v13, 0x7f02000b
goto/16 :goto_1
.line 1154
:cond_9
const/4 v2, 0x3
if-ne v11, v2, :cond_a
.line 1155
const v13, 0x7f02000c
goto/16 :goto_1
.line 1156
:cond_a
const/4 v2, 0x4
if-ne v11, v2, :cond_b
.line 1157
const v13, 0x7f02000d
goto/16 :goto_1
.line 1158
:cond_b
const/4 v2, 0x5
if-ne v11, v2, :cond_c
.line 1159
const v13, 0x7f02000e
goto/16 :goto_1
.line 1160
:cond_c
const/4 v2, 0x6
if-ne v11, v2, :cond_d
.line 1161
const v13, 0x7f02000f
goto/16 :goto_1
.line 1162
:cond_d
const/4 v2, 0x7
if-ne v11, v2, :cond_2
.line 1163
const v13, 0x7f020010
goto/16 :goto_1
.end method
请教:以上代码要将 :cond_7 至 :cond_d 扩展至重复12次,该怎样改呢?
.locals 19
.prologue
.line 1140
move-object/from16 v0, p0
iget-object v2, v0, Lcom/amigo/compass_pro/Pra1;->eModeBitmaps:[Landroid/graphics/Bitmap;
if-eqz v2, :cond_1
.line 1203
:cond_0
return-void
.line 1143
:cond_1
const/16 v2, 0x8
new-array v2, v2, [Landroid/graphics/Bitmap;
move-object/from16 v0, p0
iput-object v2, v0, Lcom/amigo/compass_pro/Pra1;->eModeBitmaps:[Landroid/graphics/Bitmap;
.line 1145
const/4 v11, 0x0
.local v11, i:I
:goto_0
const/16 v2, 0x8
if-ge v11, v2, :cond_0
.line 1147
const/4 v13, 0x0
.line 1148
.local v13, r:I
if-nez v11, :cond_7
.line 1149
const v13, 0x7f020009
.line 1165
:cond_2
:goto_1
move-object/from16 v0, p0
iget-object v2, v0, Lcom/amigo/compass_pro/Pra1;->mContext: Landroid/app/Activity;
invoke-virtual {v2}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;
move-result-object v2
invoke-static {v2, v13}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
move-result-object v1
.line 1166
.local v1, image: Landroid/graphics/Bitmap;
const-string v2, "window"
move-object/from16 v0, p0
invoke-virtual {v0, v2}, Lcom/amigo/compass_pro/Pra1;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/view/WindowManager;
invoke-interface {v2}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v8
.line 1168
.local v8, display: Landroid/view/Display;
invoke-virtual {v8}, Landroid/view/Display;->getWidth()I
move-result v16
.line 1169
.local v16, w:I
invoke-virtual {v8}, Landroid/view/Display;->getHeight()I
move-result v9
.line 1170
.local v9, h:I
move/from16 v12, v16
.line 1171
.local v12, m:I
move/from16 v0, v16
if-ge v9, v0, :cond_3
.line 1172
move v12, v9
.line 1173
:cond_3
const/16 v2, 0xf0
if-gt v12, v2, :cond_4
.line 1175
const/16 v2, 0x190
if-ge v9, v2, :cond_4
.line 1177
const/16 v12, 0xb4
.line 1182
:cond_4
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v2
int-to-float v0, v2
move/from16 v17, v0
.line 1183
.local v17, width:F
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v2
int-to-float v10, v2
.line 1184
.local v10, height:F
int-to-float v2, v12
cmpl-float v2, v17, v2
if-lez v2, :cond_5
.line 1186
int-to-float v2, v12
div-float v2, v2, v17
mul-float/2addr v10, v2
.line 1187
int-to-float v0, v12
move/from16 v17, v0
.line 1189
:cond_5
int-to-float v2, v12
cmpl-float v2, v10, v2
if-lez v2, :cond_6
.line 1191
int-to-float v2, v12
div-float/2addr v2, v10
mul-float v17, v17, v2
.line 1192
int-to-float v10, v12
.line 1194
:cond_6
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v2
int-to-float v2, v2
div-float v15, v17, v2
.line 1195
.local v15, scaleWidth:F
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v2
int-to-float v2, v2
div-float v14, v10, v2
.line 1197
.local v14, scaleHeight:F
new-instance v6, Landroid/graphics/Matrix;
invoke-direct {v6}, Landroid/graphics/Matrix;-><init>()V
.line 1198
.local v6, matrix: Landroid/graphics/Matrix;
invoke-virtual {v6, v15, v14}, Landroid/graphics/Matrix;->postScale(FF)Z
.line 1200
move-object/from16 v0, p0
iget-object v0, v0, Lcom/amigo/compass_pro/Pra1;->eModeBitmaps:[Landroid/graphics/Bitmap;
move-object/from16 v18, v0
const/4 v2, 0x0
const/4 v3, 0x0
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v4
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v5
const/4 v7, 0x1
invoke-static/range {v1 .. v7}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;
move-result-object v2
aput-object v2, v18, v11
.line 1145
add-int/lit8 v11, v11, 0x1
goto/16 :goto_0
.line 1150
.end local v1 #image: Landroid/graphics/Bitmap;
.end local v6 #matrix: Landroid/graphics/Matrix;
.end local v8 #display: Landroid/view/Display;
.end local v9 #h:I
.end local v10 #height:F
.end local v12 #m:I
.end local v14 #scaleHeight:F
.end local v15 #scaleWidth:F
.end local v16 #w:I
.end local v17 #width:F
:cond_7
const/4 v2, 0x1
if-ne v11, v2, :cond_8
.line 1151
const v13, 0x7f02000a
goto/16 :goto_1
.line 1152
:cond_8
const/4 v2, 0x2
if-ne v11, v2, :cond_9
.line 1153
const v13, 0x7f02000b
goto/16 :goto_1
.line 1154
:cond_9
const/4 v2, 0x3
if-ne v11, v2, :cond_a
.line 1155
const v13, 0x7f02000c
goto/16 :goto_1
.line 1156
:cond_a
const/4 v2, 0x4
if-ne v11, v2, :cond_b
.line 1157
const v13, 0x7f02000d
goto/16 :goto_1
.line 1158
:cond_b
const/4 v2, 0x5
if-ne v11, v2, :cond_c
.line 1159
const v13, 0x7f02000e
goto/16 :goto_1
.line 1160
:cond_c
const/4 v2, 0x6
if-ne v11, v2, :cond_d
.line 1161
const v13, 0x7f02000f
goto/16 :goto_1
.line 1162
:cond_d
const/4 v2, 0x7
if-ne v11, v2, :cond_2
.line 1163
const v13, 0x7f020010
goto/16 :goto_1
.end method
请教:以上代码要将 :cond_7 至 :cond_d 扩展至重复12次,该怎样改呢?
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
看原图
赞赏
雪币:
留言: