Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
24i
Level 7

Registry not cleared after removing channel

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)
0 Kudos
20 Replies
Tyler_Smith
Level 7

Re: Registry not cleared after removing channel

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
0 Kudos
24i
Level 7

Re: Registry not cleared after removing channel

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!
0 Kudos
johnmarsden
Level 7

Re: Registry not cleared after removing channel

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? 
0 Kudos
renojim
Level 10

Re: Registry not cleared after removing channel

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
0 Kudos
johnmarsden
Level 7

Re: Registry not cleared after removing channel

"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. 
0 Kudos
renojim
Level 10

Re: Registry not cleared after removing channel

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
0 Kudos
Komag
Level 9

Re: Registry not cleared after removing channel

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?
0 Kudos
Highlighted
lisakb140
Level 7

Re: Registry not cleared after removing channel

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()?
0 Kudos
squirreltown
Level 9

Re: Registry not cleared after removing channel

"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
0 Kudos