Issue 58: GIRAFPLACE does not accept valid apk-files...
Project Member Reported by jkg@jkg.dk, May 18, 2011
If settings.xml has warnings, its not accepted

warnings != errors, and the apk should be accepted.
May 18, 2011
Project Member #1 swlass...@gmail.com
I found the issue...

If you take a look in this code (line 330 -> 357 in https://code.google.com/p/sw6android/source/browse/sw6.girafplaceweb/_functions.php):

        //Return codes from sw6.xmlvalidator
        define("VALID_XML",     0);
        define("INVALID_XML",   1);
        
        //Commands to execute
        $command        = " ./sw6.xmlvalidator/exec.sh ./temp/$id/assets/settings.xml";
        $command        = escapeshellcmd($command);
        $output         = array();

        //Execute command and store output and return value
        exec($command, $output, $return);
        
        unlink("./temp/$id/assets/settings.xml");
        rmdir("./temp/$id/assets");
        rmdir("./temp/$id/res/drawable-ldpi");
        rmdir("./temp/$id/res");
        rmdir("./temp/$id");
        chdir($chw);
        if(sizeof($output) == 0) {
                return array('package' => $package, 'version' => $versioncode, 'versionString' => $versionname);
        } else {
                Connect();
                foreach($output as $value){
                        $query = "INSERT INTO errors (applicationId,errorMessage) VALUES($id,$value)";
                        mysql_query($query);
                }
                Close();
                throw new Exception("XML not valid");
        }

---------------------

As I told you, and as my code sample for using the server version (--silent) of the sw6.xmlvalidator documents, the return value from my validator returns 0 if the settings.xml IS VALID and 1 if it is INVALID. In your code, you use "if(sizeof($output) == 0) {" to check, if the settings.xml is valid or not... And this is the issue - because, if one uploads an settings.xml with warnings only, then it will be rejected, as warnings are also printed to the screen.

Furthermore, as we discussed when I implemented the server version of the sw6.xmlvalidator, we agreed that you will use the warnings and print them as "warnings" to the user at .apk file upload.. I cannot see where this is implemented?
Cc: swlass...@gmail.com rj...@student.aau.dk mlisb...@student.aau.dk afran...@student.aau.dk nand...@student.aau.dk
Labels: -Priority-Medium Priority-Critical