From 292ce4f77815d40da4d17301acfd5fa897087cc8 Mon Sep 17 00:00:00 2001 From: Murtadha Alsabbagh Date: Sat, 30 Nov 2019 14:00:31 +0300 Subject: [PATCH 1/2] add apk downloader for json variation --- library/build.gradle | 1 + library/src/main/.DS_Store | Bin 0 -> 6148 bytes .../javiersantos/appupdater/AppUpdater.java | 4 + .../javiersantos/appupdater/UtilsLibrary.java | 666 ++++++++++-------- library/src/main/res/.DS_Store | Bin 0 -> 6148 bytes .../res/layout/download_progress_dialog.xml | 25 + library/src/main/res/strings.xml | 12 + library/src/main/res/values-ar/strings.xml | 4 + library/src/main/res/values/strings.xml | 2 + 9 files changed, 420 insertions(+), 294 deletions(-) create mode 100644 library/src/main/.DS_Store create mode 100644 library/src/main/res/.DS_Store create mode 100644 library/src/main/res/layout/download_progress_dialog.xml create mode 100644 library/src/main/res/strings.xml create mode 100644 library/src/main/res/values-ar/strings.xml diff --git a/library/build.gradle b/library/build.gradle index 08ecd2f8..c6b98c0d 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -29,4 +29,5 @@ dependencies { api 'com.android.support:design:27.1.1' api 'com.squareup.okhttp3:okhttp:3.10.0' api 'org.jsoup:jsoup:1.11.3' + api 'com.mindorks.android:prdownloader:0.6.0' } diff --git a/library/src/main/.DS_Store b/library/src/main/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4707dc4dd61f181681b7ec392e3d6ecc37838568 GIT binary patch literal 6148 zcmeHK%}T>S5Z-O8CKe=uhYB779=v#{SoIoe>q$^d(StuVA;AVhB1zgFN+I|FK7d~R zc@Om=d=c-?>~2M=-bAF#!0b0WJ2T6E3H!qsMJi4OHfm*;ANebA2mb2=SO?Vu9Nx6F$TBdID`OcJMLlN_uIz8b{u6+ z5c!FyCu^J>1(6r`>v1>oQW39;3wz(mI#5Sjw%V3pQrGmhQ5g(s8yl-;t+qZ~H3wT; zRj}7LheKV{7FTu-&bn9EH@A29506jJl79}rs*rhwBX|KrQPH!LD2$^E@Qk8IQG~<* zF+dDV00U}k)5;UD7Fq%^Kn(mY1Gqn!poo^jT%y=Ipuy`Sj+YQoz{a-(qN&hQm`j8a z5H3>zWhz%s3@+2bZ>l&;VJ=aoGcIO^I%;OFUMO754t`UFGj2(wmKY!gzA{jhT?5bm z=Fji{uSwJ+28e-)Vt|(#cB2kUQfKSf;_$3BLC--^FfNz)kphM|iXj${;tHq`@SA7= VS_*TC-~pkFfS`dIV&G31cn7yiU(^5q literal 0 HcmV?d00001 diff --git a/library/src/main/java/com/github/javiersantos/appupdater/AppUpdater.java b/library/src/main/java/com/github/javiersantos/appupdater/AppUpdater.java index d98ed887..0175f8dc 100644 --- a/library/src/main/java/com/github/javiersantos/appupdater/AppUpdater.java +++ b/library/src/main/java/com/github/javiersantos/appupdater/AppUpdater.java @@ -11,6 +11,7 @@ import android.text.TextUtils; import android.util.Log; +import com.downloader.PRDownloader; import com.github.javiersantos.appupdater.enums.AppUpdaterError; import com.github.javiersantos.appupdater.enums.Display; import com.github.javiersantos.appupdater.enums.Duration; @@ -56,6 +57,9 @@ public AppUpdater(Context context) { this.btnDismiss = context.getResources().getString(R.string.appupdater_btn_dismiss); this.btnDisable = context.getResources().getString(R.string.appupdater_btn_disable); this.isDialogCancelable = true; + + //Initialize file downloader + PRDownloader.initialize(context); } @Override diff --git a/library/src/main/java/com/github/javiersantos/appupdater/UtilsLibrary.java b/library/src/main/java/com/github/javiersantos/appupdater/UtilsLibrary.java index a4594f67..110bbeba 100644 --- a/library/src/main/java/com/github/javiersantos/appupdater/UtilsLibrary.java +++ b/library/src/main/java/com/github/javiersantos/appupdater/UtilsLibrary.java @@ -8,9 +8,21 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; +import android.os.Build; +import android.support.v4.content.FileProvider; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.Log; - +import android.widget.Toast; + +import com.downloader.Error; +import com.downloader.OnCancelListener; +import com.downloader.OnDownloadListener; +import com.downloader.OnPauseListener; +import com.downloader.OnProgressListener; +import com.downloader.OnStartOrResumeListener; +import com.downloader.PRDownloader; +import com.downloader.Progress; import com.github.javiersantos.appupdater.enums.Duration; import com.github.javiersantos.appupdater.enums.UpdateFrom; import com.github.javiersantos.appupdater.objects.GitHub; @@ -20,6 +32,7 @@ import org.jsoup.Jsoup; import java.io.BufferedReader; +import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; @@ -34,298 +47,363 @@ class UtilsLibrary { - static String getAppName(Context context) { - ApplicationInfo applicationInfo = context.getApplicationInfo(); - int stringId = applicationInfo.labelRes; - return stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId); - } - - static String getAppPackageName(Context context) { - return context.getPackageName(); - } - - static String getAppInstalledVersion(Context context) { - String version = "0.0.0.0"; - - try { - version = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - - return version; - } - - static Integer getAppInstalledVersionCode(Context context) { - Integer versionCode = 0; - - try { - versionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode; - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - - return versionCode; - } - - static Boolean isUpdateAvailable(Update installedVersion, Update latestVersion) { - if (latestVersion.getLatestVersionCode() != null && latestVersion.getLatestVersionCode() > 0) { - return latestVersion.getLatestVersionCode() > installedVersion.getLatestVersionCode(); - } else { - if (!TextUtils.equals(installedVersion.getLatestVersion(), "0.0.0.0") && !TextUtils.equals(latestVersion.getLatestVersion(), "0.0.0.0")) { - try - { - final Version installed = new Version(installedVersion.getLatestVersion()); - final Version latest = new Version(latestVersion.getLatestVersion()); - return installed.compareTo(latest) < 0; - } catch (Exception e) - { - e.printStackTrace(); - return false; - } - } else return false; - } - } - - static Boolean isStringAVersion(String version) { - return version.matches(".*\\d+.*"); - } - - static Boolean isStringAnUrl(String s) { - Boolean res = false; - try { - new URL(s); - res = true; - } catch (MalformedURLException ignored) {} - - return res; - } - - static Boolean getDurationEnumToBoolean(Duration duration) { - Boolean res = false; - - switch (duration) { - case INDEFINITE: - res = true; - break; - } - - return res; - } - - private static URL getUpdateURL(Context context, UpdateFrom updateFrom, GitHub gitHub) { - String res; - - switch (updateFrom) { - default: - res = String.format(Config.PLAY_STORE_URL, getAppPackageName(context), Locale.getDefault().getLanguage()); - break; - case GITHUB: - res = Config.GITHUB_URL + gitHub.getGitHubUser() + "/" + gitHub.getGitHubRepo() + "/releases/latest"; - break; - case AMAZON: - res = Config.AMAZON_URL + getAppPackageName(context); - break; - case FDROID: - res = Config.FDROID_URL + getAppPackageName(context); - break; - } - - try { - return new URL(res); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - - } - - static Update getLatestAppVersionStore(Context context, UpdateFrom updateFrom, GitHub gitHub) { - switch (updateFrom) { - case GOOGLE_PLAY: - return getLatestAppVersionGooglePlay(context); - default: - return getLatestAppVersionHttp(context, updateFrom, gitHub); - } - } - - private static Update getLatestAppVersionGooglePlay(Context context) { - String version = "0.0.0.0"; - String recentChanges = ""; - - URL updateURL = getUpdateURL(context, UpdateFrom.GOOGLE_PLAY, null); - - try { - version = getJsoupString(updateURL.toString(), ".hAyfc .htlgb", 7); - - //TODO: Release Notes for Google Play is not working - //recentChanges = getJsoupString(updateURL.toString(), ".W4P4ne .DWPxHb", 1); - - if (TextUtils.isEmpty(version)) { - Log.e("AppUpdater", "Cannot retrieve latest version. Is it configured properly?"); - } - } catch (Exception e) { - Log.e("AppUpdater", "App wasn't found in the provided source. Is it published?"); - } - - Log.e("Update", version); - - return new Update(version, recentChanges, updateURL); - } - - private static String getJsoupString(String url, String css, int position) throws Exception { - return Jsoup.connect(url) - .timeout(30000) - .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6") - .get() - .select(css) - .get(position) - .ownText(); - } - - private static Update getLatestAppVersionHttp(Context context, UpdateFrom updateFrom, GitHub gitHub) { - Boolean isAvailable = false; - String source = ""; - OkHttpClient client = new OkHttpClient(); - URL url = getUpdateURL(context, updateFrom, gitHub); - Request request = new Request.Builder() - .url(url) - .build(); - ResponseBody body = null; - - try { - Response response = client.newCall(request).execute(); - body = response.body(); - BufferedReader reader = new BufferedReader(new InputStreamReader(body.byteStream(), "UTF-8")); - StringBuilder str = new StringBuilder(); - - String line; - while ((line = reader.readLine()) != null) { - switch (updateFrom) { - case GITHUB: - if (line.contains(Config.GITHUB_TAG_RELEASE)) { - str.append(line); - isAvailable = true; - } - break; - case AMAZON: - if (line.contains(Config.AMAZON_TAG_RELEASE)) { - str.append(line); - isAvailable = true; - } - break; - case FDROID: - if (line.contains(Config.FDROID_TAG_RELEASE)) { - str.append(line); - isAvailable = true; - } - } - } - - if (str.length() == 0) { - Log.e("AppUpdater", "Cannot retrieve latest version. Is it configured properly?"); - } - - response.body().close(); - source = str.toString(); - } catch (FileNotFoundException e) { - Log.e("AppUpdater", "App wasn't found in the provided source. Is it published?"); - } catch (IOException ignore) { - - } finally { - if (body != null) { - body.close(); - } - } - - final String version = getVersion(updateFrom, isAvailable, source); - final URL updateUrl = getUpdateURL(context, updateFrom, gitHub); - - return new Update(version, updateUrl); - } - - private static String getVersion(UpdateFrom updateFrom, Boolean isAvailable, String source) { - String version = "0.0.0.0"; - if (isAvailable) { - switch (updateFrom) { - case GITHUB: - String[] splitGitHub = source.split(Config.GITHUB_TAG_RELEASE); - if (splitGitHub.length > 1) { - splitGitHub = splitGitHub[1].split("(\")"); - version = splitGitHub[0].trim(); - if (version.startsWith("v")) - { // Some repo uses vX.X.X - splitGitHub = version.split("(v)", 2); - version = splitGitHub[1].trim(); - } - } - break; - case AMAZON: - String[] splitAmazon = source.split(Config.AMAZON_TAG_RELEASE); - splitAmazon = splitAmazon[1].split("(<)"); - version = splitAmazon[0].trim(); - break; - case FDROID: - String[] splitFDroid = source.split(Config.FDROID_TAG_RELEASE); - splitFDroid = splitFDroid[1].split("(<)"); - version = splitFDroid[0].trim(); - break; - } - } - return version; - } - - static Update getLatestAppVersion(UpdateFrom updateFrom, String url) { - if (updateFrom == UpdateFrom.XML){ - ParserXML parser = new ParserXML(url); - return parser.parse(); - } else { - return new ParserJSON(url).parse(); - } - } - - - static Intent intentToUpdate(Context context, UpdateFrom updateFrom, URL url) { - Intent intent; - - if (updateFrom.equals(UpdateFrom.GOOGLE_PLAY)) { - intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getAppPackageName(context))); - } else { - intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())); - } - - return intent; - } - - static void goToUpdate(Context context, UpdateFrom updateFrom, URL url) { - Intent intent = intentToUpdate(context, updateFrom, url); - - if (updateFrom.equals(UpdateFrom.GOOGLE_PLAY)) { - try { - context.startActivity(intent); - } catch (ActivityNotFoundException e) { - intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())); - context.startActivity(intent); - } - } else { - context.startActivity(intent); - } - } - - static Boolean isAbleToShow(Integer successfulChecks, Integer showEvery) { - return successfulChecks % showEvery == 0; - } - - static Boolean isNetworkAvailable(Context context) { - Boolean res = false; - ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - if (cm != null) { - NetworkInfo networkInfo = cm.getActiveNetworkInfo(); - if (networkInfo != null) { - res = networkInfo.isConnected(); - } - } - - return res; - } + static String getAppName(Context context) { + ApplicationInfo applicationInfo = context.getApplicationInfo(); + int stringId = applicationInfo.labelRes; + return stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId); + } + + static String getAppPackageName(Context context) { + return context.getPackageName(); + } + + static String getAppInstalledVersion(Context context) { + String version = "0.0.0.0"; + + try { + version = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + + return version; + } + + static Integer getAppInstalledVersionCode(Context context) { + Integer versionCode = 0; + + try { + versionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + + return versionCode; + } + + static Boolean isUpdateAvailable(Update installedVersion, Update latestVersion) { + if (latestVersion.getLatestVersionCode() != null && latestVersion.getLatestVersionCode() > 0) { + return latestVersion.getLatestVersionCode() > installedVersion.getLatestVersionCode(); + } else { + if (!TextUtils.equals(installedVersion.getLatestVersion(), "0.0.0.0") && !TextUtils.equals(latestVersion.getLatestVersion(), "0.0.0.0")) { + try { + final Version installed = new Version(installedVersion.getLatestVersion()); + final Version latest = new Version(latestVersion.getLatestVersion()); + return installed.compareTo(latest) < 0; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } else return false; + } + } + + static Boolean isStringAVersion(String version) { + return version.matches(".*\\d+.*"); + } + + static Boolean isStringAnUrl(String s) { + Boolean res = false; + try { + new URL(s); + res = true; + } catch (MalformedURLException ignored) { + } + + return res; + } + + static Boolean getDurationEnumToBoolean(Duration duration) { + Boolean res = false; + + switch (duration) { + case INDEFINITE: + res = true; + break; + } + + return res; + } + + private static URL getUpdateURL(Context context, UpdateFrom updateFrom, GitHub gitHub) { + String res; + + switch (updateFrom) { + default: + res = String.format(Config.PLAY_STORE_URL, getAppPackageName(context), Locale.getDefault().getLanguage()); + break; + case GITHUB: + res = Config.GITHUB_URL + gitHub.getGitHubUser() + "/" + gitHub.getGitHubRepo() + "/releases/latest"; + break; + case AMAZON: + res = Config.AMAZON_URL + getAppPackageName(context); + break; + case FDROID: + res = Config.FDROID_URL + getAppPackageName(context); + break; + } + + try { + return new URL(res); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + + } + + static Update getLatestAppVersionStore(Context context, UpdateFrom updateFrom, GitHub gitHub) { + switch (updateFrom) { + case GOOGLE_PLAY: + return getLatestAppVersionGooglePlay(context); + default: + return getLatestAppVersionHttp(context, updateFrom, gitHub); + } + } + + private static Update getLatestAppVersionGooglePlay(Context context) { + String version = "0.0.0.0"; + String recentChanges = ""; + + URL updateURL = getUpdateURL(context, UpdateFrom.GOOGLE_PLAY, null); + + try { + version = getJsoupString(updateURL.toString(), ".hAyfc .htlgb", 7); + + //TODO: Release Notes for Google Play is not working + //recentChanges = getJsoupString(updateURL.toString(), ".W4P4ne .DWPxHb", 1); + + if (TextUtils.isEmpty(version)) { + Log.e("AppUpdater", "Cannot retrieve latest version. Is it configured properly?"); + } + } catch (Exception e) { + Log.e("AppUpdater", "App wasn't found in the provided source. Is it published?"); + } + + Log.e("Update", version); + + return new Update(version, recentChanges, updateURL); + } + + private static String getJsoupString(String url, String css, int position) throws Exception { + return Jsoup.connect(url) + .timeout(30000) + .userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6") + .get() + .select(css) + .get(position) + .ownText(); + } + + private static Update getLatestAppVersionHttp(Context context, UpdateFrom updateFrom, GitHub gitHub) { + Boolean isAvailable = false; + String source = ""; + OkHttpClient client = new OkHttpClient(); + URL url = getUpdateURL(context, updateFrom, gitHub); + Request request = new Request.Builder() + .url(url) + .build(); + ResponseBody body = null; + + try { + Response response = client.newCall(request).execute(); + body = response.body(); + BufferedReader reader = new BufferedReader(new InputStreamReader(body.byteStream(), "UTF-8")); + StringBuilder str = new StringBuilder(); + + String line; + while ((line = reader.readLine()) != null) { + switch (updateFrom) { + case GITHUB: + if (line.contains(Config.GITHUB_TAG_RELEASE)) { + str.append(line); + isAvailable = true; + } + break; + case AMAZON: + if (line.contains(Config.AMAZON_TAG_RELEASE)) { + str.append(line); + isAvailable = true; + } + break; + case FDROID: + if (line.contains(Config.FDROID_TAG_RELEASE)) { + str.append(line); + isAvailable = true; + } + } + } + + if (str.length() == 0) { + Log.e("AppUpdater", "Cannot retrieve latest version. Is it configured properly?"); + } + + response.body().close(); + source = str.toString(); + } catch (FileNotFoundException e) { + Log.e("AppUpdater", "App wasn't found in the provided source. Is it published?"); + } catch (IOException ignore) { + + } finally { + if (body != null) { + body.close(); + } + } + + final String version = getVersion(updateFrom, isAvailable, source); + final URL updateUrl = getUpdateURL(context, updateFrom, gitHub); + + return new Update(version, updateUrl); + } + + private static String getVersion(UpdateFrom updateFrom, Boolean isAvailable, String source) { + String version = "0.0.0.0"; + if (isAvailable) { + switch (updateFrom) { + case GITHUB: + String[] splitGitHub = source.split(Config.GITHUB_TAG_RELEASE); + if (splitGitHub.length > 1) { + splitGitHub = splitGitHub[1].split("(\")"); + version = splitGitHub[0].trim(); + if (version.startsWith("v")) { // Some repo uses vX.X.X + splitGitHub = version.split("(v)", 2); + version = splitGitHub[1].trim(); + } + } + break; + case AMAZON: + String[] splitAmazon = source.split(Config.AMAZON_TAG_RELEASE); + splitAmazon = splitAmazon[1].split("(<)"); + version = splitAmazon[0].trim(); + break; + case FDROID: + String[] splitFDroid = source.split(Config.FDROID_TAG_RELEASE); + splitFDroid = splitFDroid[1].split("(<)"); + version = splitFDroid[0].trim(); + break; + } + } + return version; + } + + static Update getLatestAppVersion(UpdateFrom updateFrom, String url) { + if (updateFrom == UpdateFrom.XML) { + ParserXML parser = new ParserXML(url); + return parser.parse(); + } else { + return new ParserJSON(url).parse(); + } + } + + + static Intent intentToUpdate(Context context, UpdateFrom updateFrom, URL url) { + Intent intent; + + if (updateFrom.equals(UpdateFrom.GOOGLE_PLAY)) { + intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getAppPackageName(context))); + } else { + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())); + } + + return intent; + } + + static void goToUpdate(final Context context, UpdateFrom updateFrom, URL url) { + Intent intent = intentToUpdate(context, updateFrom, url); + + if (updateFrom.equals(UpdateFrom.GOOGLE_PLAY)) { + try { + context.startActivity(intent); + } catch (ActivityNotFoundException e) { + intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())); + context.startActivity(intent); + } + } else if (updateFrom.equals(UpdateFrom.JSON)) { + + final String rootFolder = context.getApplicationContext().getExternalFilesDir(null).getAbsolutePath(); + + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setView(R.layout.download_progress_dialog); + final AlertDialog dialog = builder.create(); + + dialog.show(); + + PRDownloader.download(url.toString(), rootFolder, "application.apk") + .build() + .setOnStartOrResumeListener(new OnStartOrResumeListener() { + @Override + public void onStartOrResume() { + + } + }) + .setOnPauseListener(new OnPauseListener() { + @Override + public void onPause() { + + } + }) + .setOnCancelListener(new OnCancelListener() { + @Override + public void onCancel() { + + } + }) + .setOnProgressListener(new OnProgressListener() { + @Override + public void onProgress(Progress progress) { + + } + }) + .start(new OnDownloadListener() { + @Override + public void onDownloadComplete() { + dialog.dismiss(); + installApk(new File(rootFolder + "/" + "application.apk"), context); + } + + @Override + public void onError(Error error) { + dialog.dismiss(); + Toast.makeText(context, R.string.message_download_failed, Toast.LENGTH_LONG).show(); + } + }); + } else { + context.startActivity(intent); + } + } + + static void installApk(File file, Context context) { + String type = "application/vnd.android.package-archive"; + + + Uri uri = FileProvider.getUriForFile(context.getApplicationContext(), context.getApplicationContext().getPackageName() + ".provider", file); + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { + uri = Uri.fromFile(file); + } + + Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); + intent.setDataAndType(uri, type); + intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + + context.startActivity(intent); + } + + + static Boolean isAbleToShow(Integer successfulChecks, Integer showEvery) { + return successfulChecks % showEvery == 0; + } + + static Boolean isNetworkAvailable(Context context) { + Boolean res = false; + ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); + if (cm != null) { + NetworkInfo networkInfo = cm.getActiveNetworkInfo(); + if (networkInfo != null) { + res = networkInfo.isConnected(); + } + } + + return res; + } } diff --git a/library/src/main/res/.DS_Store b/library/src/main/res/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..20a8d4ba34f9ae91e8e0e153208cfcb2f5943774 GIT binary patch literal 6148 zcmeHKOKQU~5Pj2zkkU<-UFrf|^aduRC&&ewPwB?k5R47B;0NGqlFTfhWicL{esfbQjO?U3RBudHgj^Q*M+e6>Cl|*x#(zP#f#U3p#7_FZh z!o%2rXF8q7+pCzbyK~p}-3Nnf2@dFP32Npe_P?8lZ~5oQXsjt12nK?IU|{YH=oLg+ zJsL(I32cquW`(VnnmYJI58dqg^=ii Ifj?m26Qxi$2><{9 literal 0 HcmV?d00001 diff --git a/library/src/main/res/layout/download_progress_dialog.xml b/library/src/main/res/layout/download_progress_dialog.xml new file mode 100644 index 00000000..f1b4f08e --- /dev/null +++ b/library/src/main/res/layout/download_progress_dialog.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/library/src/main/res/strings.xml b/library/src/main/res/strings.xml new file mode 100644 index 00000000..d909fcb3 --- /dev/null +++ b/library/src/main/res/strings.xml @@ -0,0 +1,12 @@ + + নতুন আপডেট পাওয়া গেছে! + আপডেট %1$s ডাউনলোডযোগ্য\n\n সর্বশেষ আপডেট ডাউনলোড করার ফলে আপনি %2$s এর সর্বশেষ ফিচার, উন্নতি এবং বাগ সংশোধন গুলো পাবেন। + আপডেট %1$s ডাউনলোডযোগ্য\n\nআপনি এই নতুন ফিচার গুলো পাবেন:\n%2$s + আপডেট %1$s পাওয়া গেছে! + %2$s এর %1$s আপডেট ডাউনলোডযোগ্য + কোনো আপডেট পাওয়া যায় নি + আপনি %s এর সর্বশেষ সংস্করণ ব্যবহার করছেন! + আপডেট + আর দেখাবেন না + বাদ দিন + diff --git a/library/src/main/res/values-ar/strings.xml b/library/src/main/res/values-ar/strings.xml new file mode 100644 index 00000000..1315d720 --- /dev/null +++ b/library/src/main/res/values-ar/strings.xml @@ -0,0 +1,4 @@ + + تحميل آخر نسخة من التطبيق! + لا يمكن تحميل التطبيق حالياً + diff --git a/library/src/main/res/values/strings.xml b/library/src/main/res/values/strings.xml index 7bf55c93..a6b13eca 100644 --- a/library/src/main/res/values/strings.xml +++ b/library/src/main/res/values/strings.xml @@ -12,4 +12,6 @@ Update notifications appupdater_channel_01 + Cannot download at this time! + Downloading update! From a32054aefb11b8d2860f0da3e53b56aecdd5e0ca Mon Sep 17 00:00:00 2001 From: Murtadha Alsabbagh Date: Sat, 30 Nov 2019 15:16:29 +0300 Subject: [PATCH 2/2] add missing permissions --- library/src/main/AndroidManifest.xml | 16 ++++++++++++++++ library/src/main/res/xml/file_paths.xml | 4 ++++ 2 files changed, 20 insertions(+) create mode 100644 library/src/main/res/xml/file_paths.xml diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml index d691409e..9915cbcf 100644 --- a/library/src/main/AndroidManifest.xml +++ b/library/src/main/AndroidManifest.xml @@ -3,4 +3,20 @@ + + + + + + + + + + diff --git a/library/src/main/res/xml/file_paths.xml b/library/src/main/res/xml/file_paths.xml new file mode 100644 index 00000000..2ccc46be --- /dev/null +++ b/library/src/main/res/xml/file_paths.xml @@ -0,0 +1,4 @@ + + + +