安卓白色标签[英] Android white labeling

本文是小编为大家收集整理的关于安卓白色标签的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在为商店上有这个"foo"应用程序的公司工作,该应用程序是我们的硬件的帮助程序,该硬件由经销商揭示.我们确保名称尽可能通用 - 为了让我们的供应商能够将应用程序作为"他们的应用程序".

但是 - 但是 - 一些重新销售商确实希望在应用程序上拥有他们的确切姓名和图标.他们愿意支付所以,我需要发生这种情况.

问题:

  1. 我明白我正在寻找构建变体.但是,我仍然可以修改apk-package-name,显示名称是使用build变体的默认启动器图标?
  2. 这是允许的......吗?我不是"正式"垃圾邮件垃圾邮件,但感觉就像我可以禁止这样做.
  3. 代码签名 - 我会上载我的自我,我需要签署使用不同的证书(无论它在Android上呼叫什么).再次 - 这是模糊的,我找不到这个主题的文件.
  4. 我还计划以这种方式释放我的应用程序的Beta版本.我目前正在使用标准机制,但这意味着测试人员不能向客户展示应用程序(因为它没有完成或大多数时间崩溃)[1]

  5. 这个术语"白色标签"在这里申请...?

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

推荐答案

您可以使用疑似构建变体进行此操作,但您可能需要口味.

以下是一个具有多个构建类型和味道的示例Gradle文件.您在风格设置中设置了ApplicationId(在播放商店中使用的PackageName).

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

  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的"Build Variants"部分中选择的构建,每种类型和Flavors资源都被合并到APK中(替换主文件夹中的任何相同名称).

在此处输入图像描述

Android Studio将显示该文件夹的文件夹,如此图像中突出显示的当前构建.

在此处输入图像描述


编辑 - 完整的官方文档可在此处提供: https://开发人员. android.com/tools/building/configuring-gradle.html

本文地址:https://www.itbaoku.cn/post/1937945.html

问题描述

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.

Questions:

  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]

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

[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.

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.

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

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.

enter image description here

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

enter image description here


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