-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'microg:master' into master
- Loading branch information
Showing
16 changed files
with
303 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# How to translate microG | ||
|
||
microG can be translated using Weblate. The microG project is hosted at https://hosted.weblate.org/projects/microg/. | ||
|
||
> At the moment, [microG-UI-tools](play-services-core/microg-ui-tools), an internal component, is not available for translation using Weblate. You may want to open a PR for this. This component hosts strings for the "Self-Check" menu and a few other things. | ||
Preferably do not open a PR for components that can be translated with Weblate. Otherwise, merge conflicts can happen. If you already made a PR, you can try [importing](https://docs.weblate.org/en/latest/user/files.html#uploading-translations) the files manually into Weblate for each component. | ||
|
||
If your language is not available for translation from a quick look, you may need to first create an account, set your language in your settings, check the project again, and then you should be able to add it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...core/src/main/kotlin/com/google/android/gms/credential/manager/PasswordManagerActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.google.android.gms.credential.manager | ||
|
||
import android.accounts.AccountManager | ||
import android.os.Bundle | ||
import android.util.Log | ||
import android.view.View | ||
import android.webkit.WebView | ||
import android.widget.ProgressBar | ||
import android.widget.RelativeLayout | ||
import androidx.appcompat.app.AppCompatActivity | ||
import org.microg.gms.accountsettings.ui.WebViewHelper | ||
import org.microg.gms.auth.AuthConstants | ||
|
||
const val PASSWORD_MANAGER_CLASS_NAME = "com.google.android.gms.credential.manager.PasswordManagerActivity" | ||
|
||
const val EXTRA_KEY_ACCOUNT_NAME = "pwm.DataFieldNames.accountName" | ||
|
||
private const val TAG = "PasswordManagerActivity" | ||
|
||
private const val PSW_MANAGER_PATH = "https://passwords.google.com/" | ||
|
||
class PasswordManagerActivity : AppCompatActivity() { | ||
|
||
private lateinit var webView: WebView | ||
|
||
private val accountName: String? | ||
get() = runCatching { intent?.getStringExtra(EXTRA_KEY_ACCOUNT_NAME) }.getOrNull() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
Log.d(TAG, "onCreate: start") | ||
|
||
val accounts = AccountManager.get(this).getAccountsByType(AuthConstants.DEFAULT_ACCOUNT_TYPE) | ||
val realAccountName = accounts.find { it.name.equals(accountName) }?.name | ||
|
||
Log.d(TAG, "realAccountName: $realAccountName") | ||
|
||
val layout = RelativeLayout(this) | ||
layout.addView(ProgressBar(this).apply { | ||
layoutParams = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT).apply { | ||
addRule(RelativeLayout.CENTER_HORIZONTAL) | ||
addRule(RelativeLayout.CENTER_VERTICAL) | ||
} | ||
isIndeterminate = true | ||
}) | ||
webView = WebView(this).apply { | ||
layoutParams = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT) | ||
visibility = View.INVISIBLE | ||
} | ||
layout.addView(webView) | ||
setContentView(layout) | ||
WebViewHelper(this, webView).openWebView(PSW_MANAGER_PATH, realAccountName) | ||
} | ||
|
||
override fun onBackPressed() { | ||
if (this::webView.isInitialized && webView.canGoBack()) { | ||
webView.goBack() | ||
} else { | ||
super.onBackPressed() | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...n/core/src/main/kotlin/org/microg/gms/location/settings/GoogleLocationSettingsActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.microg.gms.location.settings | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class GoogleLocationSettingsActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
runCatching { startActivity(Intent("android.settings.LOCATION_SOURCE_SETTINGS")) } | ||
finish() | ||
} | ||
} |
Oops, something went wrong.