2022/05/07 ~ 2022/05/13 のもくもく日記
もくもく 前回までは
2022/04/30 ~ 2022/05/06 のもくもく日記 をご覧ください。
今回の目標
- レシピの整備
途中経過
その1
Google が提供していた3D 共有サイトPoly がいつの間にか終了してた😱 https://www.moguravr.com/poly-termination/
Sceneform ってのもあった気がしたけど、こちらもArchive になってた 全然追っていなかったのがバレてしまうw https://github.com/google-ar/sceneform-android-sdk
Android Emulator でAR を試しているのだけど、水平面 is どこw Emulator でいい感じに補正するの、めっちゃむずいw
ARCore の試し方、これが分かりやすかった 4~5年前にPoly から3D モデルを拾ってきて試した頃より、だいぶ進化していてて良き😊 https://dev.classmethod.jp/articles/io19-arcore-scene-viewer-demo/
この記事、サンプル付きで手軽に試せて、とても助かった😊 https://qiita.com/ft-lab/items/a3ddc635c8d034137efa
その2
この一文、個人的にめっちゃ好きw
Android の通信実装でよくRetrofit を使うことが多いのだけど、時たまRetrofit だとやりづらいものをOkHttp とかで実装するのだけど、その時にこの部分も自分で書かんといけんのかとなって、頭を抱える部分なのでw https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/KotlinExtensions.kt#L54
Retrofit のHttpException の実装はこれなんだけど、便利なので他に流用したい ……ただ、悩ましいのは移植した後にRetrofit 使うことになったときに、パッケージ名の混乱をしそうなとこ さて、どうしたものか https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/HttpException.java
その3
OkHttp を使って画像をWeb サーバーから引っ張ってくるの、考える度にややこいと感じるw 特にキャッシュ用のファイル領域ってアプリごとにどのくらい用意すべきが悩ましい 他の画像ライブラリを併用しているときは、さらに2重で領域確保しないようにするは???ってなってめんどいw
その4
👀 https://tech.stmn.co.jp/entry/2020/07/21/105839
その5
Kotlin のinternal 宣言した関数とかがJava から見えるかどうかはまだ試していないけど、少なくとも下記の記述をするとJava からは参照できなかった
@JvmName("-???")
まじか👀
Kotlin でinternal class を定義したライブラリを発行して、それを別のアプリからJava で呼び出すの、びっくりなことに出来てしまった😱
Java のコード上に波線でKotlin internal だよって警告は出るけど、実行は出来てしまったorz
その6
そういえば、この子の存在忘れてた。どっかで調べたい💪 https://codeql.github.com/docs/
その7
Android 実装時にParcelable を使うか、それともSerializable を使うか、めっちゃ悩ましいw
Effective Java だとシリアライズを避けた方が良さそうな雰囲気だけど、Parcelable も同じ議論になったりしないかな🤔
とりあえずSerializable のドキュメントを見てみた👀
Warning: Deserialization of untrusted data is inherently dangerous and should be avoided. Untrusted data should be carefully validated.
https://developer.android.com/reference/java/io/Serializable
併せてParcelable のドキュメントを読んでみたのだけど、Serializable のようなWarning の記載はなかった👀 https://developer.android.com/reference/android/os/Parcelable
これかな👀 読み解く自信はないけど、頑張ってみるか💪 https://github.com/coky-t/owasp-mstg-ja/blob/master/Document/0x05h-Testing-Platform-Interaction.md#オブジェクト逆シリアライゼーションのテスト
英語版の方に、もう少し詳細が書いてあるかも👀 https://mobile-security.gitbook.io/mobile-security-testing-guide/android-testing-guide/0x05h-testing-platform-interaction#testing-object-persistence-mstg-platform-8
Parcelable に戻ってきた https://developer.android.com/guide/components/activities/parcelables-and-bundles
Android のAcitivity 間遷移時にBundle 使ってデータを受け渡すけど、Bundle の中でParcel を使っているっぽい
Parcel は汎用のシリアル化メカニズムではないけど、Android の中だけで使うなら、Serializable ではなくこちらで統一したほうがいい気がしてきた
今回の進捗
※関連SNS
- https://x.com/shion_engineer/status/1522785628857188353
- https://x.com/shion_engineer/status/1522795027876827137
- https://x.com/shion_engineer/status/1522798308682477569
- https://x.com/shion_engineer/status/1522826454249078785
- https://x.com/shion_engineer/status/1522831056914632704
- https://x.com/shion_engineer/status/1522831666296737797
- https://x.com/shion_engineer/status/1522865823047897088
- https://x.com/shion_engineer/status/1522920643108679680
- https://x.com/shion_engineer/status/1523205900801961984
- https://x.com/shion_engineer/status/1524002710630330369
- https://x.com/shion_engineer/status/1524350078571675648
- https://x.com/shion_engineer/status/1524615719744577536
- https://x.com/shion_engineer/status/1524624940926136321
- https://x.com/shion_engineer/status/1524687416749355008
- https://x.com/shion_engineer/status/1524703297218965507
- https://x.com/shion_engineer/status/1524704244976488448
- https://x.com/shion_engineer/status/1524707432039350272