-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] 为 OwnDroid 添加启动时 PIN 锁 #20
Comments
好主意 可以直接用安卓sdk的KeyguardManager和BiometricManager,用锁屏密码和指纹验证 |
对哦, 这样代码写起来也比较方便, 用户体验也无缝不少。 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
开始做了😀 11bd8a2 本来想用compose的Navigation做验证页和主页的切换,但是compose的导航不好用,所以多加了一个activity,但是多一个activity后启动速度慢了好多😭 现在想想,还是试试fragment吧 |
This comment was marked as off-topic.
This comment was marked as off-topic.
不是多activity导致卡,而是启动owndroid之后,MainActivity判断有没有解锁,没解锁就跳转到AuthActivity,AuthActivity解锁完了再跳转回MainActivity,如果解锁了就直接显示内容 就是跳转的时候有点卡 (在我这个骁龙855的一加7上没什么感觉,但是在骁龙675的红米note7pro会卡)
|
This comment was marked as off-topic.
This comment was marked as off-topic.
杀后台之后需要验证
感觉还是MainActivity做入口好,如果AuthActivity做入口了,那每次通过桌面图标进Owndroid又得跳转一次 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
差不多做好了 来看看 |
This comment was marked as off-topic.
This comment was marked as off-topic.
不过好像能防止点击就行了吧... 返回键毕竟做不了什么。
哦哦, 这样。 |
应该用一个ViewModel类存住所有变量 验证时不显示Home,验证完了用这些变量恢复界面 |
有道理。 |
试着用viewModel存住状态,但是嵌套的NavHost不能用viewModel 比如,进入应用管理、回到主页、再进入应用管理,就会崩溃: 所以现在的方法应该只有一个了,就是用Fragment |
翻到一篇这个, 但看不懂。
回归初心了。 |
我在百度上搜这个Exception,搜到了StackOverflow里面这个问题的机翻
😭😭😭白搞了 |
已经回滚代码了,给AuthFragment加了个背景并设置 还是得改NavHost 我在百度上搜索 怎么防止compose navhost监听返回键,那个百度AI回答了这个 import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalFocusManager
import androidx.activity.OnBackPressedDispatcher
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.remember
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
@Composable
fun PreventBackPressNavHost(
onBackPressDispatcher: OnBackPressedDispatcher,
navController: NavHostController = rememberNavController(),
content: @Composable () -> Unit
) {
var isEnabled by remember { mutableStateOf(false) }
val focusManager = LocalFocusManager.current
DisposableEffect(onBackPressDispatcher) {
val callback = onBackPressDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
if (isEnabled) isEnabled = false
}
})
callback.isEnabled = isEnabled
onDispose {
callback.remove()
}
}
NavHost(navController = navController, startDestination = "home") {
composable("home") {
content()
DisposableEffect(Unit) {
val backCallback = navController.addBackPressCallback {
isEnabled = true
focusManager.clearFocus()
}
onDispose {
backCallback.remove()
}
}
}
}
} |
use composable function instead of fragment to display authenticate screen fix authenticate screen is transparent in light theme
This comment was marked as off-topic.
This comment was marked as off-topic.
任务完成 🎉
好像是塞了好多 Material Icons, 但有些感觉完全用不到, 还是塞进去了。
是这样的, 就像 QAuxv 群里根本没人聊 QAuxiliary (确信
|
This comment was marked as off-topic.
This comment was marked as off-topic.
大概两周之前,我发现这个app被上架IzzySoft了,不知道谁好心去弄的 https://apt.izzysoft.de/fdroid/index/apk/com.bintianqi.owndroid 今天一看,发现没有v5.3,有v5.2和v5.3.1 怎么,这都能撤包? |
This comment was marked as off-topic.
This comment was marked as off-topic.
甚至官方 F-droid 也有好心人帮忙提交了请求
比较高级的一集 |
可能是被设为系统应用的那个app乱搞
听说在f-droid上架需要用他的服务器构建,而且用fdroid的签名,感觉怪怪的。Rikka以前不同意shizuku上架fdroid就是因为这个RikkaApps/Shizuku#69
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
难怪biometric库乱拉屎
|
Describe the issue / 描述问题
OwnDroid 功能涉及 Device owner 等高权限的操作, 部分情况下未经授权的操作可能导致危险。
Expected implementation / 预期实现
允许用户在 OwnDroid 内设置 PIN 码 / 解锁手势, 置于后台超过指定时间 / 应用重启后自动锁定。
FAQ / 疑问解答
Q: 现在国内系统不是都自带应用锁功能嘛?
A: 类原生用户应该还是不少的吧... (Lineage 除外, 启动器自带应用锁) 以及海外 UI 也基本上没有应用锁功能。
The text was updated successfully, but these errors were encountered: