Hooking into S-Pen Sensor to Change Keyboard - Galaxy Note II, Galaxy S III Developer Discussion

Lenny and I were talking and sorta had the same idea independently, in that it would be nice to be able to use one keyboard "normally", and another when the S-Pen is in use (ie. removed).
Here's my thinking...
1) Hook into the framework via Xposed Framework such that when the S-Pen is removed, we store the current default keyboard.
2) Change the current default keyboard for the alternative keyboard (ie. the one for use when S-Pen is removed from phone)
3) When S-Pen is replaced into the device, the reverse is done - we backup the "S-Pen" keyboard, and restore the previous default.
This way, the user doesn't actually need to program it with their choice of keyboard - instead, it will simply learn what they use
Problems I anticipate:
Root access needed to change default keyboard
Can't remember where default keyboard is stored, but it might be in a database, needing me to actually write more than a few lines of code.
Any thoughts/comments?

What about hooking into the multiwindow keyboard? Or is that just complicating things?

q426669 said:
What about hooking into the multiwindow keyboard? Or is that just complicating things?
Click to expand...
Click to collapse
Not sure what you mean by this tbh... I don't use stock keyboard enough right now to know it..
I have looked at the sdk and there is functionality for the holster state of the s-pen.
I need to think through this, as likely we need a screen on receiver to run a service but only wake if the state changes...

pulser_g2 said:
Lenny and I were talking and sorta had the same idea independently, in that it would be nice to be able to use one keyboard "normally", and another when the S-Pen is in use (ie. removed).
Here's my thinking...
1) Hook into the framework via Xposed Framework such that when the S-Pen is removed, we store the current default keyboard.
2) Change the current default keyboard for the alternative keyboard (ie. the one for use when S-Pen is removed from phone)
3) When S-Pen is replaced into the device, the reverse is done - we backup the "S-Pen" keyboard, and restore the previous default.
This way, the user doesn't actually need to program it with their choice of keyboard - instead, it will simply learn what they use
Problems I anticipate:
Root access needed to change default keyboard
Can't remember where default keyboard is stored, but it might be in a database, needing me to actually write more than a few lines of code.
Any thoughts/comments?
Click to expand...
Click to collapse
ive read about Xposed framework but am not sure why/how its any usefull for this?
also what keyboard vs another would you be using in both situations ? or are you referign to handwriting style vs normal mode ?
when you pull the spen there is already an option in settings to have a pop up version of snote 'poping up' that means the framework is already able to make the call when spen is pulled ..
poping up the ime switcher instead of snote...i assume one to many steps for you .. how about a gesture to launch the keyboard of your choice ?
other then easy workarounds , I think you would need to write more then a few lines of code , like an app or something .. especially for step 3 ...

If you check out a rom with multiwindow, you'll be able to use the mini floating keyboard whem you have two things on the screen so you don't loose visibility of content. Anyways, I think that's just complicating things.
The purpose of this project is so that I could use the 4.2 keyboard whwn my s-pen is holstered, and then the samsung keyboard when it is out.
Currently when I'm using the Android IME I have to make a manual switch to the Samsung keyboard when I pull out my spen.
This would allow one IME to be used while the s-pen is unholstered, and a seperate IME when the pen is put away.

q426669 said:
If you check out a rom with multiwindow, you'll be able to use the mini floating keyboard whem you have two things on the screen so you don't loose visibility of content. Anyways, I think that's just complicating things.
The purpose of this project is so that I could use the 4.2 keyboard whwn my s-pen is holstered, and then the samsung keyboard when it is out.
Currently when I'm using the Android IME I have to make a manual switch to the Samsung keyboard when I pull out my spen.
This would allow one IME to be used while the s-pen is unholstered, and a seperate IME when the pen is put away.
Click to expand...
Click to collapse
Yup that's my thinking!
Multi windrow would be nice at a later date, but that's another stage of this

pulser_g2 said:
Yup that's my thinking!
Click to expand...
Click to collapse
Is there any type of notification (or intent? I get those mixed up) sent by the system when the spen is pulled? If so, a program could be launched on SPen removal. The next step would only be to change the default keyboard (which likely will require root, but should be doable.) So, instead of hacking anything, this would just be a separately installed apk.

garyd9 said:
Is there any type of notification (or intent? I get those mixed up) sent by the system when the spen is pulled? If so, a program could be launched on SPen removal. The next step would only be to change the default keyboard (which likely will require root, but should be doable.) So, instead of hacking anything, this would just be a separately installed apk.
Click to expand...
Click to collapse
I started looking at the samsung sdk and there is a receiver for the spen being removed.
I agree, this can be a standalone root app...
I didn't know the sdk could do this, but it can

I'm not a developer and just a noob, but I noticed that if you have anyother keyboard activated and showing, and you plug an usb on the go cable with a keyboard, you just have to press OK on a popup and then the keyboard changes.
Since I'm not even good at english, I recorded it on screencast. I'm sorry if this is useless, but I thought it could be some more starting point.

This is a very interesting idea, is this project "dead"?
I would be more than happy to help (or do it on my own if it's dead), furthermore I have collected everything I need to make this thing work ...

Okay guys, I will start working on the app. Anyone interested in the details of progress?
If you want to help, you can think of a name better than the one I thought about (SPen IME Switcher)
Or an Icon would be very much appreciated as I'm very bad at picture creating.
EDIT: Changed mind to SPenBoard Switcher

LegendK95 said:
Okay guys, I will start working on the app. Anyone interested in the details of progress?
If you want to help, you can think of a name better than the one I thought about (SPen IME Switcher)
Or an Icon would be very much appreciated as I'm very bad at picture creating.
EDIT: Changed mind to SPenBoard Switcher
Click to expand...
Click to collapse
I'm interested. But I'm not a developer, so I can just help by beta-testing .
Post your progresses here or just open a new topic for the app

Okay then, here's the current progress:
The app is still in the works of course, but I have a working prototype! And it's working better than expected , the prototype changes the keyboard immediately according to the state of the pen (inserted or removed), but currently the keyboards are hardcoded into the service (Swype and Samsung's Keyboard in my case).
I have to find a way to get all installed keyboards and let the user choose which keyboard is wanted for which state (I have an idea how to do that), then I'll have to get enough info from the selected keyboards to switch between them (I also have an idea on how to do that )
Only downside to the app now is, the app MUST be in /system/app.
Currently I'm adding two options, one to enable/disable the service, and one to enable service at boot.

(putting on the 'moderator' hat for this post...)
In trying to promote the purpose of this section (development discussion), can you please share details (and perhaps even code snippets) on what you are doing to detect the s-pen state, how you are going about changing the active keyboard, etc.
If you choose not to share this information, please create another thread in another section for your application.
Thank you
Gary

LegendK95 said:
Okay then, here's the current progress:
The app is still in the works of course, but I have a working prototype! And it's working better than expected , the prototype changes the keyboard immediately according to the state of the pen (inserted or removed), but currently the keyboards are hardcoded into the service (Swype and Samsung's Keyboard in my case).
I have to find a way to get all installed keyboards and let the user choose which keyboard is wanted for which state (I have an idea how to do that), then I'll have to get enough info from the selected keyboards to switch between them (I also have an idea on how to do that )
Only downside to the app now is, the app MUST be in /system/app.
Currently I'm adding two options, one to enable/disable the service, and one to enable service at boot.
Click to expand...
Click to collapse
Sounds good. I might take a look at it again.
Perhaps, if you want to make it work, rough-and-ready style, you could simply have two txt files in /data, that define the s-pen and no-s-pen keyboards.
If not, you could take a look at http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html
The app being in /system/app likely isn't a major issue, though it's possible we could maybe use root to do it directly...

pulser_g2 said:
Sounds good. I might take a look at it again.
Perhaps, if you want to make it work, rough-and-ready style, you could simply have two txt files in /data, that define the s-pen and no-s-pen keyboards.
If not, you could take a look at http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html
The app being in /system/app likely isn't a major issue, though it's possible we could maybe use root to do it directly...
Click to expand...
Click to collapse
I used another way to do this, the app is actually close to being finished, I just have to add some more tweaks here and there!
I'll make sure to post detailed information on how I achieved this.
As of now, the user can choose to run service, run it on boot, and choose keyboards for each mode (SPen or No Spen), any suggestions for other options that one might need?
Regarding the /system/app thing, I tried to use root to move the app to /system/app on first launch, but failed.
I'll try to do this later, if anyone knows how to do this, then it would be great .
EDIT: Attached a picture of the app in it's current state.

LegendK95 said:
I used another way to do this, the app is actually close to being finished, I just have to add some more tweaks here and there!
I'll make sure to post detailed information on how I achieved this.
As of now, the user can choose to run service, run it on boot, and choose keyboards for each mode (SPen or No Spen), any suggestions for other options that one might need?
Regarding the /system/app thing, I tried to use root to move the app to /system/app on first launch, but failed.
I'll try to do this later, if anyone knows how to do this, then it would be great .
EDIT: Attached a picture of the app in it's current state.
Click to expand...
Click to collapse
Hmmm that looks nice
Regarding moving the app, here's how I'd suggest you do it. Should defo. work, but can't guarantee it is the fastest way.
1) Gain root
2) Remount /system as writable
3) Copy /data/app/com.your.app.name*.apk to /system/app/, chowning and chmodding to 644
4) Extract a helper app from the main APK, and install it to /data, and gain root
5) Use helper app to delete the /data/app/com.your.app.name*.apk file
That should work after a reboot, I reckon...

thread cleaned. Please read the section guidelines BEFORE posting. LegendK95, if you've started another thread for your app, you are welcome to post a link to it here (so that people can post their comments on that app in another section.)
Gary

garyd9 said:
thread cleaned. Please read the section guidelines BEFORE posting. LegendK95, if you've started another thread for your app, you are welcome to post a link to it here (so that people can post their comments on that app in another section.)
Gary
Click to expand...
Click to collapse
Thank you.
Here's the link to the finished application.
Anyway, as promised, I'll describe how the app works (for developers):
How do I know when is the pen inserted or removed?
Basically, The whole trick is in a broadcast receiver.
I found the action that Samsung uses for the pen while I was working on my other project (SF).
Details: I searched in android.policy.jar, and found it there, in a broadcast receiver subclass for the huge and important PhoneWindowManager class
The broadcast receiver receives an intent with the action "com.samsung.pen.INSERT"
When it's sent from the system, an extra value comes along.
The value is a boolean, with the String identifier "penInsert".
This broadcast receiver is a subclass of the service that switches the keyboard, once this intent is received, the "penInsert" extra value is assigned to a field inside the service's class.
Click to expand...
Click to collapse
How does the service change keyboards?
The current keyboard can be changed using different methods, but they all do it the same way.
I used the "master" way to change the keyboard, which all the different methods lead to in the end.
The current keyboard is stored as a String inside the Settings Provider's Secure Database, with an identifier String of "default_input_method".
The stored value is called the IME ID, which is generated from the package and class name implementing the method, with a / in-between.
*From developer.android.com
So with this known, if we can get the id of a keyboard, we can use the putString method to replace the value inside the Secure Database, thus resulting in changing the default keyboard to that one.
Click to expand...
Click to collapse
How do I get the list of keyboards enabled, and their ids?
You can get a List containing the information for all keyboards enabled using the InputMethodManager service, then calling getEnabledInputMethodList().
From there, you can use each Object in the list (the object will be an InputMethodInfo instance) to get their ids, labels, icons...
Click to expand...
Click to collapse
That's it I guess, if you have questions, feel free to post them here so that everyone can benefit from this.

Related

[Exploit] Location Stealing on Samsung smartphones

