Skip to content

Commit 5cdb5f0

Browse files
authored
Merge pull request #2955 from numbersprotocol/milestone-v230711-part-2
Milestone v230711 part 2
2 parents 279f44e + 5aeeb3b commit 5cdb5f0

File tree

11 files changed

+107
-56
lines changed

11 files changed

+107
-56
lines changed

.github/workflows/test.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: test
22

3-
on:
4-
push:
5-
branches: [master, develop, 'feature-*', 'fix-*', 'hotfix-*']
3+
on: [push, pull_request]
64

75
jobs:
86
lint:

CHANGELOG.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.82.4] - 2023-08-01
11+
12+
### Fixed
13+
14+
1. Fix User can’t register asset when using capture camera (#2930)
15+
1. Fix can't register new account on some android device (#2953)
16+
1017
## [0.82.3] - 2023-07-28
1118

1219
### Fixed
@@ -21,8 +28,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2128

2229
### Fixed
2330

24-
1. Fix can't register new account on some android device (#2928)
25-
1. Fix User can’t register asset when using capture camera (#2930)
2631
1. Fix Change capture tab VALIDATED to VERIFIED (#2939)
2732
1. Fix 4k videos can not generate thumbnail on some android devices (Android only) (#2923). reverted (#2938)
2833
1. Fix show correct error mesage for sign up duplicate username error (#2926)
@@ -2159,8 +2164,9 @@ This is the first release! _Capture Lite_ is a cross-platform app adapted from [
21592164
- Web - see the demo [here](https://github.com/numbersprotocol/capture-lite#demo-app)
21602165
- Android - the APK file `app-debug.apk` is attached to this release
21612166

2162-
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.82.3...HEAD
2163-
[0.82.3]: https://github.com/numbersprotocol/capture-lite/compare/0.82.2...0.23.3
2167+
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.82.4...HEAD
2168+
[0.82.4]: https://github.com/numbersprotocol/capture-lite/compare/0.82.3...0.82.4
2169+
[0.82.3]: https://github.com/numbersprotocol/capture-lite/compare/0.82.2...0.82.3
21642170
[0.82.2]: https://github.com/numbersprotocol/capture-lite/compare/0.81.2...0.82.2
21652171
[0.81.2]: https://github.com/numbersprotocol/capture-lite/compare/0.79.0...0.81.2
21662172
[0.79.0]: https://github.com/numbersprotocol/capture-lite/compare/0.78.0...0.79.0

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "io.numbersprotocol.capturelite"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 823
11-
versionName "0.82.3"
10+
versionCode 824
11+
versionName "0.82.4"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
buildFeatures {

ios/App/App.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,13 @@
368368
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
369369
CODE_SIGN_IDENTITY = "iPhone Distribution";
370370
CODE_SIGN_STYLE = Manual;
371-
CURRENT_PROJECT_VERSION = 823;
371+
CURRENT_PROJECT_VERSION = 824;
372372
DEVELOPMENT_TEAM = G7NB5YCKAP;
373373
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
374374
INFOPLIST_FILE = App/Info.plist;
375375
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
376376
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
377-
MARKETING_VERSION = 0.82.3;
377+
MARKETING_VERSION = 0.82.4;
378378
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
379379
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
380380
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -395,13 +395,13 @@
395395
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
396396
CODE_SIGN_IDENTITY = "iPhone Distribution";
397397
CODE_SIGN_STYLE = Manual;
398-
CURRENT_PROJECT_VERSION = 823;
398+
CURRENT_PROJECT_VERSION = 824;
399399
DEVELOPMENT_TEAM = G7NB5YCKAP;
400400
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
401401
INFOPLIST_FILE = App/Info.plist;
402402
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
403403
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
404-
MARKETING_VERSION = 0.82.3;
404+
MARKETING_VERSION = 0.82.4;
405405
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
406406
PRODUCT_NAME = "$(TARGET_NAME)";
407407
PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4;

ios/App/Podfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ PODS:
3333
- Capacitor
3434
- CapacitorGeolocation (5.0.4):
3535
- Capacitor
36-
- CapacitorLocalNotifications (5.0.4):
36+
- CapacitorLocalNotifications (5.0.6):
3737
- Capacitor
3838
- CapacitorNativeSettings (4.0.3):
3939
- Capacitor
4040
- CapacitorNetwork (5.0.4):
4141
- Capacitor
42-
- CapacitorPushNotifications (5.0.4):
42+
- CapacitorPushNotifications (5.0.6):
4343
- Capacitor
4444
- CapacitorShare (5.0.4):
4545
- Capacitor
@@ -231,10 +231,10 @@ SPEC CHECKSUMS:
231231
CapacitorDevice: eb4b5e3b42ac35d2527f20aad296b59e0785dc8d
232232
CapacitorFilesystem: e1bdfab09b95b181c844c16abcfda45ec8e8ed6b
233233
CapacitorGeolocation: 33015be1ef496585a60da9efa1c5642ff8624db3
234-
CapacitorLocalNotifications: 2c95d27ccf9cc28ecc59d69b54d29074c1740172
234+
CapacitorLocalNotifications: c2d8b14794064fd4814b1d6c4ddbac8029afa295
235235
CapacitorNativeSettings: b6f40955945bc659f966a43fa54fc6be192d8f9b
236236
CapacitorNetwork: e2bd0bf1614aca34bb976f125a756a8a3df1c81a
237-
CapacitorPushNotifications: 3704ac3dac68a9bfc669fb384cbc7beec9b1f100
237+
CapacitorPushNotifications: 7eb70469f1fcc3dec07126336d4896520e4991db
238238
CapacitorShare: 427bba238a1e3f116b2b349019aec6ea7f42cebd
239239
CapacitorSplashScreen: 93a389d4f7673c08214ae25bb6f21d867d5305c5
240240
CapacitorStorage: 8ec2cf8fec179d829288b16c6fba6c3c43d2bdc9

package-lock.json

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-lite",
3-
"version": "0.82.3",
3+
"version": "0.82.4",
44
"author": "numbersprotocol",
55
"homepage": "https://numbersprotocol.io/",
66
"scripts": {
@@ -45,9 +45,9 @@
4545
"@capacitor/filesystem": "^5.0.4",
4646
"@capacitor/geolocation": "^5.0.4",
4747
"@capacitor/ios": "^5.0.5",
48-
"@capacitor/local-notifications": "^5.0.4",
48+
"@capacitor/local-notifications": "^5.0.6",
4949
"@capacitor/network": "^5.0.4",
50-
"@capacitor/push-notifications": "^5.0.4",
50+
"@capacitor/push-notifications": "^5.0.6",
5151
"@capacitor/share": "^5.0.4",
5252
"@capacitor/splash-screen": "^5.0.4",
5353
"@capacitor/storage": "^1.2.4",

src/app/features/home/custom-camera/custom-camera.page.html

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
*ngIf="(mode$ | ngrxPush) === 'pre-publish'"
151151
[curCaptureFileSize]="curCaptureFileSize"
152152
[curCaptureFilePath]="curCaptureFilePath"
153+
[curCaptureFileName]="curCaptureFileName"
153154
[curCaptureMimeType]="curCaptureMimeType"
154155
[curCaptureSrc]="curCaptureSrc"
155156
(confirm)="confirmCurrentCapture()"

src/app/features/home/custom-camera/custom-camera.page.ts

+29-3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
8383

8484
curCaptureFileSize?: number;
8585
curCaptureFilePath?: string;
86+
curCaptureFileName?: string;
8687
curCaptureMimeType?: 'image/jpeg' | 'video/mp4';
8788
curCaptureType?: MediaType = 'image';
8889
curCaptureSrc?: string;
@@ -142,8 +143,32 @@ export class CustomCameraPage implements OnInit, OnDestroy {
142143
});
143144
}
144145

145-
private handleCaptureSuccessResult(result: CaptureSuccessResult) {
146-
this.prepareForPublishing(result, CameraSource.Camera);
146+
private async handleCaptureSuccessResult(result: CaptureSuccessResult) {
147+
const resultCopy = await this.copyResultIfNeeded(result);
148+
this.prepareForPublishing(resultCopy, CameraSource.Camera);
149+
}
150+
151+
private async copyResultIfNeeded(result: CaptureSuccessResult) {
152+
/**
153+
* WORKAROUND: https://github.com/numbersprotocol/capture-lite/issues/2904
154+
* On Android 13 capacitor filesystem plugin need to pass directory parameter to be
155+
* able to re-write media file (aka when we edit image and save it the same file).
156+
* Therefore we copy image to cache so we can re-write it if user crop/filter the image.
157+
*
158+
*/
159+
if (this.platform.is('android') && result.mimeType.startsWith('image/')) {
160+
const originalFilePath = result.path;
161+
const readFileResult = await Filesystem.readFile({ path: result.path });
162+
const writeFileResult = await Filesystem.writeFile({
163+
data: readFileResult.data,
164+
path: `${result.name}`,
165+
directory: Directory.Cache,
166+
recursive: true,
167+
});
168+
result.path = writeFileResult.uri;
169+
await Filesystem.deleteFile({ path: originalFilePath });
170+
}
171+
return result;
147172
}
148173

149174
private handleCaptureErrorResult(result: CaptureErrorResult) {
@@ -156,6 +181,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
156181
) {
157182
this.curCaptureFileSize = result.size;
158183
this.curCaptureFilePath = result.path;
184+
this.curCaptureFileName = result.name;
159185
this.curCaptureMimeType = result.mimeType;
160186
this.curCaptureType = result.mimeType === 'image/jpeg' ? 'image' : 'video';
161187
this.curCaptureSrc = Capacitor.convertFileSrc(result.path);
@@ -328,7 +354,7 @@ export class CustomCameraPage implements OnInit, OnDestroy {
328354
const readFileResult = await Filesystem.readFile({ path: file.path });
329355
const writeFileresult = await Filesystem.writeFile({
330356
data: readFileResult.data,
331-
path: `${Date.now()}/${file.name}`,
357+
path: `${file.name}`,
332358
directory: Directory.Cache,
333359
recursive: true,
334360
});

src/app/features/home/custom-camera/pre-publish-mode/pre-publish-mode.component.ts

+27-7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
Output,
88
ViewChild,
99
} from '@angular/core';
10-
import { FilesystemPlugin } from '@capacitor/filesystem';
11-
import { AlertController } from '@ionic/angular';
10+
import { Directory, FilesystemPlugin } from '@capacitor/filesystem';
11+
import { AlertController, Platform } from '@ionic/angular';
1212
import { TranslocoService } from '@ngneat/transloco';
1313
import { ColorMatrix, getEditorDefaults } from '@pqina/pintura';
1414
import {
@@ -62,6 +62,8 @@ export class PrePublishModeComponent {
6262

6363
readonly curCaptureFilePath$ = new ReplaySubject<string>(1);
6464

65+
readonly curCaptureFileName$ = new ReplaySubject<string>(1);
66+
6567
readonly curCaptureMimeType$ = new ReplaySubject<CaptureMimeType>(1);
6668

6769
readonly curCaptureSrc$ = new ReplaySubject<string>(1);
@@ -108,6 +110,11 @@ export class PrePublishModeComponent {
108110
if (value) this.curCaptureFilePath$.next(value);
109111
}
110112

113+
@Input()
114+
set curCaptureFileName(value: string | undefined) {
115+
if (value) this.curCaptureFileName$.next(value);
116+
}
117+
111118
@Input()
112119
set curCaptureMimeType(value: CaptureMimeType | undefined) {
113120
if (value) this.curCaptureMimeType$.next(value);
@@ -129,7 +136,8 @@ export class PrePublishModeComponent {
129136
private readonly filesystemPlugin: FilesystemPlugin,
130137
private readonly errorService: ErrorService,
131138
private readonly alertController: AlertController,
132-
private readonly translocoService: TranslocoService
139+
private readonly translocoService: TranslocoService,
140+
private readonly platform: Platform
133141
) {}
134142

135143
handleEditorUpdate(imageState: any): void {
@@ -150,12 +158,24 @@ export class PrePublishModeComponent {
150158

151159
async handleEditorProcess(imageWriterResult: any): Promise<void> {
152160
const base64 = await blobToBase64(imageWriterResult.dest as File);
153-
combineLatest([this.curCaptureFilePath$, of(base64)])
161+
combineLatest([
162+
this.curCaptureFilePath$,
163+
of(base64),
164+
this.isImage$,
165+
this.curCaptureFileName$,
166+
])
154167
.pipe(
155168
first(),
156-
switchMap(([path, data]) =>
157-
this.filesystemPlugin.writeFile({ path, data })
158-
),
169+
switchMap(([path, data, isImage, fileName]) => {
170+
if (this.platform.is('android') && isImage) {
171+
return this.filesystemPlugin.writeFile({
172+
path: fileName,
173+
data: data,
174+
directory: Directory.Cache,
175+
});
176+
}
177+
return this.filesystemPlugin.writeFile({ path, data });
178+
}),
159179
tap(() => this.isProcessingImage$.next(false)),
160180
tap(() => this.confirm.emit(true)),
161181
catchError((error: unknown) => {

src/app/shared/media/component/media.component.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ export class MediaComponent implements AfterViewInit, OnDestroy {
175175
* and the native player is no longer needed.
176176
*/
177177
private removeCSSClass() {
178-
// Remove the CSS class from the body element
179-
this.renderer.removeClass(
180-
this.elementRef.nativeElement.ownerDocument.body,
181-
this.globalCSSClass
182-
);
183-
// Remove the CSS class from the ion-app element
184-
this.renderer.removeClass(
185-
this.elementRef.nativeElement.ownerDocument.querySelector('ion-app'),
186-
this.globalCSSClass
187-
);
178+
const bodyElement = this.elementRef.nativeElement.ownerDocument.body;
179+
const ionAppElement =
180+
this.elementRef.nativeElement.ownerDocument.querySelector('ion-app');
181+
182+
if (bodyElement && ionAppElement) {
183+
// Remove the CSS class from the body element
184+
this.renderer.removeClass(bodyElement, this.globalCSSClass);
185+
// Remove the CSS class from the ion-app element
186+
this.renderer.removeClass(ionAppElement, this.globalCSSClass);
187+
}
188188
}
189189
}

0 commit comments

Comments
 (0)