yashsingh1/xdaforums huggingface dataset:
[Huawei P20 Pro Guides, News, & Discussion] hioma:
What to do if you forgot a PIN/password for Huawei EMUI "App lock" feature? I couldn't find an existing solution, so I had to solve the problem for myself. I have a Huawei p20 pro phone, but this solution is also suitable for other devices running on EMUI Android OS.

In my case, my root rights helped me, but if you don’t have them, you can probably solve the problem by using the ADB console (see UPDATE below).

So, the PIN is stored in the file "/data/misc/hsm/databases/applock.db". If you have root rights, you can delete it (and other files like "applock.db-shm", "applock.db-wal", "applock.db-journal", etc), which will reset all the settings for "App lock". Or with using any sqlite-editor on PC you can open "applock.db" file, and erase the "encrypt_password_sha256_salt" and "encrypt_password_sha256" fields in the "applockpreference" table.

In both cases restart the phone, the PIN code should disappear.

If you do not have root rights (so you cannot delete/edit the file "applock.db"), but you can read it, then you may use this python3 code (you can use any online interpreter to run it) to bruteforce PIN in less than a minute:

import hashlib, binascii

encrypt_password_sha256_salt = '609605825498166908'
encrypt_password_sha256 = '1000:5b2d362c202d34332c202d32352c202d33332c2034392c2036322c202d38372c2032362c2031312c202d32312c2031352c202d35382c2034312c203132362c2031312c202d34325d:97f6fdf9a44a1f3fb21e2296'

pbkdf2_password = bytes.fromhex(encrypt_password_sha256.split(':')[1])
needed_hash = encrypt_password_sha256.split(':')[2][:24]

result = ''
for i in range(0, 10000):
pin_str = str(i).zfill(4)
pin_and_salt = pin_str + encrypt_password_sha256_salt
sha256_hash = hashlib.sha256(str.encode(pin_and_salt))
sha256_hash_str = sha256_hash.hexdigest()
dk = hashlib.pbkdf2_hmac('sha1', str.encode(sha256_hash_str), pbkdf2_password, 1000)

if binascii.hexlify(dk)[:24].decode("utf-8") == needed_hash:
result = pin_str
break
if (i + 1) % 1000 == 0:
print('{}% done'.format((i + 1) // 100))

if result != '':
print('found: "{}"!'.format(pin_str))
else:
print('hmm... nothing found :(')

UPD:

I tried to get "applock.db" file through ADB console, and failed. "/data/misc/hsm/databases" is not accessible, "HwSystemManager.apk" a.k.a. "com.huawei.systemmanager" does not support "run-as com.huawei.systemmanager" command, and it has a "android:allowBackup=false" param in it's manifest, so "adb backup -noapk com.huawei.systemmanager" doesn't work.

So I can summarize, that my solution doesn't work without root rights (but if you have it, everything will be fine!).
[Huawei P20 Pro Guides, News, & Discussion] spityu85hun:
password stored in secured partition...

this metbod it would be too simple...

huawei is not stupid... try factory reseting.... before take factory reset,delete google account and logout huawei id...
[Huawei P20 Pro Guides, News, & Discussion] hioma:
This is not "guess", this is a working solution. "/data/misc/hsm/databases/" is secured directory, but (I think) it is accessible through ADB console (and if you have root rights, it 100% accessible and editable, so you can clear or "decipher" PIN, stored as pbkdf2 key). So you can solve problem without wiping, I think, it's a good solution.
[Huawei P20 Pro Guides, News, & Discussion] spityu85hun:
grat...now helped for thief for hack applocker pin...
[Xiaomi Mi 9 Questions & Answers] picitup:
Hi All

I'm new to this so I thought I'd put this thread together for other noobs. It explains in basic terms which rom is which, where to get it and what you can flash with your device locked or unlocked.

If I've got anything wrong, please let me know.

Unlocking Your Mi9

Don't forget to backup first!

There are plenty of threads on this, but I found a couple of gotchas. I went to the unlocking site https://en.miui.com/unlock/ and clicked the button, it took me to the Chinese language site. There was an option to choose US English, but that just gave an internal server error. After a day or so, this was working fine.

Secondly, once I had downloaded the PC based unlocking software and logged in I got an error message:

Can't unlock. Your account isn't associated with a phone number

After a bit of surfing I learned that I had to log into my Xiaomi account in a web browser and add my phone number as a backup number. Then it asked me to turn off wifi, enable mobile data, then it send me a code which I then entered into the site.

After all this it's now working, the countdown is going down and I hope to unlock my bootloader on Wednesday. Tick Tock...

Install ROMs before unlocking

If your device is not unlocked yet, you can only install official roms from here:

http://en.miui.com/download-361.html

There are instructions on how to do this on the web site. There is no need to backup when installing official ROMs. But you might like to anyway :)

There was one piece of information missing that threw me for a short while; The instructions on the web site tell you to click on the 3 dots and choose:

Choose Update Package.

This option was missing on my phone even after downloading the ROM to the phone. The fix is to go to Settings->System Update and Click the 10 logo 10 times. Fooled me lol.

Global or EEA?

If your phone is European you can't install the Global ROM. If you look at the top of the page there is a Global or EAA link. You can tell which you have by going into:

Settings->About Phone->MIUI Version.

Mine is EAA and the version is 10.2.15.0(PFAEUXM). The current Global one is V10.2.3.0.PFAMIXM. A bit of surfing shows CN=China

So EU = EAA, Global = MI and CN-China. So your box says Global but your settings say EAA? Mine too! A bit weird, but I think the EAA version supports WideVine for digital rights management for netflix etc.

Install ROMs after unlocking

You can find weekly build ROMs here:

https://xiaomi.eu/community/ and click on MIUI ROM DOWNLOADS

I am told these ROMs are based on the Chinese version, but I'm not sure of the implications there. Maybe someone could inform me?

Now that you're unlocked, you can (backup your current rom) and flash these images with TWRP. The instructions are further down the page and are quite comprehensive.

Don't relock your bootloader! I understand this will brick your phone!

That's all for now, please feel free to add or correct any info here.

Cheers

Steve
[Xiaomi Mi 9 Questions & Answers] Gourmandises:
Thanks a ton for this informative post!

It's nice to know I can use official ROMs while I wait for the bootloader to unlock, especially since i bought the CN model. I'll get to that now...

Custom ROMs are based off of the Chinese version because its the most feature-full version. Thebonly reason I don't want to use the official CN rom is because you never know what deals-requirements Xiaomi has with their government on collecting and sending back your data.
[Xiaomi Mi 9 Questions & Answers] picitup:
Hi [MENTION=9831211]Gourmandises[/MENTION]

No probs and thanks for the extra description of China roms. Mind you, just about every stock app on my EU phone has a privacy policy as long as your arm, including video player and even calculator. If you read this, Xiaomi get access to pretty much everything.

I don't want to debloat yet, as I mentioned I'm waiting for an unlock and I worry that debloating might affect the unlocking as they need to harvest enough personal data from me!

I'll update as I go along. Can't wait to install the China rom now you've told me it has more features.

BTW as far as privacy goes, I like to install No Root Firewall here:

https://play.google.com/store/apps/details?id=app.greyshirts.firewall

I like it because it blocks everything until you explicitly allow it. You can install apps with ads and they won't get through the firewall. The only slight issue is it doesn't seem to autostart on boot so you need to re-start it each time.

Cheers

Steve
[Xiaomi Mi 9 Questions & Answers] Gourmandises:
Hi [MENTION=3467492]picitup[/MENTION]

I don't know much about the ROMs but xiaomi.eu makes it seem like there's some unique things in it where they say -Our ROMs features (Whats not in Global):-

Maybe the only reason its CN rom is for the weekly builds. Global and EU don't get features as early? I think the rest of that list is custom things they've added then...

This is your thread, and I know less than you hehe
[Xiaomi Mi 9 Questions & Answers] picitup:
Well no I'm getting even more excited. Probably should get out more.

It's what I had heard about the CN ROMs. Regular updates and the EEA version will update at some point in the future.

It doesn't really matter what you know or don't know - when you learn it you know it lol. I remember going on training courses and asking stupid questions. In the tea break people would tell me they didn't understand either, but were scared to ask.

I saw on someone else's thread the footer:

If you know what you're doing, you're not learning anything

Brill

Steve
[Xiaomi Mi 9 Questions & Answers] RedWave31:
This thread needs to be seriously bumped now that Mi9 sales are rocketing.

[MENTION=3467492]picitup[/MENTION], would you be kind enough to edit the OP with a different structure? I was thinking about:

> 6-7 types of ROMs and how to find about your phone version's

- Global Stable & Global Developer

- EEA Stable

- Chinese Stable & Developer

- Xiaomi.eu fanmade custom roms based on China Developer

(& Where to download official roms)

> How to install & unlock bootloader

That would avoid a lot of frustration ("Why me wait me got phone me want unlock now"), errors ("Why me not Netflix HD, me not WideVineL1 after flashing official xiaomi.eu rom"), etc

Thank you ;)
[Xiaomi Mi 9 Questions & Answers] picitup:
Yes, no problem. My wife has forced me to drink whiskey tonight, so I'll look a restructuring it tomorrow :)

