Freya – a beautifull tool for samsung flash with the best features

Standard

Freya

Freya is a beautifull .Net project for samsung flash Based on (https://github.com/Alephgsm/SharpOdinClient)

Freya is like odin for flash, Read info,repartition (Automatically) but with faster and best features

Feature

  • Read Pit
  • Repartition
  • Select the desired files from inside the package that you want to Flash on device.

Screenshot

Manually Select Files

In this method, you can select the files that you want to be flashed on the device. 

Auto find pit

After selecting the Tar file, Freya starts searching its contents to find the pit file, if can find , Freya can select pit package in the pit section. 

Fast Flash, Read info,Repartition

you can see your device information in flashing process also you can checked repartition option in freya 

Donate

theter TRC20 TXZ1KviFtRzEiumVD8UCH1W7etJ2vM9VsQ

SharpOdinClient – samsung devices flash library in C#

Standard

SharpOdinClient

SharpOdinClient is a .NET library that allows .NET applications to communicate with samsung android devices in download mode.

A suitable client for flash(image , tar.md5 , lz4), getting info and implementing other features.

It provides a .NET implementation of the odin protocol.

Requirements:

  • .NET Framework 4.5.1
  • Official Samsung usb driver

How does work?

USB communication in SharpOdinClient is serialport.

  1. install Official Samsung usb driver
  2. Connect your device in download mode

Namespaces

first add namespaces of SharpOdinClient on your project

using SharpOdinClient.structs;
using SharpOdinClient.util;

Subscribe for events

        public MainWindow()
        {
            InitializeComponent();

            Odin.Log += Odin_Log;
            Odin.ProgressChanged += Odin_ProgressChanged;
        }

        private void Odin_ProgressChanged(string filename, long max, long value, long WritenSize)
        {
        }

        private void Odin_Log(string Text, SharpOdinClient.util.utils.MsgType Color)
        {
        }

Find Automatically samsung devices in download mode

        {
            //Find Auto odin device
            var device = await Odin.FindDownloadModePort();
            //device name
            Console.WriteLine(device.Name);

            // COM Port Of device 
            Console.WriteLine(device.COM);

            // VID and PID Of Device
            Console.WriteLine(device.VID);
            Console.WriteLine(device.PID);
        }

Read Info from device

        {
            if(await Odin.FindAndSetDownloadMode())
            {
                //get info from device
                var info = await Odin.DVIF();
                await Odin.PrintInfo();
            }
        }

in info variable we get dictionary of string , string The concept of some ‘keys’

  • capa = Capa Number
  • product = Product Id
  • model = Model Number
  • fwver = Firmware Version
  • vendor = vendor
  • sales = Sales Code
  • ver = Build Number
  • did = did Number
  • un = Unique Id
  • tmu_temp = Tmu Number
  • prov = Provision

Read Pit from device

        {
            if(await Odin.FindAndSetDownloadMode())
            {
                await Odin.PrintInfo();
                if (await Odin.IsOdin())
                {
                    if(await Odin.LOKE_Initialize(0))
                    {
                        var Pit = await Odin.Read_Pit();
                        if (Pit.Result)
                        {
                            var buffer = Pit.data;
                            var entry = Pit.Pit;
                        }
                    }
                }
            }
        }

for doing any action in download mode , need first to check IsOdin and Run LOKE_Initialize argument, if you do not want to write anything on device set LOKE_Initialize totalfilesize parameter to zero(0)

buffer = is byte array of pit from device , you can write this buffer on file for saving pit entry = is list of partition information of your device

Write Pit On Device

  /// <summary>
        /// write pit file on your device
        /// </summary>
        /// <param name="pit">in this parameter, you can set tar.md5 contains have pit file(Like csc package of firmware)
        /// or pit file with .pit format
        /// </param>
        /// <returns>true if success</returns>
        public async Task<bool> Write_Pit(string pit)
        {
            if (await Odin.FindAndSetDownloadMode())
            {
                await Odin.PrintInfo();
                if (await Odin.IsOdin())
                {
                    if (await Odin.LOKE_Initialize(0))
                    {
                        var Pit = await Odin.Write_Pit(pit);
                        return Pit.status;
                    }
                }
            }
            return false;
        }
  • pit parameter = if you want to write pit from tar or tar.md5(Like CSC) file on device you can set your tar type file path , also you can set your pit single file with .pit format file

Flash List Of tar.md5 package on device

        /// Add List Of Your tar package (bl,ap,cp,csc , or more)
        /// </summary>
        /// <param name="ListOfTarFile">add tar type files path in this list</param>
        /// <returns></returns>
        public async Task<bool> FlashFirmware(List<string> ListOfTarFile)
        {
            var FlashFile = new List<FileFlash>();
            foreach(var i in ListOfTarFile)
            {
                var item = Odin.tar.TarInformation(i);
                if(item.Count > 0)
                {
                    foreach (var Tiem in item)
                    {
                        if (!Exist(Tiem , FlashFile))
                        {
                            var Extension = System.IO.Path.GetExtension(Tiem.Filename);
                            var file = new FileFlash
                            {
                                Enable = true,
                                FileName = Tiem.Filename,
                                FilePath = i
                            };

                            if (Extension == ".pit")
                            {
                                //File Contains have pit
                            }
                            else if (Extension == ".lz4")
                            {
                                file.RawSize = Odin.CalculateLz4SizeFromTar(i, Tiem.Filename);
                            }
                            else
                            {
                                file.RawSize = Tiem.Filesize;
                            }
                            FlashFile.Add(file);
                        }
                    }
                }
               
            }

            if(FlashFile.Count > 0)
            {
                var Size = 0L;
                foreach (var item in FlashFile)
                {
                    Size += item.RawSize;
                }
                if (await Odin.FindAndSetDownloadMode())
                {
                    await Odin.PrintInfo();
                    if (await Odin.IsOdin())
                    {
                        if (await Odin.LOKE_Initialize(Size))
                        {
                            var findPit = FlashFile.Find(x => x.FileName.ToLower().EndsWith(".pit"));
                            if(findPit != null)
                            {
                                var res = MessageBox.Show("Pit Finded on your tar package , you want to repartition?", "", MessageBoxButton.YesNo);
                                if (res == MessageBoxResult.Yes)
                                {
                                    var Pit = await Odin.Write_Pit(findPit.FilePath);

                                }
                            }
                          
                            var ReadPit = await Odin.Read_Pit();
                            if (ReadPit.Result)
                            {
                                var EfsClearInt = 0;
                                var BootUpdateInt = 1;
                                if (await Odin.FlashFirmware(FlashFile, ReadPit.Pit, EfsClearInt, BootUpdateInt, true))
                                {
                                    if (await Odin.PDAToNormal())
                                    {
                                        return true;
                                    }
                                }
                            }
                        }
                    }
                }
            }


            return false;
        }

for flashing tar,tar.md5 contains files(lz4 , image, bin and more …) we need to create list of FileFlash from you tar package information.

Enable property in FileFlash is bool if you set this propery to false, SharpOdinClient does not Flash on the phone.

in FlashFirmware function , SharpOdinClient can write lz4 from contains of your tar package

Flash Single File

You can Flash your single file like boot.img or more files on partitions

        /// <summary>
        /// Flash Single File lz4 , image
        /// </summary>
        /// <param name="FilePath">path of your file</param>
        /// <param name="PartitionFileName">like boot.img , sboot.bin or more ...</param>
        /// <returns></returns>
        public async Task<bool> FlashSingleFile(string FilePath , string PartitionFileName)
        {
            var FlashFile = new FileFlash
            {
                Enable = true,
                FileName = PartitionFileName,
                FilePath = FilePath,
                RawSize = new FileInfo(FilePath).Length
            };

            if (await Odin.FindAndSetDownloadMode())
            {
                await Odin.PrintInfo();
                if (await Odin.IsOdin())
                {
                    if (await Odin.LOKE_Initialize(FlashFile.RawSize))
                    {
                        var ReadPit = await Odin.Read_Pit();
                        if (ReadPit.Result)
                        {
                            var EfsClearInt = 0;
                            var BootUpdateInt = 0;
                            if (await Odin.FlashSingleFile(FlashFile, ReadPit.Pit, EfsClearInt, BootUpdateInt, true))
                            {
                                if (await Odin.PDAToNormal())
                                {
                                    return true;
                                }
                            }
                        }
                    }
                }
            }


            return false;
        }

donate

theter TRC20 TXZ1KviFtRzEiumVD8UCH1W7etJ2vM9VsQ

samsung device download mode to brom and brom to normal algorithm

Standard

 switch your Samsung phone(mediatek chipset) from download mode to bootrom mode  !!

Also switch from bootrom mode to normal mode.

With this project, you will be able to switch any Samsung phone that has a mediatek processor from download mode to brom mode.

Well, you know about brom, right? Brom mode is present on all MediaTek processors, but depends on the device brand.
Samsung does not normally allow access to brom mode, and you need to Remove back Cover and  short test point .
Well, a lot of people might not like the Remove back Cover of the phone and the screws on their phone, we have a special solution for that.

so with our algorithm , you can switch download mode to brom , after doing anythink on your device , you can switch brom to normal mode.

This algorithm does not write static packet or binary . And performs calculations based on the data it receives from the device.

In this way, you can do bypass frp, imei repair, network unlock and anything that can be done in bootrom mode without the need for a point test.

This means that you connect the phone in download mode and you can perform your desired operations and return the phone to its normal state.

————————————-

If you have a special order, you can share it with us.

contact us for buy this source code

https://t.me/GsmCoder

samsung download mode service protocol source code

Standard

About Source code

samsung devices have download mode boot

this source code is fully native ,not using api and more …

Lasted updated :

  • + 2021/12/19

Written programming language:

  • c#
  • vb.net
  • The requested language is accepted.

supported and tested models:

  • Up to last models

functions :

  • Read full information in download mode like storage type , build number and more …
  • repartition (with pit file)
  • read partitions (pit map)
  • check is odin mode
  • parsing partition table information (pit)
  • reboot from download mode to normal
  • Flash single file
  • flash manually files from tar (advanced) You can specify which file to write from within tar (it does not matter if it is lz4 or normal type)
  • flash multiple tar file
  • supported lz4 compressed

contact us for buy this source code

https://t.me/GsmCoder