Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

How can I restore my Kodi backup automatically in a new ROM?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I restore my Kodi backup automatically in a new ROM?

    Hey guys. Hopefully I'm posting this in the right subforum. If its not if one of the mods could move it to the appropriate one that would be great.

    The question I have for all of you intelligent android folk is regarding how I can get my custom Kodi configuration (skin, addons, settings) to install on first boot of my custom ROM. I'm a box reseller and am trying to streamline the process of installing everything so I can save time. I've currently tried a few things but haven't had any success. I've used a script called InstallAPK.sh to attempt to decompress my kodi user data folder that I copied off of my Dev box, compressed to tar format and placed into my ROM but it doesn't seem to work. I'd be more than willing to post my script if somebody wants to take a look at it. I've tried setting the decompress path to both /storage/emulated/0/Android/data/ as well as /sdcard/Android/data to no avail. The second thing I tried was decompiling the Kodi APK and installing all of my user data directly into it, re-zipping, resigning and installing that way. All of my addons showed up in kodi but immediately started throwing errors as soon as I booted up. At this point I'm not sure what else to do. If any of you bright minds have an idea how I can accomplish this I'd be extremely grateful. Thanks!


    Chad
    Last edited by th3magpi3; 05 April 2015, 04:07.

    #2
    Had the same problem as you. Never found a solution it can be done as i have seen it before, but in the end i found it was better to create an addon for kodi to install from the internet so if you make any modifications to the setup all customers will get an update. i have managed to get box turn around to 10mins from standard to customized.

    Comment


      #3
      Originally posted by qpr1991 View Post
      Had the same problem as you. Never found a solution it can be done as i have seen it before, but in the end i found it was better to create an addon for kodi to install from the internet so if you make any modifications to the setup all customers will get an update. i have managed to get box turn around to 10mins from standard to customized.
      Could you explain in a little more detail what you're referring to? Was it using the webserver option for kodi or did you create your own addon? If you used any documentation to build it would you mind pointing me in the right direction?

      Comment


        #4
        Originally posted by th3magpi3 View Post

        Could you explain in a little more detail what you're referring to? Was it using the webserver option for kodi or did you create your own addon? If you used any documentation to build it would you mind pointing me in the right direction?
        What I did was I created my own addon. Didn't really know much about how to start it. But I managed to get hold of a very old droidsticks wizzard . Opened up the contents with notepad ++ and it all become very self explanatory. I will upload there addon when I get on my computer.

        Comment


          #5
          Originally posted by qpr1991 View Post

          What I did was I created my own addon. Didn't really know much about how to start it. But I managed to get hold of a very old droidsticks wizzard . Opened up the contents with notepad ++ and it all become very self explanatory. I will upload there addon when I get on my computer.
          Sounds fantastic. Thank you.

          Comment


            #6
            You could also try this this addon was never working when kodi 14.1 came out. But just tested it and it all works fine. You can set the restore path to a Dropbox account where you would keep your backup. You can also set the backup path to Dropbox. So if you make any changes on your Dev box it just backup and everyone's boxes will be ready to restore.

            And if you just put one addon into kodi when you decompli the apk you shouldn't get any many errors.

            Comment


              #7
              Originally posted by qpr1991 View Post
              You could also try this this addon was never working when kodi 14.1 came out. But just tested it and it all works fine. You can set the restore path to a Dropbox account where you would keep your backup. You can also set the backup path to Dropbox. So if you make any changes on your Dev box it just backup and everyone's boxes will be ready to restore.

              And if you just put one addon into kodi when you decompli the apk you shouldn't get any many errors.

              My only problem with that is as far as I know it doesn't save the gui settings so all of my addon shortcuts and menu prefs would be gone. I started using USB-SDcard Wizard because it does fix these issues and it's great but AFAIK it does not allow the use of a dropbox account. I'm currently messing around with THIS. I need to find/write a script that will allow me to create a text file and place it in the SD card directory though in order for this to work.

              Comment


                #8
                you can make a .tar.gz file with your backup on and add it to your rom in /system/etc then edited the preinstall.sh script
                hope this helps
                foz

                Comment


                  #9
                  When moving/compressing the file with es file explorer you need to make sure you are viewing hidden files
                  Prahjister ****MK808(nonB)****MK808B V5****MK808B Plus****UBOX R89**** CX919****MK808B Pro****Nexbox N9****Eny Em95****Matricon Q2****Tanix TX5 Pro****

                  Comment


                    #10
                    Originally posted by foz View Post
                    you can make a .tar.gz file with your backup on and add it to your rom in /system/etc then edited the preinstall.sh script
                    hope this helps
                    foz

                    THANKS! I actually ended up doing something very similar to this suggestion to achieve the results I was looking for. I TAR'd the whole kodi directory starting from the sdcard directory on my dev box using this command

                    Code:
                    [FONT=Monaco]tar cvf /storage/external_storage/sda1/kodi.tar /sdcard/Android/data/org.xbmc.kodi[/FONT]
                    This made an archive called kodi.tar on my USB stick that was plugged into my DEV box. I then placed that into a directory called pre_app in the /system/ directory of my ROM. Then, I placed the following code into a script thats called on by the kernel at boot. This should work in the preinstall.sh script but if your ROM has init.d support you should be able to copy it to a script in that directory.

                    Code:
                    #!/system/bin/sh
                    Code:
                    [FONT=Monaco]MBOX=/data/local/kodi_changes_installed[/FONT]
                    [FONT=Monaco]TAR=/system/pre_app[/FONT]
                    
                    [FONT=Monaco]if [ ! -e $MBOX ]; then[/FONT]
                    [FONT=Monaco]echo "booting the first time, must pre-install the KODI changes"[/FONT]
                    
                    [FONT=Monaco]busybox sleep 5[/FONT]
                    [FONT=Monaco]busybox tar -xvf $TAR/kodi.tar -C /[/FONT]
                    
                    [FONT=Monaco]# busybox rm -rf $TAR[/FONT]
                    [FONT=Monaco]touch $MBOX[/FONT]
                    [FONT=Monaco]echo "OK, installation complete."[/FONT]
                    [FONT=Monaco]fi[/FONT]
                    What this does is first checks to see if there's a file called kodi_changes_installed in the /data/local/ directory. Because it will be first boot and the script has never ran before, there will be no file so the script will execute. The script then creates the kodi_changes_installed file, extracts your TAR'd kodi directory including all of your addons and userdata and finishes installing. When you boot your box again the script will see that the kodi_changes_installed file exists and will not run the script again. If any of y'all have any questions feel free to let me know. I had a LOT of help figuring this out thanks to a very helpful dev on another forum I frequent and I'd be more than happy to help spread the knowledge.
                    Last edited by th3magpi3; 23 April 2015, 16:13.

                    Comment


                      #11
                      @ th3magpi3
                      +1 POST!

                      Comment


                        #12
                        Originally posted by th3magpi3 View Post


                        THANKS! I actually ended up doing something very similar to this suggestion to achieve the results I was looking for. I TAR'd the whole kodi directory starting from the sdcard directory on my dev box using this command

                        Code:
                        [FONT=Monaco]tar cvf /storage/external_storage/sda1/kodi.tar /sdcard/Android/data/org.xbmc.kodi[/FONT]
                        This made an archive called kodi.tar on my USB stick that was plugged into my DEV box. I then placed that into a directory called pre_app in the /system/ directory of my ROM. Then, I placed the following code into a script thats called on by the kernel at boot. This should work in the preinstall.sh script but if your ROM has init.d support you should be able to copy it to a script in that directory.

                        Code:
                        #!/system/bin/sh
                        Code:
                        [FONT=Monaco]MBOX=/data/local/kodi_changes_installed[/FONT]
                        [FONT=Monaco]TAR=/system/pre_app[/FONT]
                        
                        [FONT=Monaco]if [ ! -e $MBOX ]; then[/FONT]
                        [FONT=Monaco]echo "booting the first time, must pre-install the KODI changes"[/FONT]
                        
                        [FONT=Monaco]busybox sleep 5[/FONT]
                        [FONT=Monaco]busybox tar -xvf $TAR/kodi.tar -C /[/FONT]
                        
                        [FONT=Monaco]# busybox rm -rf $TAR[/FONT]
                        [FONT=Monaco]touch $MBOX[/FONT]
                        [FONT=Monaco]echo "OK, installation complete."[/FONT]
                        [FONT=Monaco]fi[/FONT]
                        What this does is first checks to see if there's a file called kodi_changes_installed in the /data/local/ directory. Because it will be first boot and the script has never ran before, there will be no file so the script will execute. The script then creates the kodi_changes_installed file, extracts your TAR'd kodi directory including all of your addons and userdata and finishes installing. When you boot your box again the script will see that the kodi_changes_installed file exists and will not run the script again. If any of y'all have any questions feel free to let me know. I had a LOT of help figuring this out thanks to a very helpful dev on another forum I frequent and I'd be more than happy to help spread the knowledge.
                        For me the kodi_changes_installed file gets created but the
                        busybox tar -xvf $TAR/kodi.tar -C / command doesn't get run and no extracted directory exists after boot
                        If I manually run busybox tar -xvf $TAR/kodi.tar -C / in a terminal it extracts the directory
                        What must I do to fix it?

                        What permissions should the script have and ownership?
                        What did you add exactly to init.rc or rkboard30*.rc?
                        I also tried the zip command, it works manually in a terminal but not automatically on first boot.

                        Comment


                          #13
                          Originally posted by foz View Post
                          you can make a .tar.gz file with your backup on and add it to your rom in /system/etc then edited the preinstall.sh script
                          hope this helps
                          foz

                          How do you make a .tar.gz file?

                          Comment


                            #14
                            Originally posted by IgnacioJuarez View Post


                            How do you make a .tar.gz file?
                            Read post #10.

                            Comment


                              #15
                              Originally posted by mo123 View Post

                              Read post #10.
                              Is there a way to edit a tar.gz file? If I edit it is there a way to "repackage" it so it installs? I found one and want to customize it for a few relatives with some more relative add-ons pre-installed for them. This looks like it gets pretty deep! Thanks for any help!

                              Comment

                              Working...
                              X