File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
package com .mindmac .applog .service ;
2
2
3
3
import java .io .File ;
4
+ import java .lang .reflect .Field ;
4
5
import java .lang .reflect .Method ;
5
6
import java .util .ArrayList ;
6
7
import java .util .List ;
@@ -568,7 +569,9 @@ private static Context getContext() {
568
569
Class <?> cam = Class .forName ("com.android.server.am.ActivityManagerService" );
569
570
Object am = cam .getMethod ("self" ).invoke (null );
570
571
if (am != null ){
571
- context = (Context ) cam .getDeclaredField ("mContext" ).get (am );
572
+ Field contextField = cam .getDeclaredField ("mContext" );
573
+ contextField .setAccessible (true );
574
+ context = (Context ) contextField .get (am );
572
575
}
573
576
} catch (Throwable ex ) {
574
577
Util .bug (null , ex );
Original file line number Diff line number Diff line change 7
7
import com .mindmac .applog .service .LogManager ;
8
8
9
9
import android .annotation .SuppressLint ;
10
- import android .app .Activity ;
11
10
import android .app .AlertDialog ;
12
11
import android .app .Dialog ;
13
12
import android .content .Context ;
You can’t perform that action at this time.
0 commit comments