Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
Almost exclusively depends on WebView, browser-backend stuff. Google just does whatever the fuck it wants and expects the world to twist. Working out different methods to test. Currently, I've got it to work, except now it doesn't go away unless you click a button. So you can check each button, and they'll just keep showing up multiple. xD It's a slow bitch patching, signing, deploying, installing, launching, testing.

The problem with click-hold is that is for CONTEXT MENU, aka it simulates right-clicking. I don't know if the game uses right-clicks, so I can just intercept long-click and tell it to ignore actually right-clicking and use that to trigger start if Android doesn't fuck that over, too.
I can confirm that the game does not make use of right clicks whatsoever.

Edit: I should ask, will this fuck with existing saves in the android app? will it count as a separate app or will it count as an update and let me keep my saves? Because "save to file" is also something they broke so I can't back up my files or import them into another app.
 

jfmherokiller

Well-Known Member
May 25, 2020
1,016
1,198
I found the issue, they're using onMouseOver, specifically:

JavaScript:
return u.createElement("div",
{id:n,
className:e,
title:t,
style:{fill:o},
"data-header":this.props.statusEffect.storageName,
"data-body":this.props.statusEffect.tooltip,
"data-iconclass":this.props.statusEffect.iconName,
"data-remaining":this.props.statusEffect.minutesLeft,
onMouseOver:function(){return window.setTooltipElement(n,
Wu.SU.STATUS_EFFECT)},
onMouseOut:function(){return window.setTooltipElement(null,
Wu.SU.NONE)}},
a,
u.createElement("span",
{className:"focusBorder",
tabIndex:"-1"}))}}]),
o}(u.Component);
They need to use onTouchStart and onTouchEnd. I'll try patching it and testing.

Edit: Progress, initially. At the moment, I can get them to stay up permanently from a tap, but that also triggers the button. I am wondering how I wish do go about this, such as requiring two taps for a button to work, one to show the message, another to actually click. Or just hold+drag off.
in any kind of modern development thing wouldnt there be some kind of css polyfill or the like that will check and take care of choosing on mouseover vs Ontouchstart?
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
I can confirm that the game does not make use of right clicks whatsoever.

Edit: I should ask, will this fuck with existing saves in the android app? will it count as a separate app or will it count as an update and let me keep my saves? Because "save to file" is also something they broke so I can't back up my files or import them into another app.
It'd be a different signing key, so it'd think of it as a different 'app'. TitaniumBackup 'data-only' would probably work.
in any kind of modern development thing wouldnt there be some kind of css polyfill or the like that will check and take care of choosing on mouseover vs Ontouchstart?
There are various JS libraries that can handle it, but it'd be a pain in the ass to try to integrate. Trying to do this as clean and small as possible. There is only one section that needs modding to affect this behavior, but I'm trying to intercept long-press, and it isn't playing nicely.
 

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
It'd be a different signing key, so it'd think of it as a different 'app'. TitaniumBackup 'data-only' would probably work.
Unfortunately Titaniumbackup needs root, which, while I probably could root my 2017 Amazon Fire tablet, it's too easy to brick for me to try. So I guess I'm shit outta luck on that front. Still, not the end of the world.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
Unfortunately Titaniumbackup needs root, which, while I probably could root my 2017 Amazon Fire tablet, it's too easy to brick for me to try. So I guess I'm shit outta luck on that front. Still, not the end of the world.
Who uses Android without rooting? Er, anyway, I got it to work perfectly, complete success. Why are exporting/importing saves broken for you?
 
Last edited:

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
Who uses Android without rooting? Er, anyway, I got it to work perfectly, long-hold to reveal descriptions. Going test trying to prevent longpress as well. Why are exporting/importing saves broken for you?
Someone who can't afford to replace their device if it bricks during the process, a lesson I learned with an old Galaxy S3 years ago.
Anyway, I dunno why I can't save to file in the app. I recall seeing other people mention the same issue, which leads me to believe that the devs simply broke saving to file. I can load from a file just fine. Just can't save. It's not a permissions issue afaik. Clicking the button just leaves it highlighted, no external dialogue pops up to save the file like it does with loading.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
Someone who can't afford to replace their device if it bricks during the process, a lesson I learned with an old Galaxy S3 years ago.
Anyway, I dunno why I can't save to file. I recall seeing other people mention the same issue, which leads me to believe that the devs simply broke saving to file. I can load from a file just fine. Just can't save. It's not a permissions issue afaik. Clicking the button just leaves it highlighted, no external dialogue pops up to save the file like it does with loading.
They must not have implemented file-choosing using native HTML...weird, or it is broken for Android's kittysandbox.

