指令集学习

来源:互联网 发布:网络语言不规范原因 编辑:程序博客网 时间:2024/06/14 00:07
--------------------------------------------------------------------------------------------
AllAppsList.java   


removePackage


014038: 7210 fb07 0100                         |0002: invoke-interface {v1}, Ljava/util/List;.size:()I // method@07fb
01403e: 0a04                                   |0005: move-result v4
014040: 1215                                   |0006: const/4 v5, #int 1 // #1
014042: 9102 0405                              |0007: sub-int v2, v4, v5
014046: 3a02 2300                              |0009: if-ltz v2, 002c // +0023
01404a: 7220 f807 2100                         |000b: invoke-interface {v1, v2}, Ljava/util/List;.get:(I)Ljava/lang/Object; // method@07f8
014050: 0c03                                   |000e: move-result-object v3
014052: 1f03 0f01                              |000f: check-cast v3, Lcom/android/launcher2/ApplicationInfo; // class@010f




for (int i = data.size() - 1; i >= 0; i--)


sub-int v2, v4, v5  --------> int i = data.size() - 1   v4(data.size())  v5(1)
if-ltz v2, 002c  -------->  v2 小于0
add-int/lit8 v2, v2, #int -1 --------> i--


-------------


 |0045: invoke-interface {v5}, Ljava/util/List;.size:()I // method@07fb
014158: 0a02                                   |0048: move-result v2
01415a: 1203                                   |0049: const/4 v3, #int 0 // #0
01415c: 3523 3700                              |004a: if-ge v3, v2, 0081 // +0037
      
  for (int i = 0; i < count; i++) 


 |006c: add-int/lit8 v3, v3, #int 1 // #01
--------------------------------------------------------------------------------------------
 |0000: invoke-virtual {v5}, Landroid/graphics/Bitmap;.getWidth:()I // method@00e6
0142aa: 0a03                                   |0003: move-result v3
0142ac: 6e10 e500 0500                         |0004: invoke-virtual {v5}, Landroid/graphics/Bitmap;.getHeight:()I // method@00e5
0142b2: 0a04                                   |0007: move-result v4


0142b4: b243                                   |0008: mul-int/2addr v3, v4
0142b6: da02 0304                              |0009: mul-int/lit8 v2, v3, #int 4 // #04


v2-------->size
  int size = bitmap.getWidth() * bitmap.getHeight() * 4;
--------------------------------------------------------------------------------------------
 |000d: iget v7, v13, Lcom/android/launcher2/BubbleTextView;.mRight:I // field@02a7
014796: 52d8 a202                              |000f: iget v8, v13, Lcom/android/launcher2/BubbleTextView;.mLeft:I // field@02a2
01479a: b187                                   |0011: sub-int/2addr v7, v8
------------------>  v7-v8
--------------------------------------------------------------------------------------------
reg=4 scrollX I 
reg=5 scrollY I 
or-int v7, v4, v5------>  if ((scrollX | scrollY) == 0) 
neg-int v7, v4 --------》 v4的负数付给V7
mul-int v4, v0, v8-------》 v0 * v8 =v4
sub-int v5, v0, v6------->  v0 - v6 = v5
add-int/2addr v4, v5       v4= v4+v5


 |0064: cmp-long v0, v2, v4                   
 |0066: if-gez v0, 0073 ----->  如果v0为true则走0073


 if (v2 < v4) 
--------------------------------------------------------------------------------------------
01a584: 6e10 890a 0100                         |001c: invoke-virtual {v1}, Ljava/io/File;.list:()[Ljava/lang/String; // method@0a89
01a58a: 0c03                                   |001f: move-result-object v3
01a58c: 2134                                   |0020: array-length v4, v3
01a58e: 1205                                   |0021: const/4 v5, #int 0 // #0
01a590: 3445 0300                              |0022: if-lt v5, v4, 0025 // +0003
01a594: 0e00                                   |0024: return-void
01a596: 4602 0305                              |0025: aget-object v2, v3, v5
 |0027: new-instance v0, Ljava/io/File; // class@01d7
01a59e: 7020 840a 2000                         |0029: invoke-direct {v0, v2}, Ljava/io/File;.<init>:(Ljava/lang/String;)V // method@0a84
01a5a4: 6e10 860a 0000                         |002c: invoke-virtual {v0}, Ljava/io/File;.exists:()Z // method@0a86
01a5aa: 0a06                                   |002f: move-result v6
01a5ac: 3806 0500                              |0030: if-eqz v6, 0035 // +0005
01a5b0: 6e10 850a 0000                         |0032: invoke-virtual {v0}, Ljava/io/File;.delete:()Z // method@0a85
01a5b6: d805 0501                              |0035: add-int/lit8 v5, v5, #int 1 // #01
01a5ba: 28eb                                   |0037: goto 0022 // -0015


for (String s : file.list()) {
f = new File(s);
if (f.exists())
f.delete();
}