Android白色标签 [英] Android white labeling

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

问题描述

我正在为一家在商店中拥有此"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. 我还计划以这种方式发布我的应用程序的Beta版本.我目前使用的是标准机制,但这意味着测试人员无法向客户展示该应用的情况(因为大多数情况下该应用尚未完成或崩溃)[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 :)

推荐答案

您可以根据自己的怀疑使用构建变体来做到这一点,但是您可能还需要风味.

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
    }
}

这里是用于为每种类型\ flavor添加资源的文件夹结构.在此示例中,第二种风味称为粉丝".默认情况下使用主"文件夹.每种类型和口味的资源都将合并到apk中(替换主文件夹中的任何同名名称),具体取决于您在Android Studio的构建版本"部分中选择的是哪种版本.

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

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

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