Block the app after installation by Google Protect - java

When installing an application on Android 7, Google's protection system prevents it from installing and displays the following message:
Play Protect doesn't recognise this app's developer. Apps from unknown developers can sometimes be unsafe.
How can i fix it?

Go to Build Type tab. Select release mode and set:
Signing Config to the config . (The one you just created).
Sync your gradle . Enjoy!
Android Build Types

Yes, it's usually caused by an APK manually installed without downloading it from PlayStore.
The Protect informs the user about the potential problems about installing this kind of App.
You can disable the Protect from Android Settings page or (maybe) room the PlayStore Settings.

Related

Native Android foreground location service crashing Flutter application

I want to get location updates in background when app is minimized. So I created a demo Flutter application with a service in native Android which I can run in foreground to get the continuous location updates for application and it is working fine as my expectation it is updating locations in notifications (for test).
Then I tried to implement same service with actual Flutter application with same service mentioned in manifest file same as demo application but my application is crashing on starting so I can't debug and in addition to that I don't get any error in building.
My main Flutter application is working fine without the location service implementation so only issues is after implementation it causes crashing.
What could be the issue and solution for this problem or how can I find out what is the problem?
I am doing same thing in original Flutter application same as in this dart code of demo application. How can I investigate this problem?
I am adding my answer regarding the question mentioned above.
in my case, it was not a foreground service which was crashing application but the issue was that As the flutter is growing framework, We get lot of updates & changes. With one of those Flutter update, Flutter updated plugin registration process for app on native side so some plugin with older version dependencies doesn't get registered with app as flutter doesn't support FlutterView(deprecated) anymore.
Note: Always make sure your plugin dependencies are updated to latest version of its dependencies in pubspec.yaml.
For me, My main application and demo application created for foreground was working according to my expectation but when I merge them it was crashing because camera plugin dependency version was too old. Second thing you can do is which can also reduce chances of error due to androidx compatibilty as well. Though, it is not too tough to do in old app as well.
Note : Create new flutter project and move your all dart code to new application.
Please be careful while doing this option.
-- Don't forget to add permissions in manifest files which you are accessing in app.
-- Don't forget to add assets and resources used on native side if you have added or changed.
-- Don't forget to set version according to version of old app.
-- Don't forget to make changes in your gradle files if any of app dependencies use that configurations like minimum sdk, targetSdk, etc... (if it applies in your case)
If you don't find this useful you can run your android side code in android studio and can find out what is the problem by debugging that code and fix it. Thanks

Integrated SDK behave differently after PlayStore app bundling

I integrated 3rd party SDK to my Android app.
I tested staging and release build APK, no problem. The build is done using bitrise/BETA by crashlytics.
I downloaded the release app from Google Play Store.
The SDK throws persistent error/exception that does not appear during 2.
The SDK developer deducted that the cause may be from the missing checksum, which is generated using this piece of code:
mChecksumMD5 = Util.calculateMD5(new File(mContext.getApplicationInfo().nativeLibraryDir+"/libxyz.so"));
I suspect it may be due to app bundling, which is not present during build via bitrise/BETA. I tried to use bundled app using bundle tools (https://github.com/google/bundletool/releases) for staging build and it doesn't have any problem (bitrise staging vs bundled staging are all ok). So is there something different about the app bundling happening in Google Play Store? What may cause this unexpected exception?

Installing Teamviewer silently on android device from a remote location using java

I want to install the TeamViewer software automatically on client's android device remotely using java. I have researched about a number of third party tools for automatic installation of software but the problem is that each one of them needs user interaction/permission in one or the other way.
In my app I will disable the touch of the device after the user logs in and an animation will be displayed based on the real time data from the server. I want to install the software assuming that no user is present at the other end and no response should be needed to install teamviewer.(My app will not there be on Google play.)
I am very new to android development, but through my research I found that .exe file can not be installed on Android as its a Linux based OS.I was planning to keep the Application(.exe) file at server and then try to install it issuing some adb command from my code.
Can someone please tell me how is it possible? How should I proceed? Please help.
Thanks in advance for any help.
There are two way for installing an App on an Android device:
Via ADB. This requires Debugging to be enabled on the device, and the computer the Java program is executed on requires an USB connection to the device (and proper USB drivers) and the device must be "ADB-paired" with the computer if the device has at least Android 4.2. Furthermore you need ADB which is part of the Android SDK and therefore not present on a regular PC. You could ship a version of ADB with your program but ADB is platform specific (Windows, OSX, Linux, ..) therefore you would have to include multiple versions and select on.
Vis Google Play. Once the user is logged-in any app from the play store can be installed to the users's device via web interface. As the Google log-in credentials are required a user must be present to enter them.
Conclusion: What you want is nearly impossible, especially the "without user interaction" part.
You can't install a app from other app without user interactions, that would a big security problem.
The one app that can it is Google Play for obvious reasons.

How can I save my Android application so that the end-user can execute it without the Android SDK

I have recently started programming for the Android platform. I have a simple application which I would like to email to someone so that they can execute the application and check how it works.
I am currently using the Emulator in the Android SDK to execute my application but the person who I am emailing it to does not have Android SDK and it would be a mission to send the whole project folder.
Is there any way that I can send just one file such as an .exe or something that would allow the recipient to execute the application to see how it works.
Thanks so much for your help in advance guys
The "exe" for android is called apk. I suggest you to look at this question. You'll need to build the apk and sign it in order to be able to run it.
If you just want to send it to a user for testing purposes, you can enable the setting in the target android device to allow "unknown sources" (I don't know the proper english name, as I don't have an english android here at the moment). You can find this in the app settings.
In your development environment look for the apk file created by eclipse. Then connect your smartphone to the pc and copy the apk over. Start up a file manager and click on the apk and it will install just like any other app.
If you want to deploy it properly, you have to sign it and probably follow the procedures from google. Since I don't have a fully deployable app yet, I can't say what the procedures is for that, but the google site is very helpfull on all aspects about android programming.
Check the "bin" folder in your project path. There you will have a .apk that you can share with your clients.
If they execute it in an Android mobile phone the application will be installed.

Signing and Android app as root

I want to run an app for testing some specific scenarios in root mode. From the android developer site Android does not provide apps with root privileges except when using FACTORY_TEST permission. From reading online I found that for using the permission, I need to sign it with platform keys that are generated while building the Android source code. If I have access to platform signatures then how to add android.permission.FACTORY_TEST permission?
Every time I add this setting in the manifest.xml, the xml displays an error saying only factory applications can use this. All the online help turned up till now asks me to do the following steps.
Add android:sharedUserId="android.uid.system. Export the apk as unsigned apk from eclipse.
Sign the apk with platform keys.
Install and it and use it.
Since the manifest throws the error, do I need to simply ignore the error and continue?
Are there any detailed steps on how to do it?
om the android developer site Android does not provide apps with root privileges except when using FACTORY_TEST permission. From reading online I found that for using the permission, I need to sign it with platform keys that are generated while building the Android source code.
Where did you read this? As I understand, you cannot use the FACTORY_TEST permission without having access to the key used by the OEM to sign their firmware or otherwise compiling and signing your own modified firmware.
Is this the kind of message you are seeing?
08-05 17:57:46.170: WARN/PackageManager(52): Not granting permission
android.permission.FACTORY_TEST to package XXXX (protectionLevel=2
flags=0x7e44)
In any case, these permissions (with protectionLevel 2 or 3) can only be used if you're an OEM or building your own custom ROM (to run on a presumably rooted phone).

Categories

Resources