Skip navigation links
de.onyxbits.raccoon.finsky

Class AppStreamer

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int MAIN_OBB
      Applies to AppFileMetadata.getFileType()
      static int PATCH_OBB
      Applies to AppFileMetadata.getFileType()
    • Constructor Summary

      Constructors 
      Constructor and Description
      AppStreamer(ClientProvider provider, java.lang.String userAgent, boolean compress, de.onyxbits.raccoon.proto.AndroidAppDeliveryData aadd) 
      AppStreamer(org.apache.hc.client5.http.classic.HttpClient client, java.lang.String userAgent, boolean compress, de.onyxbits.raccoon.proto.AndroidAppDeliveryData aadd)
      Construct a streamer for downloading a single app.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int countFiles()
      Sum up the total number of individual files to download.
      java.util.List<de.onyxbits.raccoon.proto.AppFileMetadata> getAdditionalFiles()
      List OBB Files
      de.onyxbits.raccoon.proto.AndroidAppDeliveryData getAndroidAppDeliveryData() 
      java.util.List<de.onyxbits.raccoon.proto.SplitDeliveryData> getSplitFiles()
      List split APKs
      java.io.InputStream open()
      Stream the (base) APK.
      java.io.InputStream open(de.onyxbits.raccoon.proto.AppFileMetadata afm)
      Stream an extension file (OBB).
      java.io.InputStream open(de.onyxbits.raccoon.proto.SplitDeliveryData sdd)
      Stream a split delivery file (Android App Bundle).
      java.io.InputStream openPatch()
      Stream base APK patch
      java.io.InputStream openPatch(de.onyxbits.raccoon.proto.AppFileMetadata afm)
      Stream an OBB Patch
      java.io.InputStream openPatch(de.onyxbits.raccoon.proto.SplitDeliveryData sdd)
      Stream a patch for a split APK file.
      long sizeOf()
      Size of the base APK
      long sizeOfAdditionalFiles()
      Combined size of all additional files (OBB)
      long sizeOfSplitFiles()
      Combined size of all split APK files
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAIN_OBB

        public static final int MAIN_OBB
        Applies to AppFileMetadata.getFileType()
        See Also:
        Constant Field Values
      • PATCH_OBB

        public static final int PATCH_OBB
        Applies to AppFileMetadata.getFileType()
        See Also:
        Constant Field Values
    • Constructor Detail

      • AppStreamer

        public AppStreamer(org.apache.hc.client5.http.classic.HttpClient client,
                           java.lang.String userAgent,
                           boolean compress,
                           de.onyxbits.raccoon.proto.AndroidAppDeliveryData aadd)
        Construct a streamer for downloading a single app.
        Parameters:
        client - client to use for downloading
        userAgent - User Agent string. Obtainable from MockUtil.toDownloadAgent(de.onyxbits.raccoon.mockup.Device) . May be null.
        compress - use compression if available. Compression is handled transparently.
        aadd - the raw download parameters.
      • AppStreamer

        public AppStreamer(ClientProvider provider,
                           java.lang.String userAgent,
                           boolean compress,
                           de.onyxbits.raccoon.proto.AndroidAppDeliveryData aadd)
    • Method Detail

      • sizeOf

        public long sizeOf()
        Size of the base APK
        Returns:
        file size (uncompressed)
      • sizeOfAdditionalFiles

        public long sizeOfAdditionalFiles()
        Combined size of all additional files (OBB)
        Returns:
        file count
      • sizeOfSplitFiles

        public long sizeOfSplitFiles()
        Combined size of all split APK files
        Returns:
        combined file size (uncompressed).
      • countFiles

        public int countFiles()
        Sum up the total number of individual files to download.
        Returns:
        One plus the total number of split APKs, plus the number of OBBs.
      • getAndroidAppDeliveryData

        public de.onyxbits.raccoon.proto.AndroidAppDeliveryData getAndroidAppDeliveryData()
        Returns:
        the AndroidAppDeliveryData, this streamer was configured with.
      • getAdditionalFiles

        public java.util.List<de.onyxbits.raccoon.proto.AppFileMetadata> getAdditionalFiles()
        List OBB Files
        Returns:
        an empty list if there are no additional files.
      • getSplitFiles

        public java.util.List<de.onyxbits.raccoon.proto.SplitDeliveryData> getSplitFiles()
        List split APKs
        Returns:
        an empty list if there are no split APKs.
      • open

        public java.io.InputStream open()
                                 throws java.io.IOException,
                                        org.apache.hc.client5.http.HttpResponseException,
                                        java.security.NoSuchAlgorithmException,
                                        java.security.NoSuchProviderException,
                                        javax.crypto.NoSuchPaddingException,
                                        java.security.InvalidKeyException,
                                        org.apache.hc.client5.http.ClientProtocolException,
                                        java.security.InvalidAlgorithmParameterException
        Stream the (base) APK.
        Returns:
        A stream for reading the APK from the network (caller must close it).
        Throws:
        java.io.IOException
        org.apache.hc.client5.http.ClientProtocolException
        java.security.NoSuchAlgorithmException
        java.security.NoSuchProviderException
        javax.crypto.NoSuchPaddingException
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
        org.apache.hc.client5.http.HttpResponseException
      • openPatch

        public java.io.InputStream openPatch()
                                      throws org.apache.hc.client5.http.HttpResponseException,
                                             java.io.IOException
        Stream base APK patch
        Returns:
        Stream for reading the patch from the network (caller must close), null if there's no patch.
        Throws:
        org.apache.hc.client5.http.HttpResponseException
        java.io.IOException
      • openPatch

        public java.io.InputStream openPatch(de.onyxbits.raccoon.proto.AppFileMetadata afm)
                                      throws org.apache.hc.client5.http.HttpResponseException,
                                             java.io.IOException
        Stream an OBB Patch
        Parameters:
        afm - should be obtained by iterating over #getAdditionalFiles()
        Returns:
        Stream for reading the patch from the network (caller must close). Null if there's no patch.
        Throws:
        org.apache.hc.client5.http.HttpResponseException
        java.io.IOException
      • open

        public java.io.InputStream open(de.onyxbits.raccoon.proto.AppFileMetadata afm)
                                 throws org.apache.hc.client5.http.HttpResponseException,
                                        java.io.IOException
        Stream an extension file (OBB).
        Parameters:
        afm - should be obtained by iterating over #getAdditionalFiles()
        Returns:
        Stream for reading the OBB file from network (caller must close). Null if unavailable.
        Throws:
        org.apache.hc.client5.http.HttpResponseException
        java.io.IOException
      • open

        public java.io.InputStream open(de.onyxbits.raccoon.proto.SplitDeliveryData sdd)
                                 throws org.apache.hc.client5.http.HttpResponseException,
                                        java.io.IOException
        Stream a split delivery file (Android App Bundle).
        Parameters:
        sdd - should be obtained by iterating over #getSplitFiles()
        Returns:
        Stream for reading from network (caller must close). Null if unavailable.
        Throws:
        org.apache.hc.client5.http.HttpResponseException
        java.io.IOException
      • openPatch

        public java.io.InputStream openPatch(de.onyxbits.raccoon.proto.SplitDeliveryData sdd)
                                      throws org.apache.hc.client5.http.HttpResponseException,
                                             java.io.IOException
        Stream a patch for a split APK file. Note: it is not possible to merge split apk files.
        Parameters:
        sdd - should be obtained by iterating over #getSplitFiles()
        Returns:
        Stream for reading from network (caller must close). Null if unavailable.
        Throws:
        org.apache.hc.client5.http.HttpResponseException
        java.io.IOException
Copyright © Raccoon - the APK downloader