Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91c3b5af authored by Hai Shalom's avatar Hai Shalom
Browse files

[Passpoint] Truncate IMSI from the SimCredential toString method

Truncate IMSI from the SimCredential toString method, avoid displaying
confidential IMSI information.

Bug: 149422812
Test: dumpsys wifi - confirm result
Change-Id: I9d542bc6ff60de1a78076abe1010c0c03a5f444b
parent 1345eb11
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -738,7 +738,16 @@ public final class Credential implements Parcelable {
        @Override
        public String toString() {
            StringBuilder builder = new StringBuilder();
            builder.append("IMSI: ").append(mImsi).append("\n");
            String imsi;
            if (mImsi != null) {
                if (mImsi.length() > 6 && mImsi.charAt(6) != '*') {
                    // Truncate the full IMSI from the log
                    imsi = mImsi.substring(0, 6) + "****";
                } else {
                    imsi = mImsi;
                }
                builder.append("IMSI: ").append(imsi).append("\n");
            }
            builder.append("EAPType: ").append(mEapType).append("\n");
            return builder.toString();
        }