zoukankan      html  css  js  c++  java
  • 查看Android应用包名、Activity的几个方法

    一、没有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>   
  • 相关阅读:
    html页面特效代码大全
    ASP.NET中个文件夹功能
    A project with an Output Type of Class Library cannot be started directly
    Chapter10“I/O设备的同步和异步”之I/O设备同步操作
    c c++ 文件操作
    linux find 文件夹下查找字符串
    c c++ sizeof
    c socket编程
    c fcntl函数
    read write 返回值
  • 原文地址:https://www.cnblogs.com/feiyueNotes/p/7896050.html
Copyright © 2011-2022 走看看