Editing APK without the source? - java

i had made an android app
i want to share this app with a person
the person must replace 1 line code in the source so it works for him (it is a link in the source)
but the thing is that i don't want to give the source to anyone .
is there is a way to edit and apk file and change the link to his own link
if there is a way i think i could automate the thing , i could make a .exe file when he press it it will ask him for the link when he press OK it will edit the apk for him then give it to him
is this scenario possible ?

If you really want to do this you can put file containing URL to raw resource folder. Your friend can unarchive apk, change url and compress apk back. No special "hacker" skills required.
But you better add this url to preferences and let your friend type it by himself.
P.S. you can edit source code. But it's quite tricky )

Related

How to read txt file from Google Drive?

I'm trying to make launcher for my game. I want it to display update log. How I want it to work:
Replace log.txt file on Google Drive and new log will be displayed in launcher.
I have no idea how to make this. Also I have to make auto-updater.
It will work similiar to update log - upload .jar file and res folder on drive. When game launched it will check for updates and if new update available it will download it.
Like I said, I have no idea how to do this.
I advise you to use GitHub to upload your files. Then you can use the URL provided by GitHub to open a urlStream in your project and read that file like a .txt.
Google drive is a file explorer only. It will allow you to upload and download files, it does not have the power to display or edit them. Unless you want to display them in the Google drive web application in which case there should be a webContentLink available in the response data for the file.get method, however the file will need to be either public or the user must have access to it in order to be able to see it.
To display the file you will need to download it and display it locally. To edit it you will need to download the file and edit it then upload it again.
Tbh i think what you are asking is out of scope for this api.

Java - Download from OneDrive public folder

I have a link for OneDrive. The format is https://onedrive.live.com/?cid=XXXXXXXXXXXXXXXX&id=XXXXXXXXXXXXXXXX%XXXXX
The link is public, it's not mine and new files is often added in it. My question is simple. What is the best way in Java to list all the file/folder from this link and to download a file ?
I tried HtmlUnit but it give a big javascript error.
Since the link is public, do I really need to use a OneDrive SDK ? I really don't know how to proccess with OneDrive... Thank's for any help
https://github.com/isac322/OneDrive-SDK-java This SDK will help you get the path and download the folder.

Folder view in ANDROID STUDIO

I want to go to a certain folder in the application I wrote in android studio.I want to go where my folders are.I want to go back to where the folders are in not accessing the data in it. for example "my files - internal storage - downloads". I want to open it. Would you suggest a source way or function, which I can use for this? Thank you.
try device file explorer https://developer.android.com/studio/debug/device-file-explorer
hope this helps

how do i go about doing this file path?

I made an app that i'm am working on updates for and in the old version I hard coded the file path like this
"/data/data/my.app.here/troll"
so now I am trying to do an update and I am trying to use something similar to
Context.getFilesDir()
but that returns
/data/user/0/my.app.here/files
the app info is stored on the troll file and when I push updates I don't want to use another path and have them start their information all over again. What's the best way to resolve this situation?
Can someone kindly tell me the best way to resolve this situation?
Call getParentFile() on the File returned by getFilesDir() to get its parent directory. Your troll file should be in there. That wasn't a great place to put a file, and so YMMV.
If your concern is the /data/user/0/, that will be handled by Android and should map to /data/data/ when the primary user is the one running your app.

Prevent Google Photos to ask for backing up app folders

I am making a chat app that stores sent images in it's private folder on external storage. After saving an image the Google Photos app notices that and asks if the user wants to backup that folder.
Is there a way to prevent that?
'.nomedia' file does not help.
Kindof, Google backup reads imgs and video types.
There are 3 workarounds that I know,
Make the Folder hidden.
Add "." before the folder name. (when u create the folder)
Have a lot of folder hierarchy.
Example: /0/AppName/sentimgs/ <- Can be read by google backup
/0/AppName/bla/bla/bla/sentimgs/ <- Cant be read.
Save the img without an extension. And make ur app add it when they want to view it.
The Shank's first solution worked for me.
However, I noticed that I created .nomedia file wrong, so after fixing it the backup problem has been also solved.

Categories