Skip to content

Commit b429ead

Browse files
committed
feat(app): prevent SDK starts
Signed-off-by: Trumeet <[email protected]>
1 parent 70de7bd commit b429ead

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/src/main/java/moe/yuuta/mipushtester/MainFragment.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ public void handleToggleRegister (View v) {
116116
} else {
117117
XLog.i("Unregistering");
118118
MiPushClient.unregisterPush(requireContext());
119+
requireContext().getSharedPreferences("mipush", Context.MODE_PRIVATE)
120+
.edit()
121+
// It will check if all settings are valid. If it's invalid, it won't register.
122+
.putString("devId", null)
123+
.apply();
119124
mRegistrationStatus.registered.set(false);
120125
}
121126
}

app/src/main/java/moe/yuuta/mipushtester/status/RegistrationStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private RegistrationStatus(@NonNull Context context) {
3030

3131
public void fetchStatus (@NonNull Context context) {
3232
useMIUIPush.set(MiPushClient.shouldUseMIUIPush(context));
33-
// FIXME: It will start push, we should prevent it
33+
// It will register push
3434
regId.set(MiPushClient.getRegId(context));
3535
// SDK will detect it's registered or not. Only registered client will return a non-null value.
3636
// The detection code is optimized, the best way is to use public APIs.

0 commit comments

Comments
 (0)