Last active
August 8, 2022 12:52
-
-
Save iflove/617fd010dccce2b5acea2bcc74815d32 to your computer and use it in GitHub Desktop.
Android 日常
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
Android 日常记录 |
andoid build.gradle 例子 ,学习网上开源项目,以及平时项目中用过的
android {
//定义ndk 版本,巧用环境变量和gradle.properties文件
ndkVersion = System.getenv("JITPACK_NDK_VERSION") ?: project.properties.ndkVersion
//默认配置
defaultConfig {
//清单文件占位符
manifestPlaceholders.TERMUX_PACKAGE_NAME = "com.termux"
//指定 ABI,打包apk,相关ABI库放入其中
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your app.
abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a',
'arm64-v8a'
}
//关联到您的原生库. 指定可选配置:只能为 CMake 或 ndk-build 指定可选参数和标记。
externalNativeBuild {
//ndkBuild块; 二选一
ndkBuild {
cFlags "-std=c11"
}
//CMake块;二选一
cmake {
// Passes optional arguments to CMake.
arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang"
// Sets a flag to enable format macro constants for the C compiler.
cFlags "-D__STDC_FORMAT_MACROS"
// Sets optional flags for the C++ compiler.
cppFlags "-fexceptions", "-frtti"
}
}
}
//打包配置
packagingOptions {
//so 文件不压缩
doNotStrip "**/*.so"
}
//关联到您的原生库. 使用 cmake 或 ndkBuild 块对其进行配置:
externalNativeBuild {
//ndkBuild块; 二选一
ndkBuild {
path "src/main/cpp/Android.mk"
}
//CMake块;二选一
cmake {
path "CMakeLists.txt"
}
}
//构建多个APK 不限篇幅请参考官方(https://developer.android.com/studio/build/configure-apk-splits)
splits {
abi {
//是否多个apk
enable gradle.startParameter.taskNames.any { it.contains("Debug") }
reset ()
include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
//是否需要生成通用 APK
universalApk true
}
}
//签名文件配置
signingConfigs {
debug {
storeFile file('dev_keystore.jks')
keyAlias 'alias'
storePassword 'xrj45yWGLbsO7W0v'
keyPassword 'xrj45yWGLbsO7W0v'
}
}
lintOptions {
disable 'ProtectedPermissions'
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
task versionName {
doLast {
print android.defaultConfig.versionName
}
}
//在 Project 配置结束后调用
afterEvaluate {
android.applicationVariants.all { variant ->
variant.javaCompileProvider.get().dependsOn(downloadBootstraps)
}
}
java 命令
jar xvf test.jar
jar cvf filename.jar a.class b.class: 压缩指定文件;
jar cvf weibosdkcore.jar *: 全部压缩;
反编译
FDex2
FDex2_1.1.apk
链接:https://pan.baidu.com/s/1End0Ki1FPCSSsHfXn6Etqw
提取码:u9rx
--来自百度网盘超级会员V1的分享
VirtualXposed
VirtualXposed:无需root手机即可使用Xposed框架
脱壳
Android9.0 不支持!
首先,将VirtualXposed、FDex2和需要脱壳的应用都安装到手机上。然后,启动VirtualXposed,并在VirtualXposed中安装FDex2。
然后,在VirtualXposed中选择模块管理激活FDex2。
在VirtualXposed中安装要脱壳的应用,具体和上面的步骤一样。然后,启动VirtualXposed中的FDex2,并配置要脱壳的应用。
在VirtualXposed中运行要脱壳的应用,脱壳后的dex文件如下图:
然后,使用adb pull命令将脱壳后的dex文件导出到电脑。
GDA
Luyten
Java 反编译工具Luyten
classyshark
ClassyShark - APK 分析利器
java -jar /Users/system/Downloads/ClassyShark.jar
smalidea
smalidea is a smali language plugin for IntelliJ IDEA/Android Studio
idea 下调试smali的插件工具
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
修改签名文件别名,能正常覆盖安装apk