Hook AMS + APT实现集中式登录

Overview

AndLogin

通过Hook AMS + APT实现集中式登录

效果如下:

preview

优势:

  1. 以非侵入性的方式将分散的登录判断逻辑集中处理,减少了代码量,提高了开发效率。
  2. 增加或删除目标页面时无需修改判断逻辑,只需增加或删除其对应注解即可,符合开闭原则,降低了耦合度
  3. 在用户登录成功后直接跳转到目标界面,保证了用户操作不被中断。

login

使用:

1,添加依赖

allprojects {
    repositories {
        maven { url 'https://www.jitpack.io' }
    }
}


dependencies {
	implementation 'com.github.wdsqjq.AndLogin:lib:1.0.0'
	kapt 'com.github.wdsqjq.AndLogin:apt_processor:1.0.0'
}

2,给需要登录的Activity添加注解

@RequireLogin
class TargetActivity1 : AppCompatActivity() {
	...
}

@RequireLogin
class TargetActivity2 : AppCompatActivity() {
	...
}

3,给登录Activity添加注解

@LoginActivity
class LoginActivity : AppCompatActivity() {
	...
}

4,提供判断是否登录的方法

需要是一个静态方法

@LoginActivity
class LoginActivity : AppCompatActivity() {

    companion object {
        // 该方法用于返回是否登录
        @JudgeLogin
        @JvmStatic
        fun checkLogin(): Boolean {
            return SpUtil.isLogin()
        }
    }
}
You might also like...
Releases(1.0.0)
Owner
dajuzi
dajuzi
应用分身、模拟设备、模拟wifi、虚拟多开、钉钉打卡、企微打卡、插件开发、XP插件、模拟用户操作、java hook、c++ hook

VirtualApp11 original software This project is only for your use, please have any questions Wechat : serven_scorpion Email : [email protected] Teleg

ServenScorpion 395 Dec 26, 2022
A React Native project starter with Typescript, a theme provider with hook to easy styling component, a folder architecture ready and some configs to keep a codebase clean.

React Native Boilerplate Folder structure : src ├── assets │   ├── audios │   ├── fonts │   ├── icons │   └── images ├── components │   ├── Layout.tsx

LazyRabbit 23 Sep 1, 2022
A Mixin framework for Spigot/Bukkit that allows you to hook custom event anywhere

A Mixin framework for Spigot/Bukkit that allows you to hook custom event anywhere. Start coding your advanced plugins today!

DragonCommissions 14 Nov 30, 2022
PluginHooker is a Bukkit plugin that aims to provide an ultimately simple and better method to hook Bukkit events.

PluginHooker PluginHooker is a Bukkit plugin that aims to provide an ultimately simple and better method to hook Bukkit events. Localization 简体中文 Feat

null 12 Nov 23, 2022