经测试再android 4.4时是可以直接在android studio中运行debug签名包,在xposed中运行的,但是6.0的机器不好使。解决办法是在运行时使用release版并签名
apply plugin: 'com.android.application' android {
signingConfigs {
config {
keyAlias 'demo'
keyPassword 'xirtam'
storeFile file('C:\\workspace\\demo.jks')
storePassword 'xirtam'
}
}
compileSdkVersion 28
defaultConfig {
applicationId "com.xirtam.testhook"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
}
} dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' compileOnly 'de.robv.android.xposed:api:82'
}
然后在android studio的Build Variants视图中,Build Variant中选择release,再次运行即可。