2018/01/30

TARGET_BUILD_TYPE は deprecated らしい

AOSP の設定に `TARGET_BUILD_TYPE` という項目があるけど、既に deprecated らしい。
確かに使ったことないな。

参考
[how to set the DEBUG environment - Google グループ](https://groups.google.com/forum/#!topic/android-building/RPFvWjpQC_E)
その割に、最新のコードでも残ってるし、deprecated のコメントも無いのが気になるところ。
参考
[buildspec.mk.default - platform/build - Git at Google](https://android.googlesource.com/platform/build/+/android-wear-8.0.0_r1/buildspec.mk.default)
2018/01/25

Android Emulator が黒画面でフリーズ

久しぶりに Android の Emulator を起動したら起動はするものの、黒い画面のままフリーズし、そのうち落ちてしまうようになってしまいました。

2018/01/20

pk8 & x509.pem を jks キーストアに登録する方法

以下のように2段階の処理で可能一発で変換するツールは見つけられなかったけど、コマンドラインで処理できるのでスクリプトを書いておけばOK。

### pkcs12 キーストアファイルに登録
以下のようにして、pkcs12 形式のキーストアファイルに登録する。

`-name platform` は省略可能。省略すると `1` というエイリアスになる。

```console
`gutter: false;
$ openssl pkcs8 -in platform.pk8 -inform DER -outform PEM | openssl pkcs12 -export -in platform.x509.pem -inkey /dev/stdin -name platform -out platform.pk12
```

### pkcs12 を jks キーストアにインポートする

`-alias` と `-destalias` は省略可能。

```console
`gutter: false;
$ keytool -importkeystore -destkeystore mykeystore.jks -srckeystore platform.pk12 -srcstoretype PKCS12 -alias platform -destalias platform
```

参考
- [how to import x509.pem pk8 file into jks(keystore)? - Stack Overflow](https://stackoverflow.com/a/40145242) - [鍵ストアファイルとアプリの署名に関する情報の整理 – iroha Tech Note](http://tech.at-iroha.jp/?p=734)
2018/01/19

PRODUCT_DEFAULT_DEV_CERTIFICATE にパスワード付き署名を設定する場合は注意

AOSP をビルドする際、デフォルトだと署名には
`build/target/product/security/` 以下にある `testkey.x509.pem` と `testkey.pk8` が使われます。
しかし、実際にリリースするデバイスには自分の署名を使うべきです。

2017/09/10

Vino の設定は gconftool-2 では出来ない

2018/10/30 追記
Ubuntu 18.04 では設定方法が変わりました。
[Ubuntu 18.04 で Vino を有効にする方法(コマンドラインで) | 穀風](https://kokufu.blogspot.com/2018/10/ubuntu-1804-vino.html)
Ubuntu で Vino の設定をコマンドラインで行う場合、「`gconftool-2` を使う」と書いてあるサイトが沢山あるのですが、 既に `gconftool-2` は使えません。 `gconftool-2` は GNOME2 用の設定ツールなので、GNOME3正確には gtk+3 で導入された `gsettings` を使用しますUnity がベースにしている GNOME のバージョンがイマイチよくわからん…。 `gsettings` を使って、以下のように Vino を有効化することができます。 ```console `gutter: false; $ gsettings set org.gnome.Vino enabled true ``` 設定できる項目一覧は以下のように取得可能です。 ```console `gutter: false; $ gsettings list-keys org.gnome.Vino notify-on-connect alternative-port disable-background use-alternative-port icon-visibility use-upnp view-only enabled prompt-enabled disable-xdamage authentication-methods network-interface require-encryption mailto lock-screen-on-disconnect vnc-password ``` Ubuntu 18.04 LTS からデフォルトデスクトップが Unity ではなく GNOME に戻るようなので、またいろいろ変わるんだろうなぁ。 参考 - [vino - Enable remote VNC from the commandline? - Ask Ubuntu](https://askubuntu.com/a/265012) - [Gconf, Dconf, Gsettings and the relationship between them - Ask Ubuntu](https://askubuntu.com/questions/249887/gconf-dconf-gsettings-and-the-relationship-between-them) - [Growing Ubuntu for cloud and IoT, rather than phone and convergence | Ubuntu Insights](https://insights.ubuntu.com/2017/04/05/growing-ubuntu-for-cloud-and-iot-rather-than-phone-and-convergence/)