Мне нужно обновить приложение без участия пользователя.
Я использую этот код для приложения обновления.
Я использую корневое устройство. это устройство и android 4.0.3.
public static void installNewApk() {
String path = AppController.instance.getFilesDir().getAbsolutePath() + "/" + "app-release.apk";
try {
Runtime.getRuntime().exec(new String[]{"su", "-c", "pm install -r " + path});
} catch (IOException e) {
System.out.println(e.toString());
System.out.println("no root");
}
}
, но после запуска этого кода я получаю эту ошибку и приложение не устанавливается.
D/AudioHardware: AudioHardware pcm playback is exiting standby.
D/AudioHardware: openPcmOut_l() mPcmOpenCnt: 0
E/su: sudb - Opening database
E/su: sudb - Database opened
E/su: sudb - Database closed
D/su: 10062 com.rasoul.test executing 0 pm install -r /data/data/com.rasoul.test/files/app-release.apk using shell /system/bin/sh : sh
D/AndroidRuntime: >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime: CheckJNI is ON
W/dalvikvm: Exception Ljava/lang/NullPointerException; thrown while initializing Ljava/lang/System;
W/dalvikvm: Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Ljava/lang/ClassLoader$SystemClassLoader;
W/dalvikvm: WARNING: system class loader is NULL (setting main ctxt)
W/dalvikvm: Warning: tracked references remain post-initialization
W/dalvikvm: MAIN reference table (0xe9be80) dump:
W/dalvikvm: Last 1 entries (of 1):
E/dalvikvm: Class lookup Ljava/lang/Daemons; attempted with exception pending
W/dalvikvm: Pending exception is:
I/dalvikvm: java.lang.ExceptionInInitializerError:
I/dalvikvm: at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)
I/dalvikvm: at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm: Caused by:
I/dalvikvm: java.lang.ExceptionInInitializerError:
I/dalvikvm: at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:100)
I/dalvikvm: at java.lang.ClassLoader.access$000(ClassLoader.java:65)
I/dalvikvm: at java.lang.ClassLoader$SystemClassLoader.<clinit>(ClassLoader.java:81)
I/dalvikvm: at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)
I/dalvikvm: at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm: Caused by:
I/dalvikvm: java.lang.NullPointerException:
I/dalvikvm: at java.util.Hashtable.put(Hashtable.java:365)
I/dalvikvm: at java.lang.System.initSystemProperties(System.java:286)
I/dalvikvm: at java.lang.System.getProperties(System.java:260)
I/dalvikvm: at java.lang.System.getProperty(System.java:425)
I/dalvikvm: at java.lang.System.getProperty(System.java:406)
I/dalvikvm: at java.lang.System.<clinit>(System.java:90)
I/dalvikvm: at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:100)
I/dalvikvm: at java.lang.ClassLoader.access$000(ClassLoader.java:65)
I/dalvikvm: at java.lang.ClassLoader$SystemClassLoader.<clinit>(ClassLoader.java:81)
I/dalvikvm: at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)
I/dalvikvm: at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm: DALVIK THREADS:
I/dalvikvm: (mutexes: tll=0 tsl=0 tscl=0 ghl=0)
I/dalvikvm: "main" prio=5 tid=1 RUNNABLE
I/dalvikvm: | group="main" sCount=0 dsCount=0 obj=0x40a40460 self=0xe9b828
I/dalvikvm: | sysTid=6938 nice=0 sched=0/0 cgrp=default handle=1074472072
I/dalvikvm: | schedstat=( 0 0 0 ) utm=12 stm=3 core=0
I/dalvikvm: at dalvik.system.NativeStart.main(Native Method)
E/dalvikvm: VM aborting
A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)
I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG: Build fingerprint: 'Android/full_mini210/mini210:4.0.3/IML74K/eng.root.20150408.135557:eng/test-keys'
I/DEBUG: pid: 6938, tid: 6938 >>> app_process <<<
I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
I/DEBUG: r0 00000000 r1 00000000 r2 400ac1ac r3 00000000
I/DEBUG: r4 deadd00d r5 408c8c58 r6 0000020c r7 402220a8
I/DEBUG: r8 00000000 r9 408c3f90 10 408a6665 fp 00000000
I/DEBUG: ip 408c4070 sp bea06110 lr 40861807 pc 40861806 cpsr 60000030
I/DEBUG: d0 74726f6261204d56 d1 726174536576696e
I/DEBUG: d2 7953247265646175 d3 73616c436d65746c
I/DEBUG: d4 4bd752184bd751e0 d5 4bd752884bd75250
I/DEBUG: d6 4bd752f84bd752c0 d7 4bd753684bd75330
I/DEBUG: d8 0000000000000000 d9 0000000000000000
I/DEBUG: d10 0000000000000000 d11 0000000000000000
I/DEBUG: d12 0000000000000000 d13 0000000000000000
I/DEBUG: d14 0000000000000000 d15 0000000000000000
I/DEBUG: d16 0000000000000000 d17 3f50624dd2f1a9fc
I/DEBUG: d18 41b68fb7a9000000 d19 0000000000000000
I/DEBUG: d20 0000000000000000 d21 0000000000000000
I/DEBUG: d22 0000000000000000 d23 0000000000000000
I/DEBUG: d24 0000000000000000 d25 0000000000000000
I/DEBUG: d26 0000000000000000 d27 0000000000000000
I/DEBUG: d28 0000000000000000 d29 0000000000000000
I/DEBUG: d30 0000000000000000 d31 0000000000000000
I/DEBUG: scr 60000010
I/DEBUG: #00 pc 00050806 /system/lib/libdvm.so (dvmAbort)
I/DEBUG: #01 pc 00075ae4 /system/lib/libdvm.so
I/DEBUG: #02 pc 00076282 /system/lib/libdvm.so (_Z24dvmFindSystemClassNoInitPKc)
I/DEBUG: #03 pc 00076ac2 /system/lib/libdvm.so (_Z18dvmFindSystemClassPKc)
I/DEBUG: #04 pc 0006019e /system/lib/libdvm.so (_Z19dvmGcStartupClassesv)
I/DEBUG: #05 pc 00052712 /system/lib/libdvm.so (_Z10dvmStartupiPKPKcbP7_JNIEnv)
I/DEBUG: #06 pc 00053e0a /system/lib/libdvm.so (JNI_CreateJavaVM)
I/DEBUG: #07 pc 000450e2 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnv)
I/DEBUG: #08 pc 000454c4 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcS2_)
I/DEBUG: #09 pc 00008f0a /system/bin/app_process
I/DEBUG: #10 pc 000164e4 /system/lib/libc.so (__libc_init)
I/DEBUG: code around pc:
I/DEBUG: 408617e4 34b4f8d3 ee98f7cd 26001e73 2f01f813 ...4....s..&.../
I/DEBUG: 408617f4 42abb152 d0074416 4798e7f8 f7ff4c0a R..B.D.....G.L..
I/DEBUG: 40861804 7026ffa7 ee8ef7cd 2006490c 44794a0c ..&p.....I. .JyD
I/DEBUG: 40861814 f7cd447a 2000ed44 ee06f7cd 58e54b05 zD..D.. .....K.X
I/DEBUG: 40861824 2b006c6b e7e9d1e9 deadd00d 000627d4 kl.+.........'..
I/DEBUG: code around lr:
I/DEBUG: 408617e4 34b4f8d3 ee98f7cd 26001e73 2f01f813 ...4....s..&.../
I/DEBUG: 408617f4 42abb152 d0074416 4798e7f8 f7ff4c0a R..B.D.....G.L..
I/DEBUG: 40861804 7026ffa7 ee8ef7cd 2006490c 44794a0c ..&p.....I. .JyD
I/DEBUG: 40861814 f7cd447a 2000ed44 ee06f7cd 58e54b05 zD..D.. .....K.X
I/DEBUG: 40861824 2b006c6b e7e9d1e9 deadd00d 000627d4 kl.+.........'..
I/DEBUG: memory map around addr deadd00d:
I/DEBUG: be9e6000-bea07000 [stack]
I/DEBUG: (no map for address)
I/DEBUG: ffff0000-ffff1000 [vectors]
I/DEBUG: stack:
I/DEBUG: bea060d0 00000000
I/DEBUG: bea060d4 4007cce7 /system/lib/libc.so
I/DEBUG: bea060d8 400a6720 /system/lib/libc.so
I/DEBUG: bea060dc 400a66b0 /system/lib/libc.so
I/DEBUG: bea060e0 00000000
I/DEBUG: bea060e4 4007df01 /system/lib/libc.so
I/DEBUG: bea060e8 400a655c /system/lib/libc.so
I/DEBUG: bea060ec 00000000
I/DEBUG: bea060f0 0000020c
I/DEBUG: bea060f4 402220a8 /system/lib/libandroid_runtime.so
I/DEBUG: bea060f8 00000000
I/DEBUG: bea060fc 4007cd17 /system/lib/libc.so
I/DEBUG: bea06100 408c3f90 /system/lib/libdvm.so
I/DEBUG: bea06104 bea06313 [stack]
I/DEBUG: bea06108 df0027ad
I/DEBUG: bea0610c 00000000
I/DEBUG: #00 bea06110 bea062a4 [stack]
I/DEBUG: bea06114 6c756e28
I/DEBUG: bea06118 0000296c
I/DEBUG: bea0611c 00000000
I/DEBUG: bea06120 00000000
I/DEBUG: bea06124 00000000
I/DEBUG: bea06128 00000000
I/DEBUG: bea0612c 00000000
I/DEBUG: bea06130 00000000
I/DEBUG: bea06134 00000000
I/DEBUG: bea06138 00000000
I/DEBUG: bea0613c 00000000
I/DEBUG: bea06140 00000000
I/DEBUG: bea06144 00000000
I/DEBUG: bea06148 00000000
I/DEBUG: bea0614c 00000000
I/DEBUG: bea06150 00000000
I/DEBUG: bea06154 00000000
I/DEBUG: bea06158 00000000
I/DEBUG: bea0615c 00000000
I/DEBUG: bea06160 00000000
I/DEBUG: bea06164 00000000
I/DEBUG: bea06168 00000000
I/DEBUG: bea0616c 00000000
I/DEBUG: bea06170 00000000
I/DEBUG: bea06174 00000000
I/DEBUG: bea06178 00000000
I/DEBUG: bea0617c 00000000
I/DEBUG: bea06180 00000000
I/DEBUG: bea06184 00000000
I/DEBUG: bea06188 00000000
I/DEBUG: bea0618c 00000000
I/DEBUG: bea06190 00000000
I/DEBUG: bea06194 00000000
I/DEBUG: bea06198 00000000
I/DEBUG: bea0619c 00000000
I/DEBUG: bea061a0 00000000
I/DEBUG: bea061a4 00000000
I/DEBUG: bea061a8 00000000
I/DEBUG: bea061ac 00000000
I/DEBUG: bea061b0 00000000
I/DEBUG: bea061b4 00000000
I/DEBUG: bea061b8 00000000
I/DEBUG: bea061bc 00000000
I/DEBUG: bea061c0 00000000
I/DEBUG: bea061c4 00000000
I/DEBUG: bea061c8 00000000
I/DEBUG: bea061cc 00000000
I/DEBUG: bea061d0 00000000
I/DEBUG: bea061d4 00000000
I/DEBUG: bea061d8 00000000
I/DEBUG: bea061dc 00000000
I/DEBUG: bea061e0 00000000
I/DEBUG: bea061e4 00000000
I/DEBUG: bea061e8 00000000
I/DEBUG: bea061ec 00000000
I/DEBUG: bea061f0 00000000
I/DEBUG: bea061f4 00000000
I/DEBUG: bea061f8 00000000
I/DEBUG: bea061fc 00000000
I/DEBUG: bea06200 00000000
I/DEBUG: bea06204 00000000
I/DEBUG: bea06208 00000000
I/DEBUG: bea0620c 00000000
I/DEBUG: bea06210 00000000
I/DEBUG: bea06214 00000000
I/DEBUG: bea06218 00000000
I/DEBUG: bea0621c 00000000
I/DEBUG: bea06220 00000000
I/DEBUG: bea06224 00000000
I/DEBUG: bea06228 00000000
I/DEBUG: bea0622c 00000000
I/DEBUG: bea06230 00000000
I/DEBUG: bea06234 00000000
I/DEBUG: bea06238 00000000
I/DEBUG: bea0623c 00000000
I/DEBUG: bea06240 00000000
I/DEBUG: bea06244 00000000
I/DEBUG: bea06248 00000000
I/DEBUG: bea0624c 00000000
I/DEBUG: bea06250 00000000
I/DEBUG: bea06254 00000000
I/DEBUG: bea06258 00000000
I/DEBUG: bea0625c 00000000
I/DEBUG: bea06260 00000000
I/DEBUG: bea06264 00000000
I/DEBUG: bea06268 00000000
I/DEBUG: bea0626c 00000000
I/DEBUG: bea06270 00000000
I/DEBUG: bea06274 00000000
I/DEBUG: bea06278 00000000
I/DEBUG: bea0627c 00000000
I/DEBUG: bea06280 00000000
I/DEBUG: bea06284 00000000
I/DEBUG: bea06288 00000000
I/DEBUG: bea0628c 00000000
I/DEBUG: bea06290 00000000
I/DEBUG: bea06294 00000000
I/DEBUG: bea06298 00000000
I/DEBUG: bea0629c 00000000
I/DEBUG: bea062a0 00000000
I/DEBUG: bea062a4 00000000
I/DEBUG: bea062a8 00000000
I/DEBUG: bea062ac 00000000
I/DEBUG: bea062b0 00000000
I/DEBUG: bea062b4 00000000
I/DEBUG: bea062b8 00000000
I/DEBUG: bea062bc 00000000
I/DEBUG: bea062c0 00000000
I/DEBUG: bea062c4 00000000
I/DEBUG: bea062c8 00000000
I/DEBUG: bea062cc 00000000
I/DEBUG: bea062d0 00000000
I/DEBUG: bea062d4 00000000
I/DEBUG: bea062d8 00000000
I/DEBUG: bea062dc 00000000
I/DEBUG: bea062e0 00000000
I/DEBUG: bea062e4 00000000
I/DEBUG: bea062e8 00000000
I/DEBUG: bea062ec 00000000
I/DEBUG: bea062f0 00000000
I/DEBUG: bea062f4 00000000
I/DEBUG: bea062f8 00000000
I/DEBUG: bea062fc 00000000
I/DEBUG: bea06300 00000000
I/DEBUG: bea06304 00000000
I/DEBUG: bea06308 00000000
I/DEBUG: bea0630c 00000000
I/DEBUG: bea06310 00000000
I/DEBUG: bea06314 452d4875 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG: bea06318 408a43eb /system/lib/libdvm.so
I/DEBUG: bea0631c bea0651c [stack]
I/DEBUG: bea06320 00e9b828 [heap]
I/DEBUG: bea06324 40886ae9 /system/lib/libdvm.so
I/DEBUG: #01 bea06328 408c3f90 /system/lib/libdvm.so
I/DEBUG: bea0632c 4086d5ff /system/lib/libdvm.so
I/DEBUG: bea06330 00000001
I/DEBUG: bea06334 4bd3afa8 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG: bea06338 00000000
I/DEBUG: bea0633c bea06380 [stack]
I/DEBUG: bea06340 0000000c
I/DEBUG: bea06344 00e9b828 [heap]
I/DEBUG: bea06348 00e9bb94 [heap]
I/DEBUG: bea0634c 408ab2a4 /system/lib/libdvm.so
I/DEBUG: bea06350 0000001b
I/DEBUG: bea06354 400ab474
I/DEBUG: bea06358 0000200b
I/DEBUG: bea0635c 00e94000 [heap]
I/DEBUG: bea06360 00f1f2e0 [heap]
I/DEBUG: bea06364 00002000
I/DEBUG: bea06368 00e98d00 [heap]
I/DEBUG: bea0636c 00000000
I/DEBUG: bea06370 408a6665 /system/lib/libdvm.so
I/DEBUG: bea06374 400779dd /system/lib/libc.so
I/DEBUG: bea06378 00e9b828 [heap]
I/DEBUG: bea0637c 40a40460 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG: bea06380 00000000
I/DEBUG: bea06384 00e9b828 [heap]
I/DEBUG: bea06388 40a40530 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG: bea0638c 00000001
I/DEBUG: bea06390 00000010
I/DEBUG: bea06394 408c3f90 /system/lib/libdvm.so
I/DEBUG: bea06398 bea0651c [stack]
I/DEBUG: bea0639c 00e9b828 [heap]
I/DEBUG: bea063a0 402220a8 /system/lib/libandroid_runtime.so
I/DEBUG: bea063a4 00e98d00 [heap]
I/DEBUG: bea063a8 bea06494 [stack]
I/DEBUG: bea063ac 408a6665 /system/lib/libdvm.so
I/DEBUG: bea063b0 408a66aa /system/lib/libdvm.so
I/DEBUG: bea063b4 40887287 /system/lib/libdvm.so