简体   繁体   English

Android:在我们的应用程序的预安装版本中寻找一种解锁隐藏功能的方法

[英]Android: Looking for a method to unlock hidden features in pre-installed version of our app

I am afraid this question is a bit more open ended but I hope this is justified by the fact that the situation is a bit unusual...恐怕这个问题有点开放,但我希望这是有道理的,因为情况有点不寻常......

What we want to achieve我们想要达到的目标

One of our apps will be pre-installed on upcoming Android phones distributed by a mobile carrier.我们的一款应用程序将预装在即将由移动运营商分发的 Android 手机上。 However, in that pre-installed app some features should be unlocked that are not otherwise (for users who have installed the app from the Google Play Store) available.但是,在该预安装的应用程序中,应该解锁一些原本不可用的功能(对于从 Google Play 商店安装应用程序的用户)。 Something like an extended free trial period for a new paid subscription, for example.例如,为新的付费订阅延长免费试用期。

What we've come up with so far到目前为止我们已经提出了什么

One option would of course be a special build of the app that enables the hidden features through some feature toggle.一种选择当然是应用程序的特殊构建,通过某些功能切换启用隐藏功能。 However, this special build would possibly be overwritten by an automatic update from the Play Store before the user has ever even opened the app.然而,这个特殊的构建可能会在用户打开应用程序之前被 Play 商店的自动更新覆盖。

So our best guess so far is to pre-install both the normal build of our main app AND some other app with no or minimal UI.所以到目前为止,我们最好的猜测是预安装我们的主应用程序的正常版本和其他一些没有或只有极少 UI 的应用程序。 The main app would then detect the presence of that other key app (through the package manager) and unlock the hidden features based on that.然后,主应用程序将检测到其他关键应用程序的存在(通过 package 管理器)并基于此解锁隐藏的功能。

AFAICT this was the way that free trials for paid apps were handled before Google In App Purchases supported non-consumable one-time products. AFAICT 这是在 Google In App Purchases 支持非消耗性一次性产品之前处理付费应用程序免费试用的方式。 And it should also still work as far as both apps are signed with the same key and, starting with Android 11, the main app declares the key in the AndroidManifest.xml .只要两个应用程序都使用相同的密钥签名,它也应该仍然有效,并且从 Android 11 开始,主应用程序在AndroidManifest.xml中声明密钥。

Correct so far?到目前为止正确吗?

But...但...

Ideally the hidden features should only be able to be consumed once per device , ie the user should be able to claim the extended free trial only for one new subscription - and not for additional ones for their neighbour and their dog.理想情况下,每个设备只能使用一次隐藏的功能,即用户应该只能为一个新订阅申请延长免费试用期,而不是为他们的邻居和他们的狗申请额外的免费试用期。

This is not a very strong requirement, so we were thinking of adding some communication between the main and key apps and that the key app would store the fact that the benefit had been claimed before.这不是一个非常强的要求,因此我们正在考虑在应用程序和关键应用程序之间添加一些通信,并且关键应用程序将存储之前已声明该好处的事实。 Of course, this could probably be circumvented by deleting the app data of the key app but it's better than nothing...当然,这可能可以通过删除关键应用程序的应用程序数据来规避,但总比没有好......

So, questions:所以,问题:

  • Is there a way to mostly/completely hide the key app from the user?有没有办法大部分/完全隐藏用户的关键应用程序 So that the function of the key app would at least be somewhat obscured?这样关键应用程序的 function 至少会有些模糊?
  • Is there any other method we are overlooking?还有其他我们忽略的方法吗? Like, is there a way to set some kind of global variable in an Android image that the carrier could set for us - like com.exampleapp.unlock.hiddenfeature1 = true ?就像,有没有办法在运营商可以为我们设置的 Android 图像中设置某种全局变量 - 比如com.exampleapp.unlock.hiddenfeature1 = true - and which we could query instead of checking for the presence of the key app ? - 我们可以查询哪个而不是检查关键应用程序的存在? This would probably still be susceptible to multiple uses but maybe there'd be a way to prohibit that, too?这可能仍然容易受到多种用途的影响,但也许也有办法禁止这种情况?

What else?还有什么?

From a technical standpoint, an obvious method would be to query the IMEI of the device (maybe for a pre-installed app that would still be possible?) and then either compare that to a list of eligible devices or at least keep track of the IMEIs for which the hidden feature had been claimed.从技术角度来看,一个明显的方法是查询设备的 IMEI(也许对于仍然可能的预安装应用程序?),然后将其与符合条件的设备列表进行比较,或者至少跟踪已声明隐藏功能的 IMEI。 But, of course, for data privacy reasons that's not possible.但是,当然,出于数据隐私的原因,这是不可能的。

So, I hope I made our goals clear and am very grateful for any advice, suggestions and input!所以,我希望我明确了我们的目标,非常感谢任何建议、建议和意见!

Context语境

  • Pre-Installed-App: PIA预装应用程序: PIA
  • Google-Play App: GPA . Google-Play 应用程序: GPA

Problems问题

  • PIA being a "Flavor" PIA是一种“风味”
  • PIA leveraging "Shared Preferences" to leave marks the GPA app can "pick up" PIA 利用“共享偏好”留下 GPA 应用程序可以“拾取”的标记
  • Any other form of "common ground".任何其他形式的“共同点”。

The issue(s) with these is that you cannot avoid the various scenarios where this would fail, notably if the user never opens your app before it's replaced by a GPA update, or a simple SharedPreferences cleanup / reinstall.这些问题是您无法避免失败的各种情况,特别是如果用户在被 GPA 更新或简单的 SharedPreferences 清理/重新安装之前从未打开您的应用程序。

Ideas?想法?

Ideas are cheap, so take all of this with a grain of salt.想法很便宜,所以对所有这些都持保留态度。 I'm mostly thinking out loud because I find it to be an interesting problem.我主要是在大声思考,因为我发现这是一个有趣的问题。

  1. Have you considering some form of Licencing ?您是否考虑过某种形式的Licencing Eg: using the Google Play licencing例如:使用 Google Play许可

  2. Could a form ofdynamic delivery help you here?一种动态交付形式可以帮助您吗?

  3. How about Having a PIA that is just a launcher for a special flavor of your app?让一个 PIA 只是一个启动器来启动您的应用程序的特殊风格怎么样? (that the user can get via Instant apps ? The PIA won't be updated by the GPA because it won't be touched (and if it is, it's only touched by you, and yes, users could do it again, but then you'd be fighting about the impossible). You will have to accept that some users will "cheat". But by using the PlayStore and all these "features" you can always control much more stuff. Not sure if the Play store is something these new devices will have or not. (用户可以通过即时应用程序获得?PIA 不会被 GPA 更新,因为它不会被触及(如果是,它只会被你触及,是的,用户可以再做一次,但随后你会为不可能的事情而战)。你将不得不接受一些用户会“作弊”。但是通过使用 PlayStore 和所有这些“功能”,你总是可以控制更多的东西。不确定 Play 商店是否是什么东西这些新设备将有或没有。

  4. Short of all this, you're going to have to handle this server-side yourself.除此之外,您将不得不自己处理这个服务器端。 Having an app where users "register" or request the trial, and take it from there.拥有一个用户“注册”或请求试用的应用程序,然后从那里获取。

I can't think of other ideas at this time.目前我想不出其他的想法。

I am not hunting for rep, feel free to pick a better response, but let us know what you chose to do.我不是在寻找代表,请随意选择更好的回应,但请告诉我们您选择做什么。 ;) ;)

Umm, let me see if I understood you correctly.嗯,让我看看我是否理解正确。

You have this app on Google Play, and the same package will also be pre-installed on some devices.您在 Google Play 上有这个应用程序,并且相同的 package 也将预装在某些设备上。 I assume you can control as to how this app is going to be installed on the devices.我假设您可以控制如何在设备上安装此应用程序。 Meaning: The pre-installed ones will be a system app that cannot be removed from the phone.含义:预装的将是无法从手机中删除的系统应用程序 And, if you download it from the play store as an update where the app was pre-installed already on that device, it will remain as a system app.而且,如果您从 Play 商店下载它作为该设备上已经预安装了该应用程序的更新,它将保留为系统应用程序。

You can basically tell which version of the app is installed on any device, with a basic check of this:您基本上可以通过基本检查来判断任何设备上安装了哪个版本的应用程序:

boolean isSystemApp = (getApplicationInfo() & ApplicationInfo.FLAG_SYSTEM) != 0

This simple call should tell you whether the app is pre-installed to the device or not.这个简单的调用应该告诉您应用程序是否已预安装到设备中。 It's also not changed even if the user receives an update afterwards.即使用户之后收到更新,它也不会改变。 If this flag is false, you can simply assume it's either side-loaded or installed from Google Play Store (without having it as pre-installed I mean).如果此标志为假,您可以简单地假设它是侧面加载的或从 Google Play 商店安装的(我的意思是没有预先安装它)。

You can open the features if the app is a system app, and close it otherwise.如果应用程序是系统应用程序,您可以打开这些功能,否则将其关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为常规和预安装的应用发布android更新版本的应用 - How to release android update version of app for regular and pre-installed app Android-预先安装的应用程式已停止由3.7.13版的Google Play更新 - Android - Pre-installed app stopped being updated by Google Play on version 3.7.13 如何向预先安装的付费Android应用程序的用户分发更新? - How to distribute updates to users of pre-installed paid Android App? 在预装的 Android 应用程序中动态更新 Libphonenumber 元数据 - dynamically update Libphonenumber metadata in pre-installed Android app 带有预安装的本地化数据的Android APK - Android APK with pre-installed localized data 预装的应用程序 - Pre-installed applications 我应该在我的Android应用程序中包含日历功能吗? (大多数手机上是否预装了日历?) - Should I include Calendar functionality into my android App? (Is calendar pre-installed on most phones?) 预装 Android APK - 允许使用应用签名进行 Google Play 更新 - Pre-installed Android APK - allow Google Play updates with App Signing 是否可以在 AOSP 中将预安装的 android 应用程序的活动显示为启动 LOGO? - Is it possible to show pre-installed android app's activity as Boot LOGO in AOSP? 如何快速列出 Android 中的文件或文件夹,如预装的图库或音乐应用程序 - How to list quickly files or folders in Android like pre-installed Gallery or Music app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM