从命令行注册Android App Bundle

时间:2018-05-28 06:04:45

标签: android jarsigner android-app-bundle

任何人都知道如何使用命令行中的新密钥库来签署.aab文件? 文档here提到我们可以使用jarsigner从命令行签署我们的应用程序包。但我找不到命令行? 有人知道命令行吗?

将我的捆绑包上传到Google Play后出现此错误:

You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner:

我尝试使用以下命令对应用包进行签名:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore xample.jks bundle.aab keystoreAlias

非常感谢。

2 个答案:

答案 0 :(得分:1)

在其他情况下,我有相同的错误(或者可能是相同的)。

我正在尝试将import sys import multiprocessing from multiprocessing import Pool def SplitGenomeString(start,length): #where con in sqlconnection to database using as global variable cursorObj = con.cursor() cursorObj.execute('SELECT substr(Chr.Sequence,{},{}) FROM Chromosome Chr'.format(str(start),str(length)) return cursorObj.fetchall() def getSubSequence(s): #Write your Queries according to your requirements for finding subsequence s if __name__ == '__main__': length = SplitGenomeString(0,sys.maxint) cores = multiprocessing.cpu_count() #asumming the subsequence you want to check is 100 subseq_len = 100 for i in range(0,length,round(length/cores)): ls.append(SplitGenomeString(i,round(length/cores))) #this will also include the excluded parts because of splitting geneome string temp = [] for i in range(len(ls) - 1): temp.append(ls[i][1 - subseq_len):] + ls[i+1][:subseq_len - 1]) ls = ls + temp with Pool(cores) as p: p.map(getSubSequence,ls) 捆绑包进行一些更改。最初,我使用zip或jar创建未签名的档案。之后,我使用*.aab工具对其进行了签名。 我发现jarsigner不是使用bundletool

的普通邮政编码。
*.aab

因此,在使用> java -jar bundletool.jar validate --bundle application.aab [BT:0.12.0] Error: The App Bundle zip file contains directory zip entry 'base/' which is not allowed. com.android.tools.build.bundletool.model.exceptions.BundleFileTypesException$DirectoryInBundleException: The App Bundle zip file contains directory zip entry 'base/' which is not allowed. at com.android.tools.build.bundletool.validation.BundleZipValidator.validateBundleZipEntry(BundleZipValidator.java:29) at com.android.tools.build.bundletool.validation.ValidatorRunner.lambda$validateBundleZipFile$1(ValidatorRunner.java:47) at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406) at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleZipFile(ValidatorRunner.java:46) at com.android.tools.build.bundletool.validation.AppBundleValidator.validateFile(AppBundleValidator.java:92) at com.android.tools.build.bundletool.commands.ValidateBundleCommand.execute(ValidateBundleCommand.java:78) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:92) at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46) 对其进行签名之后,我使用了该实用程序来创建*.aab。 您需要将jarsigner子文件夹的内容压缩到单独的存档中。

base/*

答案 1 :(得分:0)

可能您已经找到了解决问题的方法。不过,由于它可能会在将来对某人有所帮助,所以我只想说我遇到了同样的问题,将哈希算法更改为 SHA-256 可以帮助我克服它。

jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore xample.jks bundle.aab keystoreAlias