FORUMS
Remove All Ads from XDA

[REF] How Infrared is (not) working on LePro3 - some infos for IR devs

235 posts
Thanks Meter: 414
 
Post Reply Email Thread
30th November 2016, 06:09 PM |#11  
Senior Member
Thanks Meter: 142
 
More
Quote:
Originally Posted by serc

Hi i am very very happy, that people like androcheck are working on this problem.
i have the le max2 and the same problem 3party IR apps dont running with lemax2.
i have the siswoo r8 monster and the same problem

i want to use rCoid app from playstore in future i hope

thankyou androcheck for your work



hi joms
Leecos IR remote wants to know my contacts and phonecalls why ????
without permission it is not running why ???
i have paid for IR hardware but it is not running free !!!

Well it's not like it will steal your contact information. The LeEco remote can do voice activated control I think hence it is asking for call access (which uses microphone).
1st December 2016, 08:56 AM |#12  
Quote:
Originally Posted by Joms_US

Well it's not like it will steal your contact information. The LeEco remote can do voice activated control I think hence it is asking for call access (which uses microphone).

I don't think that LeEco is doing something bad here, but to be honest I also find it a little bit frightening what permissions the remote app is claiming. It seems like a lot of these permissions aren't used, but I didn't really look into this.

Also for voice control you don't need the CALL_PHONE permission. The RECORD_AUDIO permission would be sufficient for that.

Here is the full list of permissions the LeEco remote app is claiming in its Manifest:
Code:
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_MOCK_LOCATION
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_WIFI_STATE
android.permission.AUTHENTICATE_ACCOUNTS
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
android.permission.CALL_PHONE
android.permission.CHANGE_NETWORK_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.GET_ACCOUNTS
android.permission.INTERNET
android.permission.MANAGE_ACCOUNTS
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
android.permission.READ_CONTACTS
android.permission.READ_EXTERNAL_STORAGE
android.permission.READ_PHONE_STATE
android.permission.READ_PHONE_STATE
android.permission.RECORD_AUDIO
android.permission.SEND_SMS
android.permission.SYSTEM_ALERT_WINDOW
android.permission.SYSTEM_OVERLAY_WINDOW
android.permission.USE_CREDENTIALS
android.permission.VIBRATE
android.permission.WAKE_LOCK
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.WRITE_SETTINGS
com.android.alarm.permission.SET_ALARM
com.letv.android.account.permission.ACCOUNT_RELEVANT
com.letv.android.remotecontrol.permission.PUSH_RECEIVER
com.letv.android.remotecontrol.permission.SEND_CONTROL
The Following User Says Thank You to androcheck For This Useful Post: [ View ] Gift androcheck Ad-Free
1st December 2016, 08:09 PM |#13  
Ok, I found another possible way to use the Infrared blaster (for sending):
Instead of directly communicating over the serial line, I tried to bind to the QuickSet SDK service from within my own test-app. As the QuickSet SDK service is not protected with a permission this should be possible and indeed, binding the service worked flawlessly.

Unfortunately I forgot that there is still the "masterswitch" to turn on or off the MAXQ616 IR controller chip.
This is done by writing a "1" or a "0" into the file /sys/remote/enable which normally is done by the LeEco remote app:
Code:
# power on IR controller:
echo 1 > /sys/remote/enable

# power-off IR controller:
echo 0 > /sys/remote/enable
This file is provided by the "ir_maxq616" driver in the kernel and just sets a GPIO to 1 or 0 (which I guess is connected to the IR controller chip to power it down or a least go to a power-save mode):
Code:
// snippet from: kernel/drivers/misc/ir_maxq616.c

	if (enable == 0) {
		if (irdata->power_on) {
			gpio_set_value(irdata->en_gpio, 0);
			irdata->power_on = 0;
		}
	} else {
		if (irdata->power_on == 0) {
			gpio_set_value(irdata->en_gpio, 1);
			msleep(1500);
			irdata->power_on = 1;
		}
	}
The SELinux policy only allows the original LeEco remote app to write into this kernel sys-file. So if we want to write this file from other apps (for turning the IR chip on), unfortunately we will need to be root (or globally set SE policy to "permissive").

Nevertheless, taking all this into account I made a small test-app, and voila, I was able to trabsmit my own custom IR pattern from my own test app.
I guess, that's a first step in the right direction.

Here is a short video demonstrating that the IR blaster really is emitting infrared signals: Short demo video

(I published my proof-of-concept app on Github as reference for interested developers: https://github.com/johnzweng/QuickSetSDKProofOfConcept)
The Following 5 Users Say Thank You to androcheck For This Useful Post: [ View ] Gift androcheck Ad-Free
2nd December 2016, 03:59 AM |#14  
Member
Flag Athens
Thanks Meter: 2
 
Donate to Me
More
Should I be concerned that LeEco requires my location in order to use my REMOTE app
2nd December 2016, 08:00 AM |#15  
Quote:
Originally Posted by umOuch

Should I be concerned that LeEco requires my location in order to use my REMOTE app

I don't know. I could imagine that you might want to access coarse location so that the app can offer you remotes for cable providers in your region? Also, I could imagine internet access might be needed for downloading new remotes and speech recognition.

But I didn't really look what exactly is going on there. The app is pretty huge and includes some 3rd party libraries and packages. Maybe some of these are requiring some of the permissions.
The Following User Says Thank You to androcheck For This Useful Post: [ View ] Gift androcheck Ad-Free
2nd December 2016, 10:33 AM |#16  
First breakthrough:
I've created a (still very, very alpha) Xposed module which hooks the ConsumerIrService class and tries to bind the QuickSet SDK service to send the Infrared commands which it has received over the standard Android Infrared API using the QuickSet SDK API (so it acts like a bridge between the two APIs).

And it works!! (in principle)
There are still a lot of edges, but if want to try it out yourself, I've attached an alpha-version of the Xposed module to this posting so you could try yourself with your favorite remote control app.

It does NOT YET WORK OUT OF THE BOX! You have to follow these steps before it will work:
  1. Install the Xposed module, enable it in Xposed app, reboot
  2. After reboot, open the original LeEco remote app one time and press some buttons (we still need this step here, to turn on the IR blaster. The LeEco remote app just does this here: "echo 1 > /sys/remote/enable"). You could also do this yourself in a terminal (as root). Should only be necessary once after every reboot.
  3. Then open the system settings -> go to "Apps" -> search for "UEI Android Services SDK(LeTV)" -> click "Force Stop" (I am still not sure why this step is necessary, somehow the SDK service needs to be restarted once after every reboot..)
  4. Open any app which uses standard Infrared API and SUCESSS! Check with a digital camera (or another phone's camera) if the IR blaster really is emitting infrared.
If I find some time over the weekend, I will try to get these things fixed.

Here a short demonstration video.


As you can see in the video I tested this with three different apps and it worked with my Samsung TV. I just randomly chose these apps from Play Store: ZaZa Remote-Universal Remote, ASmart Remote IR and IR Universal Remote

Also, I have just tested this only on EUI 5.8.018S (WAXCNFN5801811012S)!
So if you are running a different (newer) version of EUI, please give feedback if it's working or not! Thanks!

[edit]removed attachement, as there is now a working 1.0 version[/edit]
The Following 4 Users Say Thank You to androcheck For This Useful Post: [ View ] Gift androcheck Ad-Free
2nd December 2016, 05:19 PM |#17  
It was less work than expected. Now it seems to work for me perfectly. I cleaned up the code, published it on Github and made a new thread for the Xposed module (I think this thread should stay more focused on the technical backgrounds while the new thread will be dedicated to the Xposed module).

Head over here:
[MOD][Xposed] Make Infrared Blaster working with all 3rd party apps
The Following 5 Users Say Thank You to androcheck For This Useful Post: [ View ] Gift androcheck Ad-Free
8th December 2016, 03:47 PM |#18  
andr68rus's Avatar
Senior Member
Flag Tambov
Thanks Meter: 5,166
 
Donate to Me
More
Quote:
Originally Posted by androcheck

So, I was also interested why 3rd party)

Hi. Thanks for your work! This info help me to run Remote Control on Cyanogen(Mokee).
The Following User Says Thank You to andr68rus For This Useful Post: [ View ] Gift andr68rus Ad-Free
10th December 2016, 01:05 PM |#19  
Quote:
Originally Posted by andr68rus

Hi. Thanks for your work! This info help me to run Remote Control on Cyanogen(Mokee).

You're welcome!
12th January 2017, 08:31 AM |#20  
I have a question about LeEco built in remote control app. The question is that why is that app having feature such as 'Mock Location'. Is there any possible reason for that as per your knowledge.
12th January 2017, 09:31 AM |#21  
Quote:
Originally Posted by Swastik Raj Chauhan

I have a question about LeEco built in remote control app. The question is that why is that app having feature such as 'Mock Location'. Is there any possible reason for that as per your knowledge.

I really can't answer that. I am wondering myself.
Post Reply Subscribe to Thread

Tags
hal, infrared, quickset sdk, serial device

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes