Comments (32)
没有找到 com.qianfandu.app.AppApplication 你是不是没有改注册的名称 这个是demo里面的AppApplication
from dexknife-wj.
如果被加壳的app里面定义一个Application,除了在app的Manifest文件里面注册这个Application,还有哪里需要注册呢?
from dexknife-wj.
你要修改加壳的那个项目或者修改配置具体看gihub上的说明,我好像写了的
from dexknife-wj.
修改你要加载的Application 路径
from dexknife-wj.
您文档上写的是针对壳的Application,原话是:# application '你的壳的application 名称' 。
所以不太确定在被加壳项目上添加application之后,需要怎么注册
from dexknife-wj.
我将被加壳项目的application名称注册到这个项目的配置文件里,这么写的:
application 'MyAppApplication' 。
这样写会报以下错误:
Process: com.txjs.wj.dexknife_wj, PID: 11564
java.lang.RuntimeException: Unable to instantiate application com.txjs.wj.dexknife_wj.MyAppApplication: java.lang.ClassNotFoundException: Didn't find class "com.txjs.wj.dexknife_wj.MyAppApplication" on path: DexPathList[[zip file "/data/app/com.txjs.wj.dexknife_wj-1/base.apk"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4540)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.txjs.wj.dexknife_wj.MyAppApplication" on path: DexPathList[[zip file "/data/app/com.txjs.wj.dexknife_wj-1/base.apk"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:980)
at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4540)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Suppressed: java.lang.ClassNotFoundException: com.txjs.wj.dexknife_wj.MyAppApplication
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
from dexknife-wj.
这个是设置你修改加壳包的 名称,自己项目里面Application不用设置,自己会去获取启动
from dexknife-wj.
你新加的AppApplication 注册了吗
from dexknife-wj.
是在清单文件里面注册就行吧?
from dexknife-wj.
默认读取AndroidManifest.xml里面注册的
from dexknife-wj.
现在app定义的Application的名字是MyAppApplication,在app的AndroidManifest注册了,build.gradle中没有注册,加固后报错信息是:
05-17 10:04:13.577 18405-18405/? E/ProxyApplication: loadEncryptDex success
05-17 10:04:13.591 18405-18405/? E/ApkToolPlus: data size 36
05-17 10:04:13.605 18405-18405/? E/ProxyApplication: changeTopApplication failure!!!
05-17 10:04:13.630 18405-18405/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.txjs.wj.dexknife_wj, PID: 18405
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.txjs.wj.dexknife_wj/com.txjs.wj.dexknife_wj.MainActivity}: java.lang.RuntimeException: Unable to instantiate application com.qianfandu.app.AppApplication: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[dex file "/data/data/com.txjs.wj.dexknife_wj/app_apktoolplus_dex/classes2.dex"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$800(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.RuntimeException: Unable to instantiate application com.qianfandu.app.AppApplication: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[dex file "/data/data/com.txjs.wj.dexknife_wj/app_apktoolplus_dex/classes2.dex"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$800(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[dex file "/data/data/com.txjs.wj.dexknife_wj/app_apktoolplus_dex/classes2.dex"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:980)
at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$800(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
Suppressed: java.lang.ClassNotFoundException: com.qianfandu.app.AppApplication
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
from dexknife-wj.
这是我的build.gradle配置文件:
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.library.wj:dexknife-wj:1.0.3'//分包
}
}
apply plugin: 'com.android.application'
apply plugin: 'dexknifeWj'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.txjs.wj.dexknife_wj"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// dex突破65535的限制
multiDexEnabled true
}
// signingConfigs {
// releaseConfig {
// keyAlias 'cric'
// keyPassword 'crickeystore'
// storeFile file('../doc/ecan.keystore')
// storePassword 'keystorecric'
// }
// config_debug {
// keyAlias 'androiddebugkey'
// keyPassword 'android'
// storeFile file('../doc/debug.keystore')
// storePassword 'android'
// }
// }
signingConfigs {
releaseConfig {
keyAlias 'cric'
keyPassword 'crickeystore'
storeFile file('../doc/ecan.keystore')
storePassword 'keystorecric'
v2SigningEnabled false//禁用新版签名 配合packer多渠道打包
}
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.releaseConfig
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
signingConfig signingConfigs.releaseConfig
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dexKnife {
//必选参数
enabled true //if false,禁用分包插件
//可选参数/
//1.如果没有可选参数,将根据enabled决定是否分包。
//2.如果有可选参数,需满足必选参数和可选参数的条件才允许分包
//=======================加固
shell true
packerNgShell false
apktoolpath '../doc/apktool.jar'
jiaguzippath '../doc/jiagu.zip'
// application 'com.qianfandu.ProxyApplication'
//=======================多渠道
// 指定渠道打包输出目录
archiveOutput = file(new File(project.buildDir.path, new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "_apks"))
// 指定渠道打包输出文件名格式
// 默认是 ${appPkg}-${flavorName}-${buildType}-v${versionName}-${versionCode}
archiveNameFormat = 'qianfandu-${flavorName}-${versionName}'
// 是否检查Gradle配置中的signingConfig,默认不检查
// checkSigningConfig = false
// 是否检查Gradle配置中的zipAlignEnabled,默认不检查
// checkZipAlign = false
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.2.0'
}
from dexknife-wj.
你注册是不是写的完整路径 不要写 .Application的简写
from dexknife-wj.
清单文件这样写的:
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
这是加固后运行报错信息:
05-17 10:38:48.250 23872-23872/? E/ApkToolPlus: data size 2028264
05-17 10:38:48.385 23872-23872/? E/ProxyApplication: loadEncryptDex success
05-17 10:38:48.397 23872-23872/? E/ApkToolPlus: data size 36
05-17 10:38:48.413 23872-23872/? E/ProxyApplication: changeTopApplication failure!!!
05-17 10:38:48.454 23872-23872/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.txjs.wj.dexknife_wj, PID: 23872
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.txjs.wj.dexknife_wj/com.txjs.wj.dexknife_wj.MainActivity}: java.lang.RuntimeException: Unable to instantiate application com.qianfandu.app.AppApplication: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[dex file "/data/data/com.txjs.wj.dexknife_wj/app_apktoolplus_dex/classes2.dex"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$800(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.RuntimeException: Unable to instantiate application com.qianfandu.app.AppApplication: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[dex file "/data/data/com.txjs.wj.dexknife_wj/app_apktoolplus_dex/classes2.dex"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$800(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[dex file "/data/data/com.txjs.wj.dexknife_wj/app_apktoolplus_dex/classes2.dex"],nativeLibraryDirectories=[/data/app/com.txjs.wj.dexknife_wj-1/lib/arm, /vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:980)
at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.access$800(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1305)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.qianfandu.app.AppApplication" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib, /lib, /usr/lib, /home/EPT_Middleware/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
Suppressed: java.lang.ClassNotFoundException: com.qianfandu.app.AppApplication
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
from dexknife-wj.
<application
android:name="com.txjs.wj.dexknife_wj.App"
from dexknife-wj.
显示的是没有切换app成功 我有空再demo上写个Application 试下
from dexknife-wj.
抱歉上面的回复没有显示全,我的清单文件这样写的:
<application
android:name="com.txjs.wj.dexknife_wj.MyAppApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
from dexknife-wj.
您有什么思路吗,我可以按照思路改一下。工期紧啊 -_-!!
from dexknife-wj.
你看下壳项目的 ProxyApplication 里面的切换Application 看看有什么错误了
from dexknife-wj.
照理说不该有什么问题 看看是不是兼容的问题
from dexknife-wj.
嗯,我再捣鼓一下吧
from dexknife-wj.
我试了没有问题 看看你是不是写错了
from dexknife-wj.
不应该写错啊,您方便把demo发来吗? 我的邮箱是:[email protected]
from dexknife-wj.
我添加的application,如果不加壳是可以正常运行的,里面的东西也会执行。
from dexknife-wj.
大概是sdk版本不一样 取不到反射方法 还需要测试下 你急需的话可以修改那个壳项目的反射方法 错误是没有反射到 下个版本我会兼容上去
from dexknife-wj.
您下个版本大概啥时候出呢?
from dexknife-wj.
我可以帮忙测试
from dexknife-wj.
我重新给你发个jiagu.zip吧 估计github上面的那个有问题
from dexknife-wj.
这个位置应该也有个 用这个也可以吧 应该没有问题 我也另外发你邮箱了
from dexknife-wj.
是的,用了这个jiagu.zip,demo就可以运行起来了!
from dexknife-wj.
好的 插件最近没有时间更新。。。 有空就升级。。
from dexknife-wj.
这个插件真的很方便,感谢分享~
from dexknife-wj.
Related Issues (13)
- 加固后,apk大小比原来的大了几M,这个有办法减少吗 HOT 17
- 工程里的myapplication怎么编译成jiagu.zip HOT 8
- 华为手机android4.4.2报DexOpt问题 HOT 20
- 能否支持用cmd里输入java -jar dexknife-wj-1.1.1.jar来运行UpdateJiaGu HOT 1
- 加固后,首次启动时慢,dex越大启动时间越久 HOT 6
- 请教一下这两个参数为什么不起作用 HOT 3
- 部分手机会出现dex decrypt failure,闪退 HOT 13
- 在启动时,多次点图标启动,偶现出现changeTopApplication failure!!! HOT 17
- 有个问题(启动App后崩溃) HOT 4
- dexknife-wj-1.1.1.jar这个文件是怎么生成的? HOT 2
- jiagu.zip在哪里 HOT 5
- 启动插件的BroadcastReceiverr失败 HOT 30
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexknife-wj.