是否有所有 Android 手机构造函数的所有股票消息应用程序包名称的列表?

发布于 2024-12-19 17:43:19 字数 35 浏览 0 评论 0原文

或者,有没有一种简单的方法可以知道系统应用程序的包名称?

Alternatvely, is there an easy way to know the package name of a system app ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

握住你手 2024-12-26 17:43:19

我刚刚正在开发一个应用程序储物柜,其中有一个重要应用程序类别,可供用户锁定它们。
显然,默认短信应用程序是需要锁定的重要应用程序。
所以我创建了自己的默认短信应用程序包名称列表。
我希望这对您和其他人有所帮助,帮助我改进此列表:

"com.google.android.apps.messaging"
"com.jb.gosms"
"com.concentriclivers.mms.com.android.mms"
"fr.slvn.mms"
"com.android.mms"
"com.sonyericsson.conversations"
"com.samsung.android.messaging"

I just was Developing an App locker that have a category for important app to offer user to lock them.
and obviously default SMS app is important app to lock.
so i create my own list of default sms apps package name.
I hope this will be helpful for you and others help me to improve this list:

"com.google.android.apps.messaging"
"com.jb.gosms"
"com.concentriclivers.mms.com.android.mms"
"fr.slvn.mms"
"com.android.mms"
"com.sonyericsson.conversations"
"com.samsung.android.messaging"
Hello爱情风 2024-12-26 17:43:19

你到底想做什么?
或者,为什么需要这样的列表?

作为一般建议,您不应根据静态列表编写任何代码,因为与此列表相关的任何内容都可能会发生变化。

What are you exactly trying to do?
Alternatively, why do you need such a list ?

As a general advice, you shouldn't code anything according to a static list, because anything related to this list is likely to evolve.

风吹雪碎 2024-12-26 17:43:19

ya you can get

public class ListofAppinMyDevice {
    public class PInfo {   
        public String appname = "";   
        public String pname = "";   
        public String versionName = "";   
        public int versionCode = 0;   
    }   

    public ArrayList<PInfo> getInstalledApps(boolean getSysPackages) 
    {   
    ArrayList<PInfo> res = new ArrayList<PInfo>();        

    List<PackageInfo> packs = AppUtils.mContext.getPackageManager().getInstalledPackages(0);   
    for(int i=0;i<packs.size();i++) {   
        PackageInfo p = packs.get(i);

        ApplicationInfo s=p.applicationInfo;

        if(((s.flags & ApplicationInfo.FLAG_SYSTEM)!=1))
        {

        PInfo newInfo = new PInfo();

        newInfo.appname = p.applicationInfo.loadLabel(AppUtils.mContext.getPackageManager()).toString();   
        newInfo.pname = p.packageName;   
        newInfo.versionName = p.versionName;   
        newInfo.versionCode = p.versionCode;   
         System.out.println("3rd party apps-------------------"+p.packageName +"--------"+newInfo.appname);
        res.add(newInfo);  
        }

        if ((!getSysPackages) ) {   
            continue ;   
        }   

    }   
    return res;    
}  

}

//你可以使用下面的方法获取系统安装的应用程序

  public static void listPackages() {   
            ListofAppinMyDevice getmyApp=new ListofAppinMyDevice();

            apps =getmyApp.getInstalledApps(true); 
/* false = will get 3rd part package detials 
true -will get all system packages */  
            System.out.println("Total InstalledApps in your device--=="+apps.size());
            final int max = apps.size();   
            applist=new StringBuilder();
            for (int i=0; i<max; i++) {   
                String packageName=apps.get(i).pname;


    }

ya you can get

public class ListofAppinMyDevice {
    public class PInfo {   
        public String appname = "";   
        public String pname = "";   
        public String versionName = "";   
        public int versionCode = 0;   
    }   

    public ArrayList<PInfo> getInstalledApps(boolean getSysPackages) 
    {   
    ArrayList<PInfo> res = new ArrayList<PInfo>();        

    List<PackageInfo> packs = AppUtils.mContext.getPackageManager().getInstalledPackages(0);   
    for(int i=0;i<packs.size();i++) {   
        PackageInfo p = packs.get(i);

        ApplicationInfo s=p.applicationInfo;

        if(((s.flags & ApplicationInfo.FLAG_SYSTEM)!=1))
        {

        PInfo newInfo = new PInfo();

        newInfo.appname = p.applicationInfo.loadLabel(AppUtils.mContext.getPackageManager()).toString();   
        newInfo.pname = p.packageName;   
        newInfo.versionName = p.versionName;   
        newInfo.versionCode = p.versionCode;   
         System.out.println("3rd party apps-------------------"+p.packageName +"--------"+newInfo.appname);
        res.add(newInfo);  
        }

        if ((!getSysPackages) ) {   
            continue ;   
        }   

    }   
    return res;    
}  

}

//you can get the system installed app by using this below method

  public static void listPackages() {   
            ListofAppinMyDevice getmyApp=new ListofAppinMyDevice();

            apps =getmyApp.getInstalledApps(true); 
/* false = will get 3rd part package detials 
true -will get all system packages */  
            System.out.println("Total InstalledApps in your device--=="+apps.size());
            final int max = apps.size();   
            applist=new StringBuilder();
            for (int i=0; i<max; i++) {   
                String packageName=apps.get(i).pname;


    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文