Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
24i
Streaming Star

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 20
Tyler_Smith
Streaming Star

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
Streaming Star

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
Visitor

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
Community Streaming Expert

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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
johnmarsden
Visitor

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
Community Streaming Expert

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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Komag
Roku Guru

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
lisakb140
Visitor

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
Roku Guru

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.