Mac App Store Rejection and Sandboxing Requirements
Posted: Thu Mar 31, 2016 12:15 am
I've got an app in the Mac App Store, but I haven't been able to update it in almost a year. The sandboxing requirements have changed, I'm sure, and now I seem to be in violation. Specifically I stand accused of attempting to write to data files in the app package. My app does copy data files from the package to the proper location for data in the user library container, but I'm pretty darned sure I'm not trying to write to the files in the package.
I've heard the sandboxing requirements now forbid some "shell" commands. I use shell commands because I've read in these forums that revCopyFile still seems to have issues. Here's how I'm doing that...
local tItemDelimParking
local tPackageDefaultFolder
put the fileName of me into tPackageDefaultFolder
put the itemDelimiter into tItemDelimParking
set the itemDelimiter to "/"
put "" into the last item of tPackageDefaultFolder
set the itemDelimiter to tItemDelimParking
put "CQdata" after tPackageDefaultFolder
set the defaultFolder to tPackageDefaultFolder
put tPackageDefaultFolder & "/Questions.rev" into gPackageFilePath_Questions
put tPackageDefaultFolder & "/Settings Saver.rev" into gPackageFilePath_Settings_Saver
put tPackageDefaultFolder & "/Teams.rev" into gPackageFilePath_Teams
put specialFolderPath("Home") & "/Library/Containers/com.classroomquizshow.classroomquizshow/Data/Library/Application Support/Classroom Quizshow" into gLibraryDefaultFolder
--This folder automatically created by OS X for App Store apps.
put gLibraryDefaultFolder & "/Questions.rev" into gLibraryFilePath_Questions
put gLibraryDefaultFolder & "/Teams.rev" into gLibraryFilePath_Teams
put gLibraryDefaultFolder & "/Settings Saver.rev" into gLibraryFilePath_Settings_Saver
if there is no file gLibraryFilePath_Settings_Saver then -- if Library data files don't yet exist
local tCommand
put ("cp -n ""e&gPackageFilePath_Questions"e&"e&gLibraryDefaultFolder"e) into tCommand -- The -n means the file will not be overwritten if it already exists. http://ss64.com/osx/cp.html
get shell(tCommand)
put ("cp -n ""e&gPackageFilePath_Teams"e&"e&gLibraryDefaultFolder"e) into tCommand
get shell(tCommand)
put ("cp -n ""e&gPackageFilePath_Settings_Saver"e&"e&gLibraryDefaultFolder"e) into tCommand
get shell(tCommand)
set the destroyStack of stack gLibraryFilePath_Questions to true
set the destroyStack of stack gLibraryFilePath_Settings_Saver to true
set the destroyStack of stack gLibraryFilePath_Teams to true
close stack gLibraryFilePath_Questions
close stack gLibraryFilePath_Settings_Saver
close stack gLibraryFilePath_Teams
end if
Here's some feedback someone in the Apple app review department was kind enough to provide me:
Upon further investigation, the app is performing a "rename" command on the previously mentioned file writes which may give some insight as to how the files are being acted upon.
"Classroom Quizs" - WRITE - rename - “/Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Teams.rev~" - /Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Teams.rev
"Classroom Quizs" - WRITE - rename - “/Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Questions.rev~" - /Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Questions.rev
"Classroom Quizs" - WRITE - rename - “/Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Settings Saver.rev~" - /Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Settings Saver.rev
I know I don't have the word "rename" anywhere in my code, so this is somehow being generated in standalone creation. Any ideas? Also, it looks like the new and old names in the attempted renames only differ by that squiggle/tilde thing on the end. Might that be a clue?
Thanks in advance,
Steve
I've heard the sandboxing requirements now forbid some "shell" commands. I use shell commands because I've read in these forums that revCopyFile still seems to have issues. Here's how I'm doing that...
local tItemDelimParking
local tPackageDefaultFolder
put the fileName of me into tPackageDefaultFolder
put the itemDelimiter into tItemDelimParking
set the itemDelimiter to "/"
put "" into the last item of tPackageDefaultFolder
set the itemDelimiter to tItemDelimParking
put "CQdata" after tPackageDefaultFolder
set the defaultFolder to tPackageDefaultFolder
put tPackageDefaultFolder & "/Questions.rev" into gPackageFilePath_Questions
put tPackageDefaultFolder & "/Settings Saver.rev" into gPackageFilePath_Settings_Saver
put tPackageDefaultFolder & "/Teams.rev" into gPackageFilePath_Teams
put specialFolderPath("Home") & "/Library/Containers/com.classroomquizshow.classroomquizshow/Data/Library/Application Support/Classroom Quizshow" into gLibraryDefaultFolder
--This folder automatically created by OS X for App Store apps.
put gLibraryDefaultFolder & "/Questions.rev" into gLibraryFilePath_Questions
put gLibraryDefaultFolder & "/Teams.rev" into gLibraryFilePath_Teams
put gLibraryDefaultFolder & "/Settings Saver.rev" into gLibraryFilePath_Settings_Saver
if there is no file gLibraryFilePath_Settings_Saver then -- if Library data files don't yet exist
local tCommand
put ("cp -n ""e&gPackageFilePath_Questions"e&"e&gLibraryDefaultFolder"e) into tCommand -- The -n means the file will not be overwritten if it already exists. http://ss64.com/osx/cp.html
get shell(tCommand)
put ("cp -n ""e&gPackageFilePath_Teams"e&"e&gLibraryDefaultFolder"e) into tCommand
get shell(tCommand)
put ("cp -n ""e&gPackageFilePath_Settings_Saver"e&"e&gLibraryDefaultFolder"e) into tCommand
get shell(tCommand)
set the destroyStack of stack gLibraryFilePath_Questions to true
set the destroyStack of stack gLibraryFilePath_Settings_Saver to true
set the destroyStack of stack gLibraryFilePath_Teams to true
close stack gLibraryFilePath_Questions
close stack gLibraryFilePath_Settings_Saver
close stack gLibraryFilePath_Teams
end if
Here's some feedback someone in the Apple app review department was kind enough to provide me:
Upon further investigation, the app is performing a "rename" command on the previously mentioned file writes which may give some insight as to how the files are being acted upon.
"Classroom Quizs" - WRITE - rename - “/Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Teams.rev~" - /Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Teams.rev
"Classroom Quizs" - WRITE - rename - “/Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Questions.rev~" - /Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Questions.rev
"Classroom Quizs" - WRITE - rename - “/Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Settings Saver.rev~" - /Applications/Classroom Quizshow.app/Contents/MacOS/CQdata/Settings Saver.rev
I know I don't have the word "rename" anywhere in my code, so this is somehow being generated in standalone creation. Any ideas? Also, it looks like the new and old names in the attempted renames only differ by that squiggle/tilde thing on the end. Might that be a clue?
Thanks in advance,
Steve