Decompiled and Recompiled Gboard app just force quits after installation. - General Questions and Answers

Hello all, I'm trying to debug the gboard app that I want to make some edits to. I used apktool 2.2.2 to decompile and make some xml edits, and recompile. I signed the new apk with apk-signer. After I install the app, it just force closes and does nothing. I made very rudimentary edits to the emojis, so nothing majorly changed, only a few strings. Ideally, I'm trying to edit the text emojis such as "=-O" to better ones like =O and maybe email addresses or some passwords.
The big picture of what I'm trying to accomplish is have a single button press that inserts my own text, like a gaming computer G-key. I was able to do this with earlier versions of the google keyboard,m but now want to try with Gboard since it's such a better keyboard. If you have any suggestions to solve either editing the apk or any keyboards that have fully customizable keystrokes please let me know.

Hey,
I did a custom google keyboard APK a few years ago and, as I replaced my phone with a Galaxy S8+ running Android 7.0, the app is not working anymore. I'm trying to redo it with a newer version of the app, but I'm facing the same issue as you: I'm able to decompile, edit, recompile, sign and install the app but as soon as I open the keyboard settings or the keyboard itself, it crash.
My first version had a similar issue, but I was able to open the settings, and manually download the dictionnaries needed (English and French in my case), then the keyboard would work. In the present case, i'm not even able to open the settings of the keyboard before it crash. I don't know if the dictionnaries are still the issue, thought...
I have read somewhere that it could have to do with the signature not being recognized as a Google App signature, or something like that.
If you have any news, please let me know
Jonathan

Related

[Q] HTC Keyboard on CM7

Simple enough. After a long time of searching here and elsewhere, I have found no way to install the official HTC_IME keyboard on a ROM that doesn't already have it. Any attempts to do so just cause a Force Close upon trying to interact with it in any way.
And do not bother saying "just try _____ instead". If I wanted to try a different keyboard, I wouldn't be posting this thread.
I have a logcat that says "Unable to instantiate activity ComponentInfo", which I read is a problem with activities not being defined in AndroidManifest.xml. But unfortunately, the AndroidManifest.xml that comes with HTC_IME is junk. Trying to open it in any program either shows you what looks like non-western encoding, or it won't open it at all.
If anybody has any insight, that would be delightful. Either something I could try to make it work, or providing the logcat that shows all the errors that popped up, or something. Anything to finally get the Sense 3.5/3.6 HTC_IME working on our phones.
If nobody has any idea about this, does anybody at least know how I might go about figuring out any aspects of this problem besides the shot-in-the-dark Googling I've been doing trying to figure this out?
Just in case, I have attached the aLogcat file that I saved, filtered by the app to just show errors (which in this case, is only the errors generated by trying to access the keyboard via the Settings menu). If desired, I can generate and attach one for when you try to actually activate the keyboard via the Input Method operation.
I took the HTC IME apk from the HD revolution rom (system/apps) and pushed it onto my sensation's Virtuous Inquisition and I got it working except for the swype part.
I tried that. But unfortunately, CM7 is definitely missing libraries and/or other files needed by the apk file. Virtuous would be likely to have them because it's built from a Sense ROM, as opposed to CM7 most definitely *not* being built from anything but pure Android.
Someone had thought they found all the files needed to use the keyboard, but trying that did nothing for me, which means either more files are needed, or maybe something has to be done with the very messy and nearly uneditable AndroidManifest.xml file. But it seems that nobody on the forums has any idea. I had rather hoped that a developer might at least know, but of course I appreciate any input.
Would this work?
I'm not sure, but I'm certainly going to download it and give it a shot. Whether it works or not, thanks for the heads up. You've reminded me that I should also look around the forums of other qHD HTC phones in case somebody has figured something out in one of those.
Edit: Bah, of course the download link doesn't work. Every time I try, ESET kicks in and complains. Even when I shut it off. And once I finally got ESET to shut up, IE just refused to download the file anyway.
nvm i signed up for swype beta lol.

Hooking into S-Pen Sensor to Change Keyboard

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.

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

How to move settings from one specific app to new device?

Among the various keyboards that I use, I have dedicated "Swype" to Spanish for voice typing. (Sometimes dedicating a keyboard to a language prevents Google Voice from confusing languages.)
It installs as a separate apk.
On my old unrooted Huawei, I had downloaded the Spanish module.
On the new rooted OP7, Swype does not want to download Spanish: it just spins. I think they discontinued the app and the servers are down.
MyDevicePro reports that Swype is called "com.nuance.swype.dtc.india".
I looked that folder on the old phone's Android/data, but couldn't find it.
Would anyone have tips as to where to look? My thinking is to copy the files to the new phone. Or is there a better way to do it?
Thanks in advance.

Installing app failed

Greetings everybody.
I will start by saying i was never into android modding because i never had any needs so far, neither i have knowledge, it would be time wasting to teach myself a lot for just problem with 1 app since my work does not need that knowledge(well until now ).
So, theres an intercom device branded Hikvision which is a indoor station android tablet running on 5.1.
The front gui is apk launcher which im trying to make it work on 3rd party tablets/phones, since that tablet is overpriced for hardware it have. Luckily that launcher allows me to install 2 apks as they say, "You could install apps for smart home assistant". Instantly i installed Show Hidden Settings and changed launcher to android 5.1. Then i extraxted IndoorDevice apk with apk extractor.
When i try to install on any other android device i get error.
INSTALL_FAILED_SHARED_USER_INCOMPATIBLE. I stumbled across few posts where there is a procedure with apktool.jar and Signapk.jar but i dont know how to use them.
Anyone bored enough to try that on apk that will be on next link? I will pay few beers over paypal.
Indoor Station APK
Kind regards

Categories

Resources