mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Delta Chat Android Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
* Allow to add relay from clipboard or image if camera permission is not granted
|
||||
|
||||
## v2.33.1
|
||||
2025-12
|
||||
|
||||
|
||||
@@ -111,7 +111,9 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
System.loadLibrary("native-utils");
|
||||
|
||||
dcAccounts = new DcAccounts(new File(getFilesDir(), "accounts").getAbsolutePath());
|
||||
Log.i(TAG, "DcAccounts created");
|
||||
rpc = new Rpc(new FFITransport(dcAccounts.getJsonrpcInstance()));
|
||||
Log.i(TAG, "Rpc created");
|
||||
AccountManager.getInstance().migrateToDcAccounts(this);
|
||||
|
||||
// October-2025 migration: delete deprecated "permanent channel" id
|
||||
@@ -120,6 +122,7 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
// end October-2025 migration
|
||||
|
||||
int[] allAccounts = dcAccounts.getAll();
|
||||
Log.i(TAG, "Number of profiles: " + allAccounts.length);
|
||||
for (int accountId : allAccounts) {
|
||||
DcContext ac = dcAccounts.getAccount(accountId);
|
||||
if (!ac.isOpen()) {
|
||||
@@ -150,7 +153,9 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
notificationCenter = new NotificationCenter(this);
|
||||
eventCenter = new DcEventCenter(this);
|
||||
new Thread(() -> {
|
||||
Log.i(TAG, "Starting event loop");
|
||||
DcEventEmitter emitter = dcAccounts.getEventEmitter();
|
||||
Log.i(TAG, "DcEventEmitter obtained");
|
||||
while (true) {
|
||||
DcEvent event = emitter.getNextEvent();
|
||||
if (event==null) {
|
||||
|
||||
@@ -76,7 +76,6 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||
private static final String INSTANCES_URL = "https://chatmail.at/relays";
|
||||
private static final String DEFAULT_CHATMAIL_HOST = "arcanechat.me";
|
||||
|
||||
public static final String QR_ACCOUNT_EXTRA = "qr_account_extra";
|
||||
public static final String FROM_WELCOME = "from_welcome";
|
||||
private static final int REQUEST_CODE_AVATAR = 1;
|
||||
|
||||
@@ -113,12 +112,16 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||
if (DcHelper.getContext(this).isConfigured() == 1) {
|
||||
// if account is configured it means we didn't come from Welcome screen nor from QR scanner,
|
||||
// instead, user clicked a dcaccount:// URI directly, so we need to just offer to add a new relay
|
||||
Intent intent = new Intent(this, RelayListActivity.class);
|
||||
String qrData = getIntent().getData().toString();
|
||||
intent.putExtra(RelayListActivity.EXTRA_QR_DATA, qrData);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
return;
|
||||
Uri uri = getIntent().getData();
|
||||
if (uri != null) {
|
||||
Intent intent = new Intent(this, RelayListActivity.class);
|
||||
intent.putExtra(RelayListActivity.EXTRA_QR_DATA, uri.toString());
|
||||
startActivity(intent);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
// if URI is unexpectedly null, then fallback to new profile creation
|
||||
AccountManager.getInstance().beginAccountCreation(this);
|
||||
}
|
||||
|
||||
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(!fromWelcome) {
|
||||
@@ -241,16 +244,6 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
String accountQr = getIntent().getStringExtra(QR_ACCOUNT_EXTRA);
|
||||
if (accountQr != null) {
|
||||
getIntent().removeExtra(QR_ACCOUNT_EXTRA);
|
||||
setProviderFromQr(accountQr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
@@ -152,14 +152,6 @@ public class AccountManager {
|
||||
dialog.show(((FragmentActivity) activity).getSupportFragmentManager(), null);
|
||||
}
|
||||
|
||||
public void addAccountFromQr(Activity activity, String qr) {
|
||||
beginAccountCreation(activity);
|
||||
activity.finishAffinity();
|
||||
Intent intent = new Intent(activity, InstantOnboardingActivity.class);
|
||||
intent.putExtra(InstantOnboardingActivity.QR_ACCOUNT_EXTRA, qr);
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
||||
public void addAccountFromSecondDevice(Activity activity, String backupQr) {
|
||||
switchAccountAndStartActivity(activity, 0, backupQr);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class QrActivity extends BaseActionBarActivity implements View.OnClickLis
|
||||
.onAllGranted(() -> ((QrScanFragment) adapter.getItem(TAB_SCAN)).handleQrScanWithPermissions(QrActivity.this))
|
||||
.onAnyDenied(() -> {
|
||||
if (scanRelay) {
|
||||
finish();
|
||||
Toast.makeText(this, getString(R.string.chat_camera_unavailable), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
viewPager.setCurrentItem(TAB_SHOW);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public class QrActivity extends BaseActionBarActivity implements View.OnClickLis
|
||||
&& Manifest.permission.CAMERA.equals(permissions[0])
|
||||
&& grantResults[0] == PackageManager.PERMISSION_DENIED) {
|
||||
if (scanRelay) {
|
||||
finish();
|
||||
Toast.makeText(this, getString(R.string.chat_camera_unavailable), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
viewPager.setCurrentItem(TAB_SHOW);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@
|
||||
<string name="onboarding_create_instant_account">Create New Profile</string>
|
||||
<!-- Secondary button on the welcome screen, allows to "Add as Second Device", "Restore from Backup" -->
|
||||
<string name="onboarding_alternative_logins">I Already Have a Profile</string>
|
||||
<!-- This is a button and a title, allowing to log in to existing, classic email accounts, setting ports, passwords and so on -->
|
||||
<!-- This is a button and a title, allowing to use existing, classic email, setting ports, passwords and so on -->
|
||||
<string name="manual_account_setup_option">Use Classic Email as Relay</string>
|
||||
<!-- Instant onboarding title (there is not more to do than to set name and avatar) -->
|
||||
<string name="instant_onboarding_title">Your Profile</string>
|
||||
@@ -636,7 +636,7 @@
|
||||
<string name="welcome_chat_over_email">Secure Decentralized Chat</string>
|
||||
<string name="scan_invitation_code">Scan Invitation Code</string>
|
||||
<string name="login_title">Log In</string>
|
||||
<string name="login_advanced_hint">This login is for advanced users:\n\n• Do not use an account you\'re using in another app.\n\n• Classic email server allow chats without end-to-end encryption marked by a mail icon.</string>
|
||||
<string name="login_advanced_hint">This login is for advanced users:\n\n• Do not use an address you\'re using in another app.\n\n• Classic email server allow chats without end-to-end encryption marked by a mail icon.</string>
|
||||
<string name="login_inbox">Inbox</string>
|
||||
<string name="login_imap_login">IMAP Login Name</string>
|
||||
<string name="login_imap_server">IMAP Server</string>
|
||||
|
||||
Reference in New Issue
Block a user