With B4ppc and a Windows Mobile Device I use the following procedure:
First, I read the Device ID:
c$ = Hardware.GetDeviceID
I modify the ID:
c$ = StrRemove(c$,6,StrLength(c$)-6) 'I use the first 8 characters
I transform the ID from Hex to Dec:
Codice = n.HexToDec (c$) ' I transform from Hex to Dec
I assign the Password value (using “ k ” and “ m ”) and I transform it from Dec to Hex:
Password = n.DecToHex(Int((Codice / k ) + m ))
With a Text Edit ( Notepad.exe) I create the Pwd.txt file and I write the Password in the first line ...
I distribute my Windows Mobile application with the Pwd.txt file ( in the same directory )
When my programm starts, it searchs for Pwd.txt file ...
and reads the “ Rpwd “ string ...
FileOpen (c1,"Pwd.txt",cRead,,cASCII)
Rpwd = FileRead (c1)
FileClose (c1)
If the Rpwd value is equal to Password value , my Apk works normally
Otherwise my Apk stops :
If Rpwd <> Password Then
Msgbox ( “Please send this code : “ & Codice & “ to ........... and you will have your Password “) ‘Apk stops
Else
DatiInput.Show ‘ Apk starts
End If
Now, my questions are :
How can I follow the above procedure but with B4Android ?
Is it possible to read the Device ID ?
How can I create a file in the Android Device root ?
I would like to distribute my Android Apk and after that I will send the “Pwd.txt” file containing the correct Password for any device ...
Have you any suggestions for me?
Thanks
Gottrik
First, I read the Device ID:
c$ = Hardware.GetDeviceID
I modify the ID:
c$ = StrRemove(c$,6,StrLength(c$)-6) 'I use the first 8 characters
I transform the ID from Hex to Dec:
Codice = n.HexToDec (c$) ' I transform from Hex to Dec
I assign the Password value (using “ k ” and “ m ”) and I transform it from Dec to Hex:
Password = n.DecToHex(Int((Codice / k ) + m ))
With a Text Edit ( Notepad.exe) I create the Pwd.txt file and I write the Password in the first line ...
I distribute my Windows Mobile application with the Pwd.txt file ( in the same directory )
When my programm starts, it searchs for Pwd.txt file ...
and reads the “ Rpwd “ string ...
FileOpen (c1,"Pwd.txt",cRead,,cASCII)
Rpwd = FileRead (c1)
FileClose (c1)
If the Rpwd value is equal to Password value , my Apk works normally
Otherwise my Apk stops :
If Rpwd <> Password Then
Msgbox ( “Please send this code : “ & Codice & “ to ........... and you will have your Password “) ‘Apk stops
Else
DatiInput.Show ‘ Apk starts
End If
Now, my questions are :
How can I follow the above procedure but with B4Android ?
Is it possible to read the Device ID ?
How can I create a file in the Android Device root ?
I would like to distribute my Android Apk and after that I will send the “Pwd.txt” file containing the correct Password for any device ...
Have you any suggestions for me?
Thanks
Gottrik