yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Renate:
Ok, let me get in hot water here.

patch sucks. Ok, it's domain agnostic, but it sucks.

It can't tell the difference between smali and a letter to your grandmother.

What are we trying to do here?

We want to inject two new methods and modify one method.

Trying to textually alter a single method is looking for a bruising.

Was that v12 or cond_2 or what?

The only real solution is to completely replace a method that you want to alter.

Might you lose some improvement in that method that has passed you by?

Maybe, but at least you have a method that work(ed).

You need something that understands smali, can inject a method, can replace a method.

Now, I can't be bothered to figure out the intent of what the single line modifications to generatePackageInfo() do.

If somebody can post what the finished product should look like...

But here's an example of execution which injects the two new methods:

C:\stuff>mergesmali /v . \ComputerEngine.smali
Reading \ComputerEngine.smali
Read 119 lines, 0 fields, 2 methods
Reading C:\stuff\com\android\server\pm\ComputerEngine.smali
Read 20891 lines, 33 fields, 209 methods
Inserted method mayFakeSignature(AndroidPackage, PackageInfo, Set)
Inserted method requestsFakeSignature(AndroidPackage)
Writing C:\stuff\com\android\server\pm\ComputerEngine.smali
Wrote 20977 lines, 33 fields, 211 methods
[Android Software/Hacking General [Developers Only]] fbalder18:
Renate, thanks for clarification and showing me mergesmali. But I couldn't even get the first step with injection of the two methods done. Being far, far, far away from being able to patch the other necessary places.

Probably I can get it done when I convert the ComputerEngine.smali code into Java code and then do a diff and patch.
[Android Software/Hacking General [Developers Only]] Renate:
Oh, I missed the point that this was not some distributed patch, this was something that you knocked off.

C:\stuff>mergesmali . \ComputerEngine.smali /v
Reading \ComputerEngine.smali
Read 439 lines, 0 fields, 3 methods
Reading C:\stuff\com\android\server\pm\ComputerEngine.smali
Read 21718 lines, 33 fields, 209 methods
Inserted method mayFakeSignature(AndroidPackage, PackageInfo, Set)
Inserted method requestsFakeSignature(AndroidPackage)
Replaced method generatePackageInfo(PackageStateInternal, long, int)
Writing C:\stuff\com\android\server\pm\ComputerEngine.smali
Wrote 21599 lines, 33 fields, 211 methods

Here's your mergesmali patch file

Edit: Please download a new mergesmali.exe (just updated)

No, this is not critical, it just reports attempts to do a patch twice nicer.

Read 21610 lines, 33 fields, 211 methods
Already inserted method mayFakeSignature(AndroidPackage, PackageInfo, Set)
Already inserted method requestsFakeSignature(AndroidPackage)
Already replaced method generatePackageInfo(PackageStateInternal, long, int)
[Android Software/Hacking General [Developers Only]] Aqq123:
It's all in the first post, inside services_replace.zip. Java source is available as well:
[Android Software/Hacking General [Developers Only]] fbalder18:
Dear Renate, have so many thanks for your help!! But unfortunately I'm still stuck.

I can modify ComputerEngine.smali with your correction from patch.zip in #47. The resultant output is the same as in that post. I attach the resultant file here.

But when I try to compile it back using

apktool b -c -f -o services.jar services

I get two errors:

ComputerEngine.smali[3255,0] A non-abstract/non-native method must have at least 1 instruction

ComputerEngine.smali[8712,0] A non-abstract/non-native method must have at least 1 instruction

When I look into the file at those lines, the two methods requestsFakeSignature and generatePackageInfo only contain blank lines.

I have absolutely no knowledge about Android programming and so have no idea how to correct this.

I also attach the services.jar from WSA that I want to modify.
[Android Software/Hacking General [Developers Only]] Renate:
Damn, this is screwed up.

It's 35°C here and I have to figure out what regression error crept in.

Hold on...

Edit: So I'm an idjit.

That comes of typing Smali annotations by hand.

Try this:
[Android Software/Hacking General [Developers Only]] fbalder18:
NO NO, you are not !!!

apktool did build fine now, I start to integrate into WSA.
[Android Software/Hacking General [Developers Only]] fbalder18:
@Aqq123 and @Renate, you both are GREAT !!!

I have WSA 2307.40000.3.0 running with KernelSU 0.66, Signature Spoofing and microG 0.2.28.

Have so many thanks for your help !!!

I have to admit that WSA is a test system for me. But a very important one! I think about switching my daily driver (Xiaomi Poco X3 Pro with crDroid 9.6) from Magisk to KernelSU. And I would not try without testing beforehand if all privacy related stuff and the banking apps are working with KernelSU. I have a new banking app that I don't get to run as the others with Magisk. I consider it as more future-proof to spend time to get it running with KernelSU. And Signature Spoofing was a major milestone since they need Play Services and I absolutely won't install Google's stuff.

Tomorrow I can write a short summary if it is of interest.
[Android Software/Hacking General [Developers Only]] Renate:
Oh, I finally got around to reading the whole thread.

The OP had com.android.server.pm.PackageManagerService.ComputerEngine

@fbalder18 had com.android.server.pm.ComputerEngine

That is, the first is a subclass, the second isn't.

If you use mergesmali and the patch.zip in post #50 on a subclass you'll have to edit the first line to make it a subclass.
[Android Software/Hacking General [Developers Only]] JessyGlory:
Hello all..I tried to generate optimisation files but i could not get those files ..After moving recompiled service.jar to system partition my phone is automatically restarted then i observered two files in data /dalvik-cache /oat64 then i removed those files but after reboot got original services.jar and i lost root also ..please explain in detail how to create those optimization files ..please help me
[Android Software/Hacking General [Developers Only]] kurtn:
What rom do you want to patch? In mist cases it is easier to use the lsposed module "fakegapps"
[Android Software/Hacking General [Developers Only]] fbalder18:
Since the system partition usually is read-only I created the vdex/odex in /sdcard. I installed microG using a Magisk/KernelSU module (MinMicroG). So I added services.jar, services.odex and services.vdex in this module.

After getting this module to run the Dalvik/ART cache needs to be wiped. On Windows Subsystem for Android there is no recovery to achieve this. There I reinstalled all already installed applications.
[Android Software/Hacking General [Developers Only]] kullanici32:
As far as I remember,

You should put the file created for dalvik (dex vdex files) in this location.

In other words, boot once and add the resulting optimization files there:

system/framework/oat/arm64/services.odex

And as far as I remember, this was the location of the resulting optimization files:

/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex

/data/dalvik-cache/arm64/system@framework@services.jar@classes.vdex

and I deleted these complicated texts and made the other one services.dex and the other one services.vdex, and added them here:

system/framework/oat/arm64/services.odex change this, with dalvik optimization file

system/framework/oat/arm64/services.vdex change this, with dalvik optimization file

But like I said, I don't remember exactly
[Android Software/Hacking General [Developers Only]] JessyGlory:
I have tried ..but it didnot work..Thank you...
[Android Software/Hacking General [Developers Only]] kullanici32:
There's something I'm remembering wrong, I'm using grapheneos right now, so I can't help you right now, but if I try it one day, I'll let you know.

edit:

Now it comes to my mind, can you try the opposite? In other words, instead of putting what is in Dalvik into the system, put the dex and vdex files in the system in their place in Dalvik, (that is, do the opposite of what I wrote above and try)
[Android Software/Hacking General [Developers Only]] kurtn:
So you are still trying to get microG working on a Samsung oneui operating system? You already have magisk? Use LSPosed and whew-inc fakegapps
[Android Software/Hacking General [Developers Only]] kullanici32:
No, I dont work for one ui,

I used it with lsposed, micro g started to be insufficient. I bought pixel 5 and installed graphene os. Now I will install micro g on s10e as a second device (micro g has many features last update)
[Android Software/Hacking General [Developers Only]] kurtn:
beyond0lte
[Android Software/Hacking General [Developers Only]] kullanici32:
Of course I don't want it as a custom ROM, it's for stock ROM :)
[Android Software/Hacking General [Developers Only]] kurtn:
We are talking in circles. One ui is the samsung stock rom. You have magisk? Go the fakegapos route.
[Android Software/Hacking General [Developers Only]] kullanici32:
Ah, I guess we didn't communicate fully, I can already upload it, So I don't need any help.

Only the old versions of micro g were not functional (the sign in with google buttons in the applications were not working) That's why I didn't use it.

but now the update has arrived and it says it will work, I just installed it now but I haven't tried it yet. Anyway, I don't have any problems with the installation right now, I just wish we had patched the framework instead of the module and had a working function, it would have been great, I wouldn't have used it with root and lsposed.
[Android Software/Hacking General [Developers Only]] fbalder18:
@Renate, are you still active in the field of smali patching? I just wanted to patch an Android 14 (LineageOS 21) framework/services.jar with signature spoofing. I used your mergesmali.exe and your patch as I did the last time in August 2023 with success. Now mergesmali does not give an error, but apktool does. Do you have an idea if this is a patching problem or a problem with apktool? Log and files are attached (patch file renamed for upload).

