Protecting Against Piracy Of Raspberry Pi Apps???

[quote=238108:@James Redway]Hi Mike,

I tried it on the Pi2 and I get all zeros. No correct serial number.[/quote]
Can you post me your /proc/cpuinfo file contents please?

Thanks

processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 1
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 2
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

processor : 3
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

Hardware : BCM2709
Revision : a21041
Serial : 000000003a2399f4

James I just fired up my Pi2 that was in the box. I am recreating what you are seeing. I will keep at it since I also have a vested interest in this.

Thank you :slight_smile:

Thank you Mike.

I appreciate it.

I am loading up with debuglog messages. Initially it appears that we have an issue with the TIS. Ill let you know what i find.

It appears that the folderitem is good (exists = true, readable = true, path name: /proc/cpuinfo)
The textinput read returns no value so I am going to try a shell to do a simple cat on that file to see if I can yield the results of the folderitem.

James,

Success. The issue was with the TextInputStream as it wasn’t pulling the folderitem properly. I switched over to a shell to use the folderitem and parse the results. Works for me here on my Pi, but please let me know?

Thanks!

https://www.dropbox.com/s/imhuihxryd8de9r/Pi2SerialTest.xojo_binary_project?dl=0

This version provides the CPU Serial number and Hardware type.

[quote=238046:@James Redway]Hi Norman,

I know you do not have a Pi in which to test that code on. I understood that, and I appreciate you taking the time to help.

I think that Xojo deciding to support this little Raspberry Pi computer is a great thing and it opens up lots of potential for producing apps from a commercial point of view.

The problem IS, that the OS and the app is installed on the SAME SD card. One can easily copy the contents of a SD card. It was my intention to sell both the Pi unit and the app preinstalled on the card as one package. However, there would be nothing to prevent someone from simply copying the SD card and distributing my app.
[/quote]

If you sell it all as one glue the SD card in place
Done !

[quote=238099:@James Redway]Mike, you can’t really do that since you run the debugger is running on a Mac and the app is suppose to be run on the Pi.
[/quote]
create a tiny console app with JUST the code I posted
insert system.debuglog calls after EVERY LINE so you can track what is going on
compile the console app
put it on the pi
run it from the command line

[quote=238136:@Norman Palardy]If you sell it all as one glue the SD card in place
Done ![/quote]

Or something like this.

http://store.mobileappsystems.com/100052

[quote=238137:@Norman Palardy]create a tiny console app with JUST the code I posted
insert system.debuglog calls after EVERY LINE so you can track what is going on
compile the console app
put it on the pi
run it from the command line[/quote]

Yes (Thankyou:) ) I figured that out :slight_smile: Using your post above about using the debuglog thats how I solved the issue or found that textinputstream wasn’t working. I had to break my pi2 out though :slight_smile:

Re-post to working project example:
https://www.dropbox.com/sh/cm427dppf80p800/AABYi6Y6dHzzTtlpXEFM4sv4a?dl=0

[quote=238138:@Mike Cotrone]Or something like this.
http://store.mobileappsystems.com/100052[/quote]

Heh … tamper resistant screws - HAH
Apple used to to assembled to old lampshade iMacs - those took about 5 seconds to get out :slight_smile:
IF you do something like this case then use the tamper proofs screws and some really good glue so they shear IF someone tries to open it
Or rivet it closed
Welding doesn’t work since it kind fries the board inside

Basically you need / want a case that IF someone tries to open it they bust everything inside
Worked for a company that did such a design and IF you tampered with the case it basically destroyed the machine inside

Always fun when you get one of those & the person says “No I didn’t do anything” and yet the insides are totally broken :stuck_out_tongue:

[quote=238144:@Norman Palardy]Heh … tamper resistant screws - HAH
Apple used to to assembled to old lampshade iMacs - those took about 5 seconds to get out :slight_smile:
IF you do something like this case then use the tamper proofs screws and some really good glue so they shear IF someone tries to open it
Or rivet it closed
Welding doesn’t work since it kind fries the board inside

Basically you need / want a case that IF someone tries to open it they bust everything inside
Worked for a company that did such a design and IF you tampered with the case it basically destroyed the machine inside

Always fun when you get one of those & the person says “No I didn’t do anything” and yet the insides are totally broken :P[/quote]

We have been thinking of using that case or one similar and then using tamper-proof seals that we are having made. This should also protect the unit from normal curiosity issues. If they break the tamper-seal then they void their support warranty. :wink:

someone needs to buy @Norman Palardy a PI…

I already have a name for it - “Paper Weight” :stuck_out_tongue:

call it what you want… but then you can test all your knowledge that you are sharing on the PI…

PaperWeight.NormsHouse.com

:slight_smile:

It’d be fun to tinker with

At some point I’ll need to have one so I can work on the debugger & remote stub & all those things but there are a few bits that have to happen in the compiler & linker before we’re ready for me to poke at those

Right now remote debugging and debugging literally CAN’T work
But we’re working on that :slight_smile:

Hi Mike,

That worked perfectly!!! Thanks so much for all your help. That is just what I was looking for. Tanner’s code above also works really well when you change the command line tail -1 /proc/cpuinfo. That gives you the last line.

Mike’s code trims it down to just the serial number which is all you need to capture.

As tempting as Norman’s idea is to glue in the SD Card, I think that Mike’s code for reading the serial number may be a better solution.

To me, if your app can’t be protected from piracy, it makes little sense to spend the time to develop for Raspberry Pi unless of course you are making something that is hardware oriented, in which the hardware is the made product.

But, if your app is information-driven and it has value that others wan and willing to steal, you will be opening yourself up for piracy.

By capturing the CPU serial number you have at lease one element that makes the Pi unique. You can then save that serial number to the SD Card in an encrypted database, and if the SD card is removed and placed into another Pi, the software will no longer work. I think this has value for those who want to use Xojo to develop for the Pi.

The Raspberry Pi is a very cool idea and has the potential for multiple applications as far as one’s imagination can go.

Thanks to all who helped me. I really appreciate the help!

@Norman Palardy :
something simple that could be included in the System class ? not only for the Pi in fact.

It’s a stocking stuffer. Evidently Normans sock was occupied with a combustible sedimentary rock.