@@ -173,25 +173,30 @@ object IconHookHandler : BaseHookHandler() {
173173
174174 // 不使用自带的图标缩放, 防止在 MIUI 上出现图标白边及图标错位
175175 NewSystemUIHooker .Members .normalizeAndWrapToAdaptiveIcon.addBeforeHook {
176- val scale = instance.current()
177- .method { name = " getNormalizer" ; superClass() }.call()!! .current()
178- .method { name = " getScale" ; paramCount(4 ); superClass() }
179- .invoke<Float >(
180- args.first { it is Drawable },
181- args.first { it is RectF },
182- null ,
183- null
184- )!!
185- args(args.indexOfFirst { it is FloatArray }).cast<FloatArray >()!! [0 ] = scale
186-
187- val oriDrawable = args.first { it is Drawable } as Drawable
188- val returnType = NewSystemUIHooker .Members .normalizeAndWrapToAdaptiveIcon.returnType
189-
190- printLog(" normalizeAndWrapToAdaptiveIcon(): avoid shrink icon by system ui" )
191- result = if (returnType == AdaptiveIconDrawable ::class .java)
192- TransparentAdaptiveIconDrawable (oriDrawable)
193- else
194- oriDrawable
176+ if (Thread .currentThread().stackTrace.any { it.methodName == " makeSplashScreenContentView" }) {
177+ printLog(" normalizeAndWrapToAdaptiveIcon(): avoid shrink icon by system ui" )
178+ val boolShrinkNonAdaptiveIconsIndex = args.indexOfFirst { it is Boolean }
179+ if (boolShrinkNonAdaptiveIconsIndex != - 1 ) {
180+ args(boolShrinkNonAdaptiveIconsIndex).setFalse()
181+ } else {
182+ val scale = instance.current(ignored = true )
183+ .method { name = " getNormalizer" ; superClass() }.call()?.current()
184+ ?.method { name = " getScale" ; paramCount(4 ); superClass() }
185+ ?.invoke<Float >(
186+ args.first { it is Drawable },
187+ args.first { it is RectF },
188+ null ,
189+ null
190+ ) ? : 0.92f
191+ args(args.indexOfFirst { it is FloatArray }).cast<FloatArray >()!! [0 ] = scale
192+ val oriDrawable = args.first { it is Drawable } as Drawable
193+ val returnType = NewSystemUIHooker .Members .normalizeAndWrapToAdaptiveIcon.returnType
194+ result = if (returnType == AdaptiveIconDrawable ::class .java)
195+ TransparentAdaptiveIconDrawable (oriDrawable)
196+ else
197+ oriDrawable
198+ }
199+ }
195200 }
196201 NewSystemUIHooker .Members .createIconBitmap_BaseIconFactory.addBeforeHook {
197202 args(0 ).cast<Drawable >()?.let { drawable ->
0 commit comments