{"record":{"id":"ce1cf749419a93ce","repo":"microg/GmsCore","slug":"missing-package-name-ce1cf7","errorCode":null,"errorMessage":"Missing package name","messagePattern":"Missing package name","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-core/src/main/kotlin/com/google/android/gms/locationsharingreporter/service/LocationSharingReporterApiService.kt","lineNumber":74,"sourceCode":"\nprivate const val TAG = \"LocationSharingReporter\"\nval FEATURES = arrayOf(\n        Feature(\"LOCATION_SHARING_REPORTER\", 2),\n        Feature(\"LOCATION_SHARING_REPORTER_SYNC\", 1),\n        Feature(\"PERIODIC_LOCATION_SHARING_REPORTER\", 1),\n        Feature(\"START_LOCATION_REPORTING\", 1),\n        Feature(\"STOP_LOCATION_REPORTING\", 1),\n        Feature(\"GET_REPORTING_ISSUES\", 1),\n        Feature(\"UPDATE_NOTICE_STATE\", 1),\n        Feature(\"LOCATION_SHARING\", 1),\n)\n\nclass LocationSharingReporterApiService : BaseService(TAG, GmsService.LOCATION_SHARING_REPORTER) {\n\n    override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService?) {\n        Log.d(TAG, \"handleServiceRequest: $request\")\n        val callingPackageName = PackageUtils.getAndCheckCallingPackage(this, request.packageName)\n                ?: throw IllegalArgumentException(\"Missing package name\")\n        PackageUtils.assertGooglePackagePermission(this, GooglePackagePermission.REPORTING)\n        ProfileManager.ensureInitialized(this)\n        callback.onPostInitCompleteWithConnectionInfo(\n                CommonStatusCodes.SUCCESS,\n                LocationSharingReporterApiServiceImpl(this, lifecycle).asBinder(),\n                ConnectionInfo().apply { features = FEATURES }\n        )\n    }\n\n    override fun onDestroy() {\n        Log.d(TAG, \"onDestroy: \")\n        super.onDestroy()\n    }\n}\n\nclass LocationSharingReporterApiServiceImpl(\n        val context: Context,\n        override val lifecycle: Lifecycle","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-core/src/main/kotlin/com/google/android/gms/locationsharingreporter/service/LocationSharingReporterApiService.kt#L56-L92","documentation":"LocationSharingReporterApiService.handleServiceRequest throws IllegalArgumentException(\"Missing package name\") when PackageUtils.getAndCheckCallingPackage returns null — i.e. the calling package could not be resolved or does not match the declared packageName in the GetServiceRequest.","triggerScenarios":"A client binds to the location sharing reporter GMS service with a GetServiceRequest whose packageName is null/empty, or the calling UID has no resolvable package (spoofed/mismatched request).","commonSituations":"Misconfigured client library versions sending an unset packageName, or malicious/broken apps impersonating another package when binding to microG services.","solutions":["Ensure the client passes its own package name in GetServiceRequest.packageName when connecting","Update the client's play-services location library to a version that sets packageName correctly","Check that the calling app is properly installed and its UID resolves to a package","Wrap service binding in error handling; the IllegalArgumentException aborts the connection by design"],"exampleFix":"// before\nval request = GetServiceRequest().apply { /* packageName not set */ }\n// after\nval request = GetServiceRequest().apply { packageName = context.packageName }","handlingStrategy":"validation","validationCode":"val request = GetServiceRequest().apply { packageName = context.packageName }\nrequire(request.packageName?.isNotBlank() == true) { \"packageName must be set\" }","typeGuard":null,"tryCatchPattern":"try {\n    bindServiceWithRequest(request)\n} catch (e: IllegalArgumentException) {\n    Log.w(TAG, \"service request rejected\", e)\n}","preventionTips":["Always set packageName to the calling app's own package in GetServiceRequest","Keep client play-services libraries updated so packageName is populated","Never spoof another package name when binding to GMS services"],"tags":["android","ipc","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}