Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial update v2 #361

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
62209d8
✨ (feat): Partial update part 1
WcaleNieWolny Mar 17, 2024
cfeb71a
✨ (feat): Save downloaded manifest in file storage
WcaleNieWolny Mar 18, 2024
ed99508
✨ (feat): Load saved manifest from device storage
WcaleNieWolny Mar 19, 2024
1894d42
✨ (feat): Bundle deletion part 1
WcaleNieWolny Mar 23, 2024
07576cd
✨ (feat): Save manifest bundle info part 2
WcaleNieWolny Mar 23, 2024
5ec49bf
✨ (feat): Encryption + compression
WcaleNieWolny Mar 24, 2024
82f58fc
✨ (feat(ios)): Create recusiveAssetFolderLoad
WcaleNieWolny Mar 30, 2024
85b9a8c
✨ (feat(ios)): Manifest storage locking + update parsing + buildin ma…
WcaleNieWolny Mar 31, 2024
26e54c9
✨ (feat(ios)): Better manfiest storage locking, better update parsing…
WcaleNieWolny Mar 31, 2024
1ffe000
✨ (feat(ios)): Download on GCD
WcaleNieWolny Apr 1, 2024
9db3065
🔊 (fix(android)): Improve logs
WcaleNieWolny Apr 1, 2024
c8dd705
✨ (feat(ios)): Copy manifest entries
WcaleNieWolny Apr 1, 2024
ce3af0c
✨ (feat(ios)): Copy files from builtin bundle
WcaleNieWolny Apr 2, 2024
87ed6d2
✨ (feat(IOS)): Download via partial + single file download path
WcaleNieWolny Apr 4, 2024
d8e1795
✨ (feat): Save and load manifest storage to device storage
WcaleNieWolny Apr 22, 2024
7b51bb4
✨ (feat(android)): Improve download
WcaleNieWolny Apr 23, 2024
d63ea64
✨ (feat(ios)): Add encryption (WiP)
WcaleNieWolny Apr 24, 2024
4314bb3
✨ (feat(ios)): Encryption part 2
WcaleNieWolny Apr 24, 2024
9f53076
✨ (feat(ios)): Partial podspec
WcaleNieWolny Apr 24, 2024
c7bf8db
✨ (feat(ios)): More version cleaning
WcaleNieWolny Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CapgoCapacitorUpdater.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ Pod::Spec.new do |s|
s.dependency 'SSZipArchive'
s.dependency 'Alamofire'
s.dependency 'Version'
s.dependency 'GZIP', '~> 1.3'
s.dependency 'SwiftyRSA'
s.swift_version = '5.1'
end
1 change: 1 addition & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<service android:name="ee.forgr.capacitor_updater.DownloadService" />
<service android:name="ee.forgr.capacitor_updater.DownloadServiceV2" />
</application>
</manifest>
19 changes: 19 additions & 0 deletions android/src/main/java/ee/forgr/capacitor_updater/BundleInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.Date;
import java.util.Objects;
import java.util.TimeZone;
import java.util.concurrent.atomic.AtomicInteger;

import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
Expand All @@ -30,6 +32,7 @@ public class BundleInfo {
private final String version;
private final String checksum;
private final BundleStatus status;
private AtomicInteger filesToDownload;

static {
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
Expand All @@ -55,6 +58,18 @@ public BundleInfo(
this(id, version, status, sdf.format(downloaded), checksum);
}

public BundleInfo(
final String id,
final String version,
final BundleStatus status,
final Date downloaded,
final int filesToDownload,
final String checksum
) {
this(id, version, status, sdf.format(downloaded), checksum);
this.filesToDownload = new AtomicInteger(filesToDownload);
}

public BundleInfo(
final String id,
final String version,
Expand Down Expand Up @@ -94,6 +109,10 @@ public boolean isDownloaded() {
);
}

public int decreaseFilesToDownload() {
return this.filesToDownload.decrementAndGet();
}

public String getDownloaded() {
return this.isBuiltin() ? DOWNLOADED_BUILTIN : this.downloaded;
}
Expand Down
Loading