本物「Jake Wharthon」さん、偽物「Jake Whaarton」になりすます

jitpack で配布しているライブラリに不必要な怪しい通信処理を入れて

Bintray -> jcenter() 経由で同じアーティファクトidで配布してる「Jake Whaarton」さん。

これは、神と呼ばれるJakeWarthonさんの偽物です。

Jake Wharthon → 本物
Jake Whaarton → 偽物

少し話題になってましたね。

A Confusing Dependency

A Confusing Dependency : androiddev

すると、本物JakeさんのTwitterが!!

Jake Whaarton(@JakeWharton)さん | Twitter

なりすましてます、本物が偽物に。

この話を、解説しています。

アーティファクトの整合性の話は別にして、jcenter() を常に最後に置くだけでなく、mavenCentral() をそれらの前に置くことも必要です。
JCenter と Bintray は、信頼できるアーティファクトホストではありません。理想的なのはそれらから何も取得しないことです。

上から読んでいくリポジトリ群指定の最下位にオープンすぎる jcenter() を置くべし、と言っています。


repositories {

  //...
  mavenCentral()
  jcenter()
}

しかし、ワロタ。

android - Why does the Google maven repository exist and when should I use it? - Stack Overflow

Gradleが参照するリポジトリの優先順位について - Qiita


NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion とかでた。

[Developer Preview Android P] NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion; inside of com.google.android.gms [79478779] - Visible to Public - Issue Tracker

If your app is targeting API level 28 (Android 9.0) or above, you must include the following declaration within the element of AndroidManifest.xml.

対策は以下。AndroidManifest.xml。


<application ...
  ....
  <uses-library
      android:name="org.apache.http.legacy"
      android:required="false" />

Project Configuration  |  Maps SDK for Android  |  Google Developers

今回は、GoogleMap SDK vs API-28(9.0/Pie) だったけど、他でも出そうで、使えそう。


Nullable(?) な Type で カラーリングが効かない Kotlin on GitHub

これ、

文法的なカラーリングが効かなくなる。

TestSyntaxColors.kt

この記述以降が壊れる。


AttributeSet?

TestSyntaxColors_OK.kt

これって、以前からじゃなく、最近の話だよね?

 

追記:2018-11-24

直ってる。

TestSyntaxColors.kt


java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android'

なんなんすかね。

どっちかといえば、環境依存のバグではまる時間が増えてますよね。


-keepnames class kotlinx.** { *; }

IllegalStateException: Module with the Main dispatcher is missing · Issue #799 · Kotlin/kotlinx.coroutines


# ServiceLoader support
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

# Most of volatile fields are updated with AFU and should not be mangled
-keepclassmembernames class kotlinx.** {
    volatile <fields>;
}

Android app with coroutines 0.30.1-eap13 crashes in runtime · Issue #657 · Kotlin/kotlinx.coroutines

あちこち依存周りで統率取れてない感ありません?

Jetifier forces Dagger 2.16 even when 2.17 is declared as a dependency [115738511] - Visible to Public - Issue Tracker


機種変更時にやるべき Google Authenticator (2段階 認証システム) のリカバリー対策

2段階認証利用時の2段階目の確認コードを発行してくれるのがそれ。

これを機種変更や端末移行時にどうするのが良いか。移行のついでに紛失したときのリカバリーも考慮しておきたい。

「登録QRコードは登録時に一度しか表示されない。」

それらの手順は、そのアカウントを発行しているサービスによって違うのだが共通に使える方法を見ておくと基本的なしくみを理解しやすい。

 

QRコードのキャプチャ画像を保存

簡単だが、保存場所に困る。

バックアップ/リカバリの方法が多いGoogleアカウントのサービス(Drive/Photo) に保存しておくのが安心か。

 

複数端末で同時に登録

認証情報を確認できる端末が複数あることが安全ではない。とも。

ひとつの端末が死んでも安心して利用できる?

 

テキストで保存

A. サービスごとのバックアップコードを保存

画像をキャプチャするか、コピペしてどこかに保存、または、紙に書いておくか。

これも保存場所に困る。

B. QRコードをテキスト化して保存


RFC 6238 - TOTP: Time-Based One-Time Password Algorithm で規定されているテキストURLがQRコードになっているだけなのが実質。


otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

Key Uri Format · google/google-authenticator Wiki

TOTPのURIを生成し、QRにエンコードとデコードしてから、ワンタイムパスワードを計算する | blog.monophile.net

秘密鍵だけテキスト化して保存しておくこともできるか。

サービスによって微妙にパラメータは違う様子。

 

1段階に戻す

驚異を承知で戻します?

 

まとめ?

サードパーティのQRコードリーダアプリで読み取って履歴保存はやばいよね?

わたしは紙に書いておこうと思っています。

みんなはどうしてる?

スマホに依存しすぎてねえ?

2段階認証プロセスに関する一般的な問題 - Google アカウント ヘルプ