YUNOS2.2 TV版改变默认桌面

本文主要描述了在尝试更换YUNOS 2.2 TV版默认桌面时遇到的问题,即系统启动黑屏。通过跟踪代码发现是由于YUNOSSec231安全机制删除了第三方桌面的android.intent.category.HOME分类导致匹配失败。最终通过修改IntentFilter.java的matchCategories()方法临时解决了问题,但YUNOSSec231的具体来源仍未知。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    最近碰到了一个要换YUNOS2.2 TV版桌面的的问题。将custom\full_gs703d\tmp\@system@app-platform-false下面的AliTvHomeshell.apk删掉,换成其他桌面,发现系统启动黑屏

从startHomeActivityLocked()中慢慢定位到是intent匹配的问题

在startHomeActivityLocked()--->resolveActivityInfo()--->resolveIntent()--->queryIntentActivities()--->queryIntent()--->super.queryIntent()--->buildResolveList()里老是提示

01-01 08:03:10.330   508   508 V IntentResolver: Matching against filter ActivityIntentInfo{4256ad40 com.dy.alilauncher/.LauncherActivity}
01-01 08:03:10.330   508   508 V IntentResolver:   Filter did not match: category

什么鬼?我这桌面里的category明明是android.intent.category.HOME啊,不信看第三方桌面的manifest....



在代码中加过一堆log后logcat里的intent里的category成了

1-01 08:02:16.200   509   509 V IntentResolver: filter category matchingActivityIntentInfo{42c2cd70 com.kaiboer.gl.kiui7/.ui.WelcomeActivity}
01-01 08:02:16.200   509   509 V match mCategories: rm.android.intent.category.HOME
01-01 08:02:16.200   509   509 V match mCategories: android.intent.category.LAUNCHER
01-01 08:02:16.200   509   509 V match mCategories: android.intent.category.DEFAULT
01-01 08:02:16.200   509   509 V match mCategories: android.intent.category.MONKEY
01-01 08:02:16.200   509   509 V match categories: android.intent.category.HOME(这个是需要匹配的Intent)

我擦,多出来个rm,难怪匹配不上,什么情况?


发现系统启动时logcat里有这一行

01-01 08:03:02.660   518   518 D YUNOSSec231: mCategories is NOT @ android.content.pm.PackageParser.ActivityIntentInfo
01-01 08:03:02.660   518   518 D YUNOSSec231: mCategories is NOT @ android.content.pm.PackageParser.IntentInfo

01-01 08:03:02.660   518   518 W YUNOSSec231: Remove android.intent.category.HOME from com.dy.alilauncher
01-01 08:03:02.660   518   518 D YUNOSSec231: Get android.intent.category.DEFAULT from com.dy.alilauncher
01-01 08:03:02.660   518   518 D YUNOSSec231: Get android.intent.category.MONKEY from com.dy.alilauncher
01-01 08:03:02.660   518   518 D YUNOSSec231: mActions is NOT @ android.content.pm.PackageParser.ActivityIntentInfo

YUNOSSec231??估计是个阿里安全验证的机制,看到第三方的apk直接改了它的category了,晕,还带这样?

然后搜索源码树搜了半天也找不到YUNOSSec231,这玩意代码在什么地方?难道是二进制直接编进来的?求解。


找不到问题的根源就先用个笨办法

在IntentFilter.java的match()---->matchCategories()里加上

   <span style="font-size:14px;"> public final String matchCategories(Set<String> categories) {
        if (categories == null) {
            return null;
        }

        Iterator<String> it = categories.iterator();

        if (mCategories == null) {
            return it.hasNext() ? it.next() : null;
        }

		/**add by ninteo**/
<span style="color:#ff0000;">		if(mCategories != null) {
			for(int i=0;i < mCategories.size();i++) {
				if(mCategories.get(i).equals("rm.android.intent.category.HOME"))
					mCategories.set(i,"android.intent.category.HOME");
			}
		}</span>

        while (it.hasNext()) {
            final String category = it.next();
            if (!mCategories.contains(category)) {
                return category;
            }
        }

        return null;
    }</span>


=.=   

好吧,问题解决。不过谁告诉我YUNOSSec231在哪??

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值