Listening Has Always Been Our Strongest Tool!

Just Give Us a Try, we respond to all messages within 1 business day. Really!


How can we reach out to you?






NDA From The Start
We keep your idea safe. We're always willing to sign a Non-Disclosure Agreement with you and fully protect your intellectual property.

captcha

Other Ways To Meet Us :info@zealousys.com
Our Blog
Feb 06
2014

Samsung’s mobile infrared using reflection

By zealousys

Infrared was introduced in Samsung note 2 and higher. We were not able to find any public APIs to get this hardware working. So here we have a hardware component which works with Samsung’s proprietary remote and other developers are not able to utilize.

With the help of some reverse engineering, we were able to find out how IR was called so we utilized the power of reflection in java to exploit it a little further

applicationContext.xml

  1. Object irdaService;
  2. Method irWrite;
  3. public void irInit() {
  4.    irdaService = this.getSystemService(“irda”);
  5.    Class c = irdaService.getClass();
  6.    Class p[] = { String.class };
  7.    try {
  8.       irWrite = c.getMethod(“write_irsend”, p);
  9.    } catch (NoSuchMethodException e) {
  10.       e.printStackTrace();
  11.    }
  12. }

Here you can see that we are not aware of which class is used to invoke IR but using reflection we got the class and the system method to write into the infrared hardware.

Reflection is the same technology which was used in java exploit which had gone in the wild in 2013.

So now the part that is left is write bits to the input stream of infrared so it can convert into infrared rays and transmit the same.

The devices at our home like TV AC etc. accept certain signals and respond accordingly (remote control). Different functions will be performed as per the signal the unit received like power on/off and different brands will have different input for particular actions.

  1. String data = “particular signal key ”
  2. if (data != null) {
  3.    try {
  4.       irWrite.invoke(irdaService, data);
  5.    } catch (IllegalArgumentException e) {
  6.       e.printStackTrace();
  7.    } catch (IllegalAccessException e) {
  8.       e.printStackTrace();
  9.    } catch (InvocationTargetException e) {
  10.       e.printStackTrace();
  11.    }
  12. }

The above code will invoke infrared hardware to transmit a particular signal that you put into the data field.

Try different signals for different operations.

View My Stats