Android automated packaging. Only packagename is changed during compilation and packaging.

Source: Internet
Author: User

Many automated packages on the Internet compete for packages that cannot be connected to the same project. Currently, what I want to do is like xunfei voice, you need to generate the example project with the changed package name based on your registration information, but what we provide is that the apk package does not need the source code. Company Daniel writes shell scripts, round the project to replace all packagename. Now I am sharing a sample of google. I only need to modify the configuration of the corresponding build. xml file under the sdk, so that the apk of packagename cannot be connected to the same project.

You only need to add manifestpackage = "$ {package. manifest. name}" in the-package-resources command, so that the package name is changed to the actual value of package. manifest. name. As follows:


'''Java

<Target name = "-package-resources" depends = "-crunch">

<! -- Only package resources if * not * a library project -->

<Do-only-if-not-library elseText = "Library project: do not package resources...">

<Aapt executable = "$ {aapt }"

Command = "package"

Versioncode = "$ {version. code }"

Versionname = "$ {version. name }"

Debug = "$ {build. is. packaging. debug }"

Manifest = "$ {out. manifest. abs. file }"

Assets = "$ {asset. absolute. dir }"

Androidjar = "zookeeper project.tar get. android. jar }"

Apkfolder = "$ {out. absolute. dir }"

Nocrunch = "$ {build. packaging. nocrunch }"

Resourcefilename = "$ {resource. package. file. name }"

Resourcefilter = "$ {aapt. resource. filter }"

LibraryResFolderPathRefid = "project. library. res. folder. path"

LibraryPackagesRefid = "project. library. packages"

LibraryRFileRefid = "project. library. bin. r. file. path"

Previusbuildtype = "zookeeper build.last.tar get }"

BuildType = "zookeeper build.tar get }"

IgnoreAssets = "$ {aapt. ignore. assets }"

Manifestpackage = "$ {package. manifest. name}">

<Res path = "$ {out. res. absolute. dir}"/>

<Res path = "$ {resource. absolute. dir}"/>

<! -- <Nocompress/> forces no compression on any files in assets or res/raw -->

<! -- <Nocompress extension = "xml"/> forces no compression on specific file extensions in assets and res/raw -->

</Aapt>

</Do-only-if-not-library>

</Target>

'''

You can run the android update command in cmd. command to generate a build under the project. xml file, you can see the build used for packaging under the referenced sdk. modify the xml file by copying the file and modifying the reference. These will not be repeated.

Transfer door http://my.eoe.cn/109830/archive/15436.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.