getsentry / getsentry/sentry-java

isSideLoaded issue tag on Android not working as expected

未关闭
#1,906 17 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
Android Errors Improvement
主要语言
Kotlin
星标
1.4k
派生
478
平均合并
2 天 23 小时
30 天内合并 PR
67

描述

The `isSideLoaded` tag for Android displays `false` even for sideloaded apps (apps installed directly from the APK):

![image](https://user-images.githubusercontent.com/11064768/153629916-df6aa7ae-9e6d-4461-af43-6819246a1871.png)

Here the `installerStore` tag shows the app was installed by `com.android.packageinstaller`, which is the system app used when installing an APK manually, and yet `isSideLoaded` shows `false`.

@marandaneto identified the Android documentation is misleading here: https://developer.android.com/reference/android/content/pm/PackageManager#getInstallerPackageName(java.lang.String)
It says "Retrieve the package name of the application that installed a package. This identifies which market the package came from."
The first sentence is true, the second is not, since not all installer apps are "markets".

Ultimately I don't think the `isSideLoaded` tag is useful even with this fixed, since it's not really defined what "sideloaded" means. Even when the app is actually installed from a market, there are shady market apps that rehost apps copied from Google Play. And apps installed from them are definitely "installed from a store/market", but the information useful for the app developer is that it was installed from an unofficial source, even though it was not technically "sideloaded" (or was it? where is the line?).

What I would propose as the actual fix:
- Remove the `isSideLoaded` tag: it doesn't provide any information not already visible in the `installerStore` tag
- Rename `installerStore` to `installer`: it's not always a store
- Use the red highlight (as visible in `isSideLoaded: false` on the screenshot) on the `installer` tag, when it doesn't contain one of the reputable stores (Google Play, Samsung Galaxy Store, Amazon Appstore)
- Show the `installer` as `none` when none

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。