This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-04-30 16:31:16

ScratchSucks
Scratcher
Registered: 2008-04-30
Posts: 5

I Suggest you Obfuscate ScratchApplet.jar

(this isnt anything serious, [deleted by Admin])

ScratchApplet.class > ScratchApplet.java

Code:

import java.net.URL;
import javax.swing.JApplet;

public class ScratchApplet extends JApplet
{

    public ScratchApplet()
    {
    }

    public static void setSensorValue(int i, int j)
    {
        if(i < 0 || i > 15)
        {
            return;
        } else
        {
            PlayerPrims.sensorValues[i] = j;
            return;
        }
    }

    public static int getSensorValue(int i)
    {
        if(i < 0 || i > 15)
            return 0;
        else
            return PlayerPrims.sensorValues[i];
    }

    public void init()
    {
        String s = getCodeBase().toString();
        String s1 = getParameter("project");
        String s2;
        s2 = s1 == null ? null : (s2 = s + s1);
        String s3 = getParameter("autostart");
        boolean flag = true;
        if(s3 != null)
        {
            if(s3.equalsIgnoreCase("false"))
                flag = false;
            if(s3.equalsIgnoreCase("no"))
                flag = false;
        }
        try
        {
            Thread.sleep(50L);
        }
        catch(InterruptedException interruptedexception) { }
        lc = PlayerPrims.startup(s, s2, getContentPane(), flag);
        lc.tyo = System.out;
    }

    public void destroy()
    {
        PlayerPrims.shutdown(lc);
    }

    LContext lc;
}

Also in the Logo class, you have an English mistake:

Code:

error("You don't say what to do with " + prs(obj), lcontext);

should be

Code:

error("You didn't say what to do with " + prs(obj), lcontext);

Last edited by ScratchSucks (2008-04-30 16:33:49)

Offline

 

Board footer