Cheers
[Xiaomi Mi 9 Questions & Answers] marcel112:
*Forced... How awefull ?
[Xiaomi Mi 9 Questions & Answers] picitup:
It's a tough job, but someone has to do it :D
[Xiaomi Mi 9 Questions & Answers] picitup:
Yes please if we can expand this to help more people, all the better.

If you'd like to post up here and links to Chinese global/developer roms and anything you think should be included, I'd be very grateful :)

I'll then include them in the 1st post.

Cheer
[Xiaomi Mi 9 Questions & Answers] cd993:
Thanks for this, a really useful summary.

I am curious of these gsi builds, especially RR, though gonna wait a bit longer as I'm happy with MIUI being stable etc
[Xiaomi Mi 9 Questions & Answers] andypa1:
I'm a bit worried by what you say with TWRP being a one time flash only as it can't write to data.

Does this mean that if I install the xiaomi.eu ROM today, that's it no further flashes in the future?!

Also there's a warning on the xiaomi.eu download page that magisk may cause lag and fingerpring issues, has anyone experienced this?

I need to make sure that google pay works
[Xiaomi Mi 9 Questions & Answers] Gokh:
I have a global model with the EU rom, can i use the dev rom or the xiaomi.eu rom? I've read that that european models can't use global rom, will these work?
[Xiaomi Mi 9 Questions & Answers] oziojik:
i have EEA device version, can i flash global ROM and Re-Lock Bootloader ?
[Xiaomi Mi 9 Questions & Answers] meuhmeuh51:
Yes
[Xiaomi Mi 9 Questions & Answers] cd993:
Very interesting to read! I'm curious of gsi roms however so far I'd miss stock camera and this battery life is also making me hesitant.

I'm currently trying out RevolutionOS which is proving to be a very nice rom.

I did try Floko and experienced the same issue with gapps, took a while to work but managed it eventually. When booted I couldn't change the contrast/colours and all the whites seemed dull, presumably that isn't fixed yet (?!) and so for that and other reasons I decided to flash back to miui. I really don't mind it, after soong lots of tweaks and debloating etc.

But indeed, I must say I am almost tempted by the OnePlus 7 Pro whenever that comes out..... But we'll see!
[Xiaomi Mi 9 Questions & Answers] doggydog2:
What happened? Got 1% drop in 3hours. Did the phone "settle"? Did Xiaomi disconnect?;) i'm leaving it alone for 1hr blocks all day, this time i let it longer..

3C: 0.33% per hour.. is the phone dead? all seems working, network was active, data was there, google connected, VPN uninterrupted and resident programs too (no cleanup, actually tons of stuff and xposed*).

GSam: estimates 132hr (5.5days) standby per full charge, by math it is 12.6day per this sick value (lowest ever measure in non-airplane mode) funny but that's how i measured 6T,Note9,V30.. sitting at the exact spot and waiting..6T gave me 7days theoretical number and 4 real passive days afterwards* and come home with 75%, wake up next morning with 65% in active days)

Let's quickly write the conditions:

- 3g and home wifi (yes the wifi is a battery saver, and home wifi is the best... you know... proximity)

- ROM: flokoRom 21-04-2019

- kernel: stock (default)

- flashing sequence: dtbo, vendor, persist, boot, system, resize system partition, reboot to recovery, mindthegapps64, wipe caches, magisk19.0, two reboots

- governor: schedulutil (default), others (default), f-sync on (default)

- kernel wakelocks blocked: none (default), system wakelocks blocked: none (default), system alarms blocked: none (default)

- wakelocks detected: c8c000.qcom,hal_bluetooth_lock,PowerManagerService.WakeLocks,qcom_rx_wakelock (no smp2p-sleepstate there surprisingly)

- naptime: ON (=deep doze was active, however it didn't mean anything in previous tests)

- servicely: ON, force app standby: OFF (this would block notifications)

- surface settings: crDroid pocket detection and other 2 phh doze features: OFF

- Magisk 19.1 with useless GMS hack and 3C OFF, Magisk Hide OFF (as i don't want to hide my root, not using payments, and only GMS doze used this); GSI patch v3, Quickstep, edXposed, Xyoutube ON

- Exposed with Edge, XCall, XPrivacy ON; 3C OFF (only nonsys app running and monitoring only battery)

*Note: measuring Standby. More important than SOT if you want to have working phone at evening. Measuring wifi standby with no interaction is to check max potential of the phone with all background setup running (200 apps, 3 chats, 3 mails, disk encryption, network encryption, location sharing, location history, xposed - maxed out setup). Exact same process on each phone. Standby home wifi > Standby wifi > Standby 3g by huge margins. Results when moving with phone will vary drastically. My goal is humble: 1.5day of mixed use.
[Xiaomi Mi 9 Questions & Answers] doggydog2:
This type of performance continued later. Followed by permaactive browsing session 8.5%/hr (max 12hr SOT). During the active day (3g / office wifi) ended up also with ~75% (GSam: 84hr standby left). So this is great. I keep the phone and give away 6T. Finally. Achieved (consider the huge time waste however):

- no sign of Xiaomi thrashware existence

- optimal Pie experience with no feature or setting missing, QuickStep(R) and Pie navbar

- sexier lighter thinner phone with less memory but newer processors (fastest on market)

- my favorite feature Qi a QC on all charging levels existing (fastest on market), compatible with all existing standard chargers, optioanlly 3 gram magnet system to Qi-charge & hold in the car ("Floveme" on AliEx)

- great battery life

- less problems after setup than with rooted Samsung, bit more than with OnePlus (fingerprint not great, but this will improve by time i guess)

SD card sucks, but USB-C flash in the wallet works well with the chinese TWRP. OnePlus 7 is out of consideration thanks to Qc/Qi. Not sure if I want to wait for unlock next time, i'd prefer to buy 2nd hand unlocked Xiaomi phone if any ("outsource" the waiting). Let's see if OnePlus will be stubborn next year..

---------- Post added 25th April 2019 at 12:07 AM ---------- Previous post was 24th April 2019 at 11:28 PM ----------

I just noticed the AOSP Pie AOD notifications are actionable, there are normal buttons on AOD like mark as read or reply. That's best solution seen yet, you can do some little interaction with Samsung AOD but to set message read or navigate form AOD? And LED blinks on any apps you wish, in any style you set. That is cool. Hard to miss notification with vibration, sound, AOD and LED? AOSP FlokoRom, updates bi-weekly... RR is updated bi-monthly... so much for subject "ROMs - which one is which"...
[Xiaomi Mi 9 Questions & Answers] seemebreakthis:
To a total noob like me (I am even new to Android, this Mi 9 I just purchased is my very first Android phone :silly: ) it took me a while to figure out in order to start your 360-hour countdown you have to be a developer first and here is how to do it:

On your Mi 9, go to settings -> About Phone -> tap multiple times on the "MIUI version" item until the phone says "you are now a developer" or something along that line.

Then you go back to settings, this time under the "system and device" tab enter the "Additional Settings" -> "Developer Options" -> "Mi Unlock Status". Agree on all the disclaimers before you press the button to "Add Account And Device". Done. Now try to unlock using the MIFlash Unlock Tool on your PC and it will now tell you to wait for 360 hours.
[Xiaomi Mi 9 Questions & Answers] viper98:
Edit: never mind
[Xiaomi Mi 9 Questions & Answers] b0nebreaker:
I was thinking of getting the regular and car Qi chargers for my Mi 9, which ones would you recommend?
[Xiaomi Mi 9 Questions & Answers] andypa1:
all sounds great doggydog2. Is google pay working yet? and is it any easier to install for a noob like me?
[Xiaomi Mi 9 Questions & Answers] doggydog2:
fast chargers are only distributed in China, no local plugs, so for example:

https://www.aliexpress.com/item/Ori...g-Apply-to-Xiaomi-Mi9-MiX-2S/32979063042.html w/adapter

https://www.aliexpress.com/item/FLO...-S8-Note-9-Wireless-Charging/32905156727.html works great and holds by magnet, and doesn't block finger holder if you use it, install the magnet right under the camera LED

sorry i don't use such systems, i see it installed thou
[Xiaomi Mi 9 Questions & Answers] xephyris:
I'm currently in the middle of this too. Apparently, there's an extra check beyond just waiting for 360 hours which doggydog2 alludes to here:

I believe the workaround is using an older version of miflash_unlock: 2.3.803.10, it would be nice if someone could confirm this.
[Xiaomi Mi 9 Questions & Answers] maucorpat:
wich room to install

i not really understand which rom to install. EEA or global?

can i use twrp for install en.miui.com rom 10.2.9.0.PFAMIXM?

i am in spain and my current rom is 10.2.11.0 PFACNXM

or I can just install the xiaomi.eu room with TWRP?

I would like to use official room from en.miui.com
[Xiaomi Mi 9 Questions & Answers] Bn Waheed:
that's really useful thank you.
[Xiaomi Mi 9 Questions & Answers] Chrisgia:
Really useful, thank you. Just one thing : when you say " works well but can't be switched back to other kernel ", is this a joke meaning it's so good you won't go back or that you really can't reinstall the stock one afterwards ?

I also can't seem to find clear instructions on how to flash GSI roms on this device. Can someone help me out ? I'm still on latest global stable with unlocked BL. Thanks
[Xiaomi Mi 9 Questions & Answers] reg66:
Bit of an old post, I know! But just in case it helps others that are stuck on CN ROM until BL is unlocked, or perhaps they just don't feel confident enough to flash another ROM, there's a debloater tool here. At the bottom of OP, you can use it to debloat your CN ROM but more importantly, one of those apps is the Sync Daemon - which sends data to Xiaomi (nothing too bad there - all or most companies do it, but I like everything private). Remove that and privacy and peace of mind are restored!!
[Xiaomi Mi 9 Questions & Answers] doggydog2:
it's a fact, can't switch and others noticed too.

well maybe i will add a guide.. but roughly i'm using these steps.
[Xiaomi Mi 9 Questions & Answers] Pender666:
Just to add another bit of information on GSI ROMS. None of them supports Google pay because there is no option to select the secure element position, like changing from e-sim to have wallet.

The Bluetooth battery drain is a bug. You must turn the Bluetooth off before a reboot or you'll get a kernel wakelock and it will drain the battery.
[Amazfit] Anderson_F:
I bought my Stratos two moths ago and last week its suddenly started to have display problems. Its screen is blurred and foggy.

Look the images: ["https://drive.google.com/open?id=1M3fG5-ohRc4k-8MSe11i0vCcMKiCSrzS"]

I have done the Factory Reset, but the bug remains the same.

Does any knows this bug?

Thanks in advance.
[Fire General] BeauSmith:
Not exactly sure what I can do on it so far. Looks like install Google play store and Root, am I correct? No Roms yet?
[Fire General] DB126:
Correct and here (different forum): https://xdaforums.com/hd8-hd10
[LG V30 Questions & Answers] JonnyTrulove:
For those that sometimes use the reader option in Chrome, you may have already seen that the chrome app does a pretty good job of converting everything to a dark scheme. It does ditch the ads in that mode though so I'm guessing it's this that is incomplete on Google's end and why we don't have a working beta for dark/night mode yet.

While trying to get Chrome to force night or dark mode permanently I did come across an option for it, however I need someone with a little more Android code rules knowledge than myself to complete the task.

Basically, one of the lines in the Android Shared Preference file for Chrome is:

"night_mode_available" which is set to False.

I think if we can get this line switched to true and make it stick that way, "night mode" will work.

No matter what I do, the darn line of code continues to change back the second I open the app.

I have tried changing the file permissions, tried editing the file using code editors, text editors, apps, and still won't stick. Well it appears to stick until I open Chrome and then poof gone again.

If you're out there reading this a think you know how to change this line of code and make it stick then let's bring on the early Dark Chrome!

Attached is a shot of the line taken from the preferences manager app.

Thanks in advance for any help you may give, and of course if you figure it out, credit is all yours. I'm just hoping to work together to bring some more early dark modes to our phones.

Cheers
[LG V30 Questions & Answers] immns:
I think kiwi browser already has dark mode,... it is based on chrome (modded chrome i guess)
[LG V30 Questions & Answers] JonnyTrulove:
I'm going to look into that now and see what the manifest file looks like. Thanks for the tip!
[LG V30 Questions & Answers] TotallyAnxious:
Chrome beta and etc have it? It's just a flag.
[LG V30 Questions & Answers] JonnyTrulove:
Well that prob means it'll get pushed to Chrome next release, so I guess I can kill off this thread given that dark mode is definitely on it's way soon....

That's what I get for not checking the beta or dev or even Canary first lol.

Thanks [MENTION=615557]totta[/MENTION]llyAnxious for the info
[Huawei Mate 20 X Questions & Answers] Kurocham:
Help me I have a bootloader unlock code but now what?? I have EVR-AL00
[Huawei Mate 20 X Questions & Answers] gothikserpent:
Here you go : https://xdaforums.com/mate-20-x/how-to/huawei-mate-20x-bootloader-unlock-t3867882

I just unlocked mine and it was quite simple.
[Samsung Galaxy S10+ Questions & Answers] 10thDmenxn:
Just wondering why there is no rooting solution, or custom roms for this device yet? I have the unlocked S10+, and don't see much news or progress on a rooting solution. Is there a good source for news of this somewhere else? There are several things I'd like to do, but being able to put custom fonts on it would be a big help. I don't understand why Samsung is so against us putting whatever font we want on these devices.

Thanks for any help.
[Samsung Galaxy S10+ Questions & Answers] bp328i:
Wrong section
[Samsung Galaxy S10+ Questions & Answers] GreyFox777:
Next time don't buy a smartphone before root released...

It is a big question if root for s10 will be ever possible, because samsung made some changes to security :(