Skip to content

[Bug]: App adds plus sign to short numbers #114

Description

@bober757

Checklist

  • I have read the application docs, searched existing issues and discussions and this is not a duplicate
  • I am using the latest version of the project
  • I am reporting an issue with ShizuCallRecorder itself, NOT an issue about Shizuku or another app

ShizuCallRecorder Version

1.3.3

Shizuku Version

13.7.0-thedjchi

Android Version

Android 15

The model of your device

Tecno camon 30

Explain the bug

App adds plus sign to call records with short numbers like 1888

Steps to Reproduce

Call 1888
Record call
Get +1888 in filename of recording

Activity

  1. kitsumed commented on Aug 31, 2026

    @kitsumed
    Owner

    I managed to replicate it, but you deleted the logs which make it harder to locate exactly where the issue is and what your phone received as data. I have an idea of it but would prefer still having the logs.

    Update: Using ShortNumberInfo did not work. (This may be because they hard-coded the metadata path compared to the main until and do not allow us to overwrite it)

  2. self-assigned this
    on Aug 31, 2026
  3. added this to the 2.0.0 milestone on Aug 31, 2026
  4. kitsumed commented on Aug 31, 2026

    @kitsumed
    Owner

    I fixed this. But it will be in the v2 rework as my current branch is on there, so I won't commit it right now.

    For the record, here is the fix in the Phone parsing lib

            return@withContext try {
                val parsedNumber = phoneUtil.parse(rawNumber, defaultRegion.uppercase())
                // If the parsed number is valid in the selected region, return it. If not, attempt to make it international by adding a leading '+'.
                if (phoneUtil.isValidNumber(parsedNumber)) {
                    parsedNumber
                } else {
                    // Prepend "+" and tell the library that it NEED to parse it as international ("ZZ" region code).
                    val internationalNumberStr = if (rawNumber.startsWith("+")) rawNumber else "+$rawNumber"
                    AppLogger.v("Parsed number ($rawNumber) is invalid in region ($defaultRegion), attempting to parse as international: $internationalNumberStr")
                    val parsedInternationalNumber = phoneUtil.parse(internationalNumberStr, "ZZ")
                    if (phoneUtil.isValidNumber(parsedInternationalNumber)) {
                        AppLogger.v("Successfully parsed as international number: $parsedInternationalNumber")
                        return@withContext parsedInternationalNumber
                    }
                    AppLogger.v("Parsed international number ($parsedInternationalNumber) is also invalid, returning null.")
                    return@withContext null
                }
            } catch (e: Exception) {
                AppLogger.e( "Error parsing phone number: ${e.message}", e)
                null
            }

    Basically, we now check if the parsed international number is valid phoneUtil.isValidNumber(parsedInternationalNumber), 1888 was getting parsed as +1 888, but it is not valid, so now this no longer happens. This also preserve the current workaround of trying international when the main app omits the + that tell us it's international.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions