Your Digital Media Has Never Looked So Good

 
User avatar
24i
Topic Author
Posts: 37
Joined: Wed Feb 15, 2017 7:22 am

Registry not cleared after removing channel

Thu Aug 03, 2017 2:46 am

Hello,

We are stumbling upon an issue where the registry doesn't appear to be removed/cleared when a channel is removed.
We are saving some data to the registry like autologin and first-time launch. According to the docs this should be deleted after the (private) channel is removed from a device. Even after restarting the device when the channel is removed the registry still returns data when the channel is added again.

"Registry data is removed only when the application explicitly removes it, the user uninstalls the application, which remove the registry for the application, or the user performs a factory reset, which removes the registry for all applications."
- https://sdkdocs.roku.com/display/sdkdoc/roRegistry 

Anyone else having this problem?
The problem seems to occur on all devices we tested (firmware 7.7)
 
User avatar
Tyler Smith
Posts: 118
Joined: Thu Apr 14, 2016 10:51 am
Location: Nova Scotia, Canada
Contact:

Re: Registry not cleared after removing channel

Thu Aug 03, 2017 4:30 am

Are you signing multiple apps with the same key?
I believe apps that share a development key also share a single registry section. In this case, the registry would only clear if you delete all apps using that key.
Tyler Smith
Senior Developer, REDspace
redspace.com
 
User avatar
24i
Topic Author
Posts: 37
Joined: Wed Feb 15, 2017 7:22 am

Re: Registry not cleared after removing channel

Fri Aug 04, 2017 2:13 am

Hi Tyler,

That would explain it. We are using the same developer ID for signing all our internal test channels. 
I should have read the docs better I guess...

Thanks!
 
johnmarsden
Posts: 79
Joined: Wed Nov 18, 2015 1:37 pm

Re: Registry not cleared after removing channel

Mon Sep 25, 2017 7:56 am

So if that's the case, how do you go about fixing it? Is there an event for when the channel is explicitly removed or something? 
 
renojim
** Valued Community Member **
Posts: 3385
Joined: Mon Feb 15, 2010 1:35 pm

Re: Registry not cleared after removing channel

Mon Sep 25, 2017 8:05 am

Fixing what? Tyler already gave the solution if you're signing multiple apps/channels with the same key. You have to remove them all (and reboot, I believe) to clear the registry. If you don't like this behavior, then always generate a new key for every channel you develop.

-JT
 
johnmarsden
Posts: 79
Joined: Wed Nov 18, 2015 1:37 pm

Re: Registry not cleared after removing channel

Mon Sep 25, 2017 8:29 am

renojim wrote:
Fixing what?  Tyler already gave the solution if you're signing multiple apps/channels with the same key.  You have to remove them all (and reboot, I believe) to clear the registry.  If you don't like this behavior, then always generate a new key for every channel you develop.

-JT

That's not a solution though. If there a bunch of apps (5+) and you can't remove them all and also cannot generate a new key for each one, what's the best option? 
Not looking for a "tough luck," answer. Looking for something actually constructive. 
 
renojim
** Valued Community Member **
Posts: 3385
Joined: Mon Feb 15, 2010 1:35 pm

Re: Registry not cleared after removing channel

Mon Sep 25, 2017 5:12 pm

Unfortunately, I think "tough luck" is the answer. It's not likely the current behavior will ever be changed because there's probably as many reasons for it as against it.

Sorry,
-JT
 
User avatar
Komag
Posts: 748
Joined: Fri Aug 22, 2014 3:42 am

Re: Registry not cleared after removing channel

Mon Sep 25, 2017 5:52 pm

What's the problem you're trying to solve? You can manually or programmatically edit the registry, clear out parts of it if you want. Is it getting too full or something?
 
lisakb140
Posts: 28
Joined: Tue Aug 14, 2018 8:18 am

Re: Registry not cleared after removing channel

Thu Nov 29, 2018 2:15 pm

I am having this problem too, clearing the Registry of user information (logging in/logging out).

I'm using the new SG framework, and it has a deleteRegistry sub function in generalUtilies that looks like this:





sub deleteRegistry(keySection="" As String)
    print "Starting Delete Registry"
    Registry = CreateObject("roRegistry")
    i = 0
    
    if keySection <> "" then
            RegistrySection = CreateObject("roRegistrySection", keySection)
            for each key in RegistrySection.GetKeyList()
                i = i+1
                print "Deleting " keySection + ":" key
                RegistrySection.Delete(key)
            end for
            RegistrySection.flush()
    else
    
        for each section in Registry.GetSectionList()
            RegistrySection = CreateObject("roRegistrySection", section)
            for each key in RegistrySection.GetKeyList()
                i = i+1
                print "Deleting " section + ":" key
                RegistrySection.Delete(key)
            end for
            RegistrySection.flush()
        end for
        
    end if
    
    print i.toStr() " Registry Keys Deleted"
end sub



And I call it with 

 deleteRegistry("nameOfRegasString")

However, it seems like this data is still persisting. Has anyone else experienced this and had better luck??


UPDATE: I removed flush() from this function, and that seems to help the problem. I read that flush actually persists data to storage, even in the event of a reboot, so that would make sense why things were still persisting. I'm not 100% sure this was the issue, or if this even resolved....has anyone else had a similar experience with flush()?
 
User avatar
squirreltown
Posts: 836
Joined: Sun Apr 21, 2013 2:20 pm

Re: Registry not cleared after removing channel

Thu Nov 29, 2018 5:07 pm

lisakb140 wrote:
.has anyone else had a similar experience with flush()?

If you're not flush()-ing. the data in question won't be saved.  Now, maybe that's what you want, and maybe not. If you are having trouble with things persisting, it means you are not deleting the right things, when you think you are.
Kinetics Screensavers
 
lisakb140
Posts: 28
Joined: Tue Aug 14, 2018 8:18 am

Re: Registry not cleared after removing channel

Fri Nov 30, 2018 8:02 am

squirreltown wrote:
lisakb140 wrote:
.has anyone else had a similar experience with flush()?

If you're not flush()-ing. the data in question won't be saved.  Now, maybe that's what you want, and maybe not. If you are having trouble with things persisting, it means you are not deleting the right things, when you think you are.

Thanks, yes, I'm using this when a user logs out of the channel. When I included flush() in this deleteRegistry function, even after going through the steps of "logging out", it still seemed like they would be logged in. 
I guess what I don't understand is why there would be a call to persist data in a function that is supposed to be deleting a registry...it seems counter-productive!
 
destruk
Posts: 2600
Joined: Sat Dec 18, 2010 4:58 pm

Re: Registry not cleared after removing channel

Fri Nov 30, 2018 9:27 am

I wouldn't think deleting the keys would be really necessary.  Usually I simply write a default value to the keys my channel uses instead of deletion, so I don't see this issue.
 
User avatar
squirreltown
Posts: 836
Joined: Sun Apr 21, 2013 2:20 pm

Re: Registry not cleared after removing channel

Fri Nov 30, 2018 5:08 pm

Just consider flush() as save. Then it makes sense. And destruk is right, just overwrite the value, not the whole thing.
Kinetics Screensavers
 
matrixebiz
Posts: 276
Joined: Mon Jan 20, 2014 12:47 pm

Re: Registry not cleared after removing channel

Sun Dec 02, 2018 1:36 pm

How do you change the Dev ID for each channel? if you have 3 channels, do you have to have three different Roku devices signed into with three different developer accounts to save the package from?
Does the Registry also store if the channel is subscribed to or not?
 
User avatar
squirreltown
Posts: 836
Joined: Sun Apr 21, 2013 2:20 pm

Re: Registry not cleared after removing channel

Sun Dec 02, 2018 4:33 pm

matrixebiz wrote:
How do you change the Dev ID for each channel?  if you have 3 channels, do you have to have three different Roku devices signed into with three different developer accounts to save the package from?

if you are talking about the dev ID that you get along with a password after running GenKey at port 8080  -  No, you don't. You can use the same for multiple channels.


Does the Registry also store if the channel is subscribed to or not?

        Only if you make it do so. That's for you to code.
Kinetics Screensavers

Who is online

Users browsing this forum: muteki and 4 guests