apkファイルの署名とzipalign

以前投稿してたものを誤って消してしまったので再投稿。

UnityでAndroid用にビルドする時、署名の設定をすれば署名済みapkファイルが生成されるのですが、
古いバージョンのUnityだと何故か署名されていないapkファイルが生成されます。
いろいろ調べたところ不具合っぽいので、諦めてjarsignerというものを使ってみることに。

■署名されているかの確認———————-
jarsigner -verify -verbose ○○.apk
——————————————-

■署名する———————————–
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -tsa http://timestamp.digicert.com -keystore ▼▼.keystore ○○.apk □□
——————————————-

生成されたapkはそのままstoreにアップロードすると怒られるらしいので、zipalignなるものをする

■zipalignされてるか確認———————
zipalign -c -v 4 ○○.apk
——————————————-

■zipalignする——————————
zipalign -f -v 4 ○○.apk
——————————————-

○○:apkファイルの名前
▼▼:keystoreファイルの名前(フルパス)
□□:keystoreのエイリアス名

ただ、Unity2018.3.0f2だと、Unity側で署名済みapkを生成できていて、
zipalignもされてそうなので、そのままstoreにアップロードしても良さそう。

“apkファイルの署名とzipalign” への8件の返信

  1. Forex Watchers2019年4月5日 10:24 PM返信

    One question, can we zipaligned already signed apk. I m doing it manually but getting error while installing it, any suggestion here. CoDe Sep 28 ’17 at 7:20

    1. しずく2019年4月6日 1:00 AM返信

      Please tell me more about the content and the situation of the error.

  2. Alex2020年4月9日 11:59 PM返信

    I’m impressed, I must say. Seldom do I come across a blog that’s
    equally educative and engaging, and without a doubt, you’ve hit the nail
    on the head. The problem is something which too few people are speaking intelligently
    about. Now i’m very happy that I stumbled across
    this during my hunt for something concerning
    this.

  3. g2020年6月16日 3:58 AM返信

    Very good information. Lucky me I came across your site by chance
    (stumbleupon). I’ve saved as a favorite for later!

  4. g2020年6月16日 4:17 PM返信

    Hey are using WordPress for your site platform? I’m new to the blog world but
    I’m trying to get started and create my own. Do you require any coding knowledge to make your own blog?
    Any help would be really appreciated!

    1. しずく2020年6月16日 7:00 PM返信

      Thank you for your comment.

      This site is powered by wordpress.
      If you want to customize the design and functionality of the site, you can use
      I’m sure you’ll need some knowledge of coding as well.
      If you don’t do that and just run a blog.
      You probably don’t need to know anything about coding.
      I’m sure you can find plenty of information about implementing wordpress if you search for it. Good luck!

  5. g2020年6月17日 4:09 AM返信

    I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.

    nonetheless, you command get got an shakiness over that you
    wish be delivering the following. unwell unquestionably come more formerly again since exactly
    the same nearly very often inside case you shield this increase.

  6. g2020年6月17日 11:21 PM返信

    I’m gone to convey my little brother, that he should also go
    to see this web site on regular basis to take updated from newest gossip.

コメントする