Skip to content
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

Add support for custom date/time format in the output filename #204

Closed
chenxiaolong opened this issue Dec 27, 2022 · 13 comments
Closed

Add support for custom date/time format in the output filename #204

chenxiaolong opened this issue Dec 27, 2022 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@chenxiaolong
Copy link
Owner

From @nikhilbadyal's comment at: #189 (comment)

It's possible to add custom format for ${date} like yyyy-MM-ddHH:mm:ss . I don't want time_zone in output filename. As it container ugly + sign.

@chenxiaolong chenxiaolong added the enhancement New feature or request label Dec 27, 2022
@chenxiaolong chenxiaolong self-assigned this Dec 27, 2022
chenxiaolong added a commit that referenced this issue Dec 27, 2022
This commit adds support for specifying the timestamp pattern via the
${date:...} syntax. For example, ${date:yyyyMMdd_HHmmss}. Old files are
not renamed; the user is responsible for doing so manually. If the user
doesn't do so, the old files will likely be ignored by the file
rentention cleanup process.

Implements: #204

Signed-off-by: Andrew Gunnerson <[email protected]>
@chenxiaolong
Copy link
Owner Author

This is implemented in #205 and will be part of version 1.27.

Instead of ${date}, you can now specify any custom format. For example, ${date:yyyyMMdd_HHmmss}. ${date:yyyy-MM-ddHH:mm:ss} from your original comment will work too, though Android doesn't allow colons in filenames, so those would get converted to underscores.

@nikhilbadyal
Copy link

nikhilbadyal commented Dec 27, 2022

If you don't mind can you answer a question.

How do you test while developing. I want to add some features. Simply running the app in Android studio doesn't work. It doesn't start call recording if i call on the number.(I'm running an emulator).

How actually you test and develop?

I really love this minimal and working app. But still there is one feature I want, which can help me move away from skvalex.

@chenxiaolong
Copy link
Owner Author

Sure. I develop and test on a real device (Pixel 7 Pro). For testing calls, I dial voicemail (close to 300 times by now...). An emulator might work if it's possible to root the emulator image and also simulate a phone call (I'm not sure if it is).

Running from Android Studio won't work by default because it installs BCR as a user app. BCR requires system app permissions to be able to detect calls and record the audio.

The easiest way to develop is to first create a debug zip with ./gradlew zipDebug (output is in the app/build/distributions/debug folder) and then flash that zip in Magisk Manager. That way, a debug build of BCR is installed as a system app. After that, you can just build and run from Android Studio. This works because Android allows updates to system apps to be installed as regular user apps.

@drkhemu
Copy link

drkhemu commented Dec 27, 2022

hello developer sorry to bother you here, unfortunately i could not find bcr.properties file in output directory ? could you pls help me !! where to find it exactly

@nikhilbadyal
Copy link

Hey @drkhemu you will not find. You can create yourself in the same directory where your recordings are stored.

@drkhemu
Copy link

drkhemu commented Dec 27, 2022

@nikhilbadyal Hello thanks for reply , actually i tried to do that but nothing happened and when i checked log file it said , " failed to load custom filename template " and it fall back to default template , could u pls helpe.to understand it more.
i am in severe need of that

@nikhilbadyal
Copy link

@drkhemu in that case can you share the content and location (as screenshot) of the bcr.properties file.

@drkhemu
Copy link

drkhemu commented Dec 28, 2022

@nikhilbadyal hello it got solved actually , thanks for reply and time
chenxiaolong answered that you can not change ${date} in custom template as it has to be first name compulsary. So when I did that it worked.

@nikhilbadyal
Copy link

nikhilbadyal commented Dec 31, 2022

@chenxiaolong module after zipDebug fails to install.

Screenshot_1672502192

Any idea why so ?

@chenxiaolong
Copy link
Owner Author

Hmm, I've never seen that before. Does anything show up in Magisk's logs? Can you upload the zip file you built?

@nikhilbadyal
Copy link

Here it is.

@chenxiaolong
Copy link
Owner Author

[13:59:48] cxl-desktop-1 …/bcr/temp
❯ unzip ../BCR-1.29.r2.g52bef6d-debug.zip
Archive:  ../BCR-1.29.r2.g52bef6d-debug.zip
  inflating: module.prop
  inflating: LICENSE
  inflating: README.md
   creating: system/
   creating: system/addon.d/
  inflating: system/addon.d/51-com.chiller3.bcr.sh
   creating: system/etc/
   creating: system/etc/permissions/
  inflating: system/etc/permissions/privapp-permissions-com.chiller3.bcr.xml
   creating: system/priv-app/
   creating: system/priv-app/com.chiller3.bcr/
  inflating: system/priv-app/com.chiller3.bcr/app-debug.apk
   creating: META-INF/
   creating: META-INF/com/
   creating: META-INF/com/google/
   creating: META-INF/com/google/android/
  inflating: META-INF/com/google/android/update-binary
  inflating: META-INF/com/google/android/updater-script

[13:59:51] cxl-desktop-1 …/bcr/temp
❯ file META-INF/com/google/android/update-binary
META-INF/com/google/android/update-binary: a /sbin/sh script, ASCII text executable, with CRLF line terminators

It looks like the text files in the zip have Windows line endings (\r\n) instead of Unix ones (\n). That's probably why Magisk won't install it.

Googling the issue, it seems like git does this conversion by default on Windows, but you can disable it with:

git config --global core.autocrlf false

and then cloning the git repo again.

@nikhilbadyal
Copy link

Thanks for the help. I was thinking the same. As it appeared to work in Mac but not in Windows.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants