安卓白标 [英] Android white labeling

查看:22
本文介绍了安卓白标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一家商店里有这个foo"应用程序的公司工作,该应用程序是我们硬件的帮手,经销商们对此赞不绝口.我们确保名称尽可能通用 - 以便我们的供应商能够将应用程序作为他们的应用程序"进行营销.

I am working for a company which has this "foo" app on the store, the app is a helper for our hardware which is revelled by resellers. We made sure that the name is as generic as possible - in order for our vendors to be able to market the app as "their app".

但是 - 一些转销商确实希望在应用程序上有他们的确切名称和图标.他们愿意为此付出代价,我需要让这一切发生.

However - some re-sellers do want to have their exact name and icon on the app. And they are willing to pay so, I need to make this happen.

问题:

  1. 我了解我正在寻找构建变体.但是,我该如何修改 apk-package-name ,显示名称是使用构建变体的默认启动器图标?
  2. 这是否允许...?我并没有正式"向商店发送垃圾邮件,但感觉我可能会因为这样做而被禁止.
  3. 代码签名 - 我将自己上传 APK,我需要使用不同的证书(无论在 android 上调用什么)进行签名.同样 - 这很模糊,我找不到关于这个主题的文档.
  4. 我也计划以这种方式发布我的应用的测试版.我目前正在使用标准机制,但这意味着测试人员无法向客户展示应用程序(因为它大部分时间都没有完成或崩溃)[1]

  1. I understand that I am looking for build variants. But still, how can I modify the apk-package-name , display name is default launcher icon using build variants?
  2. Is this permitted...? I am not "officially" spamming the store, but it feels like I could get banned for doing that exactly.
  3. Code signing - I will upload the APK my self, and I will need to sign using different certificates (whatever it's called on android). Again - this is vague, and I cannot find documentation on this subject.
  4. I also plan on releasing a beta version of my app in this way. I am currently using the standard mechanism, but this means that testers cannot show case the app to customers (as it's not finished or crashing most of the time) [1]

白色标签"一词是否适用于此处...?

Does the term "white labeling" apply here...?

[1] 在小公司工作的乐趣 :)

[1] the joys of working in a small company :)

推荐答案

您可以像您怀疑的那样使用构建变体来做到这一点,但您也可能需要 Flavors.

You can do this with build variants as you suspected but also you would likely need Flavors.

这是一个具有多种构建类型和风格的示例 gradle 文件.您可以在风味设置中设置 ApplicationId(Play 商店中使用的包名).

Here is an example gradle file that has multiple build types and flavors. You set the ApplicationId (packagename used in Play Store) in the flavor settings.

在每种类型/风味中设置签名.您可以添加特定于每种风格的资源、图标、清单等.您甚至可以替换整个类文件,以便客户特定代码仅包含在您为其构建的客户的 apk 中.

Set up the signing in each type/flavor. You can add resources, icons, manifests etc that are specific to each flavor. You can even replace whole class files so customer specific code is only included in the apk for the customer you are building for.

  defaultConfig {
    applicationId "uk.co.foo.default"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode = 113
    versionName = "3.2.3"
}

signingConfigs {
    release {
        storeFile file("X:\\Android Projects\\Keystore\\MyKeys.jks")
        storePassword "MyPassword"
        keyAlias "KeyAlias"
        keyPassword "itsasecret"
    }
}

productFlavors {
    Customer1 {
        applicationId "uk.co.foo.customer1"
    }

    Customer2 {
        applicationId "uk.co.foo.customer2"
    }
}

buildTypes {

    debug {
        applicationIdSuffix ".debug"
        versionNameSuffix " Debug"
    }

    beta {
        applicationIdSuffix ".beta"
        versionNameSuffix " Beta"
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }

    signed {
        minifyEnabled false
        debuggable true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }

    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
    }
}

这是为每种类型\风味添加资源的文件夹结构.在此示例中,第二种口味称为粉丝".默认使用main"文件夹.根据您在 Android Studio 的构建变体"部分中选择的构建版本,每种类型和风格的资源都会合并到 apk(替换主文件夹中的任何相同名称)中.

Here is the folder structure for adding resources for each type\flavor. In this example, the second flavor is called "fan". The "main" folder is used by default. Each type and flavors resources are merged into the apk (replacing any of the same name in the main folder) depending on which build you choose in the "Build Variants" section of Android Studio.

Android Studio 将显示当前构建中哪些文件夹有效,如图中突出显示的那样.

Android Studio will display which folders are in effect for the current build as shown highlighted in this image.

编辑 - 此处提供完整的官方文档:https://developer.android.com/tools/building/configuring-gradle.html

Edit - full official documentation is available here: https://developer.android.com/tools/building/configuring-gradle.html

这篇关于安卓白标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