查看Android應用程式套件名、Activity的幾個方法

來源:互聯網
上載者:User

標籤:csdn   port   查看   raw   ref   apk   get   blog   idm   

一、沒有apk,應用已經安裝到手機或虛擬機器中

1.手機有安裝GT,開啟可以看到包名:

 

 

2.logcat

.清除logcat內容,使用命令adb logcat -c

.啟動logcat,使用命令adb logcat ActivityManager:I *:s

.啟動要查看的程式,

 

2.dumpsys

(1)啟動要查看的程式;

(2)命令列輸入:adb shell dumpsys window w |findstr \/ |findstr name=

 

補充:使用adb shell dumpsys window | findstr mCurrentFocus  命令查看當前啟動並執行包名和Activity更清晰一些。

 

 

 

二、只有Apk的情況

(1)aapt

使用命令列aapt dump xmltree ColaBox.apk AndroidManifest.xml

 

(2)使用apktool

使用反編譯工具apktool,反編譯後開啟AndroidManifest.xml檔案,尋找方式同“有源碼情況”

 

(3)aapt

aapt dump badging D:\**.apk

地址:http://blog.csdn.net/zhubaitian/article/details/38926679

 

 

三、有源碼情況

直接開啟AndroidManifest.xml檔案,找到包含android.intent.action.MAIN和android.intent.category.LAUNCHER對應的activity。

如中第三行package為com.cola.ui,第七行主Activity為com.cola.ui.ColaBox(.ColaBox為Activity簡寫方式)。

 

 

[html] view plain copy 
    1. <?xml version="1.0" encoding="utf-8"?>  
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
    3.       package="com.cola.ui"  
    4.       android:versionCode="1"  
    5.       android:versionName="1.0.0">  
    6.     <application android:icon="@drawable/icon" android:label="@string/app_name">  
    7.         <activity android:name=".ColaBox"  
    8.                   android:label="@string/app_name">  
    9.             <intent-filter>  
    10.                 <action android:name="android.intent.action.MAIN" />  
    11.                 <category android:name="android.intent.category.LAUNCHER" />  
    12.             </intent-filter>  
    13.         </activity>  
    14.     <activity android:name="Frm_Addbills"></activity>  
    15.     <activity android:name="Frm_Editacctitem"></activity>  
    16.     <activity android:name="Grid_bills"></activity>  
    17.     <service android:name="LocalService" android:exported="true" android:enabled="true"/>   
    18.   
    19.    </application>  
    20.  <uses-permission android:name="android.permission.READ_CONTACTS" />  
    21.    
    22.    
    23. </manifest>   

查看Android應用程式套件名、Activity的幾個方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.