-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it possible to update an application without user intervention/without using root? #40
Comments
|
Thank you very much for the feedback, sorry I didn't understand, how to make this ADB setup? |
No problem. I am happy to help. Steps:
|
tks! I'm going to test at this point, there's only way to do this ADB config via command prompt? |
The easiest way is via ADB. As far as I know there are two more ways to unlock the owner permission:
|
I'm having a return after ADB command:Not allowed to set the device owner because there are already some accounts on the device |
I ask about the reasons to grant permission because I have hundreds of TOTENS (kiosk mod) spread across Brazil, I can't go to each one to give permission, all I wanted was to be able to update the totems without user intervention |
I managed to use ownerInstall() on another clean device, my question now is only in relation to the update because I realized that the Application closes and does not open again alone, is that so? |
Ah yes, forgot to say. You have to log out of Google first. It does not work with a linked Google account.
I understand. However, I am not aware of an easier way. Android is quite strict about that.
Hmm. Should actually open up again. Here's a video of what it looks like on my app. |
I may be able to fix the restart thing though. The logic is controlled by the plugin. |
here it doesn't open again... I'm using android 8.1.0 |
Ok, I'll see if I can reproduce this. Today I don't have time yet, but tomorrow I'll take care of it. |
I have fixed the bug now:
However, it will take a few more days to get that into the main-branch. I want to put some other stuff in the release version. |
Good Morning! I just did some testing and the problem still persists... my app doesn't open after updating, but it does notify me that it has been updated by adm, android 8.1.0 const apkUpdater = (window as any).ApkUpdater; await apkUpdater.isDeviceOwner().then(res =>{
}).catch(err =>{ })// -> true, false |
Can you please double check that you actually have plugin version |
positive |
Ah, I think I know what the problem is. The update, that is the apk you want to update to, must have the new plugin version. The installed app version doesn't matter. |
that must be it, this apk is in version 2.0.2 if I'm not mistaken, I thought that only the current apk should have the plugin updated |
Yeah, it's not going to work that way. Only an apk with the new plugin version will restart itself. |
now it's working as it should! thank you very much, i'll check how I'm going to do the ADB commands in production line and see if it's going to be feasible to do it that way for the new tetens that come out |
I read yesterday that you can also activate the device owner status on devices with the help of an NFC tag. If your devices have NFC. |
Oh, apparently also with QR codes, if the devices have a camera:
I'll give that a try when I get a chance. |
wow!! QR code would be great, I use tablets without NFC, I don't even know what to search for, if you can, I'm very grateful! |
So, I have tried it now and I am surprised how well it works. First define which app should be used as device owner. The required format can be found here. Here is the example configuration for my demo app: {
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "de.kolbasa.apkupdater.demo/de.kolbasa.apkupdater.tools.DAReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "24lpCxXMePT5QGa0wHQl8A7jK9j-d23Sq3OXA9_ZgI8",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://raw.githubusercontent.com/kolbasa/cordova-plugin-apkupdater-demo/master/Demo.apk"
}
keytool -printcert -jarfile Demo.apk | grep "SHA1" | awk '{print $2}' | xxd -r -p | openssl base64 | tr -d '=' | tr -- '+/=' '-_' (This is the bash command. On Windows it will look a little different.) Then generate a QR code with this config on any QR generator page, e.g. here: https://zxing.appspot.com/generator/ Here is the QR code for my demo app: With this, you can now set up your devices as follows:
You can also try it first with the QR code of my demo. You just have to reset the device afterwards. |
I didn't understand very well the part of generating the QR code but tomorrow morning I will try it calmly ... |
I have updated the command so that it also works under macOS. |
Good Morning! I just didn't understand this part. Then you need to generate the signature checksum for [...]_SIGNATURE_CHECKSUM |
my device can't install the QR code reader I don't know why |
Is there an error message? |
says it is not possible to install QR code, my tablet only has a front camera that must be why |
|
I couldn't even test your QR code, after I entered the WIFI password, my device did that it's installing the QR code reader, but it can't install it, it must be known that it only has a front camera |
Ah OK, that's weird. Is the internet connection restricted on the devices? Maybe the connection to Google is blocked. On my Android 7 device, a QR code reader is also downloaded and installed first. The fact that the tablet only has a front-facing camera should not be a problem. The installed Reader supports both cameras. |
there is no blocking, i will try on other tablets, i am disappointed... :( |
I can't really help with that. I would guess that something is wrong with the Internet connection. Faulty DNS, ad blocker, restricted company network, etc. |
greetings after updating (3.0.1) the plugin in my main project I'm getting an error in the download function: Class not found , could you help me please? |
Can you give me the full error message? It works for me. Here is my ionic test with an empty project: ionic start test blank --type=angular --cordova --no-interactive
cd test
ionic cordova plugin add cordova-androidx-build --no-interactive --confirm
ionic cordova plugin add https://github.com/kolbasa/cordova-plugin-apkupdater#device-owner-reload --no-interactive --confirm
ionic cordova platform add android
ionic cordova run android -l
import {Platform} from '@ionic/angular';
import {Component} from '@angular/core';
import ApkUpdater from 'cordova-plugin-apkupdater';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
remote = 'https://raw.githubusercontent.com/kolbasa/cordova-plugin-apkupdater-demo/master/update';
constructor(public platform: Platform) {
platform.ready().then(this.update.bind(this)).catch(console.error);
}
async update() {
await ApkUpdater.download(
this.remote + '/update.zip',
{
zipPassword: 'aDzEsCceP3BPO5jy',
onDownloadProgress: progress => console.log(progress),
onUnzipProgress: progress => console.log(progress)
}
);
await ApkUpdater.install();
}
} |
The changes are now in the |
greetings, it is possible to update the app with this new ownerInstall() function without user intervention? I've been using your plugin for some time now, I use it in Kiosk mode. sorry my ingles
The text was updated successfully, but these errors were encountered: