Jump to content

Turan Can

Members
  • Content Count

    63
  • Joined

  • Last visited

Everything posted by Turan Can

  1. I have "recv -1" data, I check this. so I see if there is data or not :). It's a nice method.
  2. Turan Can

    Android hdd serial number

    Hi, Windows hdd serial number function It works very successfully. Is there an example for Android? function GetHardDiskSerial(const DriveLetter: Char): string; var NotUsed, VolumeFlags, VolumeSerialNumber: DWORD; VolumeInfo: array [0 .. MAX_PATH] of Char; begin ZeroMemory(@VolumeInfo, SizeOf(VolumeInfo)); GetVolumeInformation(PChar(DriveLetter + ':\'), nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed, VolumeFlags, nil, 0); Result := Format('%8.8X', [VolumeSerialNumber]); end; "android.os.SystemProperties"
  3. Turan Can

    Android hdd serial number

    Thank you so much. It meets my need. I wonder. Android is ultimately held in memory. Doesn't this memory have a serial number? As far as I understand. if the user has root authority. it can change the imei numbers including androidid that you sent last. I need something like the unique identification key of the device or borad.
  4. Turan Can

    Android hdd serial number

    Hello Dave, Thanks for the example. However, this only takes external hdd cards.. Should I give my uses permission authorization? Is there a ready helper in Delphi android where we can get the class structure like this? https://developer.android.com/reference/android/os/storage/StorageManager c# xamarin public static String getSerialNumber() { String serialNumber; try { Class<?> c = Class.forName("android.os.SystemProperties"); Method get = c.getMethod("get", String.class); serialNumber = (String) get.invoke(c, "gsm.sn1"); if (serialNumber.equals("")) serialNumber = (String) get.invoke(c, "ril.serialnumber"); if (serialNumber.equals("")) serialNumber = (String) get.invoke(c, "ro.serialno"); if (serialNumber.equals("")) serialNumber = (String) get.invoke(c, "sys.serialnumber"); if (serialNumber.equals("")) serialNumber = Build.SERIAL; // If none of the methods above worked if (serialNumber.equals("")) serialNumber = null; } catch (Exception e) { e.printStackTrace(); serialNumber = null; } return serialNumber; }
  5. Hi, No one left here from the old great masters πŸ™‚ Windows is running smoothly. I think there is a very serious bug on Android. in trouble numbers. I did not see any problems in the alphabet, but I did not look at what the ascii is. Step to step output data 1 xor 0 > #1 2 xor 0 > #2 3 xor 0 > #3 4 xor 0 > #4 5 xor 0 > #5 6 xor 0 > #6 7 xor 0 > #7 //these two lines don't. instead "" gives it. 8 xor 0 > #1 -- 8>#10 why..... 9 xor 0 > #1 -- 9>'t' 1 xor 0 > #1 2 xor 0 > #2 3 xor 0 > #3 4 xor 0 > #4 5 xor 0 > #5 6 xor 0 > #6 7 xor 0 > #7 Sample code procedure TForm1.Button5Click(Sender: TObject); var I, Len: Integer; S, T, D, Buff: UTF8String; begin Len := 16; SetLength(S, Len); SetLength(T, Len); SetLength(D, Len); S := '1234567891234567'; T := '0000000000000000'; D := T; XORBuffers(S[1], T[1], Len, D[1]); // XORBuffers(S[0],T[0],Len,D[0]); end; procedure TForm1.XORBuffers(const Source1, Source2; Size: Integer; var Dest); var I: Integer; S, T,D:PByte; πŸ˜„Byte; Buff: Binary; begin S := PByte(@Source1); T := PByte(@Source2); D := PByte(@Dest); for I := 0 to Size - 1 do begin C := Byte(S xor T); D := Byte(C); end; SetString(Buff, PAnsiChar(@D[0]), Size); end;
  6. David, I care about what you write. Is there anything wrong with this simple code? Is it normal to see the output differently in Windows and android? //win32 debug ch #8,#9,#$A //Android debug ch #10,\t,#012 Remy, I know what you're saying. That's not the problem. procedure TForm1.Button10Click(Sender: TObject); const CTable: array [0 .. 2] of Byte = ($8, $9, $A); var Ch: Char; I: Integer; begin for I := 0 to High(CTable) do Ch := Char(CTable); //win32 debug ch #8,#9,#$A //Android debug ch #10,\t,#012 end;
  7. Dear David, Pls... What am I telling πŸ™‚ and what am I writing. Please do not write without testing the samples. This is not a help. We extend the subject in vain. Would you please make an example code?
  8. No, this is not a tstringlist issue. this is officially chartable difference. You will see the difference when each char 0..to bla bla binds to numeric or character. char (8) > 10 char (9) > t tab linux android This is a serious mistake. It affects thousands of delphi android users. Think a little. Your application on Android sends data to an application on windows. I'm not asking questions easily. I solve all my work myself. However, this made me drink "alcohol jack daniels oopss I put a reset on my brain." for exactly 1 week πŸ™‚ Delphi needs to urgently a patch. You will either tell the project settings that you want to use the charset table, or it should offer two different char set options for windows and android.
  9. Probably the person I gave the job will not be able to do it but he insisted he said. πŸ™‚ We will see it all together. Dear friends, I hope you have a good understanding of what I want. Look, this is such a big problem. Think a little, you will understand. Thanks for your nice words Dany, I try to give as much detail as I can. It seems that I will not be able to solve the problem here. I gave this problem as a "freelancer" as a job. 250$ πŸ™‚ https://www.freelancer.com/projects/delphi/Android-Project-for-Delphi/payments/
  10. Hi Kas, It is no different from the jeans sample I made. your sample test. I added 2 pictures windows and android. This problem is actually a charset table problem. Possibly differences in windows charset and linux android char sets. For this problem, Delphi had to come up with a solution. Example: At the start of the project, I started to think that there should be a setting like setwindows charset table. So what is the source of the problem why I need this πŸ™‚ I use AES 256 bit and the same data should be the same in andorid and linux. https://github.com/Turan-Can/Delphi-Encryption-Compendium
  11. Dear friends; First of all, thank you for your answers. There are two results in the picture. Is this true ? Do I need to use something different for the character table? I wrote a very simple code at the bottom. This will explain everything David and Atilla, this code will work Please run windows first and then android. Look into the list. I made it in the picture below. procedure TForm1.Button9Click(Sender: TObject); var Ch: Char; I: Integer; T: TStringList; begin T := TStringList.Create; for I := 0 to 300 - 1 do begin Ch := Char(I); T.Append(Ch); end; end;
  12. string xor win32 output #0#1#2#3#4#5#6#7#8#9#1#2#3#4#5#6 android output #001#002#003#004#005#006#007#010'\t'#001#002#003#004#005#006#007 function XorStr(Str1, Str2: String): String; var I: Integer; Ci:Char; begin for I := 0 to Length(Str1) - 1 do begin Ci := Char(Ord(Str1) xor Ord(Str2)); Result := Result + Ci; end; end; procedure TForm1.Button7Click(Sender: TObject); var I, Len: Integer; S, T, D, Buff: string; begin S := '1234567891234567'; T := '0000000000000000'; D := XorStr(S, T); end;
  13. Dear David heffernan; first of all thank you for your answer. This code has been working on windows for years. I listened to you, I made a different example, but andorid has the same problem. My request from you. Please, I would be very happy if you first tested and respond accordingly. If I have a mistake, can you make a simple example? Please test it. Thank you. #001#002#003#004#005#006#007#010'\t'#001#002#003#004#005#006#007 function XorUtf(Str1, Str2: UTF8String): UTF8String; var I: Integer; Ci:Char; begin for I := 0 to Length(Str1) - 1 do begin Ci := Char(Ord(Str1) xor Ord(Str2)); Result := Result + Ci; end; end; procedure TForm1.Button7Click(Sender: TObject); var I, Len: Integer; S, T, D, Buff: UTF8String; begin Len := 16; SetLength(S, Len); SetLength(T, Len); // SetLength(D, Len); S := '1234567891234567'; T := '0000000000000000'; D:=XorUtf(s,t); end;
Γ—