Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1,318 changes: 1,318 additions & 0 deletions app/schemas/com.nextcloud.client.database.NextcloudDatabase/102.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ import com.owncloud.android.db.ProviderMeta
// manual migration used for 97 to 98
AutoMigration(from = 98, to = 99),
// manual migration used for 99 to 100
AutoMigration(from = 100, to = 101, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
AutoMigration(from = 100, to = 101, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
AutoMigration(from = 101, to = 102)
],
exportSchema = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ data class ShareEntity(
val isPasswordProtected: Int?,
@ColumnInfo(name = ProviderTableMeta.OCSHARES_NOTE)
val note: String?,
@ColumnInfo(name = ProviderTableMeta.OCSHARES_SEND_PASSWORD_BY_TALK)
val sendPasswordByTalk: Int?,
@ColumnInfo(name = ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD)
val hideDownload: Int?,
@ColumnInfo(name = ProviderTableMeta.OCSHARES_SHARE_LINK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fun OCShare.toEntity(accountName: String): ShareEntity = ShareEntity(
userId = userId,
accountOwner = accountName,
isPasswordProtected = if (isPasswordProtected) 1 else 0,
sendPasswordByTalk = if (isSendPasswordByTalk) 1 else 0,
note = note,
hideDownload = if (isHideFileDownload) 1 else 0,
shareLink = shareLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,7 @@ private ContentValues createContentValueForShare(OCShare share) {
contentValues.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getRemoteId());
contentValues.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, user.getAccountName());
contentValues.put(ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED, share.isPasswordProtected() ? 1 : 0);
contentValues.put(ProviderTableMeta.OCSHARES_SEND_PASSWORD_BY_TALK, share.isSendPasswordByTalk() ? 1 : 0);
contentValues.put(ProviderTableMeta.OCSHARES_NOTE, share.getNote());
contentValues.put(ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD, share.isHideFileDownload());
contentValues.put(ProviderTableMeta.OCSHARES_SHARE_LINK, share.getShareLink());
Expand Down Expand Up @@ -1717,6 +1718,7 @@ private OCShare createShareInstance(Cursor cursor) {
share.setUserId(getString(cursor, ProviderTableMeta.OCSHARES_USER_ID));
share.setRemoteId(getLong(cursor, ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED));
share.setPasswordProtected(getInt(cursor, ProviderTableMeta.OCSHARES_IS_PASSWORD_PROTECTED) == 1);
share.setSendPasswordByTalk(getInt(cursor, ProviderTableMeta.OCSHARES_SEND_PASSWORD_BY_TALK) == 1);
share.setNote(getString(cursor, ProviderTableMeta.OCSHARES_NOTE));
share.setHideFileDownload(getInt(cursor, ProviderTableMeta.OCSHARES_HIDE_DOWNLOAD) == 1);
share.setShareLink(getString(cursor, ProviderTableMeta.OCSHARES_SHARE_LINK));
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/owncloud/android/db/ProviderMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public class ProviderMeta {
public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 101;
public static final int DB_VERSION = 102;

private ProviderMeta() {
// No instance
Expand Down Expand Up @@ -209,6 +209,7 @@ static public class ProviderTableMeta implements BaseColumns {
public static final String OCSHARES_ID_REMOTE_SHARED = "id_remote_shared";
public static final String OCSHARES_ACCOUNT_OWNER = "owner_share";
public static final String OCSHARES_IS_PASSWORD_PROTECTED = "is_password_protected";
public static final String OCSHARES_SEND_PASSWORD_BY_TALK = "send_password_by_talk";
public static final String OCSHARES_NOTE = "note";
public static final String OCSHARES_HIDE_DOWNLOAD = "hide_download";
public static final String OCSHARES_SHARE_LINK = "share_link";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class CreateShareWithShareeOperation extends SyncOperation {
private final int permissions;
private final String noteMessage;
private final String sharePassword;
private final boolean isVideoVerification;
private final boolean hideFileDownload;
private final long expirationDateInMillis;
private String label;
Expand Down Expand Up @@ -85,6 +86,7 @@ public CreateShareWithShareeOperation(String path,
int permissions,
String noteMessage,
String sharePassword,
boolean isVideoVerification,
long expirationDateInMillis,
boolean hideFileDownload,
String attributes,
Expand All @@ -105,6 +107,7 @@ public CreateShareWithShareeOperation(String path,
this.hideFileDownload = hideFileDownload;
this.noteMessage = noteMessage;
this.sharePassword = sharePassword;
this.isVideoVerification = isVideoVerification;
this.context = context;
this.user = user;
this.arbitraryDataProvider = arbitraryDataProvider;
Expand Down Expand Up @@ -164,6 +167,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
attributes
);
operation.setGetShareDetails(true);
operation.setSendPasswordByTalk(isVideoVerification);
RemoteOperationResult shareResult = operation.execute(client);

if (!shareResult.isSuccess() || shareResult.getData().size() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class UpdateShareInfoOperation extends SyncOperation {
private boolean hideFileDownload;
private int permissions = -1;
private String password;
private boolean isVideoVerification;
private String label;
private String attributes;

Expand Down Expand Up @@ -107,6 +108,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
updateOp.setPermissions(permissions);
}
updateOp.setPassword(password);
updateOp.setSendPasswordByTalk(isVideoVerification);
updateOp.setLabel(label);
updateOp.setAttributes(attributes);

Expand Down Expand Up @@ -154,6 +156,8 @@ public void setPassword(String password) {
this.password = password;
}

public void setIsVideoVerification(boolean isVideoVerification) { this.isVideoVerification = isVideoVerification; }

public void setLabel(String label) {
this.label = label;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class OperationsService extends Service {
public static final String EXTRA_FILE = "FILE";
public static final String EXTRA_FILE_VERSION = "FILE_VERSION";
public static final String EXTRA_SHARE_PASSWORD = "SHARE_PASSWORD";
public static final String EXTRA_VIDEO_VERIFICATION = "SHARE_VIDEO_VERIFICATION";
public static final String EXTRA_SHARE_TYPE = "SHARE_TYPE";
public static final String EXTRA_SHARE_WITH = "SHARE_WITH";
public static final String EXTRA_SHARE_EXPIRATION_DATE_IN_MILLIS = "SHARE_EXPIRATION_YEAR";
Expand Down Expand Up @@ -599,6 +600,7 @@ private Pair<Target, RemoteOperation> newOperation(Intent operationIntent) {
int permissions = operationIntent.getIntExtra(EXTRA_SHARE_PERMISSIONS, -1);
String noteMessage = operationIntent.getStringExtra(EXTRA_SHARE_NOTE);
String sharePassword = operationIntent.getStringExtra(EXTRA_SHARE_PASSWORD);
boolean isVideoVerification = operationIntent.getBooleanExtra(EXTRA_VIDEO_VERIFICATION, false);
long expirationDateInMillis = operationIntent
.getLongExtra(EXTRA_SHARE_EXPIRATION_DATE_IN_MILLIS, 0L);
boolean hideFileDownload = operationIntent.getBooleanExtra(EXTRA_SHARE_HIDE_FILE_DOWNLOAD,
Expand All @@ -613,6 +615,7 @@ private Pair<Target, RemoteOperation> newOperation(Intent operationIntent) {
permissions,
noteMessage,
sharePassword,
isVideoVerification,
expirationDateInMillis,
hideFileDownload,
attributes,
Expand Down Expand Up @@ -647,6 +650,9 @@ private Pair<Target, RemoteOperation> newOperation(Intent operationIntent) {
password = operationIntent.getStringExtra(EXTRA_SHARE_PASSWORD);
updateShare.setPassword(password);

isVideoVerification = operationIntent.getBooleanExtra(EXTRA_VIDEO_VERIFICATION, false);
updateShare.setIsVideoVerification(isVideoVerification);

boolean fileDownloadHide = operationIntent.getBooleanExtra(EXTRA_SHARE_HIDE_FILE_DOWNLOAD
, false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ class FileDetailsSharingProcessFragment :
viewThemeUtils.androidx.run {
binding.run {
colorSwitchCompat(shareProcessSetPasswordSwitch)
colorSwitchCompat(shareProcessSetVideoVerificationSwitch)
colorSwitchCompat(shareProcessSetExpDateSwitch)
colorSwitchCompat(shareProcessSetDownloadLimitSwitch)
colorSwitchCompat(shareProcessHideDownloadCheckbox)
Expand Down Expand Up @@ -316,6 +317,7 @@ class FileDetailsSharingProcessFragment :
binding.shareProcessBtnNext.text = getString(R.string.common_next)
updateViewAccordingToFile()
showPasswordInput(binding.shareProcessSetPasswordSwitch.isChecked)
showVideoVerificationSwitch(binding.shareProcessSetPasswordSwitch.isChecked)
showExpirationDateInput(binding.shareProcessSetExpDateSwitch.isChecked)
showFileDownloadLimitInput(binding.shareProcessSetDownloadLimitSwitch.isChecked)
setMaxPermissionsIfDefaultPermissionExists()
Expand Down Expand Up @@ -356,6 +358,8 @@ class FileDetailsSharingProcessFragment :
updateViewForShareType()
binding.shareProcessSetPasswordSwitch.isChecked = share?.isPasswordProtected == true
showPasswordInput(binding.shareProcessSetPasswordSwitch.isChecked)
binding.shareProcessSetVideoVerificationSwitch.isChecked = share?.isSendPasswordByTalk == true
showVideoVerificationSwitch(binding.shareProcessSetPasswordSwitch.isChecked)
updateExpirationDateView()
showExpirationDateInput(binding.shareProcessSetExpDateSwitch.isChecked)
updateFileDownloadLimitView()
Expand Down Expand Up @@ -564,6 +568,7 @@ class FileDetailsSharingProcessFragment :
}
shareProcessSetPasswordSwitch.setOnCheckedChangeListener { _, isChecked ->
showPasswordInput(isChecked)
showVideoVerificationSwitch(isChecked)
}
shareProcessSetExpDateSwitch.setOnCheckedChangeListener { _, isChecked ->
showExpirationDateInput(isChecked)
Expand Down Expand Up @@ -745,6 +750,13 @@ class FileDetailsSharingProcessFragment :
}
}

private fun showVideoVerificationSwitch(isChecked: Boolean) {
binding.shareProcessSetVideoVerificationSwitch.setVisibleIf(isChecked)
if (!isChecked) {
binding.shareProcessSetVideoVerificationSwitch.isChecked = false
}
}

private fun removeCurrentFragment() {
onEditShareListener.onShareProcessClosed()
fileActivity?.supportFragmentManager?.beginTransaction()?.remove(this)?.commit()
Expand Down Expand Up @@ -844,6 +856,7 @@ class FileDetailsSharingProcessFragment :
permission,
binding.shareProcessHideDownloadCheckbox.isChecked,
password,
binding.shareProcessSetVideoVerificationSwitch.isChecked,
chosenExpDateInMills,
binding.shareProcessChangeName.text.toString().trim()
)
Expand Down Expand Up @@ -878,6 +891,7 @@ class FileDetailsSharingProcessFragment :
permission,
binding.shareProcessHideDownloadCheckbox.isChecked,
binding.shareProcessEnterPassword.text.toString().trim(),
binding.shareProcessSetVideoVerificationSwitch.isChecked,
chosenExpDateInMills,
noteText,
downloadAttribute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ public void shareFileWithSharee(OCFile file,
int permissions,
boolean hideFileDownload,
String password,
boolean isVideoVerification,
long expirationTimeInMillis,
String note,
String attributes,
Expand All @@ -557,6 +558,7 @@ public void shareFileWithSharee(OCFile file,
service.putExtra(OperationsService.EXTRA_SHARE_PERMISSIONS, permissions);
service.putExtra(OperationsService.EXTRA_SHARE_HIDE_FILE_DOWNLOAD, hideFileDownload);
service.putExtra(OperationsService.EXTRA_SHARE_PASSWORD, (password == null) ? "" : password);
service.putExtra(OperationsService.EXTRA_VIDEO_VERIFICATION, isVideoVerification);
service.putExtra(OperationsService.EXTRA_SHARE_EXPIRATION_DATE_IN_MILLIS, expirationTimeInMillis);
service.putExtra(OperationsService.EXTRA_SHARE_NOTE, (note == null) ? "" : note);
service.putExtra(OperationsService.EXTRA_SHARE_PUBLIC_LABEL, (label == null) ? "" : label);
Expand Down Expand Up @@ -758,6 +760,7 @@ public void updateShareInformation(OCShare share,
int permissions,
boolean hideFileDownload,
String password,
boolean isVideoVerification,
long expirationTimeInMillis,
String label) {
final var id = share.getId();
Expand All @@ -778,6 +781,7 @@ public void updateShareInformation(OCShare share,
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_PERMISSIONS, permissions);
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_HIDE_FILE_DOWNLOAD, hideFileDownload);
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_PASSWORD, password);
updateShareIntent.putExtra(OperationsService.EXTRA_VIDEO_VERIFICATION, isVideoVerification);
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_EXPIRATION_DATE_IN_MILLIS, expirationTimeInMillis);
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_PUBLIC_LABEL, (label == null) ? "" : label);
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_ATTRIBUTES, attributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/share_process_set_video_verification_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_half_margin"
android:minHeight="@dimen/minimum_size_for_touchable_area"
android:text="@string/share_no_video_verification_label"/>

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/share_process_set_exp_date_switch"
android:layout_width="match_parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@
<string name="share_via_link_section_title">Share link</string>
<string name="share_via_link_send_link_label">Send link</string>
<string name="share_no_password_title">Set password</string>
<string name="share_no_video_verification_label">Video verification</string>
<string name="share_via_link_unset_password">Unset</string>

<string name="share_search">Name, Federated Cloud ID or email address…</string>
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
androidCommonLibraryVersion = "0.33.2"
androidGifDrawableVersion = "1.2.32"
androidImageCropperVersion = "4.7.0"
androidLibraryVersion ="72a95a990f57135ef2b658d49a99dd193dcd6671"
androidLibraryVersion ="PR2079-SNAPSHOT"
androidOpensslVersion = "3.5.6"
androidPluginVersion = "9.2.1"
androidsvgVersion = "1.4"
Expand Down
8 changes: 8 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20698,6 +20698,14 @@
<sha256 value="7fbbc552d7368182cfaf9d0d76cac0f782c6371b6d3d44c7f6e75690e1536d52" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.bitfireAT" name="dav4jvm" version="3.0.1">
<artifact name="dav4jvm-3.0.1.jar">
<sha256 value="00749daffbc9900d619cde42fde415030146dea83e5886df6e1a7115e1c0f7d0" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="dav4jvm-3.0.1.module">
<sha256 value="7df449a177cc7e95df4b4e82185fb775add74bc8865da83962e4fe2573307d59" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.bumptech.glide" name="annotations" version="4.16.0">
<artifact name="annotations-4.16.0.jar">
<sha256 value="c59e39b1b31b4d5592277cd90012149d740b569d4338f56443cac82c3fbda3d1" origin="Generated by Gradle"/>
Expand Down