Related
Need to add ch13 to wireless. Ar6000 chip can do it, but i can find no config to set it. Reg domain missing on the x10. Anyong know how to re-add it? Phone is rooted, but cant find a config file either. Anyone have any ideas?
Cheers
Frank
Sent from my SO-01B using XDAu App
bummer, no one knows huh?
Sent from my X10i using XDA App
Have you tried to manually modify wpa_supplicant.conf? It's located at /data/misc/wifi/ I recommend you to use Root Explorer because it includes a text editor and can easily mount the partition. Be careful to not touch its original permissions or your wifi won't work. BR
Edit: I've been investigating this issue an there's no option in wpa_supplicant.conf to change channel range or to point to a channel, you just set the ssid. I hope it's not hardcoded in wlan_tools binary file... First thing I'd try is to write your wifi parameters into wpa_supplicant.conf and then cross your fingers
I don't think so...
I've spent hours on this (including reading source code from atheros used in openmoko) and I am starting to get an idea of how it is set.
Android passes a hex code to the ar6000 module when it loads it on boot..
That hex code is the regulatory domain... I am trying to find out what the codes are, and also where the X10 is installing that module.
you can do a lsmod as root in a terminal to see what I mean.
I could just use rmmod and insmod to remove/add the driver as needed, but would rather find the place where android is loading the module and edit it there to suit.
regards
Frank
PS, been using root explorer since the day it was rooted.
right now, I'm copying the entire system to the sdcard so I Can browse though it on the pc.
did a dump of the whole system to sdcard and then used agent ransack on a windows box to look inside all files including binaries to see if I can find where the ar6000 module is loaded, but can't find it anywhere.... lots of mentions, but nothing I can see as loading the module.
I may actually have to re-compile the ar6000 module and hard code it to all 14 channels.
I've downloaded the source from SE and I'm looking though the driver and related code trying to find a way to hard code 14 channels or some method of making it settable that doesn't involve locale
Hope you succeed. That's just ridiculous that SE sells X10 with the wrong domain in the first place so that users in Europe and Australia can't use channels 12 and 13. Even more ridiculous is that you cannot connect to ad-hoc network because that is disabled,only infrastructure mode is allowed. Maybe that could be patched too somehow...?
Im gonna set up a build enviroment and compile default ar6000.ko wifi_tools wpa_supplicant etc etc. My biggest concern is that just when i get it sorted...... someone will hack the bootloader and it won't be necessary anymore.
Don't know why they have done this.... i suspect to get the international approvals quickly without having to hack on the code.
Sent from my X10i using XDA App
MeZmeriZe_ said:
Im gonna set up a build enviroment and compile default ar6000.ko wifi_tools wpa_supplicant etc etc. My biggest concern is that just when i get it sorted...... someone will hack the bootloader and it won't be necessary anymore.
Don't know why they have done this.... i suspect to get the international approvals quickly without having to hack on the code.
Sent from my X10i using XDA App
Click to expand...
Click to collapse
I think the answer is the least common denominator. Why maintain two kernels, one with full number of channels available and one with a restricted set when the vast majority won't care and in most cases even won't know it's missing? It's easier to maintain one kernel with the lower number of channels since it'll work just fine on both markets.
Edit: Channel 14 is a japanese "bonus", so I'm disregarding this as it's only one country.
True, but the ar6000 is supposed to look at the locale set, and set the available channels from that. Unfortunately it seema SE broke it and locked it to 11 only. Needing 12 and 13 is more comman than you think
Sent from my X10i using XDA App
MeZmeriZe_ said:
True, but the ar6000 is supposed to look at the locale set, and set the available channels from that. Unfortunately it seema SE broke it and locked it to 11 only. Needing 12 and 13 is more comman than you think
Sent from my X10i using XDA App
Click to expand...
Click to collapse
Don't make assumptions about what I think, you'll look foolish. I know full well that those are useful channels, but I also know that it's illegal to use them in parts of the world. And when you're releasing a wireless device all over the world it sometimes makes more sense to limit the number of channels to the lowest common denominator.
Maybe i can look into japan rom and issue an patch in root thread
Sent from my X10i using XDA App
as i promised
http://hotfile.com/dl/52283415/58f59ba/wifi.rar.html
from docomo japan
this folder stays in /
jerpelea said:
as i promised
from docomo japan
this folder stays in /
Click to expand...
Click to collapse
So what do you suppose to do with those 3 files?
Simply copy them all in \ of the phone and reboot it?
Interesting, The module ar6000.ko IS actually different... for one thing it is 284 bytes smaller and a binary diff shows there is a small change early on in the file and a bit lopped off the end.
I put them in place in the root dir of the phone.... set the ownership:
chown -R root.root wifi
Turned off wifi so it unloaded the default module.
loaded it manually with insmod:
insmod /wifi/ar6000.ko
And off it went after turning the wifi back on.
Then renamed the old /system/wifi directory:
mv /system/wifi /system/old_wifi
and put the new one in it's place.
cp /wifi /system/wifi
works perfectly for normal wifi...
Just have to wait till I'm at work on Monday to find out if it gives me ch13. My big router has clagged wifi at present and a new card is on it's way from the US for it.. in the meantime I'm using a Siemens piece of junk that is also locked to 11 channels.
It is work I need ch13 for anyway.. will know on Monday.
Mr jerpelea, you are already a legend for your efforts rooting the phone, but you may have just put another feather in your cap.
MeZmeriZe_ said:
Interesting, The module ar6000.ko IS actually different... for one thing it is 284 bytes smaller and a binary diff shows there is a small change early on in the file and a bit lopped off the end.
I put them in place in the root dir of the phone.... set the ownership:
chown -R root.root wifi
Turned off wifi so it unloaded the default module.
loaded it manually with insmod:
insmod /wifi/ar6000.ko
And off it went after turning the wifi back on.
Then renamed the old /system/wifi directory:
mv /system/wifi /system/old_wifi
and put the new one in it's place.
cp /wifi /system/wifi
works perfectly for normal wifi...
Just have to wait till I'm at work on Monday to find out if it gives me ch13. My big router has clagged wifi at present and a new card is on it's way from the US for it.. in the meantime I'm using a Siemens piece of junk that is also locked to 11 channels.
It is work I need ch13 for anyway.. will know on Monday.
Mr jerpelea, you are already a legend for your efforts rooting the phone, but you may have just put another feather in your cap.
Click to expand...
Click to collapse
Unfortunately it still doesn't work, because they have disabled channels above 11 even in japanese firmware. :/
How do you know they disabled the japanese version? It is possible that we need to get japanese wlan_tools, wpa_supplicant and wmiconfig to get it working, not just the driver..... i cant think of any other reason they would change the driver like they have. I will be reflashing soon... i might put dotmoco japanese rom on first and test it properly
Sent from my X10i using XDA App
These files from japanese version are different simply because they are older versions. You won't get channels 12 and 13 if you substitute your files with those.
BUT I'VE FOUND A SOLUTION THAT REALLY WORKS!
You have to turn wifi off and hexedit file /data/misc/wifi/reg_code
Change its contents from 10 00 to 37 00 and you will now get full 13 channels!
Don't try to change to 40 00 (which would be for Japan), you won't get 14 channels because hardware supports just 13 and the driver would simply fail to load.
Wish there would be as simple solution as that also for the ad-hoc issue.
that is friggin awesome.... should tell jerpela so he can add it to root. funny, id looked at that file lots of times ant it never clicked that reg = region..... doh!
What is the ad-hoc issue? i wasnt aware there was one... have not tried it yet.
will look for the thread... lost in newbie "cant root" threads......
Sent from my X10i using XDA App
Hi Chilly,
Have you tested this?
I ask because it isn't working for me..
I made sure the permissions and ownership was the same as before, (system system for the one in data/misc) and also did the same for the one in /system/wifi and that one is owned root.root.
still not detecting 12 or 13... tis very odd... I am running the latest 23 rooted firmware... are you? Normal channels are working fine still.
So with camera support starting to roll in on my TP2, one of the first things I tried with the new camera was Google Goggles. Like many, I received a message that IPv6 is required in the kernel.
I've searched around, and found some solutions. It is possible to enable IPv6 with the following lines in the terminal:
Code:
su
modprobe ipv6
At this point, IPv6 is then enabled, and Google Goggles functions correctly.
It seems to me then that this would be an easy fix. Could it be added to the end of my froyo.sys.conf? And would it be easy to enable IPv6 by default in the kernel?
Wow, it's really that simple? Try adding just the second command to your froyo.user.conf, in the CustomCommands section. See what happens.
If so, I'm sure it could easily be enabled on the kernel. Heck, there may already be a cmdline option for it in the startup.txt...
Indeed it appears to be that simple. It would appear that the IPv6 support is there, in the modules file, as ipv6.ko. It is just a matter of calling the modules file with the modprobe command.
However, this is one of the larger modules, at almost 5 MB. Perhaps some of the devs are omitting this from their modules files, but Jerome's latest modules file for camera support on the Rhodium includes the ipv6 ko, and it simply needs to be loaded.
Oh, and I added the modprobe line to my froyo.user.conf, and it now loads at boot time. After every boot, I can use goggles without issue.
Just running the modboot from terminal requires that you repeat after each boot.
IPV6? Bah! It'll never catch on. But it will be cool to have an IP address of abbacaddabba.
jchutch2 said:
IPV6? Bah! It'll never catch on. But it will be cool to have an IP address of abbacaddabba.
Click to expand...
Click to collapse
Please read the first post. IPv6 is required by a small number of apps, notably Google Goggles.
gnnash said:
Please read the first post. IPv6 is required by a small number of apps, notably Google Goggles.
Click to expand...
Click to collapse
I guess he was just kidding.
I can't get the exact quote, but I have read about a good old english man, head of her majesty's patent office, in UK, in 19th century, that interviewed about the great advance in technology happening in the second half of 1800 stated something like this:
"Bad times are coming for patent offices: we already invented steam power by burning coal, what could possibly be invented more?"
LOL!
gnnash said:
Please read the first post. IPv6 is required by a small number of apps, notably Google Goggles.
Click to expand...
Click to collapse
Yeah...that was sarcasm to the nth degree. I actually already use IPv6 and browse the IPv6 Internet. It does have a few cool things on it. Check it out.
http://gogonet.gogo6.com/page/freenet6-ipv6-services
jchutch2 said:
Yeah...that was sarcasm to the nth degree. I actually already use IPv6 and browse the IPv6 Internet. It does have a few cool things on it. Check it out.
http://gogonet.gogo6.com/page/freenet6-ipv6-services
Click to expand...
Click to collapse
My apologies. Hard to tell sometimes if someone's being serious or not on these forums.
Thanks for digging this up! I've actually never modified my froyo.conf before, so I wanted to double check that I was doing it right before I jacked everything up.
Assuming I have the right set of modules, do I just add "modprobe ipv6" to the very last section? I'm assuming it gets its own line...?
Or is there something I can add to the startup.txt (which scares me a loooot less)
snowmaiden11 said:
Thanks for digging this up! I've actually never modified my froyo.conf before, so I wanted to double check that I was doing it right before I jacked everything up.
Assuming I have the right set of modules, do I just add "modprobe ipv6" to the very last section? I'm assuming it gets its own line...?
Or is there something I can add to the startup.txt (which scares me a loooot less)
Click to expand...
Click to collapse
Nope, needs to be froyo.user.conf. Go to the bottom, find the "CustomCommands" Section. Just place the command within those brackets on its own line - easy peasy.
how do you open that froyo.user.conf file? im in windows,synced up to pc and it says windows cannot open this file type. what am i doing wrong?
da1stprince said:
how do you open that froyo.user.conf file? im in windows,synced up to pc and it says windows cannot open this file type. what am i doing wrong?
Click to expand...
Click to collapse
Right click, open with. I prefer Notepad++, but normal notepad will do... just be careful of carriage returns (Linux and Windows handle them differently...)
Its showing #echo modprobe ipv6 on the line
Do I remove echo? or the # sign too?
Viper Matrix Wireless said:
Its showing #echo modprobe ipv6 on the line
Do I remove echo? or the # sign too?
Click to expand...
Click to collapse
Depending on where that is, yes you'd remove both the hash mark (#) and the echo.
I just put (in my CustomCommands section) 'modprobe ipv6' all on one line by itself.
I entered modprobe ipv6 in notepad & opened in notepad++ & it instantly showed that # echo modprobe ipv6 was entered. Thats why I brought it up.
Viper Matrix Wireless said:
I entered modprobe ipv6 in notepad & opened in notepad++ & it instantly showed that # echo modprobe ipv6 was entered. Thats why I brought it up.
Click to expand...
Click to collapse
Erm... no explanation for that. Never heard of that before, but I also never use notepad, I always use notepad++... the only thing I've had notepad screw up is carriage returns, which is expected because of the reason I stated above...
da1stprince said:
how do you open that froyo.user.conf file? im in windows,synced up to pc and it says windows cannot open this file type. what am i doing wrong?
Click to expand...
Click to collapse
You can also do this on your device using Astro.
With the camera support in the main kernel and builds, maybe it's time to implement this in an FAQ or into the builds
Sent from my MSM using XDA App
I tried this but its not working for me. Here is how I got it...
# custome shell commands, these commands run last
custome_shells{
chmod 77 /etc/dbus.conf
echo 2? /sys/devices/platform/msm_hsusb/
usb_function_switch
rm -f /sd/fsck*.rec
#echo "you can create your own commands here # example
modprobe ipv6
}
Do I delete the line [#echo "you can create your own commands here # example]
I was debugging on the phone, and all of a sudden I saw something that caught my eye:
Code:
D/FlurryAgent( 5172): Sending report to: http://data.flurry.com/aar.do
D/FlurryAgent( 5172): Report successful
I've checked the list of applications that I have installed (rename .apk to .zip and then use Total Commander to search for FlurryAgent within the archives) and I was almost shocked to see how many are containing a reference to the agent (within their classes.dex file).
I suspect that it wasn't put there for nothing ...
User britoso has provided a workaround here: you need to add three lines to /etc/hosts.
Chefs, please make sure your updates are including those three lines
PS: None of the applications asked if its ok to send usage data to analytics company flurry.com ...
sounds like the iphone scandal
andrewddickey said:
sounds like the iphone scandal
Click to expand...
Click to collapse
It seems so... we should be ready for valpurgis...
Ferrum Master said:
It seems so... we should be ready for valpurgis...
Click to expand...
Click to collapse
I'm not sure I get the connection...
There are *.flurry entries in the Adfree hosts file.
Ok, they said Flurry Analytics is to improve their apps. But, location? Is that really necessary? Glad I have Adfree installed.
Yea BC someone trying to steal/gain malicious information from u would go through the effort/be stupid enough to put evidence of it on logcat lol... come on ppl think. I mean I understand why this posted n more power to u. But if your THAT worried u need to be watching the traffic that doesn't broadcast it to yourself, not the traffic that does lol.
My 2 cents, take it for w/e its worth lol.
Sent from my Xoom using Tapatalk
blakwhite said:
There are *.flurry entries in the Adfree hosts file.
Click to expand...
Click to collapse
In my Adblock list I only found www.flurry.com, I'm still using V3.6 from wolf.
I guess I need a kernel with droid wall - and I will only allow certain applications to pass through.
And if some app requires internet connection and it doesn't tell me why beforehand, tough luck.
viulian said:
In my Adblock list I only found www.flurry.com, I'm still using V3.6 from wolf.
I guess I need a kernel with droid wall - and I will only allow certain applications to pass through.
And if some app requires internet connection and it doesn't tell me why beforehand, tough luck.
Click to expand...
Click to collapse
i recommend LBE Privacy Guard as well. It needs ONLY root and it allows you to totally take control over your apps' permissions
zmod already has these entries on hosts
Adolf1994 said:
i recommend LBE Privacy Guard as well. It needs ONLY root and it allows you to totally take control over your apps' permissions
Click to expand...
Click to collapse
Thanked, this is a very good app.
Not sure if this is strictly 'development', but it turns out the nexus Q with debugging enabled can run pretty much anything. So far I've only tested the doubleTwist alarm clock and firefox, but it works! (Admittedly, navigation is slow, but still, it's nice to see that Google was open with this)
how are you controlling the apps?
Well right now I'm just feeding it xy coordinates from a computer, but I'm considering trying to rig something up for wireless communication...if I feel motivated enough.
Nice! If i can run things like netflix and a web browser i will definitely pick one up.
shodutta92 said:
Not sure if this is strictly 'development', but it turns out the nexus Q with debugging enabled can run pretty much anything. So far I've only tested the doubleTwist alarm clock and firefox, but it works! (Admittedly, navigation is slow, but still, it's nice to see that Google was open with this)
Click to expand...
Click to collapse
Pandora would be nice with this. How are you running the apps? What if we could have an app that would directly communicate to the Nexus Q and just push the running app to it? Just brainstorming ideas
1. I have actually done some web surfing using firefox, and it works (although its not very easy right now)
2. Netflix streaming in fact does work, although I haven't really tested for video quality at the moment.
3. I can try pandora at some point during the week. Unfortunately, I don't currently have access to speakers for it, so I haven't tested any audio yet.
4. I'm running the app by sideloading apks using adb and then running adb shell to start the app.
5. I was considering writing a service that would allow me to send some commands from an android phone...but somebody may have done that already (there's an app on the play store called Tablet Remote that I may try) so I may just give that a go.
I just got my Nexus Q so I'm definitely interested in development. If you need any testers feel free to hit me up!
Sent from my SAMSUNG-SGH-I747 using Tapatalk 2
anyone know how to get windows to recognize the nexus q when you put it in debugging mode (so I can use adb)
shodutta92 said:
1. I have actually done some web surfing using firefox, and it works (although its not very easy right now)
5. I was considering writing a service that would allow me to send some commands from an android phone...but somebody may have done that already (there's an app on the play store called Tablet Remote that I may try) so I may just give that a go.
Click to expand...
Click to collapse
I've had similar experiences, side loading works just fine and all the apps start up. I looked into this tablet remote, and it seems like it would work too, but I hate the idea of Bluetooth pairing.
In the spirit of this device, I suppose the "right" way to do this would be to forward commands through a server. The receiver service running on the device end with a remote on the client end.
The limitation of the Tablet Remote is that it would require all of the apps to be started via ADB. I'm thinking of making a simple interface that starts some of the apps you would want to run (Pandora, Crackle, Netflix, etc).
I've actually developed a little app that I'll post here in a day or two. Its an app that starts a custom web server that runs in the background. I have a few commands running on it now that list the installed packages and to launch a package. Now I'm working on adding support for intents.
The idea is that you just need to load this one app through ADB (and any other apps you need installed). After that, you just go to the URL of the Q to control it.
Some commands that work now, where xxx.xxx.xxx.xxx is the IP address of the Q:
http://xxx.xxx.xxx.xxx:8081 - shows home page with a list of supported commands
http://xxx.xxx.xxx.xxx:8081/listpackages - shows a list of installed packages, each with a hyperlink to launch that package by clicking on it
http://xxx.xxx.xxx.xxx:8081/launch?package=com.xxxx.xxx - will launch a particular package
So at this point, I'm not sure how to do touch or keyboard input. Has anyone tried a usb hub to a mini usb adapter, and plugging in a USB mouse and keyboard. I guess you can't do bluetooth devices since you need something to select the action to actually do the pairing.
-Gregg Reno
nwadams said:
anyone know how to get windows to recognize the nexus q when you put it in debugging mode (so I can use adb)
Click to expand...
Click to collapse
nwadams - I had to edit the android_winusb.inf file manually. Put this in both the [Google.NTx86] and [Google.NTamd64] sections. I'm not sure if you need that &REV_0216 at the end or not. Then I manually had windows install the driver, and pointed it to the android-sdk\extras\google\usb_driver folder.
; Nexus Q
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_2C10&REV_0216
greno1 said:
nwadams - I had to edit the android_winusb.inf file manually. Put this in both the [Google.NTx86] and [Google.NTamd64] sections. I'm not sure if you need that &REV_0216 at the end or not. Then I manually had windows install the driver, and pointed it to the android-sdk\extras\google\usb_driver folder.
; Nexus Q
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_2C10&REV_0216
Click to expand...
Click to collapse
thanks man. worked like a charm.
Yeah I was actually going to try something along the web server route. We'll see: I won't have access to a Q until thursday
I've experimented with bluetooth pairing (Magic Mouse) but I couldn't get the pairing to actually complete, and logcat was rather unhelpful with that one.
Also, how're you handling starting apps where the activity needs to be specified? I've found that ones that don't handle the Launcher intent or w/e don't really start properly unless I give it the activity name manually.
I just uploaded my test app and started another thread "Juice Receiver". I figured that would probably need a thread of it's own to report problems or request features.
The background service should autostart since I created a broadcast receiver to start the service. In the manifest, I set this for the broadcast receiver: action android:name="android.intent.action.BOOT_COMPLETED"
greno1 said:
nwadams - I had to edit the android_winusb.inf file manually. Put this in both the [Google.NTx86] and [Google.NTamd64] sections. I'm not sure if you need that &REV_0216 at the end or not. Then I manually had windows install the driver, and pointed it to the android-sdk\extras\google\usb_driver folder.
; Nexus Q
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_2C10&REV_0216
Click to expand...
Click to collapse
I use linux, and i can detect the device, but it says under device number, ????????????? and no permissions as well. i try to adb shell it, no permissions. Anyone have any ideas on how to fix? Really want to start working on this bad boy.
FadedLite said:
I use linux, and i can detect the device, but it says under device number, ????????????? and no permissions as well. i try to adb shell it, no permissions. Anyone have any ideas on how to fix? Really want to start working on this bad boy.
Click to expand...
Click to collapse
sudo adb start-server
Or go on source.android.com and follow the directions for the adb permissions section and add a line for the Q info you can get from lsusb
How exactly did you send it x, y coordinates? I got the netflix apk up and running on it: https://plus.google.com/110462891087801857205/posts/Ufu6hT8GX9i
Obviously useless without some sort of input. I noticed that someone got a HID mouse working with it though.
Also to note: this was not rooted, just did a normal adb install with an apk.
kentoe said:
How exactly did you send it x, y coordinates?
Click to expand...
Click to collapse
I used MonkeyRunner (you can look it up on the android developers website.
shodutta92 said:
I used MonkeyRunner (you can look it up on the android developers website.
Click to expand...
Click to collapse
Cool, thanks.
I actually got passed the login page for netflix, just gotta somehow figure out how to press the movie to initiate streaming something.
I actually just eyeballed the screen and guessed where to press until I got a movie to play. Not precise, but good enough for testing.
Ever since I got my Droid 3 I wanted to be able to control games using the keypad, but sadly most games won't support it, so I figured, it would be cool if I could make an app that catches all the keyboard events and triggers fake MotionEvents for preset regions of the touchscreen (kindof how it's done on the iControlPad).
I believe I've found a way to fake the touches, but when searching for a way to read keyboard events when my app doesn't have the focus all lead to dead ends.
Does anybody have a clue how I could do that?
If anyone cares: I not only managed to find a way to read out all the touches and keystrokes that should go to other apps (though some android-coworker said it was impossible), but I can also filter which one of those I let through. I can even block the back- and home-buttons. And it's runnable without any running service or activity, so invisible and unkillable. I don't need most of that for my app, so I won't use what I don't need, I just stumbled across it by accident.
Every threat on this topic ended with "It's impossible to read out keystrokes destined to another app, because it would be too much of a security issue." Well, it is possible.
Sent from my XT860 using xda app-developers app
Dakkaron said:
If anyone cares: I not only managed to find a way to read out all the touches and keystrokes that should go to other apps (though some android-coworker said it was impossible), but I can also filter which one of those I let through. I can even block the back- and home-buttons. And it's runnable without any running service or activity, so invisible and unkillable. I don't need most of that for my app, so I won't use what I don't need, I just stumbled across it by accident.
Every threat on this topic ended with "It's impossible to read out keystrokes destined to another app, because it would be too much of a security issue." Well, it is possible.
Sent from my XT860 using xda app-developers app
Click to expand...
Click to collapse
I do care! I would appriciate to hear how this works, because I would need it for my ongoing development.
Besides Camara button, which is of cause easy due to the broadcast event, and the volume keys (which are more tricky, since you have to inject an own BroadcastReceiver to the AudioManager), how do you handle other keys?
Ok, it's been a while since I did this, and I had a lot of work on other projects in between so, I hope I get everything right.
To do the whole trick you need root access.
1) Get the android.permission.SYSTEM_ALERT_WINDOW permission
2) Open up a system alert window with no content. There is a setting somewhere that lets you catch all keystrokes and touches. This blocks them all from going through
3) This one is tricky. I had to analyse nonsense for days to get it right, and I fear it's still not very good. Go to /dev/input on your phone. There are files named event1, event2, ...
Each of those correspond to one input device, so one is your touchscreen, one is the keyboard and so on. What you do now is you perform the action you want to recreate on the phone (e.g. press a key) and monitor the event files through adb (there is a linux command, that I forgot, that lets you view a file in real time. Also you can copy that real time view to your harddrive by typing "adb shell [command] > record.txt").
Once you know every event that you want to recreate, you can go to the next step.
4) This is what your app has to do to let a keystroke through: The user presses a key, your app catches it. Then it changes it's mode (see 2) ) to not catch any keystrokes at all, posts the corresponding event for that key in the fitting /dev/input/eventX-file, and sets itself to catch keystrokes again.
Before the whole thing make sure, your /dev/input/eventX-file has a chmod of 666 or therelike, since you can't write into it from your app. You only need root for that, after that you don't need root. The OS resets the chmod on each reboot.
It is a hell of a lot of work. Calculate about a week or more for just that (at least that was what it took me to figure it all out). Good luck
PS: If you get your app system privileges, there is also the android.permission.INJECT_EVENTS, which allows you to inject key- and touch-events to another app using a simple function (can't remember it, but Google does). For your app to be able to get system privileges you need to copy it to /system/app, which requires root and a mounted /system. Catching the keystrokes still works the same way as above.
Dakkaron said:
Ok, it's been a while since I did this, and I had a lot of work on other projects in between so, I hope I get everything right.
To do the whole trick you need root access.
1) Get the android.permission.SYSTEM_ALERT_WINDOW permission
2) Open up a system alert window with no content. There is a setting somewhere that lets you catch all keystrokes and touches. This blocks them all from going through
3) This one is tricky. I had to analyse nonsense for days to get it right, and I fear it's still not very good. Go to /dev/input on your phone. There are files named event1, event2, ...
Each of those correspond to one input device, so one is your touchscreen, one is the keyboard and so on. What you do now is you perform the action you want to recreate on the phone (e.g. press a key) and monitor the event files through adb (there is a linux command, that I forgot, that lets you view a file in real time. Also you can copy that real time view to your harddrive by typing "adb shell [command] > record.txt").
Once you know every event that you want to recreate, you can go to the next step.
4) This is what your app has to do to let a keystroke through: The user presses a key, your app catches it. Then it changes it's mode (see 2) ) to not catch any keystrokes at all, posts the corresponding event for that key in the fitting /dev/input/eventX-file, and sets itself to catch keystrokes again.
Before the whole thing make sure, your /dev/input/eventX-file has a chmod of 666 or therelike, since you can't write into it from your app. You only need root for that, after that you don't need root. The OS resets the chmod on each reboot.
It is a hell of a lot of work. Calculate about a week or more for just that (at least that was what it took me to figure it all out). Good luck
PS: If you get your app system privileges, there is also the android.permission.INJECT_EVENTS, which allows you to inject key- and touch-events to another app using a simple function (can't remember it, but Google does). For your app to be able to get system privileges you need to copy it to /system/app, which requires root and a mounted /system. Catching the keystrokes still works the same way as above.
Click to expand...
Click to collapse
Thank you for your innovative solution
I do not understand two points:
1. How does your app will stay on top and its windows receives events, when the user opens another app, a game for example.
2. How does the background app, the game, keep running? Isn't the game onPause() when you are running your app in front?
Thanks you.
Dakkaron said:
2) Open up a system alert window with no content. There is a setting somewhere that lets you catch all keystrokes and touches. This blocks them all from going through
Click to expand...
Click to collapse
Can you please try to remember and elaborate " a setting somewhere" part?