Many Greetings, Michael
[Android Software/Hacking General [Developers Only]] kurtn:
LineageOS 21 has microG support. Do you ned a patch for geneal app signature spoofing?
[Android Software/Hacking General [Developers Only]] fbalder18:
No I only need it for com.google.android.gms and com.android.vending, not general. I didn't know that they integrated it. I only remebered that they were very stiff about signature spoofing and that they didn't want to integrate it. Was it already included in LineageOS 20? I didn't find anything about that.
[Android Software/Hacking General [Developers Only]] Renate:
Yes, of course. Sorry that it took me so long to get back to you. :p

What a bunch of knuckleheads. Saving certs in code as hex text strings. I call "bogus".

I never anticipated line lengths of 2000 characters in a smali file.

There's a new version up on my website, DL it.

Semi-related: I use my kpatch more often these days.

As the name implies, it's helpful for patching kernels.

It can also patch Dex code without going through smali.
[Android Software/Hacking General [Developers Only]] kurtn:
All builds 18 20 21 after February 2024 have that feature. There still is no official announcement. Just the review.lineageOS.org entries and an answer on reddit.
[Android Software/Hacking General [Developers Only]] fbalder18:
Hi Renate, thanks for taking care!!

I used new mergesmali.exe, but unfortunately apktool doesnt't compile yet. Log is attached.
[Android Software/Hacking General [Developers Only]] fbalder18:
Somewhere I found a note that LOS 21 only has sigspoof for userdebug build, but not for user build. The rom I want to install is an user build. So I think I need to patch.
[Android Software/Hacking General [Developers Only]] Renate:
Yeah, yeah, ok. DL the latest one.
[Android Software/Hacking General [Developers Only]] fbalder18:
Have many thanks, Renate. Compile of mergesmali-patched folder did work :)

Test of services.jar will start tomorrow.

P.S. Renate, probably the today first modified mergesmali might have worked. I think I probably could have made a mistake copying and renaming 😓
[Android Software/Hacking General [Developers Only]] Renate:
No, there was in fact a secondary problem that I missed the first time.
[Android Software/Hacking General [Developers Only]] kurtn:
So you have an unoffical lineageOS. The one who builds it, is free to pick any other microG support patch. Maybe that from divestOS.
[Samsung Galaxy Watch 4] 7lekok:
My GW4 recovery is broken after tried to reboot to recovery via ADB.

I tried to sideload pixel watchface apk using "adb reboot recovery sideload" to enter sideload mode as per ADB syntax guide...

It didn't work and just show big red circle with white exclamation mark.

After that, i managed to boot the watch using HW button reset method, but looks like my recovery is damaged and now i cannot update the watch anymore.

I have tinkering with ADB on phone many times before, and from my experience this kind of command is harmless (at worse it just reboot the phone).

Appreciate if anyone have experience on this and advice if there is any workaround....
[Samsung Galaxy Watch 4] ReX-Hell2heAven:
Should have used simple sideloader app with debugging over wifi. Anyway damage is done but you can flash same firmware which your watch having right now and set it up as new.
[Samsung Galaxy Watch 4] adfree:
If you can hold both Hardware Keys to reach Reboot Mode/Menu...

And you see:

Bootloader unlock

Then do this.

It makes some kind of Factory Reset....

Not forget lock again... in this menu:

Bootloader lock

It not kill Knox... NOT flash something...

Only unlock... lock... to do some Reset... which fixes few things...

Good Luck.

Bootloader menu not inside US LTE devices like SM-R875UUUUUUU like USA...

Best Regards
[Samsung Galaxy Watch 4] 7lekok:
Tried to enter "Download (Wireless)" mode but same error appears... Dont think i can flash anything from the bootloader now... will try @adfree suggestions and see if it can save me a trip to Samsung Customer center...
[Samsung Galaxy Watch 4] 7lekok:
Works like a charm!!

Thanks for the suggestion....
[Kindle Fire Q&A, Help & Troubleshooting] tomkeet:
I'm no expert with Amazon Fire devices.

Question is is it possible yet to root an Amazon Fire HD 8 Tablet 10th Generation?

Just it would be nice to see the apps files I have installed and maybe amend them.

Sorry more used to a laptop running windows.
[Kindle Fire Q&A, Help & Troubleshooting] GhostPlay:
I would love to root thisand stop getting sidetracked and returning to my old laptop which mm however was sabotaged by the same peoplw but wait mmm no ones ever who you think they are but they are wait
[Android Head-Units] Aluzcz:
I'm looking to buy a new android head unit for my B6 Passat.

