java.lang.Object
it.auties.whatsapp.registration.TokenProvider
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Pathprivate static TokenProvider.WhatsappApkprivate static TokenProvider.WhatsappApkprivate static Versionprivate static Version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddownloadWhatsappApk(boolean business) static Stringstatic StringgenerateGpiaToken(byte[] deviceIdentifier, int desiredLength) private static byte[]getAboutLogo(net.dongliu.apk.parser.ByteArrayApkFile apkFile) private static CompletableFuture<TokenProvider.WhatsappApk> getAndroidData(boolean business, boolean useJarCache) private static TokenProvider.WhatsappApkgetAndroidData(byte[] apk, boolean business) private static PathgetAndroidJarCache(boolean business) private static PathgetAndroidLocalCache(boolean business) private static CompletableFuture<String> getAndroidToken(String phoneNumber, boolean business, boolean useJarCache) private static StringgetAndroidToken(String phoneNumber, TokenProvider.WhatsappApk whatsappData) private static Optional<TokenProvider.WhatsappApk> getCachedApk(boolean business, boolean useJarCache) private static List<byte[]> getCertificates(net.dongliu.apk.parser.ByteArrayApkFile apkFile) private static CompletableFuture<String> getIosToken(long phoneNumber, UserAgent.PlatformType platform, boolean useJarCache) private static StringgetIosToken(long phoneNumber, Version version, boolean business) private static CompletableFuture<String> getKaiOsToken(long phoneNumber, UserAgent.PlatformType platform, boolean useJarCache) private static StringgetKaiOsToken(long phoneNumber, Version version) private static SecretKeygetSecretKey(String packageName, byte[] resource) static CompletableFuture<String> getToken(long phoneNumber, UserAgent.PlatformType platform, boolean useJarCache) static CompletableFuture<Version> getVersion(UserAgent.PlatformType platform) private static CompletableFuture<Version> getVersion(UserAgent.PlatformType platform, boolean useJarCache) private static CompletableFuture<Version> private static byte[]readKaiOsResource(String name) static voidsetAndroidCache(Path path)
-
Field Details
-
webVersion
-
iosVersion
-
cachedApk
-
cachedBusinessApk
-
androidCache
-
-
Constructor Details
-
TokenProvider
public TokenProvider()
-
-
Method Details
-
setAndroidCache
-
getVersion
-
getVersion
private static CompletableFuture<Version> getVersion(UserAgent.PlatformType platform, boolean useJarCache) -
getWebVersion
-
getToken
public static CompletableFuture<String> getToken(long phoneNumber, UserAgent.PlatformType platform, boolean useJarCache) -
getIosToken
private static CompletableFuture<String> getIosToken(long phoneNumber, UserAgent.PlatformType platform, boolean useJarCache) -
getIosToken
-
getKaiOsToken
private static CompletableFuture<String> getKaiOsToken(long phoneNumber, UserAgent.PlatformType platform, boolean useJarCache) -
getKaiOsToken
-
readKaiOsResource
-
getAndroidToken
private static CompletableFuture<String> getAndroidToken(String phoneNumber, boolean business, boolean useJarCache) -
getAndroidToken
-
getAndroidData
private static CompletableFuture<TokenProvider.WhatsappApk> getAndroidData(boolean business, boolean useJarCache) -
downloadWhatsappApk
-
getCachedApk
private static Optional<TokenProvider.WhatsappApk> getCachedApk(boolean business, boolean useJarCache) -
getAndroidJarCache
- Throws:
URISyntaxException
-
getAndroidLocalCache
-
getAndroidData
-
cacheWhatsappData
-
getAboutLogo
private static byte[] getAboutLogo(net.dongliu.apk.parser.ByteArrayApkFile apkFile) throws IOException - Throws:
IOException
-
getCertificates
private static List<byte[]> getCertificates(net.dongliu.apk.parser.ByteArrayApkFile apkFile) throws IOException, CertificateException - Throws:
IOExceptionCertificateException
-
getSecretKey
private static SecretKey getSecretKey(String packageName, byte[] resource) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
generateBusinessCertificate
-
generateGpiaToken
-