-
Name
TrustManagerFactory -
Synopsis
ATrustManagerFactoryis responsible for creatingTrustManagerobjects for a specific trust management algorithm. Obtain aTrustManagerFactoryobject by calling one of thegetInstance( )methods and specifying the desired algorithm and, optionally, the desired provider. In Java 1.4, the “SunX509” algorithm is the only one supported by the default “SunJSSE” provider. After callinggetInstance( ), you initialize the factory object withinit( ). For the “SunX509” algorithm, you pass aKeyStoreobject toinit( ). ThisKeyStoreshould contain the public keys of trusted CAs (certification authorities). Once aTrustManagerFactoryhas been created and initialized, use it to create aTrustManagerby callinggetTrustManagers( ). This method returns an array ofTrustManagerobjects because some trust management algorithms may handle more than one typ
https://stackoverflow.com/questions/4414171
這問題歷經十年
解決方案也有變化...
比較優雅的做法是使用:
https://developer.android.com/reference/android/arch/lifecycle/ProcessLifecycleOwner.html
ProcessLifecycleOwnerwill dispatchON_START,ON_RESUMEevents, as a first activity moves through these events.ON_PAUSE,ON_STOP, events will be dispatched with a delay after a last activity passed through them. This delay is long enough to guarantee thatProcessLifecycleOwnerwon't send any events if activities are destroyed and recreated due to a configuration change.
https://stackoverflow.com/questions/53954114
Fatal Exception: java.lang.SecurityException: Not allowed to bind to service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1741)
at android.app.ContextImpl.bindService(ContextImpl.java:1651)
at android.content.ContextWrapper.bindService(ContextWrapper.java:705)
at com.google.android.gms.common.stats.ConnectionTracker.zza(ConnectionTracker.java:41)
at com.google.android.gms.common.stats.ConnectionTracker.zza(ConnectionTracker.java:10)
at com.google.android.gms.common.stats.ConnectionTracker.bindService(ConnectionTracker.java:43)Windows 版
for /f "tokens=*" %i in ('git ls-files') do @(
for /f %j in ('git log --oneline "%i" ^| find /c /v ""') do @echo "%j", "%i"
) >> git-ls-files-log-count-commits.txtYou can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228
This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders
sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/logIf the action is produced further down the UI tree, like in a RecyclerView item or a custom View, the ViewModel should still be the one handling user events.
For example, suppose that all news items from NewsActivity contain a bookmark button. The ViewModel needs to know the ID of the bookmarked news item. When the user bookmarks a news item, the RecyclerView adapter does not call the exposed addBookmark(newsId) function from the ViewModel, which would require a dependency on the ViewModel. Instead, the ViewModel exposes a state object called NewsItemUiState which contains the implementation for handling the event:
data class NewsItemUiState(
val title: String,
val body: String,
val bookmarked: Boolean = false,
val publicationDate: String,
val onBookmark: () -> UnitWhy android:fullBackupOnly default value is false?
Cheok Yan Cheng 問道:
In https://developer.android.com/guide/topics/manifest/application-element,
android:fullBackupOnly
>This attribute indicates whether or not to use Auto Backup on devices where it is available. If set to true, then your app performs Auto Backup when installed on a device running Android 6.0 (API level 23) or higher. On older devices, your app ignores this attribute and performs Key/Value Backups. The default value is "false".
★ Note: StateFlow support is a preview feature that requires version
7.0.0-alpha04or higher of the Android Gradle plugin.
😨
https://developer.android.com/topic/libraries/data-binding/observability#stateflow
| # encoding: utf-8 | |
| def company_serial_no_checker(serial) | |
| # 共八位,全部為數字型態 | |
| at_least_8_digits = /^\d{8}$/ | |
| return false unless at_least_8_digits.match(serial) | |
| # 各數字分別乘以 1,2,1,2,1,2,4,1 | |
| # 例:統一編號為 53212539 |

