Community - SOTI MobiControl

Community - SOTI MobiControl

There's a new home for Articles. Find Articles on Our Product Support Page.

SOTI MobiControl Discussions


  • 0 votes 3 answers

    Del File command on Script to Android 14 is not able to erase file

    When an Android device upgrades itself to a version it may erase special access rights to MobiControl Agent, such as ACCESS ANY File.   Prior to massive deployment, we have tested wich devices have upgrade and lost permissions.   In order to test if permissions are grant or not in Android devices we have a package that includes an apk, 2 txt file and a post install script.     The apk requests EXTERNAL_ACESS_MANAGEMENT and we do nothing with it. The only reason of its presence is to identify if MC Agent is able to install and grant such permission. After the confirmation it is installed, the post install script uninstall it. If installation has failed, the script stops on this point and the log on scripts helps to identify it.   The 2 txt files is to verify if we are able to copy/replace one by another, working as a flag if the MC Agent has rights to delete or overwrite files content. One file has 9 bytes and other 4 bytes. We know it has worked  if both stay with 9 bytes.   By the list of installation failed we are able to start a remote session to grant the proper rights.   This was so, up to Android 14.   Android 14 denies the delete, copy/replace action and we could not identify which permission is missing for it. The Log from script writes the file has been deleted and the other one copied, but the scripts hangs as failed, even after writes the log of installation success at the end.   By the way, the file sync rules are able to replace the content of the files, but legacy script copy command may not.     Below you see the package and its post install script.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Post-Install Script File ; Date Created: quarta-feira, 17 de abril de 2024 ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   log -i "ANDROID ANDROID ScanMobAUth2 installed" ;Remove File testeScan2.txt ;It fails here, because the original file is still there  del /sdcard/Download/testeScan2.txt log -i "Succes on erase testeScan2.txt " ;It is weird that the log above is registered, even after del command been failed copy /sdcard/Download/versao123.txt /sdcard/Download/testeScan2.txt ;It does not copy and is expected to happen so, when the target already exists with same name and different content log -i "Succes on copy file  testeScan2.txt by versao123" ;As before, the log above should not be executed, but is ;uninstall the package uninstall br.com.nobredelatorre.scanmobauth2 log -i "Finishing ANDROID ScanMobAUth " ;it even writes the Finishing log above finishpkg   Here comes the package content   [Fileoptions] Encrypt=1 Compress=1 Format=1 [Info] Name=ScanMob VersionStr=23.0 CommentStr= Wrap=85 Build=0 BuildDir=C:\Users\Aline\Documents\MobiControl Packages\ScanMob\checked\ WrapDir=C:\Users\Aline\Documents\MobiControl Packages\ScanMob\built\ File=ScanMob.pcg TotalFileSize=1610632 ExtraSize=0 TotalPackageSize=1314126 Processor=ALL Platform=Android ProcessorType=1 PlatformType=7 Osver=2.0-22.0 VendorName= Type=0 Prompt=0 PromptMsg=Install package 'ScanMob' now? PromptTimeout=10 [Files] File1Src=C:\Users\Aline\Downloads\app-release-21.apk File1Path=Internal Storage\app-release-21.apk File1Flags=128 File1Type=17 File1Params= File1Uninst= File2Src=scripts\posti.cmd File2Path=|\posti.cmd File2Flags=256 File2Type=12 File2Params= File2Uninst= File3Src=C:\Users\Aline\Desktop\testeScan2.txt File3Path=%sdcard%\Donwload\testeScan2.txt File3Flags=1 File3Type=0 File3Params= File3Uninst= File4Src=C:\Users\Aline\Desktop\versao123.txt File4Path=%sdcard%\Donwload\versao123.txt File4Flags=1 File4Type=0 File4Params= File4Uninst=

    Android Scripting

Top 3 Contributors of The Week

View All

Earn Contributor Badge

More info
  • Diamond
    Diamond

    Top-tier experts who are delivering outstanding content. Should have more than 7000 points.

  • Platinum
    Platinum

    Experts who are consistent with great content. Should have more than 1000 points.

  • Gold
    Gold

    Highly experienced members with valuable inputs. Should have more than 700 points.

  • Silver
    Silver

    Beginners taking the initiative. Should have more than 500 points.

  • Bronze
    Bronze

    New contributors starting their journey. Should have more than 250 points.