Editing AndroidManifest.xml file of Acode 1.3.155 in Android 12 - apk

I am trying to edit Acode 1.3.155 in Android 12
I tried renaming to .zip and extract it, it gave no error. But when i zipped it back and renamed it to .apk without changing anything in extracted folder, the package installer was throwing error.I used Apk editor pro+ v2.3.2 ,But again the package installer was throwing error on building back even though nothing was changed in any of the files.So, I want to add permission given below because Acode 1.3.155 was giving Security error on opening any file (in Android 12)<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

First of all if you unzip an APK file and then re-compress it to a ZIP file you have removed the APK signature v2/v3 and thus the package installer will refuse to install it. Use apksigner from Android SDK to resign it.
READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are simply ignored on Android 11+ as it requires to update the app to use Scoped Storage API. This is the reason you are getting permission denied errors.
The only way to grant access for an app (that is just installed locally and not published via PlayStore) is to add MANAGE_EXTERNAL_STORAGE permission entry in it's AndroidManifest.xml and after installing the app you have to manually open the Android settings, select the app you have just installed and enable the slider Allow access to manage all files.
To modify an existing APK file you should use apktool on a PC. For modifying AndroidManifest.xml you don't need to decompile the sources so you can use the --no-src (-s) option:
java -jar apktool.jar d --no-src appxyz.apk
Now modify AndroidManifest.xml
java -jar apktool.jar b appxyz
Then align the built APK file using zipalign -p 4 ... and finally re-sign it.

Related

Windows store APPX package install file in different location

So I have recently developed an app for the windows store, I packaged it into an APPX package. The problem is that windows auto installs it into a non-accessible folder meaning I cannot reference .exe and .pdf files.
Is there a way to make it always install 2 files in the same place, for example the two files which need to be edited install on desktop and the rest of the app in the usual install location?
Can I do this using two separate .APPX files?
No, all APPX/MSIX packages are installed/extracted under the ProgramFiles/WindowsApps folder.
This folder is read-only, only the OS can write in there (when it's installing the app).
The solution is to copy the files you want from the install folder, the first time a user launches your application.

Xbuild can't recognize SignAndroidPackage when using bamboo

I am trying to create a .APK file in Bamboo using the xbuild executable in a command task. The way I thought it should work is like this:
CusomterApp.sln /t:SignAndroidPackage /p:Configuration=Release
This however when I run the build will give this error. Target named 'SignAndroidPackage' not found in the project. I have tried to build it without it but I am getting other errors instead. I have tried changing the order of it and changing the target but it doesn't seem to create the apk file doing this.
I have seen in another question that someone created an apk file using this(not on Bamboo):
xbuild $ANDROID_PROJECT_FILE /t:SignAndroidPackage /p:Configuration=Release
So I thought I should have no problems with using this on Bamboo but the executable doesn't seem to recognize the SignAndroidPackage and doesn't work, any ideas on how to fix this?
I create a .IPA file for an IPhone app using mdtool, with this command -v build -t:Build "c:Release|iPhone" CustomerApp.sln and this works fine for creating the .IPA file so I would have thought that the .APK would be fine too.
I think that the problem is to do with using the solution file for the Android apk file, The bamboo will create a solution folder which has both iOS and Android files in it. The iOS worked and built the IPA file when I used the CustomerApp.sln file. The apk file does not build when I use the CustomerApp.sln. If I use this CustomerApp.Droid/CustomerApp.Droid.csproj file I get a list of error's Are you missing an assembly reference?
When I was doing the IPA I got this error using the CustomerApp.iOS/CustomerApp.iOS.csproj file which I fixed by using the CustomerApp.sln file instead. How can I fix this as the whole folder contains information that is necessary for the creation of the APK file?
I have found a problem that when I try to build the apk file using this: /p:Configuration=Release CustomerApp.sln it gives me the error PCL assemblies not installed and it also has this warning : Unable to find framework corresponding to the target moniker '.NetPortable,Version=v4.5,Profile=Profile78'. Framework assembly references will be resolved from the GAC, which might not be the intended behaviour. I don't know why this is happening as I looked for the profile in the folder specified and it was there.
I had this problem before when trying to use xbuild to create the IPA file but then I used mdtool and it worked fine, I think I need to use xbuild to build the apk file but I can't see how to fix it. I also tried to run it in the terminal of the mac and I got the same error. Why is this happening?
The reason this happens is because you have to specify a .csproj, not a .sln. If you give it a solution file, you'll get an error complaining that it can't find the "SignAndroidPackage" target.

Resigning a xamarin android apk using apksigner fails

after having generated a signed apk using archive/adhoc distribute and installed it on a device it works fine.
But when i resign the signed apk using apksigner.bat (from android sdk) using the same keystore and deploy it on a device, the app won't launch.
Adb log:
W/monodroid(12082): Trying to load sgen from: /data/app-lib/com.company.TSMClient-1/libmonosgen-2.0.so
F/monodroid(12082): No assemblies found in '(null)' or '<unavailable>'. Assuming this is part of Fast Deployment. Exiting...
I/ActivityManager(21181): Process com.company.TSMClient (pid 12082) has died.
I checked inside the apk for diff and found that in the META-INF folder the resigned apk has slightly smaller .RSA and .SF files.
Any idea what's wrong ?
I fixed it this way:
I activated multidex and updated pro guard in the android sdk
To update pro guard, replace the existing folder content with the zip you downloaded from the sourceforge site
Please also vote up for Xamarin issue https://bugzilla.xamarin.com/show_bug.cgi?id=44187

Bundle Multiple Xamarin apps in one pkg installer

I have few Xamarin apps and I want to bundle them all as a single pkg/installer and organize them into a folder under Applications similar to the following snapshot attached. Is there an option to specify additional Xamarin apps in the bundle settings of the project or any build script needs to be written? Can anybody point to some samples ?
Thanks,
Suma.
1. pkg installer: Packages
See Payload section to add folder and your .app files.
They also support Certification for signing Developer Installer and Commandline. Just check the documentation.
2. Automation Build script:
Use Packages to create .pkgproj file that config your bundle apps
Go Xamarin Studio -> Project Options -> Custom Command -> Add new Common After Build: add script to copy all bundle apps to a folder that configured by above .pkgproj file
Run command line packagesbuild of Packages to build the .pkgproj file
Finish. Get your .pkg installer file in Build folder.

Move executable from application bundle to system location

In my cocoa application, i am trying to push a third party executable file to this /usr/libexec/cups location. For that , i have added this third party executable file in my bundle and successfully moved the file to that location when i run my application.
But the executable is not performing the same operation like when i install the third party installer package. if i manually copy the executable file to the location, it works fine by repairing the permission.
Edited :
Now i found that the executable file is altered in application package contents. Don't know how it get altered. what is the safest way to move a executable from application bundle to application content without getting altered.
Note that : I have disabled the sandbox mode in my application.
No need to do this complex steps. Use package maker, include your executables and application, apply the permission and create a .pkg file. If you are not releasing in mac store , its best to release the app in .pkg format using package maker.

Resources