Skip to content

Commit

Permalink
hwEmui: Patch out Huawei logging static fields
Browse files Browse the repository at this point in the history
09-22 23:33:07.570  2057  2057 E AndroidRuntime: java.lang.NoSuchFieldError: No static field HWINFO of type Z in class Landroid/util/Log; or its superclasses (declaration of 'android.util.Log' appears in /system/framework/framework.jar!classes3.dex)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at huawei.android.app.admin.TransactionSponsor.<clinit>(TransactionSponsor.java:21)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at huawei.android.app.admin.HwDevicePolicyManagerEx.<init>(HwDevicePolicyManagerEx.java:26)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.telephony.HwTelephonyManagerInner.<init>(HwTelephonyManagerInner.java:145)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.telephony.HwTelephonyManagerInner.<clinit>(HwTelephonyManagerInner.java:193)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.telephony.HwTelephonyManagerInner.getDefault(HwTelephonyManagerInner.java:197)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.telephony.HwTelephonyManager.getDefault4GSlotId(HwTelephonyManager.java:494)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.huawei.ims.ImsCallProviderUtils.getSubId(ImsCallProviderUtils.java:398)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.huawei.ims.HwImsServiceImpl.getDefaultPhone(HwImsServiceImpl.java:2893)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.huawei.ims.HwImsServiceImpl.updatePhoneBaseEvent(HwImsServiceImpl.java:2940)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.huawei.ims.HwImsServiceImpl.<init>(HwImsServiceImpl.java:569)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.huawei.ims.HwImsService.onCreate(HwImsService.java:56)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.app.ActivityThread.handleCreateService(ActivityThread.java:4486)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2161)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.os.Handler.dispatchMessage(Handler.java:106)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.os.Looper.loopOnce(Looper.java:201)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.os.Looper.loop(Looper.java:288)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at android.app.ActivityThread.main(ActivityThread.java:7924)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at java.lang.reflect.Method.invoke(Native Method)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-22 23:33:07.570  2057  2057 E AndroidRuntime:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

* sed -i 's#sget-boolean \([^,]*\), Landroid/util/Log;->HWINFO:Z#const/4 \1, 0x0#' $(grep -rl "HWINFO:Z" ./smali)
* sed -i 's#sget-boolean \([^,]*\), Landroid/util/Log;->HWModuleLog:Z#const/4 \1, 0x0#' $(grep -rl "HWModuleLog:Z" ./smali)
* sed -i 's#sget-boolean \([^,]*\), Landroid/util/Log;->HWLog:Z#const/4 \1, 0x0#' $(grep -rl "HWLog:Z" ./smali)
  • Loading branch information
R0rt1z2 committed Sep 23, 2024
1 parent 85ad5f0 commit fafa33d
Show file tree
Hide file tree
Showing 31 changed files with 187 additions and 187 deletions.
4 changes: 2 additions & 2 deletions smali/android/app/HwActivitySplitterImpl$1.smali
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

.line 771
.local v0, "isTop":Z
sget-boolean v2, Landroid/util/Log;->HWLog:Z
const/4 v2, 0x0

if-eqz v2, :cond_0

Expand Down Expand Up @@ -115,7 +115,7 @@
if-nez v2, :cond_3

.line 779
sget-boolean v2, Landroid/util/Log;->HWLog:Z
const/4 v2, 0x0

if-eqz v2, :cond_2

Expand Down
44 changes: 22 additions & 22 deletions smali/android/app/HwActivitySplitterImpl.smali
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
iput v1, v0, Landroid/view/ViewGroup$LayoutParams;->width:I

.line 435
sget-boolean v1, Landroid/util/Log;->HWLog:Z
const/4 v1, 0x0

if-eqz v1, :cond_1

Expand Down Expand Up @@ -670,7 +670,7 @@

.line 632
:cond_1
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_2

Expand Down Expand Up @@ -1219,7 +1219,7 @@
if-eqz v1, :cond_1

.line 715
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_3

Expand Down Expand Up @@ -1370,7 +1370,7 @@
invoke-virtual {v0, v1}, Landroid/view/Display;->getSize(Landroid/graphics/Point;)V

.line 968
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_1

Expand Down Expand Up @@ -2095,7 +2095,7 @@
.line 1224
:cond_1
:goto_0
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_2

Expand Down Expand Up @@ -3382,7 +3382,7 @@
.line 840
.local v2, "start":Z
:goto_1
sget-boolean v3, Landroid/util/Log;->HWLog:Z
const/4 v3, 0x0

if-eqz v3, :cond_4

Expand Down Expand Up @@ -3516,7 +3516,7 @@
.end local v2 # "start":Z
:cond_6
:goto_4
sget-boolean v1, Landroid/util/Log;->HWLog:Z
const/4 v1, 0x0

if-eqz v1, :cond_7

Expand Down Expand Up @@ -4048,7 +4048,7 @@
.locals 6

.line 872
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down Expand Up @@ -4083,7 +4083,7 @@
iput-boolean v0, p0, Landroid/app/HwActivitySplitterImpl;->mSplit:Z

.line 879
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_2

Expand Down Expand Up @@ -4180,7 +4180,7 @@
iput v3, v0, Landroid/view/WindowManager$LayoutParams;->height:I

