Changeset 11

Show
Ignore:
Timestamp:
03/12/07 23:22:11 (2 years ago)
Author:
evilbunny
Message:

Resolves bug #7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • MIDlet/bin/FreeAuth.jad

    r1 r11  
    44MIDlet-Icon: /FreeAuth.png 
    55MIDlet-Info-URL: http://www.freeauth.org/index.php/Free_Auth_MIDLet 
    6 MIDlet-Jar-Size: 12248
     6MIDlet-Jar-Size: 12196
    77MIDlet-Jar-URL: FreeAuth.jar 
    88MIDlet-Name: FreeAuth 
    99MIDlet-Permissions: javax.microedition.io.Connector.http 
    1010MIDlet-Vendor: FreeAuth.org 
    11 MIDlet-Version: 2.4.3 
     11MIDlet-Version: 2.4.4 
    1212MicroEdition-Configuration: CLDC-1.0 
    1313MicroEdition-Profile: MIDP-2.0 
  • MIDlet/bin/MANIFEST.MF

    r1 r11  
    55MIDlet-Permissions: javax.microedition.io.Connector.http 
    66MIDlet-Vendor: FreeAuth.org 
    7 MIDlet-Version: 2.4.3 
     7MIDlet-Version: 2.4.4 
    88MicroEdition-Configuration: CLDC-1.0 
    99MicroEdition-Profile: MIDP-2.0 
  • MIDlet/src/FreeAuth.java

    r4 r11  
    4444public class FreeAuth extends MIDlet implements CommandListener 
    4545{ 
     46        private Command doNextCommand = new Command("Next", Command.SCREEN, 2); 
     47 
    4648        private Command checkForDefaultsNoCommand = new Command("No", Command.SCREEN, 1); 
    4749        private Command checkForDefaultsYesCommand = new Command("Yes", Command.SCREEN, 2); 
    4850        private Command newAliasDeleteCommand = new Command("Delete", Command.SCREEN, 1); 
    49         private Command newAliasNextCommand = new Command("Next", Command.SCREEN, 2); 
    5051        private Command newManSecDeleteCommand = new Command("Delete", Command.SCREEN, 1); 
    51         private Command newManSecNextCommand = new Command("Next", Command.SCREEN, 2); 
    5252        private Command ManualSecretCommand = new Command("Manual Entry", Command.SCREEN, 2); 
    5353        private Command aboutMainCommand = new Command("About", Command.SCREEN, 2); 
     
    6464        private Command resetSecretCommand = new Command("Reset Secret", Command.SCREEN, 3); 
    6565        private Command deleteSecretCommand = new Command("Delete Secret", Command.SCREEN, 3); 
    66         private Command resetNextCommand = new Command("Next", Command.SCREEN, 2); 
    67         private Command deleteNextCommand = new Command("Next", Command.SCREEN, 2); 
    6866        private Command backupCommand = new Command("DB Backup", Command.SCREEN, 3); 
    6967        private Command restoreCommand = new Command("DB Restore", Command.SCREEN, 3); 
     
    7573 
    7674        private String currentAction = ""; 
     75        private String nextAction = ""; 
    7776        private String seed = ""; 
    7877        private String secret = ""; 
     
    172171                        doAboutCommand(); 
    173172 
    174                 else if(c == newAliasNextCommand) 
    175                         if(newalias.length() >= 1) 
    176                                 generateInit(); 
    177                         else 
    178                                 newAlias(); 
    179  
     173                else if(c == doNextCommand) 
     174                { 
     175                        if(nextAction == "newAliasNextCommand") 
     176                        { 
     177                                if(newalias.length() >= 1) 
     178                                        generateInit(); 
     179                                else 
     180                                        newAlias(); 
     181                        } else if(nextAction == "newManSecNextCommand") { 
     182                                if(seed.length() < 16) 
     183                                        newManualSecret(); 
     184                                else 
     185                                        newAlias(); 
     186                        } else if(nextAction == "resetNextCommand") { 
     187                                doresetNext(); 
     188                        } else if(nextAction == "deleteNextCommand") { 
     189                                dodeleteNext(); 
     190                        } else if(nextAction == "wipeCommand") { 
     191                                doDBWipe(); 
     192                        } else if(nextAction == "testDefCommand") { 
     193                                LoadTestDef(); 
     194                        } 
     195                } 
    180196                else if(c == newAliasDeleteCommand) 
    181197                        donewAliasDeleteCommand(); 
     
    188204                } 
    189205 
    190                 else if(c == newManSecNextCommand) 
    191                         if(seed.length() < 16) 
    192                                 newManualSecret(); 
    193                         else 
    194                                 newAlias(); 
    195  
    196206                else if(c == newManSecDeleteCommand) 
    197207                        donewManSecDeleteCommand(); 
     
    201211 
    202212                else if(c == resetSecretCommand) 
    203                         doresetSecret(); 
    204  
    205                 else if(c == resetNextCommand) 
    206                         doresetNext(); 
    207  
     213                { 
     214                        nextAction = "resetNextCommand"; 
     215                        doNext("You are about to reset this shared secret! Make sure this is what you really really want to do!"); 
     216                } 
    208217                else if(c == deleteSecretCommand) 
    209                         dodeleteSecret(); 
    210  
    211                 else if(c == deleteNextCommand) 
    212                         dodeleteNext(); 
    213  
     218                { 
     219                        nextAction = "dodeleteSecret"; 
     220                        doNext("You are about to delete this shared secret! Make sure this is what you really really want to do!"); 
     221                } 
    214222                else if(c == mainMenuCommand) 
    215223                { 
     
    221229 
    222230                else if(c == wipeCommand) 
    223                         doDBWipe(); 
    224  
     231                { 
     232                        nextAction = "wipeCommand"; 
     233                        doNext("Are you sure you want to wipe the phones database?"); 
     234                } 
    225235                else if(c == testDefCommand) 
    226                         LoadTestDef(); 
    227  
     236                { 
     237                        nextAction = "testDefCommand"; 
     238                        doNext("Are you sure you want to wipe the phones database, and load the testing defaults?"); 
     239                } 
    228240                else if(c == selectSecretCommand | c == List.SELECT_COMMAND) 
    229241                        doselectSecret(); 
     
    851863        } 
    852864 
    853         private void doresetSecret() 
    854         { 
    855                 currentAction = "donewPassCode"; 
     865        private void doNext(final String message) 
     866        { 
    856867                lowinput = new Canvas() 
    857868                { 
     
    860871                                int w=getWidth(); 
    861872                                int h=getHeight(); 
    862                                 showString(h, w, g, "You are about to reset this shared secret! Make sure this is what you really really want to do!"); 
     873                                showString(h, w, g, message); 
    863874                        } 
    864875                }; 
    865876 
    866877                lowinput.addCommand(cancelCommand); 
    867                 lowinput.addCommand(resetNextCommand); 
    868                 lowinput.setCommandListener(this); 
    869                 Display.getDisplay(this).setCurrent(lowinput); 
    870         } 
    871  
    872         private void dodeleteSecret() 
    873         { 
    874                 currentAction = "donewPassCode"; 
    875                 lowinput = new Canvas() 
    876                 { 
    877                         public void paint(Graphics g) 
    878                         { 
    879                                 int w=getWidth(); 
    880                                 int h=getHeight(); 
    881                                 showString(h, w, g, "You are about to delete this shared secret! Make sure this is what you really really want to do!"); 
    882                         } 
    883                 }; 
    884  
    885                 lowinput.addCommand(cancelCommand); 
    886                 lowinput.addCommand(deleteNextCommand); 
     878                lowinput.addCommand(doNextCommand); 
    887879                lowinput.setCommandListener(this); 
    888880                Display.getDisplay(this).setCurrent(lowinput); 
     
    10221014                }; 
    10231015 
     1016                nextAction = "newAliasNextCommand"; 
    10241017                lowinput.addCommand(newAliasDeleteCommand); 
    1025                 lowinput.addCommand(newAliasNextCommand); 
     1018                lowinput.addCommand(doNextCommand); 
    10261019                lowinput.addCommand(aboutMenuCommand); 
    10271020                lowinput.addCommand(exitMenuCommand); 
     
    11791172                }; 
    11801173 
     1174                nextAction = "newManSecNextCommand"; 
    11811175                lowinput.addCommand(newManSecDeleteCommand); 
    1182                 lowinput.addCommand(newManSecNextCommand); 
     1176                lowinput.addCommand(doNextCommand); 
    11831177                lowinput.addCommand(aboutMenuCommand); 
    11841178                lowinput.addCommand(exitMenuCommand);