Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed Apr 10, 2024
0 parents commit 7eb60f3
Show file tree
Hide file tree
Showing 13 changed files with 1,092 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output/
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

151 changes: 151 additions & 0 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#!/sbin/sh

TMPDIR=/dev/tmp
MOUNTPATH=/dev/magisk_img

# Default permissions
umask 022

# Initial cleanup
rm -rf $TMPDIR 2>/dev/null
mkdir -p $TMPDIR

# echo before loading util_functions
ui_print() { echo "$1"; }

require_new_magisk() {
ui_print "***********************************"
ui_print " Please install the latest Magisk! "
ui_print "***********************************"
exit 1
}

imageless_magisk() {
[ $MAGISK_VER_CODE -gt 18100 ]
return $?
}

##########################################################################################
# Environment
##########################################################################################

OUTFD=$2
ZIPFILE=$3

mount /data 2>/dev/null

# Load utility functions
if [ -f /data/adb/magisk/util_functions.sh ]; then
. /data/adb/magisk/util_functions.sh
NVBASE=/data/adb
else
require_new_magisk
fi

# Preperation for flashable zips
setup_flashable

# Mount partitions
mount_partitions

# Detect version and architecture
api_level_arch_detect

# Setup busybox and binaries
$BOOTMODE && boot_actions || recovery_actions

##########################################################################################
# Preparation
##########################################################################################

# Extract common files
unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2

[ ! -f $TMPDIR/install.sh ] && abort "! Unable to extract zip file!"
# Load install script
. $TMPDIR/install.sh

if imageless_magisk; then
$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
MODULEROOT=$NVBASE/$MODDIRNAME
else
$BOOTMODE && IMGNAME=magisk_merge.img || IMGNAME=magisk.img
IMG=$NVBASE/$IMGNAME
request_zip_size_check "$ZIPFILE"
mount_magisk_img
MODULEROOT=$MOUNTPATH
fi

MODID=`grep_prop id $TMPDIR/module.prop`
MODPATH=$MODULEROOT/$MODID

print_modname

ui_print "******************************"
ui_print "Powered by Magisk (@topjohnwu)"
ui_print "******************************"

##########################################################################################
# Install
##########################################################################################

# Create mod paths
rm -rf $MODPATH 2>/dev/null
mkdir -p $MODPATH

on_install

# Remove placeholder
rm -f $MODPATH/system/placeholder 2>/dev/null

# Custom uninstaller
[ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh

# Auto Mount
if imageless_magisk; then
$SKIPMOUNT && touch $MODPATH/skip_mount
else
$SKIPMOUNT || touch $MODPATH/auto_mount
fi

# prop files
$PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop

# Module info
cp -af $TMPDIR/module.prop $MODPATH/module.prop
if $BOOTMODE; then
# Update info for Magisk Manager
if imageless_magisk; then
mktouch $NVBASE/modules/$MODID/update
cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop
else
mktouch /sbin/.magisk/img/$MODID/update
cp -af $TMPDIR/module.prop /sbin/.magisk/img/$MODID/module.prop
fi
fi

# post-fs-data mode scripts
$POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh

# service mode scripts
$LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh

# Handle replace folders
for TARGET in $REPLACE; do
mktouch $MODPATH$TARGET/.replace
done

ui_print "- Setting permissions"
set_permissions

##########################################################################################
# Finalizing
##########################################################################################

cd /
imageless_magisk || unmount_magisk_img
$BOOTMODE || recovery_cleanup
rm -rf $TMPDIR $MOUNTPATH

ui_print "- Done"
exit 0
1 change: 1 addition & 0 deletions META-INF/com/google/android/updater-script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#MAGISK
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Record You - Internal Audio Recording (Magisk Module)

### This Magisk module allows the app "Record You" to record internal audio while screen recording on Android. It achieves this by:

- Converting "Record You" into a system app.
- Granting the app the `android.permission.CAPTURE_AUDIO_OUTPUT` permission.
- Enabling internal audio recording through the `REMOTE_SUBMIX` audio source (requires root).

> [!NOTE]
> This module includes an empty APK file with only a manifest file. This acts as a placeholder for the actual "Record You" app. When you install the actual app on your device, it will replace the placeholder and inherit the permissions granted by this module.
### Requirements:

- Rooted Android device with Magisk installed.

### Building the Module:

This repository includes a `build.sh` script for building the Magisk module yourself. To build:

- Clone this repository to your development machine.
- Run the following command:
```bash

./build.sh

```

This will generate the Magisk module file in the `output` directory.

### Installation:

- Obtain the above Magisk module file (.zip).
- Open the Magisk Manager app on your device.
- Navigate to the "Modules" section.
- Tap the "+" button and select "Install from storage".
- Choose the downloaded Magisk module file.
- Follow the on-screen instructions to flash the module.
- Reboot your device after flashing is complete.

### Disclaimer:

This module modifies your system files. Use it at your own risk. The developer is not responsible for any damage caused by using this module.

### License:

This code is licensed under GPL-3.0 License

### Support:

For any issues or questions, please refer to the repository's issue tracker.
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Define filename
file="RecordYou"
output_dir="output"

echo "Zipping module..."

mkdir -p $output_dir

# Create a zip file in output directory named RecordYou.zip
# Exclude unnecessary files while zipping
zip -r -q "$output_dir/${file}.zip" * \
-x ".*" \
-x "$output_dir" \
-x "build.sh" \
-x "*.md" \
-x "*.zip"

echo "Success"

exit 0
9 changes: 9 additions & 0 deletions common/post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/system/bin/sh
# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script
# and module is placed.
# This will make sure your module will still work
# if Magisk change its mount point in the future
MODDIR=${0%/*}

# This script will be executed in post-fs-data mode
9 changes: 9 additions & 0 deletions common/service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/system/bin/sh
# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script
# and module is placed.
# This will make sure your module will still work
# if Magisk change its mount point in the future
MODDIR=${0%/*}

# This script will be executed in late_start service mode
3 changes: 3 additions & 0 deletions common/system.prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file will be read by resetprop
# Example: Change dpi
# ro.sf.lcd_density=320
Loading

0 comments on commit 7eb60f3

Please sign in to comment.