.line 894
sget-boolean v3, Landroid/util/Log;->HWLog:Z
const/4 v3, 0x0

if-eqz v3, :cond_7

Expand Down Expand Up @@ -4402,7 +4402,7 @@
iput p1, v0, Landroid/view/WindowManager$LayoutParams;->width:I

.line 937
sget-boolean v1, Landroid/util/Log;->HWLog:Z
const/4 v1, 0x0

if-eqz v1, :cond_0

Expand Down Expand Up @@ -4561,7 +4561,7 @@
if-eqz v0, :cond_3

.line 995
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_1

Expand Down Expand Up @@ -4938,7 +4938,7 @@

.line 1582
.local v0, "currentLang":Ljava/lang/String;
sget-boolean v1, Landroid/util/Log;->HWLog:Z
const/4 v1, 0x0

if-eqz v1, :cond_0

Expand Down Expand Up @@ -5193,7 +5193,7 @@
.param p1, "newConfig" # Landroid/content/res/Configuration;

.line 1142
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down Expand Up @@ -5248,7 +5248,7 @@
invoke-direct {p0}, Landroid/app/HwActivitySplitterImpl;->adjustContentIndexView()V

.line 1153
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_2

Expand Down Expand Up @@ -5632,7 +5632,7 @@
.param p1, "showing" # Z

.line 357
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down Expand Up @@ -5762,7 +5762,7 @@

.line 1447
:cond_0
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_1

Expand Down Expand Up @@ -5802,7 +5802,7 @@
if-eqz v0, :cond_4

.line 1451
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_2

Expand Down Expand Up @@ -6167,7 +6167,7 @@

.line 1329
:cond_0
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_1

Expand All @@ -6189,7 +6189,7 @@
if-eqz v0, :cond_3

.line 1334
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_2

Expand Down Expand Up @@ -6255,7 +6255,7 @@

.line 1346
:cond_5
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_6

Expand Down Expand Up @@ -6402,7 +6402,7 @@

.line 1508
:cond_0
sget-boolean v0, Landroid/util/Log;->HWLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_1

Expand Down
4 changes: 2 additions & 2 deletions smali/android/app/hwfeature/HwFeatureManager.smali
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
if-nez v1, :cond_1

.line 41
sget-boolean v1, Landroid/util/Log;->HWINFO:Z
const/4 v1, 0x0

if-eqz v1, :cond_0

Expand Down Expand Up @@ -414,7 +414,7 @@
.end local v4 # "packageName":Ljava/lang/String;
:cond_1
:goto_1
sget-boolean v2, Landroid/util/Log;->HWINFO:Z
const/4 v2, 0x0

if-eqz v2, :cond_2

Expand Down
6 changes: 3 additions & 3 deletions smali/android/app/mtm/MultiTaskManager.smali
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
if-nez v1, :cond_2

.line 76
sget-boolean v1, Landroid/util/Log;->HWINFO:Z
const/4 v1, 0x0

if-eqz v1, :cond_1

Expand Down Expand Up @@ -927,7 +927,7 @@
if-nez v0, :cond_1

.line 315
sget-boolean v1, Landroid/util/Log;->HWINFO:Z
const/4 v1, 0x0

if-eqz v1, :cond_0

Expand Down Expand Up @@ -957,7 +957,7 @@

.line 321
.local v1, "e":Landroid/os/RemoteException;
sget-boolean v2, Landroid/util/Log;->HWINFO:Z
const/4 v2, 0x0

if-eqz v2, :cond_2

Expand Down
6 changes: 3 additions & 3 deletions smali/android/app/mtm/MultiTaskUtils.smali
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
.locals 2

.line 46
sget-boolean v0, Landroid/util/Log;->HWINFO:Z
const/4 v0, 0x0

if-nez v0, :cond_1

sget-boolean v0, Landroid/util/Log;->HWModuleLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down Expand Up @@ -167,7 +167,7 @@
if-nez v0, :cond_2

.line 69
sget-boolean v1, Landroid/util/Log;->HWINFO:Z
const/4 v1, 0x0

if-eqz v1, :cond_1

Expand Down
4 changes: 2 additions & 2 deletions smali/android/emcom/SmartcareInfos$SmartcareBaseInfo.smali
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
iput-object p1, p0, Landroid/emcom/SmartcareInfos$SmartcareBaseInfo;->smarcareInfos:Landroid/emcom/SmartcareInfos;

.line 37
sget-boolean v0, Landroid/util/Log;->HWINFO:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down Expand Up @@ -105,7 +105,7 @@
iput-object v0, p0, Landroid/emcom/SmartcareInfos$SmartcareBaseInfo;->pkgName:Ljava/lang/String;

.line 45
sget-boolean v0, Landroid/util/Log;->HWINFO:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down
4 changes: 2 additions & 2 deletions smali/android/location/HwAGPSManager.smali
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@
.locals 2

.line 21
sget-boolean v0, Landroid/util/Log;->HWINFO:Z
const/4 v0, 0x0

if-nez v0, :cond_1

sget-boolean v0, Landroid/util/Log;->HWModuleLog:Z
const/4 v0, 0x0

if-eqz v0, :cond_0

Expand Down
Loading

0 comments on commit fafa33d

Please sign in to comment.