How to protect protected classes?

I�m Brazilian, and I am learning English language yet. I�ll try to describe my problem.
I am using protected and friendly classes, but it doesn�t avoid anyone to use them, because if someone knows the package name of my protected class, this person can create a class with the same name of the package, and my protected and friendly classes are now unprotected! Anyone can instantiate my classes in this way.
Did anyone go through this situation? Is there solution for it?
Thank you so much!

There is a solution. I created the same post in Programming section of this forum, that is more apropriate, and there a user called Shag-VT posted a solution.
The way to ensure that nobody is getting into your classes is to "seal" the >package in the manifest and then sign the jar with a digital signature.
The followng like contains a discussion of how to add a digital signature to the >jar (it's just the general documentation for a jar file):
http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html
It also has a link to another file, which shows how to seal the package. For >convenience, here is the link:
http://java.sun.com/j2se/1.4.2/docs/guide/extensions/spec.html#sealing

Similar Messages

  • How to use protected method of a class in application

    Hi,
      will u please tell me how to use protected method of class in application. (class:cl_gui_textcontrol, method:limit_text)
    Thanks in advance,
    Praba.

    Hi Prabha,
    You can set the maximum number of characters in a textedit control in the CREATE OBJECT statement itself.
    Just see the first parameter in the method . I mean MAX_NUMBER_CHARS. Just set that value to the required number.
    Eg:
    data: edit type ref to CL_GUI_TEXTEDIT.
    create object edit
      exporting
        MAX_NUMBER_CHARS       = 10
       STYLE                  = 0
       WORDWRAP_MODE          = WORDWRAP_AT_WINDOWBORDER
       WORDWRAP_POSITION      = -1
       WORDWRAP_TO_LINEBREAK_MODE = FALSE
       FILEDROP_MODE          = DROPFILE_EVENT_OFF
        parent                 = OBJ_CUSTOM_CONTAINER
       LIFETIME               =
       NAME                   =
      EXCEPTIONS
        ERROR_CNTL_CREATE      = 1
        ERROR_CNTL_INIT        = 2
        ERROR_CNTL_LINK        = 3
        ERROR_DP_CREATE        = 4
        GUI_TYPE_NOT_SUPPORTED = 5
        others                 = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    In this case, the max: number of characters will be set to 10.
    I hope your query is solved.
    Regards,
    SP.

  • How to protect the class files inside jar file.

    Hi Group,
    pls help me.
    my need is i created a executable jar file with certain classes.
    and i'm supposed to send it to my client.
    but if the client needs he can extract the class files from the jar and with the
    help of some decompilers he can convert class file to .java source code and read the whole
    stuff.
    how can i protect my jar file from these.
    is there any security mechanism for that
    pls help me.
    Regards,
    Ranjith.M

    In order to protect my jar file I tried the jar signer technology but it only protects the jar from modification so I need to know how to protect jar file from decoding of the contents inside.

  • How can I protect my classes from de-compilers?

    Is there a way to protect my *.class files from de-compilers such as "decafe pro"????
    is there somewhere a good code-obfuscator?

    Why would you want to?
    Obfuscators won't do anything other than slow down those who want to decompile your class. And annoy them. And make debugging difficult.
    Perhaps you should re-evaluate your reasons, and if you still think you have a good reasons, then use some language other than Java. I would certainly never want to work with your code, even though I've never decompiled a class except to see how it is done.
    If you still want to prevent decompiling, write all of your code in JNI. Sure, it's not portable, but what difference would that make.

  • How to use protected method in jsp code

    Could anyone tell me how to use protected method in jsp code ...
    I declare a Calendar class , and I want to use the isTimeSet method ,
    But if I write the code as follows ..
    ========================================================
    <%
    Calendar create_date = Calendar.getInstance();
    if (create_date.isTimeSet) System.out.println("true");
    %>
    ============================================================
    when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

    The only way to access a protected variable is to subclass.
    MyCalendar extends Calendar
    but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
    cal.isSet( Calendar.HOUR );

  • How to get protected fields

    Hello,
    I don't know how to get protected fields that a class inherits from its superclass through reflexion ... the getDeclaredFields method seems not working ...
    here is my test program:
    import java.io.File;
    import java.lang.reflect.Field;
    public class Test {
         public static void main(String[] args) {
              Field [] fieldList = SubClass.class.getDeclaredFields();
              for (Field field: fieldList) {
                   field.setAccessible(true);
                   System.out.println (field.getName());
         static class SuperClass {
              protected File file;
              public SuperClass () {
                   file = new File ("a.txt");
         static class SubClass {
              private File myfile;
              public SubClass () {
                   myfile = new File ("b.txt");
    The output is
    myfile
    This means, the getDeclaredField method of the SubClass returns only fields declared by this class, not protected fields declared by its superclass.
    Anyone has an idea to fix the problem, please help me. Thank you a lot
    }

    That's not a problem, the documentation specifically says that getDeclaredFields() only returns fields from this class. If you want fields from the superclass, why not just getSuperclass().getDeclaredFields()?

  • How to use Protected event CLICK_ROW_COL  of  cl_gui_alv_grid.

    I've  worked with Double_click,Hotspot_click events of Cl_gui_alv grid class quite comfortable as they are Public.
    But i'm unable to work with click_row_col..
    Could u tell me how to use protected event click_row_col..

    Hi Ilayarajaramana 
    Did you try to build up a subclass of cl_gui_alv_grid and access the protected events via the subclass?
    You could e.g. throw an own public event every time the click_row_col event is risen.
    I know this isn't the best way, but it should work.
    Kind Regards,
    Sebastian

  • How can I protect my data in numbers from unintentional user of my iPad by other family members? In other words, how can I password protect my numbers and other apps from apple computer company?

    I have other members of my family use my iPad for educational/recreational use, young children who may want to play kid games. I don't want them to accdently get into my data stored in the three business apps from apple. I would like to password protect these files.
    I would also like to log out of the email systems that I use, so some one else can use this device to access their own emails. By leaving my accounts open al the time, is really asking for trouble from a host of sources.
    I can't believe that the iPad is not designed to protect the privacy and data from prying eyes ... Un intuitional as it may be.
    Please fix this issue so I create my info on this device and enjoy it fully. Or tell me how I can protect my data.
    Thnax.

    Thanx for your response. Any data stored anywhere should be able to be protected from stealing, malicious destruction or unintentional destruction. Theo ad an be stolen and without any kind ofpassword protection, the thief could get into your sensitive data.
    If Apple wants iPad to become a business tool that can be used with ideas, thots, data protected, then Apple needs to provide this protection to it's customers. Now it's unto the users to use it or not.
    I know iPad is being considered to be used by doctors, and can u imagine the confidentiality requirements of HIPPA rules... It will make this device not usable without data protection. I am sureweall have heard about hacking going on at all levels. It's surprising that this device's software is left unprotected.
    My iPad may be sitting on my desk and my 3 year old grand daughter would pick it up and start "playing" with it. That means I can't store anything on this machine that may possibly be changed.
    I have discussed this with specialists in apple stores, and those who have been around info technology understand my concerns and they may forward this request further up. They do not have the answer for it..... So far.
    I think data security should be everyone's concern... Be it a one person device or multiple user device.
    I hope that some responsible people at Apple would read this and provide the protection that will make this device lot more acceptable in the business world.

  • I have a document that in Word required a password to open. I copied and pasted it to Pages. Put the password protection on. Now if I click on that filename in Finder it automatically opens.Why. Anyone can read it. How do I protect it again?

    I have a document that in Word required a password to open. I copied and pasted it to Pages. Put the password protection on. Now if I click on that filename in Finder it automatically opens.Why. Anyone can read it. How do i protect it again?

    You saved it after setting the Password? :
    Inspector > Document > Document > Require Password to Open
    I just tested it and it shows up ijn The Finder with a padlock on the file icon and does require a password to open.
    Peter

  • I love Apple and I use all product. iPhone 3,3s,4,4s,5, iPad and Mac Air(now no more 3,3s and 4)... Only one thing I want to know is... What can I do if some one spy on my phone? How do I protect all my stuff that I put in my phone?

    I love Apple and I use all product. iPhone 3,3s,4,4s,5, iPad and Mac Air(now no more 3,3s and 4)... Only one thing I want to know is... What can I do if some one spy on my phone? How do I protect all my stuff that I put in my phone?

    the only way that anyone would be able to see anything at all on your phone is if they knew your apple id password, or they were looking over your shoulder
    if you are concerned that someone may know your apple id password, please change it at appleid.apple.com

  • How can i protect J2EE applications from piracy?

    I m looking for solution to protect Web application from piracy.
    I want my application run on web server for which it is built, &
    it musn't run on any other web server.
    how can i protect my web application from piracy?.
    Our .Net applications we protect using Hardware ID binding ,
    How can i protect J2EE applications?

    How is it going to get anywhere else? What's the threat model here? and what's the real, not imaginary, cost to you of the threat succeeding? and can you price your product such that it's cheaper to buy it than to pirate it?
    The answers to this question probably aren't in the field of tricky code or cryptography. They're more likely in marketing, time-to-market, pricing, and in physical security of the server, ...

  • How can i protect my iphone from virus

    How can i protect my iphone from virus plz gelp me

    Don't jailbreak it.
    As long as you do not hack it, then you have nothing to fear.

  • Due to virus attack i had to format my windows laptop...now when i installed new itunes software i had to sync my ipod touch again but it says that if do the same then the data on my ipod touch will be erased....how should i protect my ipod touch data?

    due to the virus attack i had to format my windows laptop...now when i installed new itunes software i had to sync my ipod touch again but it says that if i do it then the data present on my ipod touch will be erased as it is syncd to some older library... how should i protect my ipod touch data?

    With all you media (apps, music) in the iTunes library connect the iPod to the computer and make a backup. Do that by right clicking on the iPod under Devices in iTunes and select Back Up. Then restore the iPod from that backup.
    Note the the iPod backup that iTunes makes does not included synced media like apps and music.

  • How can i protect a folder with a password so everytime i want to open it it requires my password?

    how can i protect a folder or application in iPad  with a password so everytime i want to open it it requires my password?

    No way to do so at this time.

  • How to write Protect endprotect concept in Smartforms

    hi
    can any one suggest me
    How to write Protect endprotect concept in Smartforms
    i have some content to coem without break in SMARTFORM
    how to do that
    Thanks & Regards
    kalyan
    <thread moved, has nothing to do with ABAP Objects. Please choose your forums more carefully in future>
    Edited by: Mike Pokraka on Sep 26, 2008 12:50 AM

    Hi,
    For 4.7 version if you are using tables, there are two options for protection against line break: 
    - You can protect a line type against page break.
    - You can protect several table lines against page break for output in the main area.
    Protection against page break for line types 
    - Double-click on your table node and choose the Table tab page. 
    - Switch to the detail view by choosing the Details pushbutton. 
    - Set the Protection against page break checkbox in the table for the relevant line type.  Table lines that use this line type are output on one page. 
    Protection against page break for several table lines 
    - Expand the main area of your table node in the navigation tree. 
    - Insert a file node for the table lines to be protected in the main area. 
    - If you have already created table lines in the main area, you can put the lines that you want to protect again page break under the file using Drag&Drop. Otherwise, create the table lines as subnodes of the file. 
    - Choose the Output Options tab page of the file node and set the Page Protection option.   All table lines that are in the file with the Page Protection option set are output on one page. 
    In 4.6, Alternatively in a paragraph format use the Page protection attribute to determine whether or not to display a paragraph completely on one page. Mark it if you want to avoid that a paragraph is split up by a page break. If on the current page (only in the main window) there is not enough space left for the paragraph, the entire paragraph appears on the next page. 
    Regards,
    Himanshu Verma

  • How can I protect formulae in a newly created spreadsheet without locking the whole sheet ?

    How can I protect formulae from being overwritten on a newly created spreadsheet without locking the whole sheet ?

    Olly,
    I'll be picky here on nomenclature ;-)
    Tables and other Obects can be locked, but Sheets can't be locked.
    If you wish to shield some parts of your content from accidental modification, arrange your layout to put that sensitive content in tables separate from the tables that need to be accessed, and lock the sensitive ones. It's also possible, but rather clunky, to place shields over the sensitive area. A shield can be made by Inserting a Shape and positioning the shape over the sensitive area. With the shape selected, go to the Graphics Inpector and set the Opacity of the shape to zero. You will then be able to see through the shape but will no be able to Click through it to get at the cells below. This method is inconvenient because you have to worry about keeping the shape aligned with the table should the table need to change size or shape.
    Jerry

Maybe you are looking for

  • Still images not sharp . . .

    I have a sharp, still image I made with my Canon 5D. After I add it to FCE, and rendere it, it looses a great deal of sharpness, it's barely acceptable. And when mixed with my AVCHD footage, it definitely looks inferior. when I add the same image to

  • Use document size/PDF TrimBox as a label

    Hello. I have found the SizeLabels.jsx by Jongware and it's very close to what I want. It is putting a label, but it's using the size of the image in InDesign. I would like it to put the size of the placed file. And in the case of PDFs, put the size

  • COGS and Change in Inventory Reporting

    Dear All, Client want to Cross Verify the Cost of  Goods Sold (COGS) during the Month  with change in inventory  during the month in the system, how can we do that. Example In F.01 If we enter  1 to 5 period in Reporting periods And we enter 1 to 4 p

  • Sun Studio C++

    we are using SUN SPARC SERVERS. In that SUN STUDIO was loaded. If we create C++ files they are not compiling We are compiling as follows CC <source file name> then we are getting message that CC : not found. Please help me regarding as quickly as pos

  • Can iTunes restore, to a new phone, everything that was contained in a phone that was recently stolen?

    I recently had my iphone stolen.  I have the phone locked with the 4 digit passcode. I have not wiped the device, so if it's turned on again, it can be found and located.  If I buy a new phone, can I restore it just like the old phone?  I'm not certa