Merge pull request #13 from session-foundation/release/1.20.5

Release/1.20.5
pull/1709/head
ThomasSession 5 months ago committed by GitHub
commit 0dbf51e234
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,8 +13,8 @@ configurations.forEach {
it.exclude module: "commons-logging"
}
def canonicalVersionCode = 386
def canonicalVersionName = "1.20.4"
def canonicalVersionCode = 387
def canonicalVersionName = "1.20.5"
def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,

@ -82,6 +82,8 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
private String mimeType;
private boolean isPassingAlongMedia;
private ResolveMediaTask resolveTask;
@Override
protected void onCreate(Bundle icicle, boolean ready) {
if (!getIntent().hasExtra(ContactSelectionListFragment.DISPLAY_MODE)) {
@ -190,7 +192,8 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
} else {
contactsFragment.getView().setVisibility(View.GONE);
progressWheel.setVisibility(View.VISIBLE);
new ResolveMediaTask(context).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, streamExtra);
resolveTask = new ResolveMediaTask(context);
resolveTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, streamExtra);
}
}
@ -262,6 +265,12 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
public void onContactDeselected(String number) {
}
@Override
protected void onDestroy() {
super.onDestroy();
if (resolveTask != null) resolveTask.cancel(true);
}
@SuppressLint("StaticFieldLeak")
private class ResolveMediaTask extends AsyncTask<Uri, Void, Uri> {
private final Context context;

@ -169,9 +169,11 @@ class ConversationViewModel(
communityWriteAccessJob = viewModelScope.launch {
OpenGroupManager.getCommunitiesWriteAccessFlow()
.map {
if(openGroup?.groupId != null)
it[openGroup?.groupId]
else null
withContext(Dispatchers.Default) {
if (openGroup?.groupId != null)
it[openGroup?.groupId]
else null
}
}
.filterNotNull()
.collect{

@ -630,8 +630,17 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
}
if (oldVersion < lokiV47) {
db.execSQL(SmsDatabase.ADD_IS_DELETED_COLUMN);
db.execSQL(MmsDatabase.ADD_IS_DELETED_COLUMN);
// Ideally we shouldn't need to check if the column exists, but somehow we get
// "duplicated column" from play store crashes.
// If you are keen you can investigate
// deep into this but for now, we will just check if the column exists before adding it.
if (!columnExists(db, SmsDatabase.TABLE_NAME, SmsDatabase.IS_DELETED)) {
db.execSQL(SmsDatabase.ADD_IS_DELETED_COLUMN);
}
if (!columnExists(db, MmsDatabase.TABLE_NAME, MmsDatabase.IS_DELETED)) {
db.execSQL(MmsDatabase.ADD_IS_DELETED_COLUMN);
}
}
db.setTransactionSuccessful();

@ -37,7 +37,7 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat
private val viewModel: MessageRequestsViewModel by viewModels()
private val adapter: MessageRequestsAdapter by lazy {
MessageRequestsAdapter(context = this, cursor = threadDb.unapprovedConversationList, listener = this)
MessageRequestsAdapter(context = this, cursor = null, listener = this)
}
override fun onCreate(savedInstanceState: Bundle?, ready: Boolean) {
@ -114,7 +114,7 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat
}
private fun updateEmptyState() {
val threadCount = (binding.recyclerView.adapter as MessageRequestsAdapter).itemCount
val threadCount = adapter.itemCount
binding.emptyStateContainer.isVisible = threadCount == 0
binding.clearAllMessageRequestsButton.isVisible = threadCount != 0
}

@ -127,7 +127,7 @@ class ClearAllDataDialog : DialogFragment() {
ApplicationContext.getInstance(context).clearAllDataAndRestart().let { success ->
withContext(Main) {
if (success) {
dismiss()
dismissAllowingStateLoss()
} else {
Toast.makeText(ApplicationContext.getInstance(requireContext()), R.string.errorUnknown, Toast.LENGTH_LONG).show()
}
@ -161,8 +161,15 @@ class ClearAllDataDialog : DialogFragment() {
}
else if (deletionResultMap.values.all { it }) {
// ..otherwise if the network data deletion was successful proceed to delete the local data as well.
ApplicationContext.getInstance(context).clearAllDataAndRestart()
withContext(Main) { dismiss() }
ApplicationContext.getInstance(context).clearAllDataAndRestart().let { success ->
withContext(Main) {
if (success) {
dismissAllowingStateLoss()
} else {
Toast.makeText(ApplicationContext.getInstance(requireContext()), R.string.errorUnknown, Toast.LENGTH_LONG).show()
}
}
}
}
}
}

@ -40,7 +40,7 @@ class BuildCredentials:
self.key_password = credentials['key_password']
def build_releases(project_root: str, flavor: str, credentials_property_prefix: str, credentials: BuildCredentials, huawei: bool=False) -> BuildResult:
(keystore_fd, keystore_file) = tempfile.mkstemp(prefix='keystore_', suffix='.jks', dir=os.path.join(project_root, 'build'))
(keystore_fd, keystore_file) = tempfile.mkstemp(prefix='keystore_', suffix='.jks', dir=build_dir)
try:
with os.fdopen(keystore_fd, 'wb') as f:
f.write(base64.b64decode(credentials.keystore_b64))
@ -82,8 +82,9 @@ def build_releases(project_root: str, flavor: str, credentials_property_prefix:
project_root = os.path.dirname(sys.path[0])
build_dir = os.path.join(project_root, 'build')
credentials_file_path = os.path.join(project_root, 'release-creds.toml')
fdroid_repo_path = os.path.join(project_root, 'build/fdroidrepo')
fdroid_repo_path = os.path.join(build_dir, 'fdroidrepo')
def detect_android_sdk() -> str:
sdk_dir = os.environ.get('ANDROID_HOME')
@ -102,11 +103,11 @@ def update_fdroid(build: BuildResult, fdroid_workspace: str, creds: BuildCredent
# Check if there's a git repo at the fdroid repo path by running git status
try:
subprocess.check_call(f'git -C {fdroid_repo_path} status', shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
subprocess.check_call(f'git fetch', shell=True, cwd=fdroid_workspace)
subprocess.check_call(f'git fetch --depth=1', shell=True, cwd=fdroid_workspace)
print(f'Found fdroid git repo at {fdroid_repo_path}')
except subprocess.CalledProcessError:
print(f'No fdroid git repo found at {fdroid_repo_path}. Cloning using gh.')
subprocess.run(f'gh repo clone session-foundation/session-fdroid {fdroid_repo_path} -- --depth=1', shell=True, check=True)
subprocess.run(f'gh repo clone session-foundation/session-fdroid {fdroid_repo_path} -- -b master --depth=1', shell=True, check=True)
# Create a branch for the release
print(f'Creating a branch for the fdroid release: {build.version_name}')
@ -162,7 +163,7 @@ def update_fdroid(build: BuildResult, fdroid_workspace: str, creds: BuildCredent
with open(metadata_file, 'w') as file:
file.write(metadata_contents)
[keystore_fd, keystore_path] = tempfile.mkstemp(prefix='fdroid_keystore_', suffix='.p12', dir=os.path.join(project_root, 'build'))
[keystore_fd, keystore_path] = tempfile.mkstemp(prefix='fdroid_keystore_', suffix='.p12', dir=build_dir)
config_file_path = os.path.join(fdroid_workspace, 'config.yml')
try:
@ -207,6 +208,7 @@ def update_fdroid(build: BuildResult, fdroid_workspace: str, creds: BuildCredent
subprocess.run(f'''\
gh pr create --base master \
--title "Release {build.version_name}" \
-R session-foundation/session-fdroid \
--body "This is an automated release preparation for Release {build.version_name}. Human beings are still required to approve and merge this PR."\
''', shell=True, check=True, cwd=fdroid_workspace)
@ -224,6 +226,9 @@ if not os.path.isfile(credentials_file_path):
with open(credentials_file_path, 'rb') as f:
credentials = tomllib.load(f)
# Make sure build folder exists
if not os.path.isdir(build_dir):
os.makedirs(build_dir)
print("Building play releases...")
play_build_result = build_releases(

Loading…
Cancel
Save