Skip to content

Commit

Permalink
V31
Browse files Browse the repository at this point in the history
  • Loading branch information
werasik2aa committed Jan 21, 2024
1 parent 0159e01 commit 0dc73da
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 27 deletions.
12 changes: 7 additions & 5 deletions HuaweiUnlock/English.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ SelPathToFGB,Select Path To Firmware:
SelPathToGPTXML,Select path for save rawprogram0.xml:
SelPathToGPT,Select path to gpt.bin:
UnlockBTN,Unlock FRP
DdBtn,Download BootLoader And Unlock
DdBtnE,Unlock Dev
DdBtn,Download BootLoader And Unlock [factory BL]
DdBtnE,Unlock Dev [factory BL]
FlBtn,Flash Firmware
UnpBtn,Extract Firmware
FlashUnpBtn,Extract and Flash
Expand Down Expand Up @@ -145,11 +145,13 @@ WarnUnl,Unlocked kernel for this device not compiled or not used. Your device ma
HISIGPTtagSimpl,[HISI] Partitions
HISISelectCpu,Select CPU
HISIInitFB,Write Factory Bootloader
HISIWriteKirinBL,Read/Write Unlock KEY of Device
HISIWriteKirinBL,Write Unlock KEY to Device
HISIWriteKirinBLD,Download Factory bootloader & Read Info
HISIWriteKirinBLD2,Download Factory bootloader & boot to Fastboot
HISIInfoS,*** FBLOCK is locked! ***\nIn this FBLOCK State Not Allowed To do this
HISINewKey,[FASTBOOT] New USERLOCK key:
HISIOldKey,[FASTBOOT] Old USERLOCK code:
HISIOldKey,[FASTBOOT] Readed USERLOCK code:
HISINewKeyErr,[Fastboot] Error while Writting/Reading Unlock code
HISIVerifyHash,Verifying images...
HISIVerifyHash,Verifying images...
HISITryULTag,Unlock WARN. Can be bootloop.
HISITryUnlock,It will flash factory BootLoader as main loader. If factory bootloader shows the blackscreen, press NO! Otherwise you will get device with blackscreen. Your device may bootup only with blackscreen!
2 changes: 1 addition & 1 deletion HuaweiUnlock/LangProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace HuaweiUnlocker
{
public static class LangProc
{
public const string APP_VERSION = "30F";
public const string APP_VERSION = "31F";
public static TextBox LOGGBOX;
public static string log, loge, newline = Environment.NewLine, PrevFolder = "c:\\";
private static StreamWriter se = new StreamWriter("log.txt");
Expand Down
14 changes: 8 additions & 6 deletions HuaweiUnlock/Russian.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ SelPathToFGB,Выберите путь к прошивке:
SelPathToGPTXML,Выберите путь для сохранения файла rawprogram0.xml:
SelPathToGPT,Выберите путь к gpt.bin:
UnlockBTN,Разблокировать FRP
DdBtn,Загрузить загрузчик и разблокировать
DdBtnE,Разблокировать устройство
DdBtn,Загрузить загрузчик и разблокировать [factory BL]
DdBtnE,Разблокировать устройство [factory BL]
FlBtn,Прошить прошивку
UnpBtn,Распаковать прошивку
FlashUnpBtn,Распаковать и прошить
Expand Down Expand Up @@ -144,12 +144,14 @@ WarnUnl,Разблокированное ядро для этого устрой
[HISI]
HISIGPTtagSimpl,[HISI] Разделы
HISISelectCpu,Выберите процессор
HISIInitFB,Запись разблокированного загрузчика
HISIWriteKirinBL,Чтение/запись ключа разблокировки устройства
HISIInitFB,Записать ключ разблокировки устройства
HISIWriteKirinBL,Записать ключа разблокировки устройства
HISIWriteKirinBLD,Загрузить заводской загрузчик и прочитать информацию
HISIWriteKirinBLD2,Загрузить заводской загрузчик и войти в Fastboot
HISIInfoS,*** FBLOCK заблокирован! ***/nВ этом состоянии FBLOCK ничего не сделать
HISINewKey,[FASTBOOT] Новый ключ USERLOCK:
HISIOldKey,[FASTBOOT] Старый код USERLOCK:
HISIOldKey,[FASTBOOT] Считанный код USERLOCK:
HISINewKeyErr,[Fastboot] Ошибка при записи/считывании кода разблокировки
HISIVerifyHash, Проверка изображений...[HISI]
HISIVerifyHash, Проверка изображений...[HISI]
HISI TryULTag, разблокируйте WARN. Может быть бутлуп.
HISITryUnlock, заводской загрузчик будет прошит в качестве основного загрузчика. Если заводской загрузчик показывает черный экран - нажмите НЕТ! В противном случае вы получите устройство с черным экраном. Ваше устройство может загружаться только с черным экраном!
6 changes: 6 additions & 0 deletions HuaweiUnlock/TOOLS/Fastboot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ public bool UploadData(string path, string partname)
}
}
}
else
{
stream.Close();
stream.Dispose();
return false;
}
stream.Close();
stream.Dispose();
return true;
Expand Down
14 changes: 5 additions & 9 deletions HuaweiUnlock/TOOLS/HISI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -65,13 +66,12 @@ public static void FlashBootloader(Bootloader bootloader, string port)
public static bool ReadInfo()
{
if (!IsDeviceConnected(5)) {
LOG(1, "NoDEVICEAnsw", " [HISI] Maybe hisi Loaders Wont boot"); return false;
LOG(1, "NoDEVICEAnsw", " [HISI] Maybe fastboot drivers not installed"); return false;
} //if timeout and no device
GetASerial();
GetModelProduct();
GetModelBSN();
GetBuildID();
ReadAllMethods();
return GetFBLockState();
}
public static string GetASerial()
Expand Down Expand Up @@ -292,15 +292,11 @@ public static void StartUnlockPRCS(bool frp, bool rb, string key, Bootloader d,
if (debug) LOG(2, ex.StackTrace);
}
}
public static bool TryUnlock(string key)
public static bool TryUnlock(string cpupth)
{
if (!IsDeviceConnected()) return false;
if (fb.Command("oem unlock " + key.Trim()).Status == Fastboot.FastbootStatus.Ok)
return true;
else if (fb.Command("oem sec_unlock " + key.Trim()).Status == Fastboot.FastbootStatus.Ok)
return true;
else if (fb.Command("oem unlock-go " + key.Trim()).Status == Fastboot.FastbootStatus.Ok)
return true;
if (!fb.UploadData(cpupth, "fastboot"))
LOG(2, "Unknown", "[NC] MAYBE YOUR DEVICE DOESN'T ACCEPT THAT FASTBOOT.IMG!");
return false;
}
public static string GetPartitionList()
Expand Down
19 changes: 13 additions & 6 deletions HuaweiUnlock/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,11 @@ private void UNLOCKHISI_Click(object sender, EventArgs e)
if (BLkeyHI.Text.Length == 16)
{
ConnectKirin();
LOG(-1, "=============UNLOCKER BL/FRP (KIRIN TESTPOINT)=============");
if(DeviceInfo.loadedhose)
{
LOG(-1, "=============UNLOCKER BL/FRP (KIRIN TESTPOINT)=============");
BLKEYTXT.Text = HISI.WriteKEY(BLkeyHI.Text.ToUpper());
HISI.ReadAllMethods();
if (RbCheck.Checked) HISI.Reboot();
HISI.Disconnect();
}
Expand Down Expand Up @@ -979,7 +980,7 @@ private async void ConnectKirin()
await CurTask;
}
}
DeviceInfo.loadedhose = HISI.IsDeviceConnected(3);
DeviceInfo.loadedhose = !isVCOM.Checked || DeviceInfo.Port.ComName != "NaN" ? HISI.IsDeviceConnected(3) : false;
if (DeviceInfo.loadedhose)
{
LOG(0, "[Fastboot] ", "CheckCon");
Expand Down Expand Up @@ -1099,10 +1100,16 @@ private void ErasePA2_Click(object sender, EventArgs e)
private void TryUNLHisiFBBtn_Click(object sender, EventArgs e)
{
Tab.Enabled = false;
ConnectKirin();
if (DeviceInfo.loadedhose)
HISI.TryUnlock(HISI.ReadFactoryKey().Trim());
else LOG(2, isVCOM.Checked ? "[Huawei USB COM 1.0] " : "[FASTBOOT] ", "DeviceNotCon");
DialogResult dialogResult = MessageBox.Show(Language.Get("HISITryUnlock"), Language.Get("HISITryULTag"), MessageBoxButtons.YesNo);
if (dialogResult != DialogResult.Yes) return;
if (!DeviceInfo.loadedhose)
{
LOG(2, isVCOM.Checked ? "[Huawei USB COM 1.0] " : "[FASTBOOT] ", "DeviceNotCon");
return;
}
var file = "UnlockFiles\\" + device + "\\fastboot.img";
if (File.Exists(file))
HISI.TryUnlock(file);
Tab.Enabled = true;
LOG(0, "Done", DateTime.Now);
}
Expand Down

0 comments on commit 0dc73da

Please sign in to comment.