I want some 9" setup so o can keep the original plastic bracket and i don't won't something too flashy so 9" it is.

I'm aware of the following Junsun https://a.aliexpress.com/_mKpfV8o

And Isudar https://a.aliexpress.com/_mqxMjW4

The question is, which one to buy?

I really just want to use it as a replacement for the rcd360 which is crap. Main functions expected, reverse camera, radio, waze, Spotify, bt handsfree, agama luncher.

Not much else, will these do the job or is there something better?

In case these ones are good, which spec to buy? Usually i buy most of electronics in the highest spec but for something like a old b6 i don't need it, i was thinking midrange something around 200 euro.

Thx for any meaningful advise!
[Samsung Galaxy Tab A7 Lite] t111:
hello i have a sm-t220, i followed this tutorial

https://xdaforums.com/t/install-gsi...und-trip-explain.4473159/page-9#post-87341481

the flash with odin went well (passed with green)

the tab rebooted and show bootloader warning message (i press the power button to continue)

then the screen stay on but black , no matter what button try to press (volume+ or - and power)

is there any way to solve this? i want to install a gsi in this tablet ? the stock firmware is android 11 T220XXU1AVE1 EUR version
[Samsung Galaxy Tab A7 Lite] tom.android:
What are you flashing.?
[Samsung Galaxy Tab A7 Lite] tom.android:
What are you flashing?
[Samsung Galaxy Tab A7 Lite] t111:
twrp 220 + vbmeta_disabler and the stock rom T220XXU1AVE1
[Samsung Galaxy Tab A7 Lite] tom.android:
After reboot , black screen you try to press power key than volume + volume- but screen not activated ?
[Samsung Galaxy Tab A7 Lite] tom.android:
You have booted to twrp before or not.
[Samsung Galaxy Tab A7 Lite] t111:
yes exactly

not this is the first time , i only unlock bootloader
[Samsung Galaxy Tab A7 Lite] tom.android:
You must install TWRP in normal way before this tutorial is for restore twrp for user that used to installed TWRP before.

You can try to boot to twrp by restart device when you saw yellow text then press power+vol+

If not success, get device into download mode and install stock first.
[Samsung Galaxy Tab A7 Lite] t111:
the normal way is to install in the AP section from odin right?
[Samsung Galaxy Tab A7 Lite] tom.android:
You must have USB otg mouse. Cause twrp have no touch function. If not you can't finish install twrp.
[Samsung Galaxy Tab A7 Lite] t111:
i reflashed stock (the teblet is working fine)

then i flashed only the recovery for t220 tar in odin (using AP button ) the flash went well (green )

but after the reboot the tablet bootloop (it says " this tablet bootloader as been unloked ecc." press power key to continue") cant access to twrp (pressed the vol+ and power)
[Samsung Galaxy Tab A7 Lite] tom.android:
The best way , you should use my tutorial "DSU side loader to try GSI" if you not ready to install twrp.
[Samsung Galaxy Tab A7 Lite] tom.android:
Oh there are some problem, take an easy , please show me your download mode screen.
[Samsung Galaxy Tab A7 Lite] tom.android:
You must have boot + vbmeta patch with magisk v24 during installed twrp. ( first time to install twrp)
[Samsung Galaxy Tab A7 Lite] t111:
View attachment 5770099
[Samsung Galaxy Tab A7 Lite] t111:
the twrp file is https://github.com/Skorpion96/android_device_samsung_gta7lite/releases/
[Samsung Galaxy Tab A7 Lite] t111:
can you link me a tutorial ?
[Samsung Galaxy Tab A7 Lite] tom.android:
Wait please
[Samsung Galaxy Tab A7 Lite] tom.android:
my first time to flash twrp . (Don't use home_csc)

Howto install TWRP For SM-T225

# Patch Samsung AP Firmware via Magisk v24.0

1. Install Magisk.apk on your device SM-T225 with select no update checking, and transferred AP_xxx.tar.md5 from computer to your tab.

2. Patch Samsung AP Firmware via Magisk Manager.

( Once done, the newly created magisk_patched.tar file will be present under the

Downloads folder on your device.)

3. you may now transfer this patched TAR file to the folder on your PC where other extracted firmware files (AP, BL, CP, CSC, and HOME_CSC) are present.

4. FLASH it with ODin as usual by used magisk_patched.tar file at AP slot .

5. REBOOT SYSTEM Quick SETUP < NO NEED INTERNET>

6. Power Off and press Volum up +Volumn down + USB for boot into Download mode

7. FLASH TWRP.tar from https://github.com/DevZillion/android_device_samsung_gta7lite/releases at "AP slot"

But this time set Odin option NO Auto- REBOOT, yes do it yourself with key press ( power + volumn up). If you can't do this , let it reboot to system and uses cmd " adb reboot recovery".

When access to twrp

Go to Advanced > Terminal and type "multidisabler" (without quotes", then data wipe.

Now reboot into system, after completing first setup of the device reboot into TWRP again to see if you can see the contents of your Internal Storage, you should, if yes you have successfully disabled Samsung encryption of internal storage.
[Samsung Galaxy Tab A7 Lite] tom.android:
If you have any problems》》 can pm me.
[Samsung Galaxy Tab A7 Lite] t111:
i followed the steps the patched os is booting fine but the twrp remains black screen (i flashed the t220 variant)
[Samsung Galaxy Tab A7 Lite] tom.android:
may be screen not activated must press power btn then vol + and vol -

if can' t then boot to system >>connect with computer run cmd > adb reboot recovery

https://xdaforums.com/attachments/platform-tools-zip.5669663/
[Samsung Galaxy Tab A7 Lite] tom.android:
the last if can't installed TWRP

1. use DSU side loader for test GSI

2. if it works well use CustomAP install new GSI.

https://xdaforums.com/t/dual-boot-s...der-v-2-work-very-well.4515225/#post-87684279

https://xdaforums.com/t/update-21-n...r-a-b-partition-device.4473159/#post-87204333
[Samsung Galaxy Tab A7 Lite] tom.android:
How about your twrp?
[Samsung Galaxy Tab A7 Lite] t111:
i tried the tutorial but the blackscreen in twrp remains, i pressed all the combination of buttons, always black screen .

yesterday unfortunately i was careless and the the tablet update itself to Android 12 after a reboot (because after the verious attemps i restore to stock Android 11 with odin)

is it possible to downgrade? maybe i can just try to repack a gsi image and flash without twrp.....
[Samsung Galaxy Tab A7 Lite] tom.android:
you can uses customAP with Android 12,13. without TWRP.
[Samsung Galaxy Tab A7 Lite] tom.android:
Rechecked you used magisk version 24
[Samsung Galaxy Tab A7 Lite] t111:
i used the lastest version in github 25.2
[Samsung Galaxy Tab A7 Lite] tuelho_post:
still need the (vbmeta image with verity disabled) right? where can i find it please!
[Samsung Galaxy Tab A7 Lite] tom.android:
its for easy restore twrp back , using when you had installed twrp before ...not for first time twrp installation.

make sure you use only magisk v24,? to patch. if not twrp not show up.
[Samsung Galaxy A10 Questions & Answers] deadstarlight:
nvm, all I had to do was connect the phone to a different USB port and it flashed fine lmao
[Samsung Galaxy A10 Questions & Answers] fjb59:
i hate usb. it's tenious at best.
[Xiaomi Mi 8 Lite Questions & Answers] vancevaldivia:
I changed my ROM to china to global but the the issue was the camera. It became blurry. How can I go back to the china rom or the stock rom of my phone? Thanks!
[Xiaomi Mi 8 Lite Questions & Answers] gripbox:
wIpe in recovery , Flash original rom.
[Android Q&A, Help & Troubleshooting] TheMystic:
I have searched through the internet and I see that similar queries have been raised in the past. Unfortunately, no one seem to have found a definitive answer to this question.

I'll narrate my own experience about this problem, and I will post the solution, if I figure out the cause.

I updated my Samsung phone to OneUI 5.0 about a month back, and I'm seeing that the battery drain is significantly more than what it used to be on OneUI 4.x. During the 1st week, I thought that this could be due to some software optimization related background activities (which typically shouldn't require more than 2 charge cycles), but the battery drain continues to be bad even after a month, and probably getting worse.

When going through battery stats, I can't see anything unusual. But the battery just drains. Idle drain is now over 2 to 3% per hour, compared to about 1% earlier on OneUI 4.x.

My phone setup hasn't really changed from before the update. This makes it difficult to find out the cause of battery drain.

Looking back, the two other changes that coincided with the 5.0 update is that I installed a new screen protector (plastic film), and tried a new case. I have been using my phone without a screen protector until now, but this is not something I want to continue doing.

I have removed the case now to see if there is any improvement in battery life. If there is none, my next option would be to remove the screen protector too, just to test it out.

Since I'm noticing idle battery drain even with AOD off, I guess the screen protector isn't the issue.

Does anyone think that screen protectors or back cases can indeed be a cause of battery drain?