Hargan2

Well-Known Member
Nov 27, 2017
1,214
1,430
327
The CSS/JavaScript can be extended too by simply binding to touch events...should easily be fixable. Provide an example (exact scenario and instructions, and aim around the beginning of the game or a save file), maybe I can make a universal patch tonight.
I'm not 100% sure what you're looking for but hopefully this works. I've included two separate scenarios just to be sure. Apologies for the probably dumb question but are you looking to patch the actual .apk build? Or is this a "you have to use the HTML file from the windows build in your mobile browser for it to work" kind of thing?

You don't have permission to view the spoiler content. Log in or register now.
The tooltips are more important during dialogue, as they often contain warnings concerning what type of content the option leads to (for example warning people about gay content or other stuff people may not be into, or warnings for potentially game-altering stuff like getting yourself bimbofied or permanently transforming a character.) I didn't include any dialogue scenarios here as it's quicker to do the two options I showed, and unless it uses a completely different system for some reason it should all be the same on the backend.

I also can't really provide screenshots to show how the tooltips act on android because they just sorta pop up and then immediately disappear without any time to read.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,384
2,036
468
APKs are just zip files. Could easily patch any of the resources and then add to zip, overwrite, redeploy. As for this, what you might need to do is act like you're going to click a button but drag away from it while keeping your finger down. It shouldn't register as a tap, and it may think it is still :hov. I needed an example of where it doesn't work for Android but does for PC, does it do this at the main menu in Android?

Edit: I've installed the APK, I can see what you mean. The CSS does indeed need to be modified, I'll look into where and what and do a patch myself. If it works, I'll provide a shell script for any Linux user to auto-patch if possible.
 
Last edited:

Hargan2

Well-Known Member
Nov 27, 2017
1,214
1,430
327
APKs are just zip files. Could easily patch any of the resources and then add to zip, overwrite, redeploy.
I figured, but didn't want to assume.

Edit: I've installed the APK, I can see what you mean. The CSS does indeed need to be modified, I'll look into where and what and do a patch myself. If it works, I'll provide a shell script for any Linux user to auto-patch if possible.
Excellent. If you want, I can help you test that when it's ready (the android fix, not the linux script.) Thank you so much for looking into this, it's been the bane of android users for so long.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,384
2,036
468
I figured, but didn't want to assume.


Excellent. If you want, I can help you test that when it's ready (the android fix, not the linux script.) Thank you so much for looking into this, it's been the bane of android users for so long.
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.
 
Last edited:

Hargan2

Well-Known Member
Nov 27, 2017
1,214
1,430
327
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.
I think hold+drag off is how it used to work in the old flash apk builds. That'd be my personal preference rather than having to tap twice, but beggars can't be choosers.
 

BupoTiling03-Retired

Well-Known Member
Modder
Jul 21, 2018
1,384
2,036
468
I think hold+drag off is how it used to work in the old flash apk builds. That'd be my personal preference rather than having to tap twice, but beggars can't be choosers.
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.
 
Last edited:

Hargan2

Well-Known Member
Nov 27, 2017
1,214
1,430
327
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,182
1,672
266
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,384
2,036
468
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,214
1,430
327
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,384
2,036
468
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,214
1,430
327
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,384
2,036
468
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,214
1,430
327
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,214
1,430
327
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,384
2,036
468
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,214
1,430
327
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,182
1,672
266
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,384
2,036
468
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:
4.00 star(s) 79 Votes