Edit: Uploaded new APK which is compatible with devices from Android 2.0 and up.
First of all, let me say this: I love Samsung smartphones, I myself own one, the Samsung Galaxy S, and these are great devices. Me sharing this information is only in the will to do good, so that people know how to protect themselves from this exploit and to pressure Samsung in fixing it on future updates.
What my exploit does it to obtain the user location, without the app needing any android permission AT ALL. Usually you could obtain the user location by using permissions such as ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION or even via Internet. The thing is, by using one of those, the user is alerted that that particular app will have access to those permissions on the device, but with my exploit the app is able to get the same info without issuing any of those. Also, this does not rely on having Root permissions on the device, this exploit works on out-of-the box devices.
The reason why this happens is because a certain widget (accurweather widget that comes with the phone) on some modern Samsung phones places the info about the location readable by every app in System Properties, its hidden from the 'naked eye' if you're just looking at the API, but you just have to know its name to get it. So these next 2 lines of code will get you the information used for the exploit (go ahead and compile your own version if you're afraid of my APK):
String value1 = Settings.System.getString(getContentResolver(), "aw_daemon_service_key_city_name");
String value2 = Settings.System.getString(getContentResolver(), "aw_daemon_service_key_detail_info");
The problem is even more serious than I first though, because you only need to have the widget on the launcher once, and that info will remain in the system informations when you remote it from the launcher, even across reboots or even if you clear the widget's data and cache (pretty scary :S). Sometimes (I don't know why exactly yet) the info goes away for good, but only if you don't have this widget on your launcher!
So, what devices does this affect. From my tests, it affect the Galaxy Note and the Samsung Galaxy S II, but it should affect much more new Samsung devices probably, I just didn't test. I have a SGS but since I run cyanogenMod there was no point running it there either (cyanogenmod ftw! ).
Of course you might be wondering right now, that if you MANUALLY set the place to some strange place on the widget (let's say a remote village in China) what is reported by the exploit will be that place, but it seems to me that most people will be using this on "current location" setting.
So my truly advise is, root the phone and remove the widget for good (needs root because it is a system app). If you don't want to root the phone, then just manually change the place of the widget to something else.
In this thread I leave the simple app that shows you if your device its exploitable, and if so it shows you SOME of the information that could be exploited. As you'll notice during install, no permissions are required, nor the app will at any time ask for root permissions.
Market link to same app: https://market.android.com/details?id=com.pedronveloso.samsunglocationstealing
Indeed, very good sharing...
Keep the good work...
Cheers
Fortunately i don´t use TW....
"Issue parsing the package" error and does not let me download in the market as I'm on an LG Thrill. I would however like to see if the Thrill/O3D's Accuweather widget is also prone to this issue. Thank you.
So would it be enough for Accuweather to be updated (once its patched), or is the problem deeper then that?
Simple solution for me, just removed it.
Will search for an other weather app.
We have a class action lawsuit against HTC/Accuweather going on over on the HTC EVO side, although our accuweather issue is it's transmitting location unencrypted in plain text to advertisers.
Wonder if this could be modified to work with the Sprint/HTC accuweather
Snuble said:
So would it be enough for Accuweather to be updated (once its patched), or is the problem deeper then that?
Click to expand...
Click to collapse
From what I understand, the data is pulled with no permission or anything only because it's a system app. Remove it and be safe.
I knew I froze the app for a reason! Thanks for sharing your discovery.
Snuble said:
So would it be enough for Accuweather to be updated (once its patched), or is the problem deeper then that?
Click to expand...
Click to collapse
I don't know for sure yet, but I'm guessing it probably could. The thing is, I think accurweather its a modified version for the Samsung phones, so only a ROM itself would carry such update, and we know how long those take :\.
bedwa said:
"Issue parsing the package" error and does not let me download in the market as I'm on an LG Thrill. I would however like to see if the Thrill/O3D's Accuweather widget is also prone to this issue. Thank you.
Click to expand...
Click to collapse
Was probably because I made the minimum SDK equals to Android 2.3.3 . I've fixed that now, on the attachment and on the Market, so go ahead and try again please
Could anybody do me a huge favour, all i need is a screenshot of the results this application gets (a real location)
Im doing a dissertation on android gps forensics and it would be useful and as i dont have a samsung myself i cant do it.
Phil750123 said:
Could anybody do me a huge favour, all i need is a screenshot of the results this application gets (a real location)
Im doing a dissertation on android gps forensics and it would be useful and as i dont have a samsung myself i cant do it.
Click to expand...
Click to collapse
This an earlier screenshot I have, almost the same but field names are in portuguese, however the info extracted is the same and reads in English so you can get the idea.
Thanks a lot just what i needed!
Hi, very good work.
it's possible to know which version of accuweather you refer?
Reports null on my samsung
Sent from my SGH-T679 using XDA App

Rooted ROM yields "S Note has stopped working"

After installing the N8000XXALGA_N8000OXXALG5_PHE_RootGalaxyNote.com via Odin, the message "Unfortunately, S Note has stopped working" pops up every 5-9 seconds.
How do I resolve this situation?
Losing S-Note is not to be considered a preferable option.
The tablet is currently not really usable, as S-Note appears to be relaunching and crashing, so I can get one click, touch, or gesture between notices.
I wanted root access to avail myself of the market enabler, so I downloaded the pre-rooted ROM that's supposed to be reliable and stable, and it's supposed to keeps things stock, except for the fact that the tablet would then be rooted.
But now, I get an error message every 5 seconds telling me that S Note stopped working.
I can now get one click in, in between notices. What's worse, I can't temporarily stop S Note, to at least disable the warning, and let me try to do something.
I can't use my tablet, at all. And I haven't any other ROMs handy (except for the Jelly Bean leak).
But all I wanted was STOCK rooted... Not headache.
All I want is to use market enabler so I can download geometriq. Is that too much to ask for?!?!?
In my despair, I went into recovery mode and hit the factory reset button. I restarted my tablet as if brand new, all my files gone, my settings rearranged to default, everything... I would have backed up, but without root, I couldn't get Titanium Backup installed, previously. Now, even the demo stuff that comes with SNote is missing. Although, everything seems to be working, now.
manhattan212 said:
All I want is to use market enabler so I can download geometriq. Is that too much to ask for?!?!?
Click to expand...
Click to collapse
You don't need root for that. Isn't market enabler an app for devices which don't have install unknown sources in settings? I had that app on my old phone. Note has the option built in. Note 10.1 settings, in security, has option to check unknown sources. Which allows you to install apps from other sources and not just marketplace. Works well for me as ive installed tons of apps that way and wasn't from marketplace.
If that's not what you mean then my bust
demandarin said:
You don't need root for that. Isn't market enabler an app for devices which don't have install unknown sources in settings? I had that app on my old phone. Note has the option built in. Note 10.1 settings, in security, has option to check unknown sources. Which allows you to install apps from other sources and not just marketplace. Works well for me as ive installed tons of apps that way and wasn't from marketplace.
If that's not what you mean then my bust
Click to expand...
Click to collapse
What you're referring to I think is the allowing of unknown sources. That's a little different from what I'm trying to do.
On a slightly different but still relevant note -no pun intended... Can I re-install S Note; if so, how?
Re-install your stock rom using ODIN... This will give back all stock apps...
Then go here - http://rootgalaxynote.com/galaxy-no...t-galaxy-note-10-1-easiest-methodcwmmethod-2/ and follow the instructions... This will give root access to your stock rom (n8000) and you don't have another countries CSC...
ultramag69 said:
Re-install your stock rom using ODIN... This will give back all stock apps...
Then go here - http://rootgalaxynote.com/galaxy-no...t-galaxy-note-10-1-easiest-methodcwmmethod-2/ and follow the instructions... This will give root access to your stock rom (n8000) and you don't have another countries CSC...
Click to expand...
Click to collapse
Thanks for the reply.
But, that's exactly what I had done.
However, you know that initial collection of notes that are included, in a stock ROM?
My S Note is still missing that.
When I launch my S Note, it's barren
-not a single solitary note.
That's why I wasn't sure if reinstalling the ROM installed a brand new S Note, or what.
And that's why I was asking about reinstalling S Note itself.
As soon as you start a new note (+ key) it will give you the option of what note template you want to use...
And if you have installed an OTA to the latest you will now have a landscape template...
ultramag69 said:
As soon as you start a new note (+ key) it will give you the option of what note template you want to use...
And if you have installed an OTA to the latest you will now have a landscape template...
Click to expand...
Click to collapse
Thanks again for the reply. And thanks for bringing the landscape template to my attention; my S Note includes this template...But I'm not referring to the templates... I'm referring to the initial four Books, I think it was, that are included.
I'm not really sure what all I'm missing out on,
due to the absence of these included readings, that are missing from my Note 10.1
(I think one of these notes or a couple of the notes, are manuals).
But, beyond that, I really really want the ability to have a note/memo [like S Memo's widget allows].
On my S3 I have a whole pane dedicated to an instance of the widget.
I keep a list of things I need to do, on it; and it's always staring at me, without me having to do anything at all -I don't need to launch an application, I don't need to click any shortcuts, or go to any folder -it's just there..
And when I need to edit it or add something to it, I just simply double tap the screen, without having to launch any apps or go to application folders, or anything.
S Note has the mini app -but the mini app is REALLY always there, as in you can't get away from it, unless you close it.
And more importantly, for as long as it's there, it's editable, so it's prone to accidental smears.
S Note is an alright piece but it's just shy of gimmicky.
This S Memo feature, which enables users to take the S Pen and write a note -and keep it indefinitely handy is slightly harder to find. I've found other memo apps and note taking apps that are close -but never quite right. Some don't allow you to hand write (you have to keyboard your info in); and others don't offer this ever so wonderful widget...
This has become a tangential rant, hasn't it?
Sorry...
I just want S Memo for my note 10.1
I think I also had this issue after installing the pre-rooted European ROM on a US N8103.
I managed to find a solution - too late for you now though
1) Installing Titanium Backup Root + Pro Key via the Play Market in Windows
2) In TB Freezing S-Note and then wiping the cache (Swipe Left on the Apps Backup Properties to get to the Special Properties) I also tried wiping the Apps Data but that didn't make any difference.
You could do the same thing in Application Manager but I think it would take about 20 minutes scrolling down to maybe get to S Note whilst the message popped up. Alternately you could add a short cut to the home screen and try long pressing and dropping on to App Info - which you could maybe just about do between pop-ups.
I guess you could stick a recovery on it and just wipe the cache full stop?
[EDIT]
BTW how did you get on with the OTA didn't work out so well for me
manhattan212 said:
Thanks again for the reply. And thanks for bringing the landscape template to my attention; my S Note includes this template...But I'm not referring to the templates... I'm referring to the initial four Books, I think it was, that are included.
I'm not really sure what all I'm missing out on,
due to the absence of these included readings, that are missing from my Note 10.1
(I think one of these notes or a couple of the notes, are manuals).
But, beyond that, I really really want the ability to have a note/memo [like S Memo's widget allows].
On my S3 I have a whole pane dedicated to an instance of the widget.
I keep a list of things I need to do, on it; and it's always staring at me, without me having to do anything at all -I don't need to launch an application, I don't need to click any shortcuts, or go to any folder -it's just there..
And when I need to edit it or add something to it, I just simply double tap the screen, without having to launch any apps or go to application folders, or anything.
S Note has the mini app -but the mini app is REALLY always there, as in you can't get away from it, unless you close it.
And more importantly, for as long as it's there, it's editable, so it's prone to accidental smears.
S Note is an alright piece but it's just shy of gimmicky.
This S Memo feature, which enables users to take the S Pen and write a note -and keep it indefinitely handy is slightly harder to find. I've found other memo apps and note taking apps that are close -but never quite right. Some don't allow you to hand write (you have to keyboard your info in); and others don't offer this ever so wonderful widget...
This has become a tangential rant, hasn't it?
Sorry...
I just want S Memo for my note 10.1
Click to expand...
Click to collapse
**FIX**
manhattan212 said:
After installing the N8000XXALGA_N8000OXXALG5_PHE_RootGalaxyNote.com via Odin, the message "Unfortunately, S Note has stopped working" pops up every 5-9 seconds.
How do I resolve this situation?
Losing S-Note is not to be considered a preferable option.
The tablet is currently not really usable, as S-Note appears to be relaunching and crashing, so I can get one click, touch, or gesture between notices.
Click to expand...
Click to collapse
I had the same issue after flashing the root injected stock ICS through ODIN. I was going from a rooted JB Rom (that did not work, and was not JB.. AA not the best site.)
Anyways the only way I was able to fix it was to painfully go through the Settings>Applications>All>S-Note Clear Cache/Data, and Force Stop.
It's tedious as hell, but it works. Your lucky yours is popping up every 5 minutes mine was about every 30 seconds took awhile to get through those menus! Hope this solves your issue!

Editing / Modifying existing Custom Rom Utility?

Hi All,
I was wondering if you could point me in the direction of (IF SUCH A UTILITY EXISTS) a webpage / App / Windows Utility, that can open a pre-made existing custom rom. And say for example it can.....
1) Change the Build.Prop file, from Chinese to English and strip out any other unneeded settings.
2) Remove Chinese Apps, or any other unneeded Apps
3) Replace key Chinese Apps, with English Apps... (ie: swap pre-configured MS Bing Voice keyboard to Google Keyboard)
Basically, just tidy up a pre-released Chinese rom, into English....
Does such an App, or service exist....??? If so, can anyone point me in the right direction please...
Thanks, Lister
What you are asking for is very complex and is never one in the same across other devices. In this typical situation the best solution is to manually make the changes.
Hi Modding.MyMind,
Thank you for your quick reply, indeed I was able to make the changes post (AFTER) the initial setup, which I had to exit the setup process as the built in Voice Keyboard didn't recognise some of the words I was saying, and there was no fall back typing keyboard to type what I intended. So it meant I missed some of the in-setup questions / options. Sure, I can sign into my Google account once swapped out to the Google Keyboard that I kept on the SD card. But things like personalizing it were missed.
I'm sure about a year ago or so, there was an App on the PlayStore that could packup your installed live rom, and turn it into a flashable rom. Sure I guess thats what CWM or TWRP project can do... But sure there was a specific App that made it more like a rom packager...??
Any clues...?? Thanks, Lister
Modding.MyMind said:
What you are asking for is very complex and is never one in the same across other devices. In this typical situation the best solution is to manually make the changes.
Click to expand...
Click to collapse

[MOD][GUIDE]How To Enable The Hidden Alternate SystemUI In Note5

Not sure how many of you are aware, but there is a completely different user interface built into the Note5 that's hidden. I thought maybe some of you might like to check it out just for fun. It allows you to place widgets and apps on the lockscreen and has a bunch of cool lockscreen effects. Also, the "notifications panel" and the "recents" page are totally different, as well as many other interesting features. I added some screenshots for you guys to check out in this post.
Here are the steps to activating it:
1) First, anytime you're playing around with the SystemUI, even if it's a built in feature, it's a good idea to do a full system backup in TWRP. Not necessary, but recommended.
2) Next, you will need to have the Galaxy Apps store installed on your device. If you happened to have deleted it like I did, then I've attached the APK to this post for anyone that needs to reinstall it.
3) Open the Galaxy Apps store and update it if/when it prompts you.
4) Once the store has loaded, search for the words "Good Lock". Click on the app and click "Update", then "Install" and reboot the device when it prompts you.
(This is the hidden SystemUI that you already have on your device, but it needs the current update to work.)
5) Once rebooted into the new SystemUI, it will begin walking you through all of your new customization options. You can change any of these anytime you want by opening the "Good Lock" app in your applications list.
NOTE: If you decide that you want to deactivate the alternate SystemUI at any point, then you can just open up the "Good Lock" app and click on "Uninstall" too. You can also uninstall the Galaxy Apps store at any time and features like the new "Recents" page, if you don't like it, can be toggled off in the app as well.
Anyhow, I hope you guys have some fun with this. I'm trying it out for awhile just for kicks. Be sure to let everyone know what you thought of the new SystemUI in the comments too!
Just installed this running N5 Express ROM with no issues yet. Really like being able to have Tasker widget shortcuts on the lockscreen.
catchjeff said:
Just installed this running N5 Express ROM with no issues yet. Really like being able to have Tasker widget shortcuts on the lockscreen.
Click to expand...
Click to collapse
That's a really good idea. Been trying to think of a more useful widget to use on the lock screen. So far I've only added a fancy clock/weather widget. [emoji14] Maybe I'll give it a try.
Cool cant wait to try it out!
Sent from my SM-N920T using Tapatalk
For this you dont need a root or twrp its official from samsung
mirketos said:
For this you dont need a root or twrp its official from samsung
Click to expand...
Click to collapse
TWRP is mentioned for backing up your current configuration of TouchWiz(and your device in general) if you can before using Good Lock in case anything goes wrong. Obviously backing up your device is never required, but definitely always recommended when altering the system in any way, regardless of where it comes from. It's important to understand that Good Lock isn't just some Samsung app in the app store or just another launcher that changes the home screen, apps page, etc. It tweaks the system ui itself, including the look and function of the notifications panel, lock screen capabilities and more. It's true that you can just revert back to TW whenever you want pretty easily from within Good Lock, but the process isn't perfect. In fact, I myself applied it and reverted back only 2 times and the second time something went terribly wrong during the reversion and the system halted and it would no longer boot after that, so I had to restore a previous backup which I was glad to have had. All the data that I hadn't recently backed up though was of course lost, so yes...a TWRP backup is recommended when using Good Lock.
Also worth mentioning is the fact that if you're not running a compatible version of the stock firmware or at least a compatible TouchWiz rom, it will try to prevent you from installing it by not showing it in an app store search or by blocking access to the app's page(if you're following a link) in the Galaxy Apps store. For instance, it was there when I was on stock Marshmallow, but does not allow me to access it on stock Nougat. Instead I get error messages saying the app is not supported on my device when trying to load the Good Lock page.
Here is the link btw in case anyone can't find Good Lock in a search and wants to check if it can be used on their device. If it shows it, then it's compatible, if it doesn't then it's likely not. Just open the link in a mobile browser and click "OK" if prompted.
https://apps.samsung.com/jupiter/appquery/appDetail.as?appId=com.android.systemui
bogarty said:
TWRP is mentioned for backing up your current configuration of TouchWiz(and your device in general) if you can before using Good Lock in case anything goes wrong. Obviously backing up your device is never required, but definitely always recommended when altering the system in any way, regardless of where it comes from. It's important to understand that Good Lock isn't just some Samsung app in the app store or just another launcher that changes the home screen, apps page, etc. It tweaks the system ui itself, including the look and function of the notifications panel, lock screen capabilities and more. It's true that you can just revert back to TW whenever you want pretty easily from within Good Lock, but the process isn't perfect. In fact, I myself applied it and reverted back only 2 times and the second time something went terribly wrong during the reversion and the system halted and it would no longer boot after that, so I had to restore a previous backup which I was glad to have had. All the data that I hadn't recently backed up though was of course lost, so yes...a TWRP backup is recommended when using Good Lock.
Also worth mentioning is the fact that if you're not running a compatible version of the stock firmware or at least a compatible TouchWiz rom, it will try to prevent you from installing it by not showing it in an app store search or by blocking access to the app's page(if you're following a link) in the Galaxy Apps store. For instance, it was there when I was on stock Marshmallow, but does not allow me to access it on stock Nougat. Instead I get error messages saying the app is not supported on my device when trying to load the Good Lock page.
Here is the link btw in case anyone can't find Good Lock in a search and wants to check if it can be used on their device. If it shows it, then it's compatible, if it doesn't then it's likely not. Just open the link in a mobile browser and click "OK" if prompted.
https://apps.samsung.com/jupiter/appquery/appDetail.as?appId=com.android.systemui
Click to expand...
Click to collapse
Ok! Haha!! You dont need a make backup or something IT'S OFFICIAL YOU FOOL MAN
mirketos said:
Ok! Haha!! You dont need a make backup or something IT'S OFFICIAL YOU FOOL MAN
Click to expand...
Click to collapse
WTF dude? Seriously. Stop being an ass and actually read what I wrote. It's the least you can do after I typed all that out. You're not helping anyone by TROLLING this thread and repeatedly mentioning something so extremely redundant. If you don't want to backup then don't backup. I clearly said that it was obviously not required to do a backup and that I was only recommending to do it because I lost data and couldn't boot after selecting the option to revert back one time. Stop wasting people's time with your pointless comments. NOWHERE does it say in my post that making a backup is Required, so get over yourself. Either stop being a destructive ass or go and troll someone else! Your negative comments are not welcome here.

[Joying for VW] Universal steering wheel controls with arduino

On Joying headunits with CAN Bus, it is not possibile to use resistor based USWC: this thread aims to overcome the limitation by using an Arduino MICRO connected to the receiving unit of the USWC and to the headunit via USB to simulate a hardware keyboard.
reserved 1
Github repository: https://github.com/MobeedoM-opensource/android-auto
reserved 2
reserved 3
surfer63 said:
In your code you also use the BOOT_COMPLETED broadcast. You know that with the Joying deep-sleep option, you will see that only on rare occasions? This is: only on reboots or power (dis)connects?
Click to expand...
Click to collapse
Yes i know thank you, i noticed that for some strange reason the firmware deactivates the accessibility service even at reboot (at true boot not only with ACC_OFF).
You use the "com.fyt.boot.ACCON" intent filter in your services. If it doesn't have serious consequences please also add the "com.glsx.boot.ACCON" for those users on Sofia that might want to start using your app as well. But this in turn would also require the "minSdkVersion 23" instead of "minSdkVersion 24" like you have now. My PX5 is on 8 so I have api level 26, but my old Sofia on the bench is on 6.0.1 and it would be handy to test there first. (I tried to build your code, but there are many "hurdles" in your app/build.gradle, so I need to dive a little deeper into it)
Click to expand...
Click to collapse
Yes of course i'll add the intent filter, but please note that the current version of the app doesn't use those intents on api level 26+ (my headunit), because of the background execution limits (the implicit intent is simply not received).
The only intent that i was able to trap, but i still need to investigate because it doesn't always work and I haven't figured out why yet, is the android.hardware.usb.action.USB_DEVICE_ATTACHED.
For the build.gradle, if you tell me what are the hurdles maybe i can help, also via PM if you prefere.
You have the method startAccessibilityService with the rooted system call: What does that actually do? Is it for the user to give access? Or the system to give access (as it is rooted)? Is it for the root_preference "OnlyBroadcast"?
Click to expand...
Click to collapse
An accessibility service cannot be started programmatically in android, the user must manually activate it with the switch in the accessibility services section.
That command is used to simulate the behavior of the user who changes the state of the switch, it requires root and it is not granted to work on all roms.
You use the "getCurrentForegroundPackage()". I guess this still works if your have (for example) your navi app in the foreground and your media player in the background and you want to skip to the NEXT, as you automatically come to the last "if" statement in your MediaKeysMapper. But does this also work when your navi app is the foreground program and you are listening to the radio or some "generic_syu" program in the background?
Click to expand...
Click to collapse
Yes you are right, the last use case is not covered. To manage it correctly you need to know which app is currently playing, maybe it is possbile to distinguish syu apps by non syu apps by checking the android AudioManager which i think is only used by non-syu apps.
bambapin said:
Yes of course i'll add the intent filter, but please note that the current version of the app doesn't use those intents on api level 26+ (my headunit), because of the background execution limits (the implicit intent is simply not received).
The only intent that i was able to trap, but i still need to investigate because it doesn't always work and I haven't figured out why yet, is the android.hardware.usb.action.USB_DEVICE_ATTACHED.
For the build.gradle, if you tell me what are the hurdles maybe i can help, also via PM if you prefer.
Click to expand...
Click to collapse
I know about the implicit intents, but on a Sofia on Android 6.0.1 (api level 23) they should still work.
W.r.t. the build.gradle.
I had to remove the private.gradle import statement, some signing statements, defProd and the like, and finally (also literally in time) upgrade my sdk from 27 to 29 to be able to do a simple "./gradlew assembleDebug".
So no issues anymore.
(Of course I had set compile version to 27 in the build.gradle, but I ran into "missing" xmls, which I first blamed on being not committed to the repo (your fault, not mine of course ), but which turned out to be part of sdk 28 and up, so still my fault ).
surfer63 said:
W.r.t. the build.gradle.
I had to remove the private.gradle import statement, some signing statements, defProd and the like, and finally (also literally in time) upgrade my sdk from 27 to 29 to be able to do a simple "./gradlew assembleDebug".
Click to expand...
Click to collapse
Ah yes, the private.gradle... it contains my private keys passwords so i preferred not to publish them on the internet .
Indeed that file must be placed next to the app build.gradle with this content:
Code:
ext {
my_keyAlias = 'YOUR_KEY_ALIAS'
my_keyPassword = 'YOUR_KEY_PASSWORD'
my_storeFileName = 'YOUR_KEYSTORE_FILEPATH'
my_storePassword = 'YOUR_KEYSTORE_PASSWORD'
}
bambapin said:
Yes you are right, the last use case is not covered. To manage it correctly you need to know which app is currently playing, maybe it is possbile to distinguish syu apps by non syu apps by checking the android AudioManager which i think is only used by non-syu apps.
Click to expand...
Click to collapse
Maybe I insult you with providing this link , but anyway: here it is: https://developer.android.com/guide/topics/media-apps/mediabuttons
And the image in post #1. How is red and black connected, and to what?
surfer63 said:
Maybe I insult you with providing this link , but anyway: here it is: https://developer.android.com/guide/topics/media-apps/mediabuttons
And the image in post #1. How is red and black connected, and to what?
Click to expand...
Click to collapse
No insults at all don't worry and even if it were i hardly get offended
Actually i'm not expert on this particular topic, at the beginning i tried to use the standard Android MediaControllers but it seemed to me that when it came to "syu" APPS everything was bypassed, but if you think it's a viable way i'll try again.
The photo is the final version that is now installed in the car.
I noticed that there was enough room inside the SWC receiver to insert the arduino, i made a little hole for the usb socket and i connected the arduino directly (yes i admit, i soldered to save the space of dupont ).
What you see is the inside of the receiver + the arduino. The black and red cables are the power supply of the receiver, the orange and blue are KEY1 and KEY2 (the white and gray of the video). The arduino is simply glued with a removable glue (patafix).
@surfer63 i was thinking again about the autostart after the ACCON.
In the end i managed to make the intent android.hardware.usb.action.USB_DEVICE_ATTACHED always work so the accessibility service is always restarted, but i'm still looking for a better alternative (using the navi app would work but it interfere with the audio mixing level).
I looked again at the code of syu.ms and saw that when the unit wakes up, a series of apps are always launched with hard-coded package names: eg. "com.yh.devicehelper" and "com.cpsdna.mirror" which i don't seem to find installed in the headunit.
Do you have any idea what they are?
If they are never installed, perhaps it is enough to create an app with one of those package names and the system will take care of starting it at ACCON.
bambapin said:
No insults at all don't worry and even if it were i hardly get offended
Actually i'm not expert on this particular topic, at the beginning i tried to use the standard Android MediaControllers but it seemed to me that when it came to "syu" APPS everything was bypassed, but if you think it's a viable way i'll try again.
The photo is the final version that is now installed in the car.
I noticed that there was enough room inside the SWC receiver to insert the arduino, i made a little hole for the usb socket and i connected the arduino directly (yes i admit, i soldered to save the space of dupont ).
What you see is the inside of the receiver + the arduino. The black and red cables are the power supply of the receiver, the orange and blue are KEY1 and KEY2 (the white and gray of the video). The arduino is simply glued with a removable glue (patafix).
Click to expand...
Click to collapse
I do indeed think that the SYU apps do nothing according standard Android rules, so the MediaController would only be helpful for any other app. I do think you need to check if "some" SYU app is active by using something like "this" or by checking the com.syu.ms apk (via jadx(-gui)) or so, because that one also checks on several places whether one of its own SYU app is active or not, and on top or not.
So the bottom side of of the plate with the red led and condensator (or so), is the bottom of the SWC controller circuit?? If so, the image now makes sense.
surfer63 said:
So the bottom side of of the plate with the red led and condensator (or so), is the bottom of the SWC controller circuit?? If so, the image now makes sense.
Click to expand...
Click to collapse
Yes, it is the bottom, when it is inserted it rests on the 4 pillars and leaves enough space below, there will be almost 1cm from the arduino.
The only negative thing i noticed is that with the arduino so close to the antenna the reception distance of the buttons is a little lower than before, but they still work.
bambapin said:
@surfer63 i was thinking again about the autostart after the ACCON.
In the end i managed to make the intent android.hardware.usb.action.USB_DEVICE_ATTACHED always work so the accessibility service is always restarted, but i'm still looking for a better alternative (using the navi app would work but it interfere with the audio mixing level).
I looked again at the code of syu.ms and saw that when the unit wakes up, a series of apps are always launched with hard-coded package names: eg. "com.yh.devicehelper" and "com.cpsdna.mirror" which i don't seem to find installed in the headunit.
Do you have any idea what they are?
If they are never installed, perhaps it is enough to create an app with one of those package names and the system will take care of starting it at ACCON.
Click to expand...
Click to collapse
It worked!!! :laugh:
The app attached is automatically launched by the syu.ms at ACC_ON.
I used the package name "com.cpsdna.mirror", i have no idea what the original app was supposed to do, but now we have a real autorunner at our disposal.
bambapin said:
It worked!!! :laugh:
The app attached is automatically launched by the syu.ms at ACC_ON.
I used the package name "com.cpsdna.mirror", i have no idea what the original app was supposed to do, but now we have a real autorunner at our disposal.
Click to expand...
Click to collapse
:good: Very nice.
There are many apps in this ms.apk that no longer exist. Some are hardcoded called inside the app, some are called via the text files in the assets/property, but no longer exist.
I assume it is related to http://www.cpsdna.com/solutions1.html and a previous "mirrorlink" application. zlink is now by another company.
What I would do (and did in the past) is making a "micro starter app" (11~16Kb) , that only starts the app you want. So the "com.cpsdna.mirror" started by ACC_ON, starts your "com.mobeedom.android.auto.jyhuremote".
If Joying/FYT updates their list of started apps, you can simply take another "old" app and still call your own app without having to rewrite all the packages inside your own code.
(And please don't use the appcompat for such a microstarter . It explodes your code from ~11-16Kb to 1.5MB. I really hate how Studio always adds that to your project even if you target APIs that don't need it, or your app as such doesn't need it)
It would only need something like:
Code:
PackageManager pManager = context.getPackageManager();
Intent intent = pManager.getLaunchIntentForPackage("com.mobeedom.android.auto.jyhuremote");
if (intent != null) {
context.startActivity(intent);
}
surfer63 said:
:good: Very nice.
There are many apps in this ms.apk that no longer exist. Some are hardcoded called inside the app, some are called via the text files in the assets/property, but no longer exist.
I assume it is related to http://www.cpsdna.com/solutions1.html and a previous "mirrorlink" application. zlink is now by another company.
What I would do (and did in the past) is making a "micro starter app" (11~16Kb) , that only starts the app you want. So the "com.cpsdna.mirror" started by ACC_ON, starts your "com.mobeedom.android.auto.jyhuremote".
If Joying/FYT updates their list of started apps, you can simply take another "old" app and still call your own app without having to rewrite all the packages inside your own code.
(And please don't use the appcompat for such a microstarter . It explodes your code from ~11-16Kb to 1.5MB. I really hate how Studio always adds that to your project even if you target APIs that don't need it, or your app as such doesn't need it)
It would only need something like:
Code:
PackageManager pManager = context.getPackageManager();
Intent intent = pManager.getLaunchIntentForPackage("com.mobeedom.android.auto.jyhuremote");
if (intent != null) {
context.startActivity(intent);
}
Click to expand...
Click to collapse
Ok ok, no AppCompat
Maybe i could also put a minimum of parameterization with the ability to choose what to launch, maybe even more than one app.
Do you think something like this could be useful in your JET?
bambapin said:
Ok ok, no AppCompat
Maybe i could also put a minimum of parameterization with the ability to choose what to launch, maybe even more than one app.
Do you think something like this could be useful in your JET?
Click to expand...
Click to collapse
I don't see it yet. What would be useful to start from my Jet apk? Can you explain?
Please also note that when I started the JET apk I knew absolutely nothing about java (and didn't want to know anything about java) and started in appinventor/thunkable, as that was easy enough. But it is a big mess of all kind of shell scripts called from my app using the "rootexec" plugin, because that was the only way to make it work.
If I would start again I would rewrite it immediately in java.
So perhaps your own app would be a much better basis than my JET apk.
Please don't think I'm against it, but I do not understand (yet?) why that would be useful.
surfer63 said:
I don't see it yet. What would be useful to start from my Jet apk? Can you explain?
Please also note that when I started the JET apk I knew absolutely nothing about java (and didn't want to know anything about java) and started in appinventor/thunkable, as that was easy enough. But it is a big mess of all kind of shell scripts called from my app using the "rootexec" plugin, because that was the only way to make it work.
If I would start again I would rewrite it immediately in java.
So perhaps your own app would be a much better basis than my JET apk.
Please don't think I'm against it, but I do not understand (yet?) why that would be useful.
Click to expand...
Click to collapse
Don't know, i thought of your JET because i see it as a great collection of tools dedicated to Joying head units.
Given that on android 8 the intents ACC_ON and ACC_OFF are not usable, it could be an additional tool that allows you to schedule actions to be performed on wakeup without without the need to set Tasker as an NAVI app and without Xposed, since it still doesn't work on SC9853i.
BTW about Xposed i am also afraid, but i really hope i'm wrong, that with the code obfuscation of the firmwware, the maintenance of the Xposed modules will become increasingly difficult.
However, i will make a mini app with a list of apps to launch at ACC_ON (in my case the Accessibility Service, Poweramp and the NAVI), the code will be available if you change your mind .
bambapin said:
Given that on android 8 the intents ACC_ON and ACC_OFF are not usable, ...
Click to expand...
Click to collapse
Based on your work on USB, I also started to work on that idea again and built a "UsbReceiver" in my FytHWOneKey. It works great on my old sofia (6.0.1), but the usb event (""android.hardware.usb.action.USB_DEVICE_ATTACHED"") is never triggered on my 8.0.0 PX5. It doesn't work there.
Does this USB still work for you on 8.1.0?
bambapin said:
BTW about Xposed i am also afraid, but i really hope i'm wrong, that with the code obfuscation of the firmwware, the maintenance of the Xposed modules will become increasingly difficult.
However, i will make a mini app with a list of apps to launch at ACC_ON (in my case the Accessibility Service, Poweramp and the NAVI), the code will be available if you change your mind .
Click to expand...
Click to collapse
Xposed will no longer be feasible indeed when you look at the code obfuscation.
Your list of apps to be started: An internal list or external list (ascii config/ini file?), or preferences list?
surfer63 said:
Based on your work on USB, I also started to work on that idea again and built a "UsbReceiver" in my FytHWOneKey. It works great on my old sofia (6.0.1), but the usb event (""android.hardware.usb.action.USB_DEVICE_ATTACHED"") is never triggered on my 8.0.0 PX5. It doesn't work there.
Does this USB still work for you on 8.1.0?
Click to expand...
Click to collapse
Yes, it's the intent i'm still using to re-activate the accessibility service. It seems strange to me that it is not triggered at all, do you have any other app installed that could "steal" it? Torque for example?
EDIT: did you fetch the last version from github? i added a .xml with the filtered devices, it could be required (it depends on the firmware implementation)
Xposed will no longer be feasible indeed when you look at the code obfuscation.
Your list of apps to be started: An internal list or external list (ascii config/ini file?), or preferences list?
Click to expand...
Click to collapse
Internal, stored in the shared preferences.
bambapin said:
Yes, it's the intent i'm still using to re-activate the accessibility service. It seems strange to me that it is not triggered at all, do you have any other app installed that could "steal" it? Torque for example?
EDIT: did you fetch the last version from github? i added a .xml with the filtered devices, it could be required (it depends on the firmware implementation)
Click to expand...
Click to collapse
No other apps, only my own FytHWOneKey.
I did see the xml, but did not understand it and wanted to ask later. Those vendor id's / product id's: Are those from your usb devices or are they from (internal) Joying devices?
I can only find one vendor-id in the USB device database.

Categories

Resources