01/10/2025 10:53:00
Problem description
Xiaomi manufacturer channel frequently obtains the device information
Cause of the problem
Xiaomi vendor SDK problem.
Solution
You can refer to Solution a) or Solution b) to solve this problem.
a) Do not access Xiaomi vendor channel
You need to do the following operation:
① Remove the dependency statement implementation "com.tencent.tpns: xiaomi: $tpns_version"
.
The example is shown in the figure below:
② Delete Xiaomi vendor channel configuration in AndroidManifest.xml.
Delete the configuration pushed by Xiaomi:
<application>
<service
android:name="com.xiaomi.push.service.XMPushService"
android:enabled="true"
android:process=":pushservice" />
<service
android:name="com.xiaomi.push.service.XMJobService"
android:enabled="true"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":pushservice" />
<!-- Note: This service must be added after 3.0.1 version (including 3.0.1 version) -->
<service
android:name="com.xiaomi.mipush.sdk.PushMessageHandler"
android:enabled="true"
android:exported="true" />
<service
android:name="com.xiaomi.mipush.sdk.MessageHandleService"
android:enabled="true" />
<!-- Note: This service must be added after 2.2.5 version (including 2.2.5 version) -->
<receiver
android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver"
android:exported="true" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver
android:name="com.xiaomi.push.service.receivers.PingReceiver"
android:exported="false"
android:process=":pushservice" >
<intent-filter>
<action android:name="com.xiaomi.push.PING_TIMER" />
</intent-filter>
</receiver>
<receiver
android:exported="true"
android:name="com.tencent.android.mipush.XMPushMessageReceiver">
<intent-filter>
<action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" />
</intent-filter>
<intent-filter>
<action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" />
</intent-filter>
<intent-filter>
<action android:name="com.xiaomi.mipush.ERROR" />
</intent-filter>
</receiver>
</application>
<!-- Note: Permissions required by Xiaomi push BEGIN-->
<permission
android:name="the app's package name.permission.MIPUSH_RECEIVE"
android:protectionLevel="signature" />
<!-- Here the app's package name is changed to the package name of the current App -->
<uses-permission android:name="the app's package name.permission.MIPUSH_RECEIVE" />
<!-- Here the app's package name is changed to the package name of the current App -->
<!-- Note: Permissions required by Xiaomi push end -->
③ In MSDKConfig.ini, set XG_XIAOMI_ENABLE
to 0 so as to close Xiaomi channel support.
# TPNS Xiaomi vendor channel configuration
XG_XIAOMI_ENABLE = 0
④ Delete Xiaomi vendor channel's code obfuscation.
-keep class com.xiaomi.**{*;}
-keep public class * extends com.xiaomi.mipush.sdk.PushMessageReceiver
⑤ In case of internal access, you also need to delete the relevant 'jar' packages of Xiaomi vendor channel and directly delete the gcloudsdk-xiaomi-$version
directory.
b) If you need to access the Xiaomi manufacturer channel and solve the problem of frequently obtaining the device information.
Currently, you need to contact the TPNS side to guide you to access Xiaomi vendor channel's overseas version; the contact person is: 2000 (TEG technical support).
All rights reserved.