Anyway, a simple sed from onMouseOver to onTouchStart and onMouseOut to onTouchEnd works best (complete success), as long as you don't tap the button, of course. Keep your finger on the screen for the button to keep the description up. 2 locations inside main.[0-9a-f]+.js.

Not sure how we all want to add this. If I supply an APK, you'll need to manually migrate your save. If you can use LuckyPatcher you can easily patch the app.
 
Last edited:

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
They must not have implemented file-choosing using native HTML...weird, or it is broken for Android's kittysandbox.

Anyway, a simple sed from 'onMouseOver' to 'onTouchStart' and 'onMouseOut' to 'onTouchEnd' works best, as long as you don't tap the button, of course. Keep your finger on the screen for the button to keep the description up.

Not sure how we all want to add this. If I supply an APK, you'll need to manually migrate your save. If you can use LuckyPatcher you can easily patch the app.
Lucky patcher would be most convenient for people who don't want to lose their saves, but it's up to you.
 

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
Alright, as long as LP can grow a file. I've always worked with the bytes I could. xD
I'm going to pretend like I know what that means and I'm not just blindly stumbling around and hoping that it'll work :KEK:

Also, I noticed you mentioned this

2 locations inside main.[0-9a-f]+.js.
Which means that unless they fix it on their end, this will have to be recreated every time they update, as for some reason they change the name of those files with every release. I have a bunch of them from before I figured out they didn't overwrite lol

1666057708247.png
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
I'm going to pretend like I know what that means and I'm not just blindly stumbling around and hoping that it'll work :KEK:

Also, I noticed you mentioned this


Which means that unless they fix it on their end, this will have to be recreated every time they update, as for some reason they change the name of those files with every release. I have a bunch of them from before I figured out they didn't overwrite lol

View attachment 2107393
You should not be copying over like that, yeah. Use clean folders. What I meant by that regular expression was that the file to patch is named always main.random_hex.js in pattern.

They can fix it on their end by simply copying the functions they used (two each) and simply using the onTouch* I mentioned to alias. And no, you'd only need to patch it every time you install. Turns out LuckyPatcher won't patch a random file in the APK the way I want, an arbitrary file. LP would only do it if you 'rebuild APK', but that might change things.
 

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
You should not be copying over like that, yeah. Use clean folders. What I meant by that regular expression was that the file to patch is named always main.random_hex.js in pattern.

They can fix it on their end by simply copying the functions they used (two each) and simply using the onTouch* I mentioned to alias. And no, you'd only need to patch it every time you install. Turns out LuckyPatcher won't patch a random file in the APK the way I want, an arbitrary file. LP would only do it if you 'rebuild APK', but that might change things.
Damn. So, I'm definitely losing my save data no matter how we do this?

Edit: using my extremely limited knowledge to attempt something monumentally dumb that I won't describe in order to avoid being called an idiot
 
Last edited:

jfmherokiller

Well-Known Member
May 25, 2020
1,016
1,198
It'd be a different signing key, so it'd think of it as a different 'app'. TitaniumBackup 'data-only' would probably work.

There are various JS libraries that can handle it, but it'd be a pain in the ass to try to integrate. Trying to do this as clean and small as possible. There is only one section that needs modding to affect this behavior, but I'm trying to intercept long-press, and it isn't playing nicely.
I am more suprised that the developers behind TiTS didnt take it into account I think there is a babel/webpack plugin that will do it.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
Damn. So, I'm definitely losing my save data no matter how we do this?

Edit: using my extremely limited knowledge to attempt something monumentally dumb that I won't describe in order to avoid being called an idiot
It's all good, crap happens. :) As long as intentions are good, can't fault someone, really. :] As far as save data goes, you'd only be able to back up with root until they fix it. Quite frankly, it'd be easier to play via browser. At least then you could tell it to use Desktop Mode and get touch to work natively...and local file backups if that isn't broken on Android too as files.. It's been a few years since I used local HTML files in Android...anyone know if still possible?

It'd be easiest to tell the developer(s) of TiTs to add those functions. If you have a spare device, modify the APK and then re-sign, then install on the SPARE device and test. :) (If you need a quick setup, use uas to sign, java -jar ./uas.jar -a ./com.fenoxo.tits.apk).
 
Last edited:

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
It's all good, crap happens. :) As long as intentions are good, can't fault someone, really. :] As far as save data goes, you'd only be able to back up with root until they fix it. Quite frankly, it'd be easier to play via browser. At least then you could tell it to use Desktop Mode and get touch to work natively...and local file backups if that isn't broken on Android too as files.. It's been a few years since I used local HTML files in Android...anyone know if still possible?

It'd be easiest to tell the developer(s) of TiTs to add those functions.
I played using the browser for the first couple months until they actually made a .apk build. Desktop mode did not enable the tooltips to work natively, unfortunately. It'd be the same issue. (Though I guess at least then I could pop the .js file open and do it myself.)

Afaik, using HTML files locally in android works except maybe in android 11 and 12. I think that the scoped storage update/storage system changes they made after 10 effectively broke it. Not sure since I don't have a device that new to test it on.

Edit: I have now moved on to testing my dumb idea. initial results show promise. Nevermind. broke the app. :KEK:
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
I played using the browser for the first couple months until they actually made a .apk build. Desktop mode did not enable the tooltips to work natively, unfortunately. It'd be the same issue. (Though I guess at least then I could pop the .js file open and do it myself.)

Afaik, using HTML files locally in android works except maybe in android 11 and 12. I think that the scoped storage update/storage system changes they made after 10 effectively broke it. Not sure since I don't have a device that new to test it on.

Edit: I have now moved on to testing my dumb idea. initial results show promise. Nevermind. broke the app. :KEK:
The Desktop Mode might enable the file saving, is what I was wondering. Combine that with the main.*.js patch, you might have a nice setup until the developer(s) add the change. I use rooted Android 11+, so I don't have Scoped bull on me. :)
 
  • Like
Reactions: Hargan2

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
The Desktop Mode might enable the file saving, is what I was wondering. Combine that with the main.*.js patch, you might have a nice setup until the developer(s) add the change. I use rooted Android 11+, so I don't have Scoped bull on me. :)
Ah, gotcha. Saving to file does work in browser, yeah. I switched to the app because I had accidentally cleared my local browser cache without backing up my saves first (a classic 3 AM ultra-tired brain mistake) and lost my saves. Didn't want to worry about that again.

Do you mind if I pass on your fix to the dev bug forum? It might get us an official fix faster.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,306
1,780
Ah, gotcha. Saving to file does work in browser, yeah. I switched to the app because I had accidentally cleared my local browser cache without backing up my saves first (a classic 3 AM ultra-tired brain mistake) and lost my saves. Didn't want to worry about that again.

Do you mind if I pass on your fix to the dev bug forum? It might get us an official fix faster.
Go for it. :) Remember to let them know that tapping still clicks, you basically just 'finger on and move out of the way and keep the finger on screen to see the description'. I think the APK won't ever have local saving just because it is a sandbox browser. Not sure how to resolve that one, I don't do Electron. They should be able to simply alias the names with the touch-enabled names, and it'll work for both without needing anything else. Never rely on a browser for anything. Always use external saves.
 
Last edited:
  • Like
Reactions: Hargan2

jfmherokiller

Well-Known Member
May 25, 2020
1,016
1,198
Go for it. :) Remember to let them know that tapping still clicks, you basically just 'finger on and move out of the way and keep the finger on screen to see the description'. I think the APK won't ever have local saving just because it is a sandbox browser. Not sure how to resolve that one, I don't do Electron. They should be able to simply alias the names with the touch-enabled names, and it'll work for both without needing anything else. Never rely on a browser for anything. Always use external saves.
in terms of electron downloading the closest thing I found from simple googling is this
 

Hargan2

Well-Known Member
Nov 27, 2017
1,193
1,375
Go for it. :) Remember to let them know that tapping still clicks, you basically just 'finger on and move out of the way and keep the finger on screen to see the description'. I think the APK won't ever have local saving just because it is a sandbox browser. Not sure how to resolve that one, I don't do Electron. They should be able to simply alias the names with the touch-enabled names, and it'll work for both without needing anything else. Never rely on a browser for anything. Always use external saves.
Done. Hopefully the dev actually implements it. (Doubtful, though.) In only semi-related news, I discovered while working with another device to test out modifying the apk with luckypatcher that total commander apparently removed the ability to install .apks from it at google's request. So that's a thing. Can't do shit with your own devices anymore apparently.
 
4.00 star(s) 65 Votes