REQUEST General Settings

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
Hi has anyone worked out how to save the defaults in this section.
Smarters v3
 

Attachments

  • Screenshot_2023-06-10-21-47-36-695_com.iconiciptv.iconiciptvbox.jpg
    Screenshot_2023-06-10-21-47-36-695_com.iconiciptv.iconiciptvbox.jpg
    795.1 KB · Views: 68

G-man

Well-known member
Joined
Apr 16, 2021
Messages
1,936
Awards
4
Offline
there is a save button at the bottom of the screen


Or do you mean how to set the preloaded settings ?
Thinking about it now that would probably be what you mean?
 

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
Hi yes it's to preset them in Android studio. Thanks
 

G-man

Well-known member
Joined
Apr 16, 2021
Messages
1,936
Awards
4
Offline
I had another look at this and thought i had found where the settings are
res folder and then open each layout folder and look for the file activity_general_settings.xml ( quite a few of the layout folders has this file ) scroll down to around line 165 and this is where the checkboxes settings for each settings are ,
in the image below its showing the settings for auto_start the first option in the settings menu ,and below this are the settings for all the other enteries , these settings are for the checkbox values I think so I set visibility="gone" but tick is still in the box and the box is still visable ? I have a feeling the results your looking for are not far from here. But then got to thinking if you change values in the app to say auto start to false it must change in a file somewhere so when the app next starts it reads this setting ? dont know m8 but someone on here may be able to take interest and sus it out :)

Screenshot 2023-06-11 125510.png
 

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
Ya also found that but was looking here
 

Attachments

  • 1686501573659.png
    1686501573659.png
    247.3 KB · Views: 51

G-man

Well-known member
Joined
Apr 16, 2021
Messages
1,936
Awards
4
Offline
what happens if you set the checked to false ?
 

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
Nothing
I thing it's stored somewhere else and making the changes updates this file, I'll take a look into the strings see if there is a relationship
 

FelixSchrodinger

Well-known member
Joined
Jun 17, 2022
Messages
270
Awards
3
Offline
Bit of a bodge, but seem to have figured how to stop it from starting on boot by default. Search "auto_start" and in the BootStartupActivity.smali file:

Rich (BB code):
const-string v0, "auto_start"

const/4 v1, 0x0

invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

move-result-object v1

iput-object v1, p0, Lcom/ftsol/iptv/view/activity/BootStartupActivity;->a:Landroid/content/SharedPreferences;

const/4 v2, 0x1 <---change this from 0x1 to 0x0

The autostart checkbox in general settings is still checked though but autostart IS disabled when first running the app. The checkbox isn't controlled by the layout files. For the user to be able to turn it back on again if they wanted to, they'd have to uncheck the box, save changes, then check the box again and save changes, then it turns autostart on boot back on. It seems the settings saved to "SharedPreferences" but I've not got a clue where to find those values.

The above works fine for me, but I'm a bit OCD so the checkbox being checked was annyoying me, I tried turning it off by default. Have a look in GeneralSettingsActivity.smali , I found a bit of code that gives some clues and needed a bit of help from ChatGPT to try figure out what it's doing, I'll give brief explanation what it's doing:

Rich (BB code):
const-string v3, "auto_start_on_bootup"

const-string v4, "" <--- If there's no value for "auto_start_on_bootup" the line below sets the value to be this empty string

invoke-interface {v2, v3, v4}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v2

iget-object v3, p0, Lcom/ftsol/iptv/view/activity/GeneralSettingsActivity;->w:Landroid/content/SharedPreferences;

const-string v5, "PuraKura Play"

invoke-interface {v3, v0, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v3, "checked" <--- The line below this checks SharedPreferences for this string

invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v2

if-eqz v2, :cond_0 <--- if the value for "auto_start_on_bootup" = "checked"

iget-object v2, p0, Lcom/ftsol/iptv/view/activity/GeneralSettingsActivity;->autoStart:Landroid/widget/CheckBox; <--- get the autoStart checkbox object

const/4 v3, 0x1 <--- use value of 1 (on)

invoke-virtual {v2, v3}, Landroid/widget/CheckBox;->setChecked(Z)V <--- set the check as 1 (on)

:cond_0

I can get the checkbox to always show off by default, and even when the user turns it back on and save changes, the next time they open General settings, it will appear off even though it's on. Can do that a couple of ways:

Rich (BB code):
const-string v3, "auto_start_on_bootup"

const-string v4, ""

invoke-interface {v2, v3, v4}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v2

iget-object v3, p0, Lcom/ftsol/iptv/view/activity/GeneralSettingsActivity;->w:Landroid/content/SharedPreferences;

const-string v5, "PuraKura Play"

invoke-interface {v3, v0, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v3, "checked" <--- delete this line

invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z <--- delete this line

move-result v2 <--- delete this line

if-eqz v2, :cond_0 <--- delete this line

iget-object v2, p0, Lcom/ftsol/iptv/view/activity/GeneralSettingsActivity;->autoStart:Landroid/widget/CheckBox;

const/4 v3, 0x1 <---change this from 0x1 to 0x0

invoke-virtual {v2, v3}, Landroid/widget/CheckBox;->setChecked(Z)V

:cond_0 <--- delete this line

or set the default value as "checked" then change the checked behaviour to turn the checkbox off:

Rich (BB code):
const-string v3, "auto_start_on_bootup"

const-string v4, "checked" <--- set default value to be "checked"

invoke-interface {v2, v3, v4}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v2

iget-object v3, p0, Lcom/ftsol/iptv/view/activity/GeneralSettingsActivity;->w:Landroid/content/SharedPreferences;

const-string v5, "PuraKura Play"

invoke-interface {v3, v0, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

const-string v3, "checked"

invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v2

if-eqz v2, :cond_0

iget-object v2, p0, Lcom/ftsol/iptv/view/activity/GeneralSettingsActivity;->autoStart:Landroid/widget/CheckBox;

const/4 v3, 0x1 <--- change this from 0x1 to 0x0

invoke-virtual {v2, v3}, Landroid/widget/CheckBox;->setChecked(Z)V

:cond_0

Big essay but thought I'd share what I've found... This wasn't what I was really after though. I haven't got a clue how to set the value to be "unchecked" in SharedPreferences and then add behaviour in general settings activity to turn it off if the value is "unchecked". Obviously the code aboves from a PuraKura Play Smarters, so it might look a little bit different in other versions, but this is the one I was working with. At least the first bit does actually turn it off by default. It's just the checkbox being on is bugging me...
 
Last edited:

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
Good read, somewhere to start.
I have my APK done with Smarters V3 and got them to set the defaults of what I wanted, maybe I need to compair the two files and see what the differences are, maybe that way we might figure it out.

Thanks
 

G-man

Well-known member
Joined
Apr 16, 2021
Messages
1,936
Awards
4
Offline
This is a bit further down the rabit hole i thought i may go with this ;)
but was thinking about it and if you change those settings say to auto start to off the values have to be stored somewhere in a dynamic array i would have thought ?
it would make moe sense if they were stored on a panel like XCIPTV is but of course its not , if it was a program running on a PC it would probably be stored in user data , but just dont know enough about APK's
 

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
So I spotted this and will see what happens
1686646068928.png
Also I found this and seems 0x0 is off 0x1 is on
I'll compile and see if anything changes

1686646155429.png
 

FelixSchrodinger

Well-known member
Joined
Jun 17, 2022
Messages
270
Awards
3
Offline
Good read, somewhere to start.
I have my APK done with Smarters V3 and got them to set the defaults of what I wanted, maybe I need to compair the two files and see what the differences are, maybe that way we might figure it out.

Thanks
I'd be interested in having a nosey at that myself too mate
 

FelixSchrodinger

Well-known member
Joined
Jun 17, 2022
Messages
270
Awards
3
Offline
This is a bit further down the rabit hole i thought i may go with this ;)
but was thinking about it and if you change those settings say to auto start to off the values have to be stored somewhere in a dynamic array i would have thought ?
it would make moe sense if they were stored on a panel like XCIPTV is but of course its not , if it was a program running on a PC it would probably be stored in user data , but just dont know enough about APK's
Yeah, it being smali makes it a nightmare to read for us mere mortals 🙄 lol
 

FelixSchrodinger

Well-known member
Joined
Jun 17, 2022
Messages
270
Awards
3
Offline
So I spotted this and will see what happens
View attachment 6264
Also I found this and seems 0x0 is off 0x1 is on
I'll compile and see if anything changes

View attachment 6265
Was this in loginactivity?

In the GeneralSettingsActivity.smali, if I could change the default value if one isn't found to "unchecked" instead of an empty string like it is now, then add another "if" after the "checked" one to check if the values "unchecked" and then turn the checkbox off. That feels like it would work, but this codes a bit of a nightmare for me to read or add bits to... but I think that's on the right lines of what needs to be done
 

Hopper

Active member
VIP Member
Joined
Feb 25, 2023
Messages
182
Awards
3
Offline
Changed this value to UNCHECKED and this happened

1686649614486.png
1686649649419.png
 

FelixSchrodinger

Well-known member
Joined
Jun 17, 2022
Messages
270
Awards
3
Offline
Changed this value to UNCHECKED and this happened

View attachment 6269
View attachment 6270
Nice, getting somewhere. I'm out of the house at the minute. Out of curiosity, try setting that to anything. Like "NOTCHECKED" see if you get the same result. I'm sure "checked" is just the string that was defined earlier in the code I posted earlier. Not even sure if "unchecked" is defined anywhere else.
 

promasterfsa

Member
Joined
Jun 25, 2021
Messages
39
Awards
2
Offline
OHas anyone managed to edit the general to call some external video link instead of loading the main screen channel?
 

nowacx

Well-known member
Joined
May 28, 2021
Messages
340
Awards
4
Offline
there is a save button at the bottom of the screen


Or do you mean how to set the preloaded settings ?
Thinking about it now that would probably be what you mean?
another nice smarters layout and a solid theme you've got going in there g-man👍
kinda forgot about that layout n couple other cool smarters layouts recently having got head stuck in so much fun old kodi skins/theme layout and messing with sparkle
but think this might make for a nice ibo layout too, probably moving/removing some stuff at top right quarter of the layout to make room for ibo ads🤔 or maybe leave out ads n just rock it as is, either way will be interesting to explore🧐
 
Top