Thursday, June 11, 2015

android auto development: sensors in a car

I'm involved in "Android Auto Head Unit" development. ( not a mobile side )

I understand I couldn't share any confidential document or something else here. However, I'd like to share something that I can share with you guys who is interested in "Android Auto Head unit.

I have just finished to skim & scan almost documents shared from google. They are already did so many things that I expected.

At this moment, I'd like to talk about the sensor information from car. As you know, currently, build app for Auto, there are only  APIs for "Playing Audio" and "Messaging".
( https://developer.android.com/training/auto/index.html )

However, mainly for the safety reason, the car shall, should, will or may provide sensor data to the Android Auto. I think these sensor data will be consumed by Android auto inside to meat specific country's traffic legal things.

What after this? I believe that google has more plan to make a best use. HU could integrate more than 20 sensors on it. ( At this moment not every sensor is a mandatory ) It's fascinating. In the near future, we can build fantastic app for AA. Such as, Eco driving management app refer to your trip and gas tank gauge, time and fuel comparison app for the same start-end point and different route including high gate fee.

I hope it will make a better driving.

Thursday, September 5, 2013

to sign prebuilt android apk with my own key


  • Sometimes, I got prebuilt package that should be resigned by several reasons. Finally, I found the way to re-sign 3rd party apk binary with my key.
  • just use signapk.jar that comes from AOSP's out directory.
    for example, "signapk.jar is located in "AOSP/out/host/linux-x86/framework/signapk.jar"
  • and it could be used like this way.
  • $ java -jar signapk.jar platform.x509.pem platform.pk8 3rd_party.apk 3rd_party_my_key.apk
  • and we can see that the sign key is changed.



  • The Result~~~


  • Origin 3rd party apk's sign information


$ jarsigner --verify --verbose --certs 3rd_party.apk

         438 Thu Aug 21 17:13:34 KST 2008 META-INF/MANIFEST.MF
         480 Thu Aug 21 17:13:34 KST 2008 META-INF/CERT.SF
        1580 Thu Aug 21 17:13:34 KST 2008 META-INF/CERT.RSA
sm      5844 Thu Aug 21 17:13:34 KST 2008 AndroidManifest.xml

      X.509, O=3rd_party
      [certificate is valid from 08. 8. 22 오전 8:13 to 36. 1. 8 오전 8:13]

sm    323564 Thu Aug 21 17:13:34 KST 2008 classes.dex

      X.509, O=3rd_party
      [certificate is valid from 08. 8. 22 오전 8:13 to 36. 1. 8 오전 8:13]

sm     93351 Thu Aug 21 17:13:34 KST 2008 res/raw/nlp_metricmodel.bin

      X.509, O=3rd_party
      [certificate is valid from 08. 8. 22 오전 8:13 to 36. 1. 8 오전 8:13]

sm     76179 Thu Aug 21 17:13:34 KST 2008 res/raw/nlp_metricmodeljava.bin

      X.509, O=3rd_party
      [certificate is valid from 08. 8. 22 오전 8:13 to 36. 1. 8 오전 8:13]

sm     24756 Thu Aug 21 17:13:34 KST 2008 resources.arsc

      X.509, O=3rd_party
      [certificate is valid from 08. 8. 22 오전 8:13 to 36. 1. 8 오전 8:13]


  s = signature was verified
  m = entry is listed in manifest
  k = at least one certificate was found in keystore
  i = at least one certificate was found in identity scope

jar verified.



  • re-signed 3rd party apk's sign information


$ jarsigner --verify --verbose --certs 3rd_party_my_key.apk
         438 Thu Sep 05 15:49:58 KST 2013 META-INF/MANIFEST.MF
         480 Thu Sep 05 15:49:58 KST 2013 META-INF/CERT.SF
        1141 Thu Sep 05 15:49:58 KST 2013 META-INF/CERT.RSA
sm      5844 Thu Sep 05 15:49:58 KST 2013 AndroidManifest.xml

      X.509, O=my_key
      [certificate is valid from 12. 9. 14 오후 4:39 to 40. 1. 31 오후 4:39]

sm    323564 Thu Sep 05 15:49:58 KST 2013 classes.dex

      X.509, O=my_key
      [certificate is valid from 12. 9. 14 오후 4:39 to 40. 1. 31 오후 4:39]

sm     93351 Thu Sep 05 15:49:58 KST 2013 res/raw/nlp_metricmodel.bin

      X.509, O=my_key
      [certificate is valid from 12. 9. 14 오후 4:39 to 40. 1. 31 오후 4:39]

sm     76179 Thu Sep 05 15:49:58 KST 2013 res/raw/nlp_metricmodeljava.bin

      X.509, O=my_key
      [certificate is valid from 12. 9. 14 오후 4:39 to 40. 1. 31 오후 4:39]

sm     24756 Thu Sep 05 15:49:58 KST 2013 resources.arsc

      X.509, O=my_key
      [certificate is valid from 12. 9. 14 오후 4:39 to 40. 1. 31 오후 4:39]


  s = signature was verified
  m = entry is listed in manifest
  k = at least one certificate was found in keystore
  i = at least one certificate was found in identity scope

jar verified.

Wednesday, July 25, 2012

Eclipse JAVA Syntax Coloring and Element

Do you know?? Eclipse can identify below 29 element of java syntax.

Abstract classes, method invocations
Annotations & element references
Auto(un)boxed expressions
Brackets
Classes
Constants
Deprecated members
Enums
Fields
Inherited files, method invocations
Interfaces
Keyword 'return'
Keywords excluding 'return'
Local variable declarations
Local variable references
Method delarations
Methods
Numbers
Operators
Others
Parameter variables
Static fields
Static method invocations
Strings
Type arguments
Type variables

I'm trying to setup powerful readable coloring for my eclipse.

Would you like to try this??

Open your eclise Window -> Preferences -> Java -> Editor -> Syntax Coloring


This is my example ( still developing )


Sunday, February 5, 2012

chagne avd data partition size

just add following line to your avd/config.ini


disk.dataPartition.size=512

Wednesday, January 18, 2012

sign your apk with platform key for using shared system id

you can find the key in your AOSP code.

normally you can find here AOSP_HOME/build/target/product/security

execute this command in that dir.

1.
$ openssl pkcs8 -inform DER -nocrypt -in platform.pk8 -out platform.pem
2.
$ openssl pkcs12 -export -in platform.x509.pem -inkey platform.pem -out platform.p12 -password pass:android -name androiddebugkey
3.
$ /usr/lib/jvm/java-6-sun/bin/keytool -importkeystore -deststorepass android -destkeystore platform.jks -srcstoretype PKCS12 -srcstorepass android -srckeystore platform.p12
then you can get platform.jks file can be used on eclipse.

copy platform.jks to your key dir.

and open eclipse -> window -> preferences -> Android -> build



then your application is signed with platform key and system user id application can be ran.

remember, your Androidmanifest.xml need "android:sharedUserId="android.uid.system"

debug and modify android core app ( like settings ) on eclipse, window

First of all, you need compiled AOSP(http://source.android.com/) which API Level you want to use.

In my case, i'm using API 15 and vbox_x86 Env.

in your AOSP_HOME

@bgpark:ics$ . build/envsetup.sh
@bgpark:ics$ lunch vbox_x86-eng
@bgpark:ics$ make -j12


I think you already know this one.



Select Add Library by right mouse click










and make user library with System Library check option.
















add some jar files.
for example, we need 2 shared jar for Settings project.

add guava_intermediates\classes.jar by add External jar and change reference order.

now you can build without any problems.



You will need this article for run your core app with appropriate authority.
http://stoned-android.blogspot.com/2012/01/sign-your-apk-with-platform-key-for.html