package com.greenaddress.abcore;

import java.util.Arrays;
import java.util.List;

class Packages {

    final static String BITCOIN_NDK = "0.16.2";

    private final static String URL = "https://github.com/greenaddress/bitcoin_ndk/releases/download/v0.16.2/%s_bitcoin%s.tar.gz";

    final static List<String> NATIVE_CORE = Arrays.asList(
            "3820562arm-linux-androideabiad9ddaa9d9f18e8bb2ce2e4e08a43778d54669535faecc3d791f6a2065a2b4ee",
            "3819156aarch64-linux-android42a8e81cfd4784c1366f584989a7c3fb76b01adbf12338b0cadee7564de1f5aa",
            "4175958x86_64-linux-android9cdeffcec7e2c3053c4d898e3e7eb697359793293b0942742be1bb7e18be1d34",
            "4088067i686-linux-androida105e0c02ca26b9c64c26de72fa0fdd95238a064c6ff0a435619b8443d3db068"
    );


    final static List<String> NATIVE_KNOTS =
            Arrays.asList(
                    "4007064arm-linux-androideabi6a7079c155c73ce13d5be613b4f0c2a347d6e4522901a429d6f6462d84aba84c",
                    "4003310aarch64-linux-android71eda00b437eca28097b557e6d1df0527e492b547b9d2e5b8942396e1f7ac7a7",
                    "4416797x86_64-linux-androidc0bbf5930f43619d96b5041ec8adc40d71c61b2d21deec06891819a8d099819f",
                    "4322555i686-linux-androidf62702523815072f051c202be7b8d988e1c4f57d85059631d3d09db4c15257d7"
            );

    static String getPackageUrl(final String distro, final String arch) {
        if (distro.equals("core")) {
            return String.format(URL, arch, "");
        }
        return String.format(URL, arch, "knots");
    }
}

@@ -274,16 +274,168 @@
 ar.gz%22;%0A
+    private final static String URL_KNOTS = %22https://github.com/greenaddress/bitcoin_ndk/releases/download/v0.16.2.knots20180730/%25s_bitcoin%25s.tar.gz%22;%0A%0A
 %0A    fin
@@ -966,28 +966,16 @@
 _KNOTS =
-%0A           
  Arrays.
@@ -998,24 +998,16 @@
     
-        %224007064
+%224003537
 arm-
@@ -1027,188 +1027,180 @@
 eabi
-6a7079c155c73ce13d5be613b4f0c2a347d6e452290
+aa026c69d4f2b51efe5730dea8cbb9575ff7e6ca65
 1a
-4
 29
-d6f6462d84aba84c%22,%0A                    %224003310aarch64-linux-android71eda00b437eca28097b557e6d1df0527e492b547b9d2e5b8942396e1f7ac7a7
+cd7e2b970ac48a497b%22,%0A            %223998145aarch64-linux-android32faebb115926f731bfb0b5f2ee524d8876c90c2ed677e9e4844d73345770bc0
 %22,%0A 
@@ -1214,24 +1214,16 @@
     
-  
-      %224416797
+%224412806
 x86_
@@ -1242,72 +1242,72 @@
 roid
-c0bbf5930f43619d96b5041ec8adc40d71c61b2d21deec06891819a8d099819f
+6fc81027363625f88a3d5c1bf3338838c33c47f5e6ffe43a7f6aec3bc4b1f39a
 %22,%0A 
@@ -1321,24 +1321,16 @@
     
-  
-      %224322555
+%224320618
 i686
@@ -1347,82 +1347,74 @@
 roid
-f62702523815072f051c202be7b8d988e1c4f57d85059631d3d09db4c15257d7%22%0A        
+1a036a5b06ff9b88f7b7b60c973a8c0913d8194b3f8ed2fb0b6260430f657f87%22%0A
     
@@ -1587,16 +1587,16 @@
       %7D%0A
-
         
@@ -1611,32 +1611,38 @@
 tring.format(URL
+_KNOTS
 , arch, %22knots%22)

update knots to v0.16.2.